From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 00:29:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4089FCBB; Sun, 3 Aug 2014 00:29:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1CB217B; Sun, 3 Aug 2014 00:29:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s730T4oe072621; Sun, 3 Aug 2014 00:29:04 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s730T466072620; Sun, 3 Aug 2014 00:29:04 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201408030029.s730T466072620@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 3 Aug 2014 00:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269451 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 00:29:04 -0000 Author: hiren Date: Sun Aug 3 00:29:03 2014 New Revision: 269451 URL: http://svnweb.freebsd.org/changeset/base/269451 Log: Add myself to committers-src.dot. Better late than never :-) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat Aug 2 23:20:43 2014 (r269450) +++ head/share/misc/committers-src.dot Sun Aug 3 00:29:03 2014 (r269451) @@ -170,6 +170,7 @@ grehan [label="Peter Grehan\ngrehan@Free grog [label="Greg Lehey\ngrog@FreeBSD.org\n1998/08/30"] gshapiro [label="Gregory Shapiro\ngshapiro@FreeBSD.org\n2000/07/12"] harti [label="Hartmut Brandt\nharti@FreeBSD.org\n2003/01/29"] +hiren [label="Hiren Panchasara\nhiren@FreeBSD.org\n2013/04/12"] hmp [label="Hiten Pandya\nhmp@FreeBSD.org\n2004/03/23"] ian [label="Ian Lepore\nian@FreeBSD.org\n2013/01/07"] iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] @@ -664,6 +665,7 @@ sam -> andre sam -> benjsc sam -> sephe +sbruno -> hiren sbruno -> jimharris schweikh -> dds From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 03:27:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAE6C639; Sun, 3 Aug 2014 03:27:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A72F4224F; Sun, 3 Aug 2014 03:27:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s733Rthl055424; Sun, 3 Aug 2014 03:27:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s733Rstm055420; Sun, 3 Aug 2014 03:27:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201408030327.s733Rstm055420@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Aug 2014 03:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269457 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 03:27:55 -0000 Author: kib Date: Sun Aug 3 03:27:54 2014 New Revision: 269457 URL: http://svnweb.freebsd.org/changeset/base/269457 Log: Remove Giant acquisition from the mount and unmount pathes. It could be claimed that two things were reasonable protected by Giant. One is vfsconf list links, which is converted to the new dedicated sx vfsconf_sx. Another is vfsconf.vfc_refcount, which is now updated with atomics. Note that vfc_refcount still has the same races now as it has under the Giant, the unload of filesystem modules can happen while the module is still in use. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_init.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Sun Aug 3 03:06:00 2014 (r269456) +++ head/sys/kern/vfs_init.c Sun Aug 3 03:27:54 2014 (r269457) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,8 @@ int maxvfsconf = VFS_GENERIC + 1; * New entries are added/deleted by vfs_register()/vfs_unregister() */ struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf); +struct sx vfsconf_sx; +SX_SYSINIT(vfsconf, &vfsconf_sx, "vfsconf"); /* * Loader.conf variable vfs.typenumhash enables setting vfc_typenum using a hash @@ -104,20 +107,33 @@ struct vattr va_null; * Routines having to do with the management of the vnode table. */ -struct vfsconf * -vfs_byname(const char *name) +static struct vfsconf * +vfs_byname_locked(const char *name) { struct vfsconf *vfsp; + sx_assert(&vfsconf_sx, SA_LOCKED); if (!strcmp(name, "ffs")) name = "ufs"; - TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) + TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { if (!strcmp(name, vfsp->vfc_name)) return (vfsp); + } return (NULL); } struct vfsconf * +vfs_byname(const char *name) +{ + struct vfsconf *vfsp; + + vfsconf_slock(); + vfsp = vfs_byname_locked(name); + vfsconf_sunlock(); + return (vfsp); +} + +struct vfsconf * vfs_byname_kld(const char *fstype, struct thread *td, int *error) { struct vfsconf *vfsp; @@ -168,8 +184,11 @@ vfs_register(struct vfsconf *vfc) vfc->vfc_name, vfc->vfc_version); return (EINVAL); } - if (vfs_byname(vfc->vfc_name) != NULL) + vfsconf_lock(); + if (vfs_byname_locked(vfc->vfc_name) != NULL) { + vfsconf_unlock(); return (EEXIST); + } if (vfs_typenumhash != 0) { /* @@ -202,26 +221,6 @@ vfs_register(struct vfsconf *vfc) TAILQ_INSERT_TAIL(&vfsconf, vfc, vfc_list); /* - * If this filesystem has a sysctl node under vfs - * (i.e. vfs.xxfs), then change the oid number of that node to - * match the filesystem's type number. This allows user code - * which uses the type number to read sysctl variables defined - * by the filesystem to continue working. Since the oids are - * in a sorted list, we need to make sure the order is - * preserved by re-registering the oid after modifying its - * number. - */ - sysctl_lock(); - SLIST_FOREACH(oidp, SYSCTL_CHILDREN(&sysctl___vfs), oid_link) - if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { - sysctl_unregister_oid(oidp); - oidp->oid_number = vfc->vfc_typenum; - sysctl_register_oid(oidp); - break; - } - sysctl_unlock(); - - /* * Initialise unused ``struct vfsops'' fields, to use * the vfs_std*() functions. Note, we need the mount * and unmount operations, at the least. The check @@ -280,8 +279,30 @@ vfs_register(struct vfsconf *vfc) * Call init function for this VFS... */ (*(vfc->vfc_vfsops->vfs_init))(vfc); + vfsconf_unlock(); - return 0; + /* + * If this filesystem has a sysctl node under vfs + * (i.e. vfs.xxfs), then change the oid number of that node to + * match the filesystem's type number. This allows user code + * which uses the type number to read sysctl variables defined + * by the filesystem to continue working. Since the oids are + * in a sorted list, we need to make sure the order is + * preserved by re-registering the oid after modifying its + * number. + */ + sysctl_lock(); + SLIST_FOREACH(oidp, SYSCTL_CHILDREN(&sysctl___vfs), oid_link) { + if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { + sysctl_unregister_oid(oidp); + oidp->oid_number = vfc->vfc_typenum; + sysctl_register_oid(oidp); + break; + } + } + sysctl_unlock(); + + return (0); } @@ -294,15 +315,22 @@ vfs_unregister(struct vfsconf *vfc) i = vfc->vfc_typenum; - vfsp = vfs_byname(vfc->vfc_name); - if (vfsp == NULL) - return EINVAL; - if (vfsp->vfc_refcount) - return EBUSY; + vfsconf_lock(); + vfsp = vfs_byname_locked(vfc->vfc_name); + if (vfsp == NULL) { + vfsconf_unlock(); + return (EINVAL); + } + if (vfsp->vfc_refcount != 0) { + vfsconf_unlock(); + return (EBUSY); + } if (vfc->vfc_vfsops->vfs_uninit != NULL) { error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp); - if (error) + if (error != 0) { + vfsconf_unlock(); return (error); + } } TAILQ_REMOVE(&vfsconf, vfsp, vfc_list); maxtypenum = VFS_GENERIC; @@ -310,7 +338,8 @@ vfs_unregister(struct vfsconf *vfc) if (maxtypenum < vfsp->vfc_typenum) maxtypenum = vfsp->vfc_typenum; maxvfsconf = maxtypenum + 1; - return 0; + vfsconf_unlock(); + return (0); } /* Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Aug 3 03:06:00 2014 (r269456) +++ head/sys/kern/vfs_mount.c Sun Aug 3 03:27:54 2014 (r269457) @@ -463,9 +463,9 @@ vfs_mount_alloc(struct vnode *vp, struct mp->mnt_activevnodelistsize = 0; mp->mnt_ref = 0; (void) vfs_busy(mp, MBF_NOWAIT); + atomic_add_acq_int(&vfsp->vfc_refcount, 1); mp->mnt_op = vfsp->vfc_vfsops; mp->mnt_vfc = vfsp; - vfsp->vfc_refcount++; /* XXX Unlocked */ mp->mnt_stat.f_type = vfsp->vfc_typenum; mp->mnt_gen++; strlcpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN); @@ -505,7 +505,7 @@ vfs_mount_destroy(struct mount *mp) panic("vfs_mount_destroy: nonzero writeopcount"); if (mp->mnt_secondary_writes != 0) panic("vfs_mount_destroy: nonzero secondary_writes"); - mp->mnt_vfc->vfc_refcount--; + atomic_subtract_rel_int(&mp->mnt_vfc->vfc_refcount, 1); if (!TAILQ_EMPTY(&mp->mnt_nvnodelist)) { struct vnode *vp; @@ -736,17 +736,12 @@ sys_mount(td, uap) } AUDIT_ARG_TEXT(fstype); - mtx_lock(&Giant); vfsp = vfs_byname_kld(fstype, td, &error); free(fstype, M_TEMP); - if (vfsp == NULL) { - mtx_unlock(&Giant); + if (vfsp == NULL) return (ENOENT); - } - if (vfsp->vfc_vfsops->vfs_cmount == NULL) { - mtx_unlock(&Giant); + if (vfsp->vfc_vfsops->vfs_cmount == NULL) return (EOPNOTSUPP); - } ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); @@ -755,7 +750,6 @@ sys_mount(td, uap) ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags); - mtx_unlock(&Giant); return (error); } @@ -777,7 +771,6 @@ vfs_domount_first( struct vnode *newdp; int error; - mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); @@ -889,7 +882,6 @@ vfs_domount_update( int error, export_error; uint64_t flag; - mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) != 0, ("MNT_UPDATE should be here")); @@ -1091,7 +1083,6 @@ vfs_domount( error = namei(&nd); if (error != 0) return (error); - mtx_lock(&Giant); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { @@ -1106,7 +1097,6 @@ vfs_domount( free(pathbuf, M_TEMP); } else error = vfs_domount_update(td, vp, fsflags, optlist); - mtx_unlock(&Giant); ASSERT_VI_UNLOCKED(vp, __func__); ASSERT_VOP_UNLOCKED(vp, __func__); @@ -1153,12 +1143,10 @@ sys_unmount(td, uap) free(pathbuf, M_TEMP); return (error); } - mtx_lock(&Giant); if (uap->flags & MNT_BYFSID) { AUDIT_ARG_TEXT(pathbuf); /* Decode the filesystem ID. */ if (sscanf(pathbuf, "FSID:%d:%d", &id0, &id1) != 2) { - mtx_unlock(&Giant); free(pathbuf, M_TEMP); return (EINVAL); } @@ -1198,19 +1186,15 @@ sys_unmount(td, uap) * now, so in the !MNT_BYFSID case return the more likely * EINVAL for compatibility. */ - mtx_unlock(&Giant); return ((uap->flags & MNT_BYFSID) ? ENOENT : EINVAL); } /* * Don't allow unmounting the root filesystem. */ - if (mp->mnt_flag & MNT_ROOTFS) { - mtx_unlock(&Giant); + if (mp->mnt_flag & MNT_ROOTFS) return (EINVAL); - } error = dounmount(mp, uap->flags, td); - mtx_unlock(&Giant); return (error); } @@ -1228,8 +1212,6 @@ dounmount(mp, flags, td) uint64_t async_flag; int mnt_gen_r; - mtx_assert(&Giant, MA_OWNED); - if ((coveredvp = mp->mnt_vnodecovered) != NULL) { mnt_gen_r = mp->mnt_gen; VI_LOCK(coveredvp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 3 03:06:00 2014 (r269456) +++ head/sys/kern/vfs_subr.c Sun Aug 3 03:27:54 2014 (r269457) @@ -3233,6 +3233,7 @@ sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) int error; error = 0; + vfsconf_slock(); TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { #ifdef COMPAT_FREEBSD32 if (req->flags & SCTL_MASK32) @@ -3243,11 +3244,12 @@ sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) if (error) break; } + vfsconf_sunlock(); return (error); } -SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLTYPE_OPAQUE | CTLFLAG_RD, - NULL, 0, sysctl_vfs_conflist, +SYSCTL_PROC(_vfs, OID_AUTO, conflist, CTLTYPE_OPAQUE | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, sysctl_vfs_conflist, "S,xvfsconf", "List of all configured filesystems"); #ifndef BURN_BRIDGES @@ -3277,9 +3279,12 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) case VFS_CONF: if (namelen != 3) return (ENOTDIR); /* overloaded */ - TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) + vfsconf_slock(); + TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { if (vfsp->vfc_typenum == name[2]) break; + } + vfsconf_sunlock(); if (vfsp == NULL) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 @@ -3292,8 +3297,9 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) return (EOPNOTSUPP); } -static SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD | CTLFLAG_SKIP, - vfs_sysctl, "Generic filesystem"); +static SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD | CTLFLAG_SKIP | + CTLFLAG_MPSAFE, vfs_sysctl, + "Generic filesystem"); #if 1 || defined(COMPAT_PRELITE2) @@ -3304,6 +3310,7 @@ sysctl_ovfs_conf(SYSCTL_HANDLER_ARGS) struct vfsconf *vfsp; struct ovfsconf ovfs; + vfsconf_slock(); TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { bzero(&ovfs, sizeof(ovfs)); ovfs.vfc_vfsops = vfsp->vfc_vfsops; /* XXX used as flag */ @@ -3312,10 +3319,13 @@ sysctl_ovfs_conf(SYSCTL_HANDLER_ARGS) ovfs.vfc_refcount = vfsp->vfc_refcount; ovfs.vfc_flags = vfsp->vfc_flags; error = SYSCTL_OUT(req, &ovfs, sizeof ovfs); - if (error) - return error; + if (error != 0) { + vfsconf_sunlock(); + return (error); + } } - return 0; + vfsconf_sunlock(); + return (0); } #endif /* 1 || COMPAT_PRELITE2 */ @@ -3413,8 +3423,9 @@ sysctl_vnode(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_kern, KERN_VNODE, vnode, CTLTYPE_OPAQUE|CTLFLAG_RD, - 0, 0, sysctl_vnode, "S,xvnode", ""); +SYSCTL_PROC(_kern, KERN_VNODE, vnode, CTLTYPE_OPAQUE | CTLFLAG_RD | + CTLFLAG_MPSAFE, 0, 0, sysctl_vnode, "S,xvnode", + ""); #endif /* Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Aug 3 03:06:00 2014 (r269456) +++ head/sys/sys/mount.h Sun Aug 3 03:27:54 2014 (r269457) @@ -39,6 +39,7 @@ #include #include #include +#include #endif /* @@ -889,6 +890,11 @@ void vfs_unmountall(void); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct mtx mountlist_mtx; extern struct nfs_public nfs_pub; +extern struct sx vfsconf_sx; +#define vfsconf_lock() sx_xlock(&vfsconf_sx) +#define vfsconf_unlock() sx_xunlock(&vfsconf_sx) +#define vfsconf_slock() sx_slock(&vfsconf_sx) +#define vfsconf_sunlock() sx_sunlock(&vfsconf_sx) /* * Declarations for these vfs default operations are located in From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 03:51:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FAFC835; Sun, 3 Aug 2014 03:51:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6DD2538; Sun, 3 Aug 2014 03:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s733pYNg067052; Sun, 3 Aug 2014 03:51:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s733pYkH067039; Sun, 3 Aug 2014 03:51:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201408030351.s733pYkH067039@svn.freebsd.org> From: Adrian Chadd Date: Sun, 3 Aug 2014 03:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269458 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 03:51:34 -0000 Author: adrian Date: Sun Aug 3 03:51:33 2014 New Revision: 269458 URL: http://svnweb.freebsd.org/changeset/base/269458 Log: Do the iwn(4) panic reinitialisation under IWN_LOCK(). I've checked each of the functions being called and there's either a _locked version or it's supposed to be called with IWN_LOCK() held. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Aug 3 03:27:54 2014 (r269457) +++ head/sys/dev/iwn/if_iwn.c Sun Aug 3 03:51:33 2014 (r269458) @@ -8465,9 +8465,10 @@ iwn_panicked(void *arg0, int pending) device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " "resetting...\n", __func__, vap->iv_state); - iwn_stop(sc); - iwn_init(sc); - iwn_start(sc->sc_ifp); + IWN_LOCK(sc); + + iwn_stop_locked(sc); + iwn_init_locked(sc); if (vap->iv_state >= IEEE80211_S_AUTH && (error = iwn_auth(sc, vap)) != 0) { device_printf(sc->sc_dev, @@ -8478,6 +8479,11 @@ iwn_panicked(void *arg0, int pending) device_printf(sc->sc_dev, "%s: could not move to run state\n", __func__); } + + /* Only run start once the NIC is in a useful state, like associated */ + iwn_start_locked(sc->sc_ifp); + + IWN_UNLOCK(sc); } static void From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 05:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB02C54; Sun, 3 Aug 2014 05:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC9A429D9; Sun, 3 Aug 2014 05:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7350iDW096576; Sun, 3 Aug 2014 05:00:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7350iDE096574; Sun, 3 Aug 2014 05:00:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201408030500.s7350iDE096574@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Aug 2014 05:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269459 - in head/sys: conf kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 05:00:44 -0000 Author: imp Date: Sun Aug 3 05:00:43 2014 New Revision: 269459 URL: http://svnweb.freebsd.org/changeset/base/269459 Log: Make the witness lock limit an option. Modified: head/sys/conf/options head/sys/kern/subr_witness.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Aug 3 03:51:33 2014 (r269458) +++ head/sys/conf/options Sun Aug 3 05:00:43 2014 (r269459) @@ -685,6 +685,7 @@ WITNESS opt_global.h WITNESS_KDB opt_witness.h WITNESS_NO_VNODE opt_witness.h WITNESS_SKIPSPIN opt_witness.h +WITNESS_COUNT opt_witness.h OPENSOLARIS_WITNESS opt_global.h # options for ACPI support Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sun Aug 3 03:51:33 2014 (r269458) +++ head/sys/kern/subr_witness.c Sun Aug 3 05:00:43 2014 (r269459) @@ -132,7 +132,9 @@ __FBSDID("$FreeBSD$"); /* Define this to check for blessed mutexes */ #undef BLESSING +#ifndef WITNESS_COUNT #define WITNESS_COUNT 1536 +#endif #define WITNESS_CHILDCOUNT (WITNESS_COUNT * 4) #define WITNESS_HASH_SIZE 251 /* Prime, gives load factor < 2 */ #define WITNESS_PENDLIST (1024 + MAXCPU) From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 05:02:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC95FD91; Sun, 3 Aug 2014 05:02:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8B962A6C; Sun, 3 Aug 2014 05:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s73520l6099024; Sun, 3 Aug 2014 05:02:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7352015099023; Sun, 3 Aug 2014 05:02:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201408030502.s7352015099023@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Aug 2014 05:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269460 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 05:02:00 -0000 Author: dteske Date: Sun Aug 3 05:02:00 2014 New Revision: 269460 URL: http://svnweb.freebsd.org/changeset/base/269460 Log: Add required `exec' before Xdialog(1) invocation for the case where we expect (require) data on stdin. The effect of this is that, when backgrounded, $! returns the pid of an Xdialog(1) instance instead of an sh(1) instance -- the difference being a later kill of $! will reach the Xdialog(1) instance whereas without the exec the kill succeeds on the sh(1) instance leaving Xdialog(1) open. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Aug 3 05:00:43 2014 (r269459) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun Aug 3 05:02:00 2014 (r269460) @@ -1557,12 +1557,22 @@ f_dialog_info() # EOF. This implies that you must execute this either as an rvalue to a pipe, # lvalue to indirection or in a sub-shell that provides data on stdin. # +# To open an Xdialog(1) infobox that does not disappear until expeclitly dis- +# missed, use the following: +# +# f_xdialog_info "$info_text" < /dev/tty & +# pid=$! +# # Perform some lengthy actions +# kill $pid +# +# NB: Check $USE_XDIALOG if you need to support both dialog(1) and Xdialog(1). +# f_xdialog_info() { local info_text="$*" height width f_dialog_infobox_size height width \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$info_text" - $DIALOG \ + exec $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --no-close --no-buttons \ From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 07:59:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E2C0FCD for ; Sun, 3 Aug 2014 07:59:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607602909 for ; Sun, 3 Aug 2014 07:59:19 +0000 (UTC) Received: from pluknet (uid 1244) (envelope-from pluknet@svn.freebsd.org) id 5e47 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 07:59:19 +0000 From: Sergey Kandaurov Date: Sun, 3 Aug 2014 07:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269462 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ddebd7.5e47.3777943@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 07:59:19 -0000 Author: pluknet Date: Sun Aug 3 07:59:19 2014 New Revision: 269462 URL: http://svnweb.freebsd.org/changeset/base/269462 Log: vn_path_to_global_path: update comment. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 3 05:53:53 2014 (r269461) +++ head/sys/kern/vfs_cache.c Sun Aug 3 07:59:19 2014 (r269462) @@ -1424,7 +1424,7 @@ cache_enter(struct vnode *dvp, struct vn * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. * - * Requires a locked, referenced vnode and GIANT lock held. + * Requires a locked, referenced vnode. * Vnode is re-locked on success or ENODEV, otherwise unlocked. * * If sysctl debug.disablefullpath is set, ENODEV is returned, From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 09:47:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0834DC35 for ; Sun, 3 Aug 2014 09:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD0F6259E for ; Sun, 3 Aug 2014 09:47:51 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@svn.freebsd.org) id 5601 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 09:47:51 +0000 From: Xin LI Date: Sun, 3 Aug 2014 09:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269466 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de0547.5601.7c60e05f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 09:47:52 -0000 Author: delphij Date: Sun Aug 3 09:47:51 2014 New Revision: 269466 URL: http://svnweb.freebsd.org/changeset/base/269466 Log: Revert r269404 and use cpu_ticks() for dbuf allocation. Encode CPU's number by XOR'ing the CPU ID against the 64-bit cpu_ticks(). Reviewed by: mav, gibbs Differential Revision: https://phabric.freebsd.org/D521 MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:40:50 2014 (r269465) +++ head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:47:51 2014 (r269466) @@ -60,17 +60,6 @@ gethrtime(void) { struct timespec ts; hrtime_t nsec; - nanouptime(&ts); - nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; - return (nsec); -} - -static __inline hrtime_t -gethrtime_waitfree(void) { - - struct timespec ts; - hrtime_t nsec; - getnanouptime(&ts); nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; return (nsec); @@ -78,6 +67,7 @@ gethrtime_waitfree(void) { #define gethrestime_sec() (time_second) #define gethrestime(ts) getnanotime(ts) +#define gethrtime_waitfree() gethrtime() extern int nsec_per_tick; /* nanoseconds per clock tick */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:40:50 2014 (r269465) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:47:51 2014 (r269466) @@ -70,7 +70,11 @@ dbuf_cons(void *vdb, void *unused, int k cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL); refcount_create(&db->db_holds); +#if defined(illumos) || !defined(_KERNEL) db->db_creation = gethrtime(); +#else + db->db_creation = cpu_ticks() ^ ((uint64_t)CPU_SEQID << 48); +#endif return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 10:02:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 487A93F3 for ; Sun, 3 Aug 2014 10:02:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E69D274B for ; Sun, 3 Aug 2014 10:02:15 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@svn.freebsd.org) id 5cff by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 10:02:15 +0000 From: Alexander Motin Date: Sun, 3 Aug 2014 10:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269469 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de08a7.5cff.359ee10f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 10:02:15 -0000 Author: mav Date: Sun Aug 3 10:02:14 2014 New Revision: 269469 URL: http://svnweb.freebsd.org/changeset/base/269469 Log: Do not retry token errors. They are not going to disappear by themselves. MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sun Aug 3 09:53:34 2014 (r269468) +++ head/sys/cam/scsi/scsi_all.c Sun Aug 3 10:02:14 2014 (r269469) @@ -1592,37 +1592,37 @@ static struct asc_table_entry asc_table[ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, /* DT P B */ - { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x00, SS_FATAL | EINVAL, "Invalid token operation, cause not reportable") }, /* DT P B */ - { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x01, SS_FATAL | EINVAL, "Invalid token operation, unsupported token type") }, /* DT P B */ - { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x02, SS_FATAL | EINVAL, "Invalid token operation, remote token usage not supported") }, /* DT P B */ - { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x03, SS_FATAL | EINVAL, "Invalid token operation, remote ROD token creation not supported") }, /* DT P B */ - { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x04, SS_FATAL | EINVAL, "Invalid token operation, token unknown") }, /* DT P B */ - { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x05, SS_FATAL | EINVAL, "Invalid token operation, token corrupt") }, /* DT P B */ - { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x06, SS_FATAL | EINVAL, "Invalid token operation, token revoked") }, /* DT P B */ - { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x07, SS_FATAL | EINVAL, "Invalid token operation, token expired") }, /* DT P B */ - { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x08, SS_FATAL | EINVAL, "Invalid token operation, token cancelled") }, /* DT P B */ - { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x09, SS_FATAL | EINVAL, "Invalid token operation, token deleted") }, /* DT P B */ - { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + { SST(0x23, 0x0A, SS_FATAL | EINVAL, "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 10:47:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B81F3200 for ; Sun, 3 Aug 2014 10:47:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C7A2CD9 for ; Sun, 3 Aug 2014 10:47:45 +0000 (UTC) Received: from joerg (uid 548) (envelope-from joerg@svn.freebsd.org) id 5c38 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 10:47:45 +0000 From: Joerg Wunsch Date: Sun, 3 Aug 2014 10:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269470 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de1351.5c38.22a9a53a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 10:47:45 -0000 Author: joerg Date: Sun Aug 3 10:47:45 2014 New Revision: 269470 URL: http://svnweb.freebsd.org/changeset/base/269470 Log: Avoid a divide-by-zero panic when setting the baudrate to 0. MFC after: 2 weeks Modified: head/sys/dev/usb/serial/umcs.c Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Sun Aug 3 10:02:14 2014 (r269469) +++ head/sys/dev/usb/serial/umcs.c Sun Aug 3 10:47:45 2014 (r269470) @@ -1083,7 +1083,10 @@ umcs7840_calc_baudrate(uint32_t rate, ui for (i = 0; i < umcs7840_baudrate_divisors_len - 1 && !(rate > umcs7840_baudrate_divisors[i] && rate <= umcs7840_baudrate_divisors[i + 1]); ++i); - *divisor = umcs7840_baudrate_divisors[i + 1] / rate; + if (rate == 0) + *divisor = 1; /* XXX */ + else + *divisor = umcs7840_baudrate_divisors[i + 1] / rate; /* 0x00 .. 0x70 */ *clk = i << MCS7840_DEV_SPx_CLOCK_SHIFT; return (0); From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 11:01:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AC453B7 for ; Sun, 3 Aug 2014 11:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D59C2F33 for ; Sun, 3 Aug 2014 11:01:36 +0000 (UTC) Received: from ray (uid 1256) (envelope-from ray@svn.freebsd.org) id 53ba by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 11:01:36 +0000 From: Aleksandr Rybalko Date: Sun, 3 Aug 2014 11:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269471 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de1690.53ba.64514c82@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 11:01:36 -0000 Author: ray Date: Sun Aug 3 11:01:35 2014 New Revision: 269471 URL: http://svnweb.freebsd.org/changeset/base/269471 Log: Fix vt_vga driver to draw not-8-bit-aligned fonts correctly. Still one bug here: mouse left some gaps on track when moving left. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Sun Aug 3 10:47:45 2014 (r269470) +++ head/sys/dev/vt/hw/vga/vt_vga.c Sun Aug 3 11:01:35 2014 (r269471) @@ -87,7 +87,7 @@ static const struct vt_driver vt_vga_dri .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, - .vd_maskbitbltchr = vga_maskbitbltchr, + .vd_maskbitbltchr = vga_bitbltchr, .vd_drawrect = vga_drawrect, .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, @@ -172,88 +172,83 @@ vga_drawrect(struct vt_device *vd, int x } } -static inline void -vga_bitblt_draw(struct vt_device *vd, const uint8_t *src, - u_long ldst, uint8_t shift, unsigned int width, unsigned int height, - term_color_t color, int negate) -{ - u_long dst; - int w; - uint8_t b, r, out; - - for (; height > 0; height--) { - dst = ldst; - ldst += VT_VGA_WIDTH / 8; - r = 0; - for (w = width; w > 0; w -= 8) { - b = *src++; - if (negate) { - b = ~b; - /* Don't go too far. */ - if (w < 8) - b &= 0xff << (8 - w); - } - /* Reintroduce bits from previous column. */ - out = (b >> shift) | r; - r = b << (8 - shift); - vga_bitblt_put(vd, dst++, color, out); - } - /* Print the remainder. */ - vga_bitblt_put(vd, dst, color, r); +/* + * Shift bitmap of one row of the glyph. + * a - array of bytes with src bitmap and result storage. + * m - resulting background color bitmask. + * size - number of bytes per glyph row (+ one byte to store shift overflow). + * shift - offset for target bitmap. + */ + +static void +vga_shift_u8array(uint8_t *a, uint8_t *m, int size, int shift) +{ + int i; + + for (i = (size - 1); i > 0; i--) { + a[i] = (a[i] >> shift) | (a[i-1] << (7 - shift)); + m[i] = ~a[i]; } + a[0] = (a[0] >> shift); + m[0] = ~a[0] & (0xff >> shift); + m[size - 1] = ~a[size - 1] & (0xff << (7 - shift)); } +/* XXX: fix gaps on mouse track when character size is not rounded to 8. */ static void vga_bitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg) { - u_long dst, ldst; - int w; + uint8_t aa[64], ma[64], *r; + int dst, shift, sz, x, y; + struct vga_softc *sc; - /* Don't try to put off screen pixels */ - if (((left + width) > VT_VGA_WIDTH) || ((top + height) > - VT_VGA_HEIGHT)) + if ((left + width) > VT_VGA_WIDTH) + return; + if ((top + height) > VT_VGA_HEIGHT) return; - dst = (VT_VGA_WIDTH * top + left) / 8; - - for (; height > 0; height--) { - ldst = dst; - for (w = width; w > 0; w -= 8) { - vga_bitblt_put(vd, ldst, fg, *src); - vga_bitblt_put(vd, ldst, bg, ~*src); - ldst++; - src++; - } - dst += VT_VGA_WIDTH / 8; - } -} + sc = vd->vd_softc; -/* Bitblt with mask support. Slow. */ -static void -vga_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, - int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, - unsigned int height, term_color_t fg, term_color_t bg) -{ - struct vga_softc *sc = vd->vd_softc; - u_long dst; - uint8_t shift; + sz = (width + 7) / 8; + shift = left % 8; dst = (VT_VGA_WIDTH * top + left) / 8; - shift = left % 8; - /* Don't try to put off screen pixels */ - if (((left + width) > VT_VGA_WIDTH) || ((top + height) > - VT_VGA_HEIGHT)) - return; + for (y = 0; y < height; y++) { + r = (uint8_t *)src + (y * sz); + memcpy(aa, r, sz); + aa[sz] = 0; + vga_shift_u8array(aa, ma, sz + 1, shift); + + vga_setcolor(vd, bg); + for (x = 0; x < (sz + 1); x ++) { + if (ma[x] == 0) + continue; + /* + * XXX Only mouse cursor can go out of screen. + * So for mouse it have to just return, but for regular + * characters it have to panic, to indicate error in + * size/coordinates calculations. + */ + if ((dst + x) >= (VT_VGA_WIDTH * VT_VGA_HEIGHT)) + return; + if (ma[x] != 0xff) + MEM_READ1(sc, dst + x); + MEM_WRITE1(sc, dst + x, ma[x]); + } - if (sc->vga_curcolor == fg) { - vga_bitblt_draw(vd, src, dst, shift, width, height, fg, 0); - vga_bitblt_draw(vd, src, dst, shift, width, height, bg, 1); - } else { - vga_bitblt_draw(vd, src, dst, shift, width, height, bg, 1); - vga_bitblt_draw(vd, src, dst, shift, width, height, fg, 0); + vga_setcolor(vd, fg); + for (x = 0; x < (sz + 1); x ++) { + if (aa[x] == 0) + continue; + if (aa[x] != 0xff) + MEM_READ1(sc, dst + x); + MEM_WRITE1(sc, dst + x, aa[x]); + } + + dst += VT_VGA_WIDTH / 8; } } From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 11:43:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DAD8E9B for ; Sun, 3 Aug 2014 11:43:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74ED9229D for ; Sun, 3 Aug 2014 11:43:14 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 532c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 11:43:14 +0000 From: Alexander Motin Date: Sun, 3 Aug 2014 11:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269472 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de2052.532c.e41401d@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 11:43:14 -0000 Author: mav Date: Sun Aug 3 11:43:14 2014 New Revision: 269472 URL: http://svnweb.freebsd.org/changeset/base/269472 Log: Do not retry on set of non-transient XCOPY errors. MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sun Aug 3 11:01:35 2014 (r269471) +++ head/sys/cam/scsi/scsi_all.c Sun Aug 3 11:43:14 2014 (r269472) @@ -1673,28 +1673,28 @@ static struct asc_table_entry asc_table[ { SST(0x26, 0x05, SS_RDEF, /* XXX TBD */ "Data decryption error") }, /* DTLPWRO K */ - { SST(0x26, 0x06, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x06, SS_FATAL | EINVAL, "Too many target descriptors") }, /* DTLPWRO K */ - { SST(0x26, 0x07, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x07, SS_FATAL | EINVAL, "Unsupported target descriptor type code") }, /* DTLPWRO K */ - { SST(0x26, 0x08, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x08, SS_FATAL | EINVAL, "Too many segment descriptors") }, /* DTLPWRO K */ - { SST(0x26, 0x09, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x09, SS_FATAL | EINVAL, "Unsupported segment descriptor type code") }, /* DTLPWRO K */ - { SST(0x26, 0x0A, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x0A, SS_FATAL | EINVAL, "Unexpected inexact segment") }, /* DTLPWRO K */ - { SST(0x26, 0x0B, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x0B, SS_FATAL | EINVAL, "Inline data length exceeded") }, /* DTLPWRO K */ - { SST(0x26, 0x0C, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x0C, SS_FATAL | EINVAL, "Invalid operation for copy source or destination") }, /* DTLPWRO K */ - { SST(0x26, 0x0D, SS_RDEF, /* XXX TBD */ + { SST(0x26, 0x0D, SS_FATAL | EINVAL, "Copy segment granularity violation") }, /* DT PWROMAEBK */ { SST(0x26, 0x0E, SS_RDEF, /* XXX TBD */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 13:07:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CCAADA7 for ; Sun, 3 Aug 2014 13:07:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F6012B83 for ; Sun, 3 Aug 2014 13:07:26 +0000 (UTC) Received: from ray (uid 1256) (envelope-from ray@FreeBSD.org) id 52ce by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 13:07:25 +0000 From: Aleksandr Rybalko Date: Sun, 3 Aug 2014 13:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269474 - in head: share/man/man4 sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de340e.52ce.7073778e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 13:07:26 -0000 Author: ray Date: Sun Aug 3 13:07:25 2014 New Revision: 269474 URL: http://svnweb.freebsd.org/changeset/base/269474 Log: Allow to disable some special key combinations handled by vt(4), like debug request, reboot request. Requested by: Claude Buisson Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/vt.4 head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Sun Aug 3 12:19:45 2014 (r269473) +++ head/share/man/man4/vt.4 Sun Aug 3 13:07:25 2014 (r269474) @@ -45,6 +45,7 @@ In .Xr loader.conf 5 : .Cd hw.vga.textmode=1 .Cd kern.vty=vt +.Cd kern.vt.spclkeys=15 .Sh DESCRIPTION The .Nm @@ -195,6 +196,19 @@ or If this value is not set, .Xr sc 4 is used. +.It Va kern.vt.spclkeys +bitmap of allowed special keys. 1 is enabled, 0 is disabled. Encoded as: +.Bl -tag -compact -width 0x000000 +.It 0x0001 +Debug request key combination. (Ctrl+Alt+Esc) +.It 0x0002 +Reboot. (Ctrl+Alt+Del) +.It 0x0004 +Halt. +.It 0x0008 +Power down. +.El +Default is 15, all enabled. .El .Sh FILES .Bl -tag -width /usr/share/syscons/keymaps/* -compact Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sun Aug 3 12:19:45 2014 (r269473) +++ head/sys/dev/vt/vt.h Sun Aug 3 13:07:25 2014 (r269474) @@ -87,6 +87,12 @@ static int vt_##_name = _default; \ SYSCTL_INT(_kern_vt, OID_AUTO, _name, CTLFLAG_RWTUN, &vt_##_name, _default,\ _descr); +/* Allow to disable some special keys by users. */ +#define VT_DEBUG_KEY_ENABLED (1 << 0) +#define VT_REBOOT_KEY_ENABLED (1 << 1) +#define VT_HALT_KEY_ENABLED (1 << 2) +#define VT_POWEROFF_KEY_ENABLED (1 << 3) + struct vt_driver; void vt_allocate(struct vt_driver *, void *); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Aug 3 12:19:45 2014 (r269473) +++ head/sys/dev/vt/vt_core.c Sun Aug 3 13:07:25 2014 (r269474) @@ -116,6 +116,9 @@ VT_SYSCTL_INT(enable_altgr, 1, "Enable A VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +VT_SYSCTL_INT(spclkeys, (VT_DEBUG_KEY_ENABLED|VT_REBOOT_KEY_ENABLED| + VT_HALT_KEY_ENABLED|VT_POWEROFF_KEY_ENABLED), "Enabled special keys " + "handled by vt(4)"); static struct vt_device vt_consdev; static unsigned int vt_unit = 0; @@ -402,17 +405,21 @@ vt_machine_kbdevent(int c) switch (c) { case SPCLKEY | DBG: - kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); + if (vt_spclkeys & VT_DEBUG_KEY_ENABLED) + kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); return (1); case SPCLKEY | RBT: - /* XXX: Make this configurable! */ - shutdown_nice(0); + if (vt_spclkeys & VT_REBOOT_KEY_ENABLED) + /* XXX: Make this configurable! */ + shutdown_nice(0); return (1); case SPCLKEY | HALT: - shutdown_nice(RB_HALT); + if (vt_spclkeys & VT_HALT_KEY_ENABLED) + shutdown_nice(RB_HALT); return (1); case SPCLKEY | PDWN: - shutdown_nice(RB_HALT|RB_POWEROFF); + if (vt_spclkeys & VT_POWEROFF_KEY_ENABLED) + shutdown_nice(RB_HALT|RB_POWEROFF); return (1); }; From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 14:10:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28F50B2 for ; Sun, 3 Aug 2014 14:10:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17DD5224A for ; Sun, 3 Aug 2014 14:10:13 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 5884 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 14:10:10 +0000 From: Michael Tuexen Date: Sun, 3 Aug 2014 14:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269475 - in head: lib/libc/net sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de42c3.5884.4ea3a20a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 14:10:13 -0000 Author: tuexen Date: Sun Aug 3 14:10:10 2014 New Revision: 269475 URL: http://svnweb.freebsd.org/changeset/base/269475 Log: Add SCTP socket option SCTP_NRSACK_SUPPORTED to control the NRSACK extension. The default will still be off, since it it not an RFC (yet). Changing the sysctl name will be in a separate commit. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/lib/libc/net/sctp_sys_calls.c Sun Aug 3 14:10:10 2014 (r269475) @@ -356,6 +356,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; + case SCTP_NRSACK_SUPPORTED: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp.h Sun Aug 3 14:10:10 2014 (r269475) @@ -123,6 +123,7 @@ struct sctp_paramhdr { #define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 #define SCTP_ECN_SUPPORTED 0x00000025 #define SCTP_PR_SUPPORTED 0x00000026 +#define SCTP_NRSACK_SUPPORTED 0x00000027 /* * read-only options Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_input.c Sun Aug 3 14:10:10 2014 (r269475) @@ -2787,6 +2787,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; + inp->nrsack_supported = (*inp_p)->nrsack_supported; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; inp->sctp_context = (*inp_p)->sctp_context; inp->local_strreset_support = (*inp_p)->local_strreset_support; @@ -4911,8 +4912,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing NR-SACK chunk\n"); break; } - if ((stcb->asoc.sctp_nr_sack_on_off == 0) || - (stcb->asoc.peer_supports_nr_sack == 0)) { + if (stcb->asoc.nrsack_supported == 0) { goto unknown_chunk; } if (chk_length < sizeof(struct sctp_nr_sack_chunk)) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_output.c Sun Aug 3 14:10:10 2014 (r269475) @@ -4822,7 +4822,7 @@ sctp_send_initiate(struct sctp_inpcb *in if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } - if (stcb->asoc.sctp_nr_sack_on_off == 1) { + if (stcb->asoc.nrsack_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; @@ -5925,7 +5925,8 @@ do_a_abort: if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off)) { + if (((asoc != NULL) && (asoc->nrsack_supported == 1)) || + ((asoc == NULL) && (inp->nrsack_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; @@ -10419,8 +10420,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in uint8_t type; uint8_t tsn_map; - if ((stcb->asoc.sctp_nr_sack_on_off == 1) && - (stcb->asoc.peer_supports_nr_sack == 1)) { + if (stcb->asoc.nrsack_supported == 1) { type = SCTP_NR_SELECTIVE_ACK; } else { type = SCTP_SELECTIVE_ACK; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_pcb.c Sun Aug 3 14:10:10 2014 (r269475) @@ -2485,6 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); + inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable); /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { @@ -6084,6 +6085,7 @@ sctp_load_addresses_from_init(struct sct int got_random = 0, got_hmacs = 0, got_chklist = 0; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t nrsack_supported; #ifdef INET struct sockaddr_in sin; @@ -6115,6 +6117,7 @@ sctp_load_addresses_from_init(struct sct /* Turn off ECN until we get through all params */ ecn_supported = 0; prsctp_supported = 0; + nrsack_supported = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* mark all addresses that we have currently on the list */ net->dest_state |= SCTP_ADDR_NOT_IN_ASSOC; @@ -6454,7 +6457,6 @@ sctp_load_addresses_from_init(struct sct stcb->asoc.peer_supports_asconf = 0; stcb->asoc.peer_supports_pktdrop = 0; stcb->asoc.peer_supports_strreset = 0; - stcb->asoc.peer_supports_nr_sack = 0; stcb->asoc.peer_supports_auth = 0; pr_supported = (struct sctp_supported_chunk_types_param *)phdr; num_ent = plen - sizeof(struct sctp_paramhdr); @@ -6471,7 +6473,7 @@ sctp_load_addresses_from_init(struct sct stcb->asoc.peer_supports_pktdrop = 1; break; case SCTP_NR_SELECTIVE_ACK: - stcb->asoc.peer_supports_nr_sack = 1; + nrsack_supported = 1; break; case SCTP_STREAM_RESET: stcb->asoc.peer_supports_strreset = 1; @@ -6616,6 +6618,7 @@ next_param: } stcb->asoc.ecn_supported &= ecn_supported; stcb->asoc.prsctp_supported &= prsctp_supported; + stcb->asoc.nrsack_supported &= nrsack_supported; /* validate authentication required parameters */ if (got_random && got_hmacs) { stcb->asoc.peer_supports_auth = 1; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_pcb.h Sun Aug 3 14:10:10 2014 (r269475) @@ -408,6 +408,7 @@ struct sctp_inpcb { uint32_t sctp_cmt_on_off; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t nrsack_supported; struct sctp_nonpad_sndrcvinfo def_send; /*- * These three are here for the sosend_dgram Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_peeloff.c Sun Aug 3 14:10:10 2014 (r269475) @@ -120,6 +120,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; + n_inp->nrsack_supported = inp->nrsack_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->local_strreset_support = inp->local_strreset_support; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_structs.h Sun Aug 3 14:10:10 2014 (r269475) @@ -1153,14 +1153,13 @@ struct sctp_association { /* Flags whether an extension is supported or not */ uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t nrsack_supported; /* Did the peer make the stream config (add out) request */ uint8_t peer_req_out; /* flag to indicate if peer can do asconf */ uint8_t peer_supports_asconf; - /* EY - flag to indicate if peer can do nr_sack */ - uint8_t peer_supports_nr_sack; /* peer authentication support flag */ uint8_t peer_supports_auth; /* stream resets are supported by the peer */ @@ -1197,8 +1196,6 @@ struct sctp_association { uint8_t sctp_cmt_on_off; uint8_t iam_blocking; uint8_t cookie_how[8]; - /* EY 05/05/08 - NR_SACK variable */ - uint8_t sctp_nr_sack_on_off; /* JRS 5/21/07 - CMT PF variable */ uint8_t sctp_cmt_pf; uint8_t use_precise_time; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_sysctl.c Sun Aug 3 14:10:10 2014 (r269475) @@ -55,6 +55,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; @@ -85,8 +86,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; - /* EY */ - SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) = SCTPCTL_NR_SACK_ON_OFF_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_use_dac) = SCTPCTL_CMT_USE_DAC_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) = SCTPCTL_CWND_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; @@ -602,6 +601,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); @@ -632,8 +632,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); - /* EY */ - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), SCTPCTL_NR_SACK_ON_OFF_MIN, SCTPCTL_NR_SACK_ON_OFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_auth_disable), SCTPCTL_AUTH_DISABLE_MIN, SCTPCTL_AUTH_DISABLE_MAX); @@ -867,6 +865,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", + SCTPCTL_NRSACK_ENABLE_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); @@ -988,10 +990,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", - SCTPCTL_NR_SACK_ON_OFF_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_sysctl.h Sun Aug 3 14:10:10 2014 (r269475) @@ -46,6 +46,7 @@ struct sctp_sysctl { uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; + uint32_t sctp_nrsack_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; uint32_t sctp_peer_chunk_oh; @@ -77,8 +78,6 @@ struct sctp_sysctl { uint32_t sctp_nr_outgoing_streams_default; uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; - /* EY 5/5/08 - nr_sack flag variable */ - uint32_t sctp_nr_sack_on_off; uint32_t sctp_use_cwnd_based_maxburst; uint32_t sctp_auth_disable; uint32_t sctp_nat_friendly; @@ -161,6 +160,13 @@ struct sctp_sysctl { #define SCTPCTL_PR_ENABLE_MAX 1 #define SCTPCTL_PR_ENABLE_DEFAULT 1 +/* nrsack_enable: Enable NR_SACK */ +#define SCTPCTL_NRSACK_ENABLE_DESC "Enable NR_SACK" +#define SCTPCTL_NRSACK_ENABLE_MIN 0 +#define SCTPCTL_NRSACK_ENABLE_MAX 1 +#define SCTPCTL_NRSACK_ENABLE_DEFAULT 0 + + /* strict_sacks: Enable SCTP Strict SACK checking */ #define SCTPCTL_STRICT_SACKS_DESC "Enable SCTP Strict SACK checking" #define SCTPCTL_STRICT_SACKS_MIN 0 @@ -348,12 +354,6 @@ struct sctp_sysctl { #define SCTPCTL_CMT_ON_OFF_MAX SCTP_CMT_MAX #define SCTPCTL_CMT_ON_OFF_DEFAULT SCTP_CMT_OFF -/* EY - nr_sack_on_off: NR_SACK on/off flag */ -#define SCTPCTL_NR_SACK_ON_OFF_DESC "NR_SACK on/off flag" -#define SCTPCTL_NR_SACK_ON_OFF_MIN 0 -#define SCTPCTL_NR_SACK_ON_OFF_MAX 1 -#define SCTPCTL_NR_SACK_ON_OFF_DEFAULT 0 - /* cmt_use_dac: CMT DAC on/off flag */ #define SCTPCTL_CMT_USE_DAC_DESC "CMT DAC on/off flag" #define SCTPCTL_CMT_USE_DAC_MIN 0 Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctp_usrreq.c Sun Aug 3 14:10:10 2014 (r269475) @@ -3348,6 +3348,33 @@ flags_out: } break; } + case SCTP_NRSACK_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.nrsack_supported; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->nrsack_supported; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } case SCTP_ENABLE_STREAM_RESET: { struct sctp_assoc_value *av; @@ -5969,6 +5996,35 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_NRSACK_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + if (av->assoc_value == 0) { + inp->nrsack_supported = 0; + } else { + inp->nrsack_supported = 1; + } + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Aug 3 13:07:25 2014 (r269474) +++ head/sys/netinet/sctputil.c Sun Aug 3 14:10:10 2014 (r269475) @@ -906,7 +906,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off; asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; - asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off); + asoc->nrsack_supported = inp->nrsack_supported; asoc->sctp_cmt_pf = (uint8_t) 0; asoc->sctp_frag_point = inp->sctp_frag_point; asoc->sctp_features = inp->sctp_features; From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 14:27:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AB1175E for ; Sun, 3 Aug 2014 14:27:25 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F29A250C for ; Sun, 3 Aug 2014 14:27:24 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id e131so3963143oig.18 for ; Sun, 03 Aug 2014 07:27:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=rSDSeozvENKs2oxzmAy56WXlH8dSUQ0PdPDY2eEy9sE=; b=AoHUDjlNAk+DPhWy/3hy8noqUfP/bBBw+vDIjXvX9zdKmcQy8HQOXDl+uSGt51cjyU J4afSHYIyKEESLA57zCrk9xzsgenerjH5Ij9FHyC/Y61XgiX85gu0IEYOtLjAmVuxxj4 1+TFA7hxVueGZwSMez4KkTYE8ZALMj4xNkMA6XjWFMVG+c5hiVS5Kei7eSSlbohBMi8J pxnnNJw26QlalI8pv0MGC3U+66x4PiMjd5SXQP1YGdqY1fw3tNGxKRO9w7wCgsmE7pLf lBXGlYh1BzAfosOprbXfKhUJ3U6Slmk2z+rs7i48hkrOcf5u0onZbX17tPJXJBR0Jsrc Tg3Q== X-Gm-Message-State: ALoCoQlHahXCokldVXMQCatrGGHQthjQW8O+W5dIvscoEIQJFQJtQ+5OsXNVscWL1odWk8qIa5Zj X-Received: by 10.60.42.226 with SMTP id r2mr24720037oel.69.1407076038303; Sun, 03 Aug 2014 07:27:18 -0700 (PDT) Received: from [192.168.4.128] ([107.19.113.74]) by mx.google.com with ESMTPSA id du7sm63187190oeb.0.2014.08.03.07.27.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 07:27:17 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib In-Reply-To: <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> Date: Sun, 3 Aug 2014 08:27:18 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <65378493-7F05-4314-9809-E689891F6067@gmail.com> References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Bruce Simpson , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 14:27:25 -0000 On Jul 21, 2014, at 12:51 PM, Pedro Giffuni wrote: >=20 > Il giorno 21/lug/2014, alle ore 11:42, Bruce Simpson = ha scritto: >=20 >> On 21/07/2014 16:22, Pedro F. Giffuni wrote: >>> ] >>> Log: >>> Add re-entrant versions of the hash functions based on the GNU = api. >>> =20 >> What, if anything, can be done about qsort_r() API incompatibility? >=20 > qsort_r is non-standard and we did it first, plus we will want to stay = compatible with Apple :). >=20 > I guess we could do some ugly parameter swapping in the case where = _GNU_SOURCE > is defined, but I won=92t volunteer to do that. Are there any ABI considerations for the change? Warner From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 15:06:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3747DAC for ; Sun, 3 Aug 2014 15:06:52 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A41D2831 for ; Sun, 3 Aug 2014 15:06:51 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by gateway1.nyi.internal (Postfix) with ESMTP id 0BC01222FE for ; Sun, 3 Aug 2014 11:06:50 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sun, 03 Aug 2014 11:06:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=soQbXcBDXGQ1hO95Ci/Qb8vYk2Q=; b=liyxdWjFYROPWDZr4QRC9YoxmykM PZHY0/zES4XY50z1MGGgu8sZcOAzh6FUaoV9eMxrwof++8CyIWEsguXa6Hg4KZC1 eprKD+FSFYuKYc5cxm2IMvjbrUVClwQp3Job44UD/KUxSxT6n4rDrSjQpgkxqNl1 bDbnFDCUmPcMmMI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=soQbXcBDXGQ1hO95Ci/Qb8 vYk2Q=; b=lGsU/iN4MElBfNTOf/0lBd8dNs0H/Z5M33rKHDhIg9SGa8OeQInvAz 8V4jmriHuWHOM1ucAGep37rju3OMTDJcMJMtXqFZjJKYnIoQ80OMQ57vm96diZpT 7Cldpi9dnTq4l6FHlSwaYyDZqFP0XwPIgHGOXlhIdVqJermJPX6FE= X-Sasl-enc: vfVrLdsD6sr1ONZML4rG9EwQCR1NcYtBt/9G7KB9WqBs 1407078409 Received: from [192.168.5.197] (unknown [217.40.0.61]) by mail.messagingengine.com (Postfix) with ESMTPA id CAB7FC0000C; Sun, 3 Aug 2014 11:06:48 -0400 (EDT) Message-ID: <53DE5006.6000601@fastmail.net> Date: Sun, 03 Aug 2014 16:06:46 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Warner Losh , Pedro Giffuni Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> <65378493-7F05-4314-9809-E689891F6067@gmail.com> In-Reply-To: <65378493-7F05-4314-9809-E689891F6067@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 15:06:52 -0000 On 03/08/2014 15:27, Warner Losh wrote: >>> What, if anything, can be done about qsort_r() API incompatibility? >> qsort_r is non-standard and we did it first, plus we will want to stay compatible with Apple :). >> >> I guess we could do some ugly parameter swapping in the case where _GNU_SOURCE >> is defined, but I won’t volunteer to do that. > Are there any ABI considerations for the change? > I'm in agreement with Pedro here. Some form of compile-time checking is the best one can hope for in that situation, as it would be difficult to "ret-con" the qsort_r() ABI itself. The glibc implementation swaps two pointers in its signature. One of those points to executable code. The last time this caused problems for me was when testing the new CScope indexing backend by Elad Lahav on BSD/Mac. He had developed on Linux, however the quick fix was to fall back to using non-reentrant qsort(). From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 15:09:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06F98F29 for ; Sun, 3 Aug 2014 15:09:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1D8E2840 for ; Sun, 3 Aug 2014 15:09:13 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 52ae by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 15:09:13 +0000 From: Michael Tuexen Date: Sun, 3 Aug 2014 15:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269476 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de5099.52ae.173e21a2@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 15:09:14 -0000 Author: tuexen Date: Sun Aug 3 15:09:13 2014 New Revision: 269476 URL: http://svnweb.freebsd.org/changeset/base/269476 Log: Use consistent names for SCTP sysctls. Rename nr_sack_on_off to nrsack_enable. Please note that this extension is off by default since it is not specified in an RFC (yet). Modified: head/sys/netinet/sctp_sysctl.c Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Aug 3 14:10:10 2014 (r269475) +++ head/sys/netinet/sctp_sysctl.c Sun Aug 3 15:09:13 2014 (r269476) @@ -865,7 +865,7 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nrsack_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_NRSACK_ENABLE_DESC); From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 15:45:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7DD642A for ; Sun, 3 Aug 2014 15:45:52 +0000 (UTC) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 690A72D3A for ; Sun, 3 Aug 2014 15:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1407080359; bh=7PT45R27/H43iHCiuUO5jyJayDrqoL7I26Bljipxqw4=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=ZsAMOQYsgOfdmYLLZjvKno5/aXGmWzo+s5H1gFu1OGnSMZcDfwQyOXcPs/iutwjhcBzABfGZ1aMCtA7SIvDtPx0EeDdLSkp6UfMdwJlX7mZN4mX6a3auMCHv83OHQKWoOJKO5ztWrKWaaCOi2HrTx9uNEgJWVKJgI5ktIcBrF6BRTqw484TvJi2mwjAD6YwtUh2rCqHfR5mNcYUEWDmSomFr9WyrgluDaopeu8+vF5buG3i0of8mXeDOfpOVhNZJLAbieTUCg4BNocg+QN8SvQLoGDEOzeGtWfEAXq6KiQiymUx0U1wEH+UVFGNJpryJdIZZi48YngFRJ4EF+3Oujw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=rU899zTdQaYdWsXqdxXAv5LvpbRGXP7QedNu0zKm+2WqrTsWloFhUECsenVSpFDZgIurFBE6nhiEeIB6p1CXdQ/2/O3d+nfZVtf1EgjglTUAn9v8PB48/RpLgROhvQ7scnjL4btGbLhvMDp9p28bSAajFRd0X92rqjRzZfoV9pZkvg6ZSxCjm4qjLzCXtGTfLF4JHEOjnNRSkif7XcDWWnsWcZuhFV61k4Hfj2VPnTCMbH1wAb0u2Xe/HOGFwZKoymO0EyZr02sW2ZZTIvBWgbgS1JT3AmJTA+WOSBCIGfQCqE3kwcKabUK7uGpj72H3ZbuiFm7OFpeTiuAX8rkq+w==; Received: from [98.139.214.32] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 03 Aug 2014 15:39:19 -0000 Received: from [68.142.230.65] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 03 Aug 2014 15:39:19 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 03 Aug 2014 15:39:19 -0000 X-Yahoo-Newman-Id: 819285.98655.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: V792YDkVM1lAOiJfCaDsbjeBeFwOIifEZpp4Sc3tpyxq9om __GGdfLo1DTh5Nr6i7XwRgJORT8QAyc2AzUBY9KDlzHFYJqFM_PS4W8X8tym NowkDVXyBPjw5yi3PSwIPpTldSscw524YxkF.xNtGNgHDc.Kgm004jcyIzKZ qgvjdABX_Y47XtbwhjL71kDM74rTN9h0pO7xi5Xi3XvhMW5muU0PRBRa6ShS zjYZxa2De58UljKkjUnWc1mP7eL4Npja6etH6TGn8RLnzmmayZxK546Ryejg AGZ8iSiSN.7z0k1ga1zbuUsjDkShklHPPn78HKublDE4uKK5WufrZvROMZd. 9PM43XvhvASTfYgTCmeq69k5BqUWiup72e28Vafs4wmFxn4I3kEV3bHVs6o2 qFvmKjb_1ldK3i.F0VvbTixr0doujagIRJzY_SKQ.j2cmu7CcvsvvxNRS6hr GD679EybrmDPXta_IWWYuP8iHpj3cHlB_Yz0ZDpGwm8VjiCfyOFbEUXWl79. VYr3OvXlUKnC9N4Wo X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib From: Pedro Giffuni In-Reply-To: <65378493-7F05-4314-9809-E689891F6067@gmail.com> Date: Sun, 3 Aug 2014 10:39:15 -0500 Message-Id: <6A2B0200-EB23-459B-8E3F-6B1151C90D0E@freebsd.org> References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> <65378493-7F05-4314-9809-E689891F6067@gmail.com> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, Bruce Simpson , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 15:45:52 -0000 Il giorno 03/ago/2014, alle ore 09:27, Warner Losh ha = scritto: >=20 > On Jul 21, 2014, at 12:51 PM, Pedro Giffuni wrote: >=20 >>=20 >> Il giorno 21/lug/2014, alle ore 11:42, Bruce Simpson = ha scritto: >>=20 >>> On 21/07/2014 16:22, Pedro F. Giffuni wrote: >>>> ] >>>> Log: >>>> Add re-entrant versions of the hash functions based on the GNU = api. >>>>=20 >>> What, if anything, can be done about qsort_r() API incompatibility? >>=20 >> qsort_r is non-standard and we did it first, plus we will want to = stay compatible with Apple :). >>=20 >> I guess we could do some ugly parameter swapping in the case where = _GNU_SOURCE >> is defined, but I won=92t volunteer to do that. >=20 > Are there any ABI considerations for the change? >=20 I would keep the qsort_r() ABI unchanged and add a GNU-compatible = version that is used only when _GNU_SOURCE (but not _BSD_SOURCE) is = defined. This would already be pretty messy by itself because some portable code = may define _GNU_SOURCE but still may try to use the Apple/BSD interface = under another #ifdef. Perhaps it=92s just better to leave our headers = alone and let the end-users do the wrapping. Pedro. From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 15:48:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A01FF65B for ; Sun, 3 Aug 2014 15:48:03 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C862D55 for ; Sun, 3 Aug 2014 15:48:03 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id e131so3938012oig.4 for ; Sun, 03 Aug 2014 08:48:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=i5mjHu3TcsX4XalRaDLIEqk73ORu+fW7rG1WbzmzWAs=; b=h7fEx4kkA4+EdB+4H8Tzlj0j2Scd6mZ5LsnZ/y8bwodgqK3aDUz6oPnJO4Sx8L2bcx aw2Xgh2YRDX+9sVPI/42JAvX7kYR4M/r2k+GVMJVQhCMKkFahx82Tc7Hekf3DHxm4Iox dDus713GlY7mvSWuvdJw1WBFazKehl0JnKP8mMa1ilSVcesDsL2VHPsEP8c0Dn/YvzAe lJAfBP8yP8KjnD4QX/Hkl6gG/bTKC39hfZtMZANUUd5NQ5gnw7m8NCaEj2dgt14oyIT4 JzwRgOA2/cBmosA5KuGrA21+kgRkmJNDZjWc1vvJI0SGsMjtGdwlxszMYc7+XqMlX4u5 /8Jg== X-Gm-Message-State: ALoCoQkXFJAAXO4DM4oVPjFmjW5bBbWNZ4fykVXLCv2EqJt0gP/S327Q0QRqCIorMKmFf+zHd0wq X-Received: by 10.60.179.114 with SMTP id df18mr3906248oec.76.1407080882143; Sun, 03 Aug 2014 08:48:02 -0700 (PDT) Received: from [192.168.4.128] ([107.19.113.74]) by mx.google.com with ESMTPSA id wi4sm33011567obc.14.2014.08.03.08.47.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 08:48:01 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r267937 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/... In-Reply-To: <2037442.AGE2eZkv8p@pippin.baldwin.cx> Date: Sun, 3 Aug 2014 09:47:58 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9989584F-4933-4E20-B274-57CF7256272A@gmail.com> References: <201406262145.s5QLjnJH034761@svn.freebsd.org> <2037442.AGE2eZkv8p@pippin.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 15:48:03 -0000 On Jul 28, 2014, at 9:23 PM, John Baldwin wrote: > On Thursday 26 June 2014 21:45:49 Rui Paulo wrote: >> Author: rpaulo >> Date: Thu Jun 26 21:45:49 2014 >> New Revision: 267937 >> URL: http://svnweb.freebsd.org/changeset/base/267937 >>=20 >> Log: >> MFV illumos >>=20 >> 4477 DTrace should speak JSON >>=20 >> MFC after: 2 weeks >=20 > This makes kernel builds depend on userland sources. This breaks a = lot of my=20 > work trees where I only checkout 'sys', and breaks a generally = long-standing=20 > feature that the kernel was self-contained (recent bmake breakage to = require=20 > the '-m /usr/src/share/mk' hack aside). Perhaps you could copy = strtolctype.h > to sys/cddl/contrib/opensolaris/common/util? We already duplicate=20 > sys/cddl/contrib/opensolaris/common/avl/avl.c in a like manner, = presumably for=20 > the same reason. Just FYI: my intention is to remove that hack requirement, at least for = host !=3D kernel version cases.. I=92ve had some issues with the =93fix=94 that wound up = with a different set of hacks once the initial MAKESYSPATH is fixed. Warner From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 16:45:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52EC493E for ; Sun, 3 Aug 2014 16:45:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2556E2496 for ; Sun, 3 Aug 2014 16:45:08 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 584f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 16:45:08 +0000 From: Marcel Moolenaar Date: Sun, 3 Aug 2014 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269479 - head/sys/dev/nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de6714.584f.a7bd1bd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 16:45:08 -0000 Author: marcel Date: Sun Aug 3 16:45:07 2014 New Revision: 269479 URL: http://svnweb.freebsd.org/changeset/base/269479 Log: Fix multicast, broken by the conversion of the nfe(4) driver to the driver API. Submitted by: Mikhail Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sun Aug 3 16:22:14 2014 (r269478) +++ head/sys/dev/nfe/if_nfe.c Sun Aug 3 16:45:07 2014 (r269479) @@ -2582,7 +2582,6 @@ nfe_setmulti(struct nfe_softc *sc) bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN); bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN); - if_maddr_rlock(ifp); mc_count = if_multiaddr_count(ifp, -1); mta = malloc(sizeof(uint8_t) * ETHER_ADDR_LEN * mc_count, M_DEVBUF, M_NOWAIT); @@ -2594,24 +2593,24 @@ nfe_setmulti(struct nfe_softc *sc) bzero(addr, ETHER_ADDR_LEN); bzero(mask, ETHER_ADDR_LEN); - free(mta, M_DEVBUF); - if_maddr_runlock(ifp); goto done; }; - if_setupmultiaddr(ifp, mta, &mcnt, mc_count); + if_multiaddr_array(ifp, mta, &mcnt, mc_count); for (i = 0; i < mcnt; i++) { uint8_t *addrp; + int j; addrp = mta + (i * ETHER_ADDR_LEN); - for (i = 0; i < ETHER_ADDR_LEN; i++) { - u_int8_t mcaddr = addrp[i]; - addr[i] &= mcaddr; - mask[i] &= ~mcaddr; + for (j = 0; j < ETHER_ADDR_LEN; j++) { + u_int8_t mcaddr = addrp[j]; + addr[j] &= mcaddr; + mask[j] &= ~mcaddr; } } - if_maddr_runlock(ifp); + + free(mta, M_DEVBUF); for (i = 0; i < ETHER_ADDR_LEN; i++) { mask[i] |= addr[i]; From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 17:52:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3255E875; Sun, 3 Aug 2014 17:52:27 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B917E2A43; Sun, 3 Aug 2014 17:52:26 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id D727BD61C2D; Mon, 4 Aug 2014 03:52:18 +1000 (EST) Date: Mon, 4 Aug 2014 03:52:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r269466 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <53de0547.5601.7c60e05f@svn.freebsd.org> Message-ID: <20140804035125.A858@besplex.bde.org> References: <53de0547.5601.7c60e05f@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dZS5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=f4jRgUPOQhAA:10 a=zWNf4g-b35QA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=PP_50AfKc3DqIB_g6tMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 17:52:27 -0000 On Sun, 3 Aug 2014, Xin LI wrote: > Log: > Revert r269404 and use cpu_ticks() for dbuf allocation. > > Encode CPU's number by XOR'ing the CPU ID against the 64-bit cpu_ticks(). > > Reviewed by: mav, gibbs > Differential Revision: https://phabric.freebsd.org/D521 > MFC after: 2 weeks This is still broken. > Modified: head/sys/cddl/compat/opensolaris/sys/time.h > ============================================================================== > --- head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:40:50 2014 (r269465) > +++ head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:47:51 2014 (r269466) > @@ -60,17 +60,6 @@ gethrtime(void) { > struct timespec ts; > hrtime_t nsec; > > - nanouptime(&ts); > - nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; > - return (nsec); > -} The in-between version wasn't broken. nanouptime() is not too slow to use provided it is properly implemented. Unfortunately, this includes proper implementation in the hardware. > - > -static __inline hrtime_t > -gethrtime_waitfree(void) { > - > - struct timespec ts; > - hrtime_t nsec; > - > getnanouptime(&ts); > nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; > return (nsec); The existence of getnanouptime() is a bug. Someone might use it. > @@ -78,6 +67,7 @@ gethrtime_waitfree(void) { > > #define gethrestime_sec() (time_second) > #define gethrestime(ts) getnanotime(ts) > +#define gethrtime_waitfree() gethrtime() > > extern int nsec_per_tick; /* nanoseconds per clock tick */ > > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:40:50 2014 (r269465) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:47:51 2014 (r269466) > @@ -70,7 +70,11 @@ dbuf_cons(void *vdb, void *unused, int k > cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL); > refcount_create(&db->db_holds); > > +#if defined(illumos) || !defined(_KERNEL) > db->db_creation = gethrtime(); > +#else > + db->db_creation = cpu_ticks() ^ ((uint64_t)CPU_SEQID << 48); > +#endif > > return (0); > } cpu_ticks() is a hack to work around nanouptime() being too slow with some hardware. It is much harder to use than nanouptime(). There are no correct uses of it, including its main use. Frequency changes are hard to handle correctly. Here the bug is that it wraps after just 65536+ seconds (18+ hours) at 4GHz, even on x86 where ticks have 64 bits. This gives non-uniqeness in another way. The wrap is increased by wastefully supporting 65536 CPUs. This leaves only 48 bits before wrap occurs (the high bits are XORed. This helps for uniqueness but doesn't guarantee it. E.g., the value of 2**48 on CPU0 is indistingishable from the value of 0 on CPU1. These values occur just 65536+ seconds apart at 4GHz). There is likely to be noise in the lower bits, but this doesn't guarantee uniqueness. On other arches, ticks may have many fewer than 64 bits. Their main use assumes that they have enough bits to represent uptimes of several years, so the above probably has no additional problems. Arches without a TSC mostly use nanouptime() for ticks anyway. These tend to be the slowest arches. gibbs' original suggestion of: db->db_creation = pcup_counter++ ^ ((uint64_t)CPU_SEQID << 48); probably works. Now the counter doesn't race off to infinity at 4GHz so it is obviously unique for 2**48 creations per CPU. It increases in a different unscaled, often nonlinear timescale with much longer ticks. This is also much faster, especially on slower arches without a TSC that emulate cpu_ticks() using nanoptime(). Bruce From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 18:12:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 207CDDA for ; Sun, 3 Aug 2014 18:12:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB292D1D for ; Sun, 3 Aug 2014 18:12:58 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 58ff by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 18:12:55 +0000 From: Michael Tuexen Date: Sun, 3 Aug 2014 18:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269481 - in head: lib/libc/net sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de7ba8.58ff.6d59bb2c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 18:12:58 -0000 Author: tuexen Date: Sun Aug 3 18:12:55 2014 New Revision: 269481 URL: http://svnweb.freebsd.org/changeset/base/269481 Log: Add support for the SCTP_PKTDROP_SUPPORTED socket option and the corresponding sysctl variable. The default is off, since the specification is not an RFC yet. MFC after: 1 week Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/lib/libc/net/sctp_sys_calls.c Sun Aug 3 18:12:55 2014 (r269481) @@ -359,6 +359,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_NRSACK_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; + case SCTP_PKTDROP_SUPPORTED: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp.h Sun Aug 3 18:12:55 2014 (r269481) @@ -124,6 +124,7 @@ struct sctp_paramhdr { #define SCTP_ECN_SUPPORTED 0x00000025 #define SCTP_PR_SUPPORTED 0x00000026 #define SCTP_NRSACK_SUPPORTED 0x00000027 +#define SCTP_PKTDROP_SUPPORTED 0x00000028 /* * read-only options Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_input.c Sun Aug 3 18:12:55 2014 (r269481) @@ -2788,6 +2788,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; inp->nrsack_supported = (*inp_p)->nrsack_supported; + inp->pktdrop_supported = (*inp_p)->pktdrop_supported; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; inp->sctp_context = (*inp_p)->sctp_context; inp->local_strreset_support = (*inp_p)->local_strreset_support; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_output.c Sun Aug 3 18:12:55 2014 (r269481) @@ -4817,7 +4817,9 @@ sctp_send_initiate(struct sctp_inpcb *in if (stcb->asoc.prsctp_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_FORWARD_CUM_TSN; } - pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + if (stcb->asoc.pktdrop_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + } pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; @@ -5920,7 +5922,10 @@ do_a_abort: ((asoc == NULL) && (inp->prsctp_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_FORWARD_CUM_TSN; } - pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + if (((asoc != NULL) && (asoc->pktdrop_supported == 1)) || + ((asoc == NULL) && (inp->pktdrop_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; + } pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; @@ -11399,7 +11404,7 @@ sctp_send_packet_dropped(struct sctp_tcb } asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); - if (asoc->peer_supports_pktdrop == 0) { + if (asoc->pktdrop_supported == 0) { /*- * peer must declare support before I send one. */ Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_pcb.c Sun Aug 3 18:12:55 2014 (r269481) @@ -2486,6 +2486,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable); + inp->pktdrop_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pktdrop_enable); /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { @@ -6086,6 +6087,7 @@ sctp_load_addresses_from_init(struct sct uint8_t ecn_supported; uint8_t prsctp_supported; uint8_t nrsack_supported; + uint8_t pktdrop_supported; #ifdef INET struct sockaddr_in sin; @@ -6118,6 +6120,7 @@ sctp_load_addresses_from_init(struct sct ecn_supported = 0; prsctp_supported = 0; nrsack_supported = 0; + pktdrop_supported = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* mark all addresses that we have currently on the list */ net->dest_state |= SCTP_ADDR_NOT_IN_ASSOC; @@ -6455,7 +6458,6 @@ sctp_load_addresses_from_init(struct sct return (-25); } stcb->asoc.peer_supports_asconf = 0; - stcb->asoc.peer_supports_pktdrop = 0; stcb->asoc.peer_supports_strreset = 0; stcb->asoc.peer_supports_auth = 0; pr_supported = (struct sctp_supported_chunk_types_param *)phdr; @@ -6470,7 +6472,7 @@ sctp_load_addresses_from_init(struct sct prsctp_supported = 1; break; case SCTP_PACKET_DROPPED: - stcb->asoc.peer_supports_pktdrop = 1; + pktdrop_supported = 1; break; case SCTP_NR_SELECTIVE_ACK: nrsack_supported = 1; @@ -6619,6 +6621,7 @@ next_param: stcb->asoc.ecn_supported &= ecn_supported; stcb->asoc.prsctp_supported &= prsctp_supported; stcb->asoc.nrsack_supported &= nrsack_supported; + stcb->asoc.pktdrop_supported &= pktdrop_supported; /* validate authentication required parameters */ if (got_random && got_hmacs) { stcb->asoc.peer_supports_auth = 1; Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_pcb.h Sun Aug 3 18:12:55 2014 (r269481) @@ -409,6 +409,7 @@ struct sctp_inpcb { uint8_t ecn_supported; uint8_t prsctp_supported; uint8_t nrsack_supported; + uint8_t pktdrop_supported; struct sctp_nonpad_sndrcvinfo def_send; /*- * These three are here for the sosend_dgram Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_peeloff.c Sun Aug 3 18:12:55 2014 (r269481) @@ -121,6 +121,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; n_inp->nrsack_supported = inp->nrsack_supported; + n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->local_strreset_support = inp->local_strreset_support; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_structs.h Sun Aug 3 18:12:55 2014 (r269481) @@ -1154,6 +1154,7 @@ struct sctp_association { uint8_t ecn_supported; uint8_t prsctp_supported; uint8_t nrsack_supported; + uint8_t pktdrop_supported; /* Did the peer make the stream config (add out) request */ uint8_t peer_req_out; @@ -1167,11 +1168,6 @@ struct sctp_association { uint8_t local_strreset_support; uint8_t peer_supports_nat; - /* - * packet drop's are supported by the peer, we don't really care - * about this but we bookkeep it anyway. - */ - uint8_t peer_supports_pktdrop; struct sctp_scoping scope; /* flags to handle send alternate net tracking */ Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_sysctl.c Sun Aug 3 18:12:55 2014 (r269481) @@ -56,6 +56,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; @@ -602,6 +603,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); @@ -869,6 +871,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_NRSACK_ENABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pktdrop_enable, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_pktdrop_enable), 0, sysctl_sctp_check, "IU", + SCTPCTL_PKTDROP_ENABLE_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_sysctl.h Sun Aug 3 18:12:55 2014 (r269481) @@ -47,6 +47,7 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; uint32_t sctp_nrsack_enable; + uint32_t sctp_pktdrop_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; uint32_t sctp_peer_chunk_oh; @@ -166,6 +167,11 @@ struct sctp_sysctl { #define SCTPCTL_NRSACK_ENABLE_MAX 1 #define SCTPCTL_NRSACK_ENABLE_DEFAULT 0 +/* pktdrop_enable: Enable SCTP Packet Drop Reports */ +#define SCTPCTL_PKTDROP_ENABLE_DESC "Enable SCTP PKTDROP" +#define SCTPCTL_PKTDROP_ENABLE_MIN 0 +#define SCTPCTL_PKTDROP_ENABLE_MAX 1 +#define SCTPCTL_PKTDROP_ENABLE_DEFAULT 0 /* strict_sacks: Enable SCTP Strict SACK checking */ #define SCTPCTL_STRICT_SACKS_DESC "Enable SCTP Strict SACK checking" Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctp_usrreq.c Sun Aug 3 18:12:55 2014 (r269481) @@ -3375,6 +3375,33 @@ flags_out: } break; } + case SCTP_PKTDROP_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.pktdrop_supported; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->pktdrop_supported; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } case SCTP_ENABLE_STREAM_RESET: { struct sctp_assoc_value *av; @@ -6025,6 +6052,35 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_PKTDROP_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + if (av->assoc_value == 0) { + inp->pktdrop_supported = 0; + } else { + inp->pktdrop_supported = 1; + } + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Aug 3 18:03:00 2014 (r269480) +++ head/sys/netinet/sctputil.c Sun Aug 3 18:12:55 2014 (r269481) @@ -907,6 +907,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; asoc->nrsack_supported = inp->nrsack_supported; + asoc->pktdrop_supported = inp->pktdrop_supported; asoc->sctp_cmt_pf = (uint8_t) 0; asoc->sctp_frag_point = inp->sctp_frag_point; asoc->sctp_features = inp->sctp_features; @@ -952,7 +953,6 @@ sctp_init_asoc(struct sctp_inpcb *inp, s sctp_select_initial_TSN(&inp->sctp_ep); asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; /* we are optimisitic here */ - asoc->peer_supports_pktdrop = 1; asoc->peer_supports_nat = 0; asoc->sent_queue_retran_cnt = 0; From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 20:40:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD26C4FD for ; Sun, 3 Aug 2014 20:40:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8D182D2D for ; Sun, 3 Aug 2014 20:40:55 +0000 (UTC) Received: from alc (uid 759) (envelope-from alc@FreeBSD.org) id 5c5b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 20:40:52 +0000 From: Alan Cox Date: Sun, 3 Aug 2014 20:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269485 - in head: . share/man/man9 sys/amd64/amd64 sys/arm/arm sys/i386/i386 sys/i386/xen sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/powerpc/powerpc sys/sparc64/sparc64 sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de9e55.5c5b.353be911@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 20:40:55 -0000 Author: alc Date: Sun Aug 3 20:40:51 2014 New Revision: 269485 URL: http://svnweb.freebsd.org/changeset/base/269485 Log: Retire pmap_change_wiring(). We have never used it to wire virtual pages. We continue to use pmap_enter() for that. For unwiring virtual pages, we now use pmap_unwire(), which unwires a range of virtual addresses instead of a single virtual page. Sponsored by: EMC / Isilon Storage Division Deleted: head/share/man/man9/pmap_change_wiring.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/pmap.9 head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/pmap.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 3 18:39:11 2014 (r269484) +++ head/ObsoleteFiles.inc Sun Aug 3 20:40:51 2014 (r269485) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140803: Remove an obsolete man page +OLD_FILES+=usr/share/man/man9/pmap_change_wiring.9.gz # 20140728: libsbuf restored to old version. OLD_LIBS+=lib/libsbuf.so.7 # 20140728: Remove an obsolete man page Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Aug 3 18:39:11 2014 (r269484) +++ head/share/man/man9/Makefile Sun Aug 3 20:40:51 2014 (r269485) @@ -199,7 +199,6 @@ MAN= accept_filter.9 \ physio.9 \ pmap.9 \ pmap_activate.9 \ - pmap_change_wiring.9 \ pmap_clear_modify.9 \ pmap_copy.9 \ pmap_enter.9 \ Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Sun Aug 3 18:39:11 2014 (r269484) +++ head/share/man/man9/pmap.9 Sun Aug 3 20:40:51 2014 (r269485) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2014 +.Dd August 3, 2014 .Dt PMAP 9 .Os .Sh NAME @@ -89,7 +89,6 @@ operation. .Sh SEE ALSO .Xr pmap 9 , .Xr pmap_activate 9 , -.Xr pmap_change_wiring 9 , .Xr pmap_clear_modify 9 , .Xr pmap_copy 9 , .Xr pmap_copy_page 9 , Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/amd64/amd64/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -4693,58 +4693,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offs } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - pd_entry_t *pde; - pt_entry_t *pte; - boolean_t pv_lists_locked; - - pv_lists_locked = FALSE; - - /* - * Wiring is not a hardware characteristic so there is no need to - * invalidate TLB. - */ -retry: - PMAP_LOCK(pmap); - pde = pmap_pde(pmap, va); - if ((*pde & PG_PS) != 0) { - if (!wired != ((*pde & PG_W) == 0)) { - if (!pv_lists_locked) { - pv_lists_locked = TRUE; - if (!rw_try_rlock(&pvh_global_lock)) { - PMAP_UNLOCK(pmap); - rw_rlock(&pvh_global_lock); - goto retry; - } - } - if (!pmap_demote_pde(pmap, pde, va)) - panic("pmap_change_wiring: demotion failed"); - } else - goto out; - } - pte = pmap_pde_to_pte(pde, va); - if (wired && (*pte & PG_W) == 0) { - pmap->pm_stats.wired_count++; - atomic_set_long(pte, PG_W); - } else if (!wired && (*pte & PG_W) != 0) { - pmap->pm_stats.wired_count--; - atomic_clear_long(pte, PG_W); - } -out: - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/arm/arm/pmap-v6.c Sun Aug 3 20:40:51 2014 (r269485) @@ -3253,56 +3253,6 @@ pmap_enter_quick(pmap_t pmap, vm_offset_ } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - struct l2_bucket *l2b; - struct md_page *pvh; - struct pv_entry *pve; - pd_entry_t *pl1pd, l1pd; - pt_entry_t *ptep, pte; - vm_page_t m; - - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap); - pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)]; - l1pd = *pl1pd; - if ((l1pd & L1_TYPE_MASK) == L1_S_PROTO) { - m = PHYS_TO_VM_PAGE(l1pd & L1_S_FRAME); - KASSERT((m != NULL) && ((m->oflags & VPO_UNMANAGED) == 0), - ("pmap_change_wiring: unmanaged superpage should not " - "be changed")); - KASSERT(pmap != pmap_kernel(), - ("pmap_change_wiring: managed kernel superpage " - "should not exist")); - pvh = pa_to_pvh(l1pd & L1_S_FRAME); - pve = pmap_find_pv(pvh, pmap, trunc_1mpage(va)); - if (!wired != ((pve->pv_flags & PVF_WIRED) == 0)) { - if (!pmap_demote_section(pmap, va)) - panic("pmap_change_wiring: demotion failed"); - } else - goto out; - } - l2b = pmap_get_l2_bucket(pmap, va); - KASSERT(l2b, ("No l2b bucket in pmap_change_wiring")); - ptep = &l2b->l2b_kva[l2pte_index(va)]; - pte = *ptep; - m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); - if (m != NULL) - pmap_modify_pv(m, pmap, va, PVF_WIRED, - wired == TRUE ? PVF_WIRED : 0); -out: - rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/arm/arm/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -3544,33 +3544,6 @@ pmap_enter_quick(pmap_t pmap, vm_offset_ } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - struct l2_bucket *l2b; - pt_entry_t *ptep, pte; - vm_page_t pg; - - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap); - l2b = pmap_get_l2_bucket(pmap, va); - KASSERT(l2b, ("No l2b bucket in pmap_change_wiring")); - ptep = &l2b->l2b_kva[l2pte_index(va)]; - pte = *ptep; - pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); - if (pg) - pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired ? PVF_WIRED : 0); - rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/i386/i386/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -3968,58 +3968,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offs } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - pd_entry_t *pde; - pt_entry_t *pte; - boolean_t are_queues_locked; - - are_queues_locked = FALSE; -retry: - PMAP_LOCK(pmap); - pde = pmap_pde(pmap, va); - if ((*pde & PG_PS) != 0) { - if (!wired != ((*pde & PG_W) == 0)) { - if (!are_queues_locked) { - are_queues_locked = TRUE; - if (!rw_try_wlock(&pvh_global_lock)) { - PMAP_UNLOCK(pmap); - rw_wlock(&pvh_global_lock); - goto retry; - } - } - if (!pmap_demote_pde(pmap, pde, va)) - panic("pmap_change_wiring: demotion failed"); - } else - goto out; - } - pte = pmap_pte(pmap, va); - - if (wired && !pmap_pte_w(pte)) - pmap->pm_stats.wired_count++; - else if (!wired && pmap_pte_w(pte)) - pmap->pm_stats.wired_count--; - - /* - * Wiring is not a hardware characteristic so there is no need to - * invalidate TLB. - */ - pmap_pte_set_w(pte, wired); - pmap_pte_release(pte); -out: - if (are_queues_locked) - rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/i386/xen/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -3167,39 +3167,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offs } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - pt_entry_t *pte; - - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap); - pte = pmap_pte(pmap, va); - - if (wired && !pmap_pte_w(pte)) { - PT_SET_VA_MA((pte), *(pte) | PG_W, TRUE); - pmap->pm_stats.wired_count++; - } else if (!wired && pmap_pte_w(pte)) { - PT_SET_VA_MA((pte), *(pte) & ~PG_W, TRUE); - pmap->pm_stats.wired_count--; - } - - /* - * Wiring is not a hardware characteristic so there is no need to - * invalidate TLB. - */ - pmap_pte_release(pte); - PMAP_UNLOCK(pmap); - rw_wunlock(&pvh_global_lock); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/mips/mips/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -2425,37 +2425,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offs } /* - * Routine: pmap_change_wiring - * Function: Change the wiring attribute for a map/virtual-address - * pair. - * In/out conditions: - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - pt_entry_t *pte; - - PMAP_LOCK(pmap); - pte = pmap_pte(pmap, va); - - if (wired && !pte_test(pte, PTE_W)) - pmap->pm_stats.wired_count++; - else if (!wired && pte_test(pte, PTE_W)) - pmap->pm_stats.wired_count--; - - /* - * Wiring is not a hardware characteristic so there is no need to - * invalidate TLB. - */ - if (wired) - pte_set(pte, PTE_W); - else - pte_clear(pte, PTE_W); - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range * must have the wired attribute set. In contrast, invalid mappings Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/powerpc/aim/mmu_oea.c Sun Aug 3 20:40:51 2014 (r269485) @@ -269,7 +269,6 @@ int moea_pte_spill(vm_offset_t); /* * Kernel MMU interface */ -void moea_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t); void moea_clear_modify(mmu_t, vm_page_t); void moea_copy_page(mmu_t, vm_page_t, vm_page_t); void moea_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, @@ -319,7 +318,6 @@ vm_offset_t moea_dumpsys_map(mmu_t mmu, struct pmap_md * moea_scan_md(mmu_t mmu, struct pmap_md *prev); static mmu_method_t moea_methods[] = { - MMUMETHOD(mmu_change_wiring, moea_change_wiring), MMUMETHOD(mmu_clear_modify, moea_clear_modify), MMUMETHOD(mmu_copy_page, moea_copy_page), MMUMETHOD(mmu_copy_pages, moea_copy_pages), @@ -1016,28 +1014,6 @@ moea_deactivate(mmu_t mmu, struct thread } void -moea_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) -{ - struct pvo_entry *pvo; - - PMAP_LOCK(pm); - pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); - - if (pvo != NULL) { - if (wired) { - if ((pvo->pvo_vaddr & PVO_WIRED) == 0) - pm->pm_stats.wired_count++; - pvo->pvo_vaddr |= PVO_WIRED; - } else { - if ((pvo->pvo_vaddr & PVO_WIRED) != 0) - pm->pm_stats.wired_count--; - pvo->pvo_vaddr &= ~PVO_WIRED; - } - } - PMAP_UNLOCK(pm); -} - -void moea_unwire(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { struct pvo_entry key, *pvo; Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Aug 3 20:40:51 2014 (r269485) @@ -283,7 +283,6 @@ static void moea64_syncicache(mmu_t, pm /* * Kernel MMU interface */ -void moea64_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t); void moea64_clear_modify(mmu_t, vm_page_t); void moea64_copy_page(mmu_t, vm_page_t, vm_page_t); void moea64_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, @@ -332,7 +331,6 @@ vm_offset_t moea64_dumpsys_map(mmu_t mmu struct pmap_md * moea64_scan_md(mmu_t mmu, struct pmap_md *prev); static mmu_method_t moea64_methods[] = { - MMUMETHOD(mmu_change_wiring, moea64_change_wiring), MMUMETHOD(mmu_clear_modify, moea64_clear_modify), MMUMETHOD(mmu_copy_page, moea64_copy_page), MMUMETHOD(mmu_copy_pages, moea64_copy_pages), @@ -1026,59 +1024,6 @@ moea64_deactivate(mmu_t mmu, struct thre } void -moea64_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) -{ - struct pvo_entry *pvo; - uintptr_t pt; - uint64_t vsid; - int i, ptegidx; - - LOCK_TABLE_WR(); - PMAP_LOCK(pm); - pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF); - - if (pvo != NULL) { - pt = MOEA64_PVO_TO_PTE(mmu, pvo); - - if (wired) { - if ((pvo->pvo_vaddr & PVO_WIRED) == 0) - pm->pm_stats.wired_count++; - pvo->pvo_vaddr |= PVO_WIRED; - pvo->pvo_pte.lpte.pte_hi |= LPTE_WIRED; - } else { - if ((pvo->pvo_vaddr & PVO_WIRED) != 0) - pm->pm_stats.wired_count--; - pvo->pvo_vaddr &= ~PVO_WIRED; - pvo->pvo_pte.lpte.pte_hi &= ~LPTE_WIRED; - } - - if (pt != -1) { - /* Update wiring flag in page table. */ - MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, - pvo->pvo_vpn); - } else if (wired) { - /* - * If we are wiring the page, and it wasn't in the - * page table before, add it. - */ - vsid = PVO_VSID(pvo); - ptegidx = va_to_pteg(vsid, PVO_VADDR(pvo), - pvo->pvo_vaddr & PVO_LARGE); - - i = MOEA64_PTE_INSERT(mmu, ptegidx, &pvo->pvo_pte.lpte); - - if (i >= 0) { - PVO_PTEGIDX_CLR(pvo); - PVO_PTEGIDX_SET(pvo, i); - } - } - - } - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pm); -} - -void moea64_unwire(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { struct pvo_entry key, *pvo; Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/powerpc/booke/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -266,7 +266,6 @@ void pmap_bootstrap_ap(volatile uint32_t /* * Kernel MMU interface */ -static void mmu_booke_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t); static void mmu_booke_clear_modify(mmu_t, vm_page_t); static void mmu_booke_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); @@ -331,7 +330,6 @@ static struct pmap_md *mmu_booke_scan_md static mmu_method_t mmu_booke_methods[] = { /* pmap dispatcher interface */ - MMUMETHOD(mmu_change_wiring, mmu_booke_change_wiring), MMUMETHOD(mmu_clear_modify, mmu_booke_clear_modify), MMUMETHOD(mmu_copy, mmu_booke_copy), MMUMETHOD(mmu_copy_page, mmu_booke_copy_page), @@ -2412,31 +2410,6 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa } /* - * Change wiring attribute for a map/virtual-address pair. - */ -static void -mmu_booke_change_wiring(mmu_t mmu, pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - pte_t *pte; - - PMAP_LOCK(pmap); - if ((pte = pte_find(mmu, pmap, va)) != NULL) { - if (wired) { - if (!PTE_ISWIRED(pte)) { - pte->flags |= PTE_WIRED; - pmap->pm_stats.wired_count++; - } - } else { - if (PTE_ISWIRED(pte)) { - pte->flags &= ~PTE_WIRED; - pmap->pm_stats.wired_count--; - } - } - } - PMAP_UNLOCK(pmap); -} - -/* * Clear the wired attribute from the mappings for the specified range of * addresses in the given pmap. Every valid mapping within that range must * have the wired attribute set. In contrast, invalid mappings cannot have Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/powerpc/powerpc/mmu_if.m Sun Aug 3 20:40:51 2014 (r269485) @@ -152,22 +152,6 @@ METHOD void advise { /** - * @brief Change the wiring attribute for the page in the given physical - * map and virtual address. - * - * @param _pmap physical map of page - * @param _va page virtual address - * @param _wired TRUE to increment wired count, FALSE to decrement - */ -METHOD void change_wiring { - mmu_t _mmu; - pmap_t _pmap; - vm_offset_t _va; - boolean_t _wired; -}; - - -/** * @brief Clear the 'modified' bit on the given physical page * * @param _pg physical page Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sun Aug 3 20:40:51 2014 (r269485) @@ -100,14 +100,6 @@ pmap_advise(pmap_t pmap, vm_offset_t sta } void -pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) -{ - - CTR4(KTR_PMAP, "%s(%p, %#x, %u)", __func__, pmap, va, wired); - MMU_CHANGE_WIRING(mmu_obj, pmap, va, wired); -} - -void pmap_clear_modify(vm_page_t m) { Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/sparc64/sparc64/pmap.c Sun Aug 3 20:40:51 2014 (r269485) @@ -1666,31 +1666,6 @@ pmap_object_init_pt(pmap_t pm, vm_offset ("pmap_object_init_pt: non-device object")); } -/* - * Change the wiring attribute for a map/virtual-address pair. - * The mapping must already exist in the pmap. - */ -void -pmap_change_wiring(pmap_t pm, vm_offset_t va, boolean_t wired) -{ - struct tte *tp; - u_long data; - - PMAP_LOCK(pm); - if ((tp = tsb_tte_lookup(pm, va)) != NULL) { - if (wired) { - data = atomic_set_long(&tp->tte_data, TD_WIRED); - if ((data & TD_WIRED) == 0) - pm->pm_stats.wired_count++; - } else { - data = atomic_clear_long(&tp->tte_data, TD_WIRED); - if ((data & TD_WIRED) != 0) - pm->pm_stats.wired_count--; - } - } - PMAP_UNLOCK(pm); -} - static int pmap_unwire_tte(pmap_t pm, pmap_t pm2, struct tte *tp, vm_offset_t va) { Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Sun Aug 3 18:39:11 2014 (r269484) +++ head/sys/vm/pmap.h Sun Aug 3 20:40:51 2014 (r269485) @@ -102,7 +102,6 @@ void pmap_advise(pmap_t pmap, vm_offse int advice); void pmap_align_superpage(vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t); -void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); void pmap_clear_modify(vm_page_t m); void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); void pmap_copy_page(vm_page_t, vm_page_t); From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 21:54:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 154C3995 for ; Sun, 3 Aug 2014 21:54:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD93E24F7 for ; Sun, 3 Aug 2014 21:54:22 +0000 (UTC) Received: from issyl0 (uid 1292) (envelope-from issyl0@FreeBSD.org) id 5af1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 21:54:22 +0000 From: Isabell Long Date: Sun, 3 Aug 2014 21:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269487 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53deaf8e.5af1.208b2738@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 21:54:23 -0000 Author: issyl0 (doc committer) Date: Sun Aug 3 21:54:22 2014 New Revision: 269487 URL: http://svnweb.freebsd.org/changeset/base/269487 Log: Add generic list, status, load and unload docs to gpart(8) - In the style of gmirror(8). PR: docs/191534 Reviewed by: gavin Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Aug 3 21:37:12 2014 (r269486) +++ head/sbin/geom/class/part/gpart.8 Sun Aug 3 21:54:22 2014 (r269487) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd August 3, 2014 .Dt GPART 8 .Os .Sh NAME @@ -129,6 +129,14 @@ .Op Fl f Ar flags .Ar geom .\" +.Nm +.Cm list +.Nm +.Cm status +.Nm +.Cm load +.Nm +.Cm unload .Sh DESCRIPTION The .Nm @@ -467,6 +475,18 @@ See the section entitled below for a discussion about its use. .El +.It Cm list +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . +.It Cm load +See +.Xr geom 8 . +.It Cm unload +See +.Xr geom 8 . .El .Sh PARTITIONING SCHEMES Several partitioning schemes are supported by the From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 21:56:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 559C8B0C for ; Sun, 3 Aug 2014 21:56:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 299042519 for ; Sun, 3 Aug 2014 21:56:54 +0000 (UTC) Received: from gavin (uid 1136) (envelope-from gavin@FreeBSD.org) id 5b05 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 21:56:54 +0000 From: Gavin Atkinson Date: Sun, 3 Aug 2014 21:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269488 - head/sys/dev/pccbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53deb026.5b05.3dd68e61@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 21:56:54 -0000 Author: gavin Date: Sun Aug 3 21:56:53 2014 New Revision: 269488 URL: http://svnweb.freebsd.org/changeset/base/269488 Log: For reasons which are not clear, r254263 broke some PCMCIA and CardBus bridges in strange ways, either rendering them unable to detect insertion and removal events, or possibly unable to read from the device behind the bridge. This fixes at least one laptop, a Toshiba Tecra M5 with a Texas Instruments PCxx12 (d=0x8039 v=0c104c) bridge. The very similar Tecra M9 has the same bridge, but worked fine without this change. The bridge chip has no I/O port BAR, and there is nothing in the spec to suggest I/O decoding should be enabled; however enabling it fixes the issue. Add an XXX comment to this effect. Discussed with: jhb, imp MFC after: 2 weeks Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Sun Aug 3 21:54:22 2014 (r269487) +++ head/sys/dev/pccbb/pccbb_pci.c Sun Aug 3 21:56:53 2014 (r269488) @@ -481,6 +481,8 @@ cbb_chipinit(struct cbb_softc *sc) /* Enable memory access */ pci_enable_busmaster(sc->dev); + /* XXX: This should not be necessary, but some chipsets require it */ + PCI_MASK_CONFIG(sc->dev, PCIR_COMMAND, | PCIM_CMD_PORTEN, 2); /* disable Legacy IO */ switch (sc->chipset) { From owner-svn-src-head@FreeBSD.ORG Sun Aug 3 22:37:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5A5CE5E for ; Sun, 3 Aug 2014 22:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A90292867 for ; Sun, 3 Aug 2014 22:37:21 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 5b0e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 22:37:21 +0000 From: Peter Wemm Date: Sun, 3 Aug 2014 22:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53deb9a1.5b0e.3d442ab2@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 22:37:21 -0000 Author: peter Date: Sun Aug 3 22:37:21 2014 New Revision: 269489 URL: http://svnweb.freebsd.org/changeset/base/269489 Log: Partial revert of r262867. r262867 was described as fixing socket buffer checks for SOCK_SEQPACKET, but also changed one of the SOCK_DGRAM code paths to use the new sbappendaddr_nospacecheck_locked() function. This lead to SOCK_DGRAM bypassing socket buffer limits. Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Aug 3 21:56:53 2014 (r269488) +++ head/sys/kern/uipc_usrreq.c Sun Aug 3 22:37:21 2014 (r269489) @@ -897,7 +897,7 @@ uipc_send(struct socket *so, int flags, from = &sun_noname; so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_rcv); - if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, from, m, + if (sbappendaddr_locked(&so2->so_rcv, from, m, control)) { sorwakeup_locked(so2); m = NULL; From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 00:58:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A511A20 for ; Mon, 4 Aug 2014 00:58:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5472621 for ; Mon, 4 Aug 2014 00:58:13 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 5d4c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 00:58:12 +0000 From: Alexander Motin Date: Mon, 4 Aug 2014 00:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269492 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dedaa5.5d4c.7dda49d8@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 00:58:13 -0000 Author: mav Date: Mon Aug 4 00:58:12 2014 New Revision: 269492 URL: http://svnweb.freebsd.org/changeset/base/269492 Log: Improve locking of multicast addresses in VLAN and LAGG interfaces. This fixes several scenarios of reproducible panics, cause by races between multicast address changes and interface destruction. MFC after: 2 weeks Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_vlan.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Aug 4 00:51:57 2014 (r269491) +++ head/sys/net/if_lagg.c Mon Aug 4 00:58:12 2014 (r269492) @@ -1217,35 +1217,39 @@ lagg_ether_cmdmulti(struct lagg_port *lp struct ifnet *ifp = lp->lp_ifp; struct ifnet *scifp = sc->sc_ifp; struct lagg_mc *mc; - struct ifmultiaddr *ifma, *rifma = NULL; - struct sockaddr_dl sdl; + struct ifmultiaddr *ifma; int error; LAGG_WLOCK_ASSERT(sc); - link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER); - sdl.sdl_alen = ETHER_ADDR_LEN; - if (set) { + IF_ADDR_WLOCK(scifp); TAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - LLADDR(&sdl), ETHER_ADDR_LEN); - - error = if_addmulti(ifp, (struct sockaddr *)&sdl, &rifma); - if (error) - return (error); mc = malloc(sizeof(struct lagg_mc), M_DEVBUF, M_NOWAIT); - if (mc == NULL) + if (mc == NULL) { + IF_ADDR_WUNLOCK(scifp); return (ENOMEM); - mc->mc_ifma = rifma; + } + bcopy(ifma->ifma_addr, &mc->mc_addr, + ifma->ifma_addr->sa_len); + mc->mc_addr.sdl_index = ifp->if_index; + mc->mc_ifma = NULL; SLIST_INSERT_HEAD(&lp->lp_mc_head, mc, mc_entries); } + IF_ADDR_WUNLOCK(scifp); + SLIST_FOREACH (mc, &lp->lp_mc_head, mc_entries) { + error = if_addmulti(ifp, + (struct sockaddr *)&mc->mc_addr, &mc->mc_ifma); + if (error) + return (error); + } } else { while ((mc = SLIST_FIRST(&lp->lp_mc_head)) != NULL) { SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); - if_delmulti_ifma(mc->mc_ifma); + if (mc->mc_ifma && !lp->lp_detaching) + if_delmulti_ifma(mc->mc_ifma); free(mc, M_DEVBUF); } } Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Mon Aug 4 00:51:57 2014 (r269491) +++ head/sys/net/if_lagg.h Mon Aug 4 00:58:12 2014 (r269492) @@ -174,6 +174,7 @@ struct lagg_lb { }; struct lagg_mc { + struct sockaddr_dl mc_addr; struct ifmultiaddr *mc_ifma; SLIST_ENTRY(lagg_mc) mc_entries; }; Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Aug 4 00:51:57 2014 (r269491) +++ head/sys/net/if_vlan.c Mon Aug 4 00:58:12 2014 (r269492) @@ -460,48 +460,48 @@ trunk_destroy(struct ifvlantrunk *trunk) * traffic that it doesn't really want, which ends up being discarded * later by the upper protocol layers. Unfortunately, there's no way * to avoid this: there really is only one physical interface. - * - * XXX: There is a possible race here if more than one thread is - * modifying the multicast state of the vlan interface at the same time. */ static int vlan_setmulti(struct ifnet *ifp) { struct ifnet *ifp_p; - struct ifmultiaddr *ifma, *rifma = NULL; + struct ifmultiaddr *ifma; struct ifvlan *sc; struct vlan_mc_entry *mc; int error; - /*VLAN_LOCK_ASSERT();*/ - /* Find the parent. */ sc = ifp->if_softc; + TRUNK_LOCK_ASSERT(TRUNK(sc)); ifp_p = PARENT(sc); CURVNET_SET_QUIET(ifp_p->if_vnet); /* First, remove any existing filter entries. */ while ((mc = SLIST_FIRST(&sc->vlan_mc_listhead)) != NULL) { - error = if_delmulti(ifp_p, (struct sockaddr *)&mc->mc_addr); - if (error) - return (error); SLIST_REMOVE_HEAD(&sc->vlan_mc_listhead, mc_entries); + (void)if_delmulti(ifp_p, (struct sockaddr *)&mc->mc_addr); free(mc, M_VLAN); } /* Now program new ones. */ + IF_ADDR_WLOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mc = malloc(sizeof(struct vlan_mc_entry), M_VLAN, M_NOWAIT); - if (mc == NULL) + if (mc == NULL) { + IF_ADDR_WUNLOCK(ifp); return (ENOMEM); + } bcopy(ifma->ifma_addr, &mc->mc_addr, ifma->ifma_addr->sa_len); mc->mc_addr.sdl_index = ifp_p->if_index; SLIST_INSERT_HEAD(&sc->vlan_mc_listhead, mc, mc_entries); + } + IF_ADDR_WUNLOCK(ifp); + SLIST_FOREACH (mc, &sc->vlan_mc_listhead, mc_entries) { error = if_addmulti(ifp_p, (struct sockaddr *)&mc->mc_addr, - &rifma); + NULL); if (error) return (error); } @@ -1374,7 +1374,7 @@ vlan_unconfig_locked(struct ifnet *ifp, * Check if we were the last. */ if (trunk->refcnt == 0) { - trunk->parent->if_vlantrunk = NULL; + parent->if_vlantrunk = NULL; /* * XXXGL: If some ithread has already entered * vlan_input() and is now blocked on the trunk @@ -1568,6 +1568,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd struct ifreq *ifr; struct ifaddr *ifa; struct ifvlan *ifv; + struct ifvlantrunk *trunk; struct vlanreq vlr; int error = 0; @@ -1712,8 +1713,12 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd * If we don't have a parent, just remember the membership for * when we do. */ - if (TRUNK(ifv) != NULL) + trunk = TRUNK(ifv); + if (trunk != NULL) { + TRUNK_LOCK(trunk); error = vlan_setmulti(ifp); + TRUNK_UNLOCK(trunk); + } break; default: From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 01:16:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15E5A261 for ; Mon, 4 Aug 2014 01:16:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01EE027E4 for ; Mon, 4 Aug 2014 01:16:22 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 5597 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 01:16:21 +0000 From: Alexander Motin Date: Mon, 4 Aug 2014 01:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269497 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dedee5.5597.b732dd2@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 01:16:22 -0000 Author: mav Date: Mon Aug 4 01:16:20 2014 New Revision: 269497 URL: http://svnweb.freebsd.org/changeset/base/269497 Log: Add support for Windows dialect of EXTENDED COPY command, aka Microsoft ODX. This allows to avoid extra network traffic when copying files on NTFS iSCSI disks within one storage host by drag'n'dropping them in Windows Explorer of Windows 8/2012. It should also accelerate Hyper-V VM operations, etc. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_ser_table.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Aug 4 01:16:08 2014 (r269496) +++ head/sys/cam/ctl/ctl.c Mon Aug 4 01:16:20 2014 (r269497) @@ -1023,6 +1023,7 @@ ctl_init(void) STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); STAILQ_INIT(&softc->io_pools); + ctl_tpc_init(softc); if (ctl_pool_create(softc, CTL_POOL_INTERNAL, CTL_POOL_ENTRIES_INTERNAL, &internal_pool)!= 0){ @@ -1170,6 +1171,7 @@ ctl_shutdown(void) mtx_destroy(&softc->queue_lock); #endif + ctl_tpc_shutdown(softc); mtx_destroy(&softc->pool_lock); mtx_destroy(&softc->ctl_lock); @@ -4596,7 +4598,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); STAILQ_INIT(&lun->error_list); - ctl_tpc_init(lun); + ctl_tpc_lun_init(lun); /* * Initialize the mode page index. @@ -4748,7 +4750,7 @@ ctl_free_lun(struct ctl_lun *lun) atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); - ctl_tpc_shutdown(lun); + ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Mon Aug 4 01:16:08 2014 (r269496) +++ head/sys/cam/ctl/ctl_cmd_table.c Mon Aug 4 01:16:20 2014 (r269497) @@ -248,10 +248,18 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 10 POPULATE TOKEN */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_populate_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_NONE, + 16, { 0x10, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 11 WRITE USING TOKEN */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_write_using_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_NONE, + 16, { 0x11, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 12 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -334,10 +342,18 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 07 RECEIVE ROD TOKEN INFORMATION */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_receive_rod_token_information, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x07, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 08 REPORT ALL ROD TOKENS */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_report_all_rod_tokens, CTL_SERIDX_RD_CAP, + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_FLAG_DATA_IN, + CTL_LUN_PAT_NONE, + 16, {0x08, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, }; /* 9E SERVICE ACTION IN(16) */ Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Mon Aug 4 01:16:08 2014 (r269496) +++ head/sys/cam/ctl/ctl_private.h Mon Aug 4 01:16:20 2014 (r269497) @@ -422,6 +422,7 @@ struct ctl_thread { STAILQ_HEAD(, ctl_io_hdr) isc_queue; }; +struct tpc_token; struct ctl_softc { struct mtx ctl_lock; struct cdev *dev; @@ -460,6 +461,8 @@ struct ctl_softc { time_t last_print_jiffies; uint32_t skipped_prints; struct ctl_thread threads[CTL_MAX_THREADS]; + TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; + struct callout tpc_timeout; }; #ifdef _KERNEL @@ -500,8 +503,10 @@ int ctl_report_supported_tmf(struct ctl_ int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); -void ctl_tpc_init(struct ctl_lun *lun); -void ctl_tpc_shutdown(struct ctl_lun *lun); +void ctl_tpc_init(struct ctl_softc *softc); +void ctl_tpc_shutdown(struct ctl_softc *softc); +void ctl_tpc_lun_init(struct ctl_lun *lun); +void ctl_tpc_lun_shutdown(struct ctl_lun *lun); int ctl_inquiry_evpd_tpc(struct ctl_scsiio *ctsio, int alloc_len); int ctl_receive_copy_status_lid1(struct ctl_scsiio *ctsio); int ctl_receive_copy_failure_details(struct ctl_scsiio *ctsio); @@ -510,6 +515,10 @@ int ctl_receive_copy_operating_parameter int ctl_extended_copy_lid1(struct ctl_scsiio *ctsio); int ctl_extended_copy_lid4(struct ctl_scsiio *ctsio); int ctl_copy_operation_abort(struct ctl_scsiio *ctsio); +int ctl_populate_token(struct ctl_scsiio *ctsio); +int ctl_write_using_token(struct ctl_scsiio *ctsio); +int ctl_receive_rod_token_information(struct ctl_scsiio *ctsio); +int ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio); #endif /* _KERNEL */ Modified: head/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- head/sys/cam/ctl/ctl_ser_table.c Mon Aug 4 01:16:08 2014 (r269496) +++ head/sys/cam/ctl/ctl_ser_table.c Mon Aug 4 01:16:20 2014 (r269497) @@ -69,7 +69,7 @@ ctl_serialize_table[CTL_SERIDX_COUNT][CT /*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, pS, bK, bK}, /*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, bK}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, pS, pS, bK, pS}, /*RES */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK}, /*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, pS, bK, bK}, /*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK}, Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Mon Aug 4 01:16:08 2014 (r269496) +++ head/sys/cam/ctl/ctl_tpc.c Mon Aug 4 01:16:20 2014 (r269497) @@ -65,6 +65,10 @@ __FBSDID("$FreeBSD$"); #define TPC_MAX_INLINE 0 #define TPC_MAX_LISTS 255 #define TPC_MAX_IO_SIZE (1024 * 1024) +#define TPC_MAX_IOCHUNK_SIZE (TPC_MAX_IO_SIZE * 16) +#define TPC_MIN_TOKEN_TIMEOUT 1 +#define TPC_DFL_TOKEN_TIMEOUT 60 +#define TPC_MAX_TOKEN_TIMEOUT 600 MALLOC_DEFINE(M_CTL_TPC, "ctltpc", "CTL TPC"); @@ -86,6 +90,19 @@ struct tpc_io { TAILQ_ENTRY(tpc_io) links; }; +struct tpc_token { + uint8_t token[512]; + uint64_t lun; + uint32_t blocksize; + uint8_t *params; + struct scsi_range_desc *range; + int nrange; + int active; + time_t last_active; + uint32_t timeout; + TAILQ_ENTRY(tpc_token) links; +}; + struct tpc_list { uint8_t service_action; int init_port; @@ -99,43 +116,127 @@ struct tpc_list { int ncscd; int nseg; int leninl; + struct tpc_token *token; + struct scsi_range_desc *range; + int nrange; + off_t offset_into_rod; + int curseg; + off_t cursectors; off_t curbytes; int curops; int stage; uint8_t *buf; - int segbytes; + off_t segsectors; + off_t segbytes; int tbdio; int error; int abort; int completed; + time_t last_active; TAILQ_HEAD(, tpc_io) allio; struct scsi_sense_data sense_data; uint8_t sense_len; uint8_t scsi_status; struct ctl_scsiio *ctsio; struct ctl_lun *lun; + int res_token_valid; + uint8_t res_token[512]; TAILQ_ENTRY(tpc_list) links; }; +extern struct ctl_softc *control_softc; + +static void +tpc_timeout(void *arg) +{ + struct ctl_softc *softc = arg; + struct ctl_lun *lun; + struct tpc_token *token, *ttoken; + struct tpc_list *list, *tlist; + + /* Free completed lists with expired timeout. */ + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + TAILQ_FOREACH_SAFE(list, &lun->tpc_lists, links, tlist) { + if (!list->completed || time_uptime < list->last_active + + TPC_DFL_TOKEN_TIMEOUT) + continue; + TAILQ_REMOVE(&lun->tpc_lists, list, links); + free(list, M_CTL); + } + mtx_unlock(&lun->lun_lock); + } + + /* Free inactive ROD tokens with expired timeout. */ + TAILQ_FOREACH_SAFE(token, &softc->tpc_tokens, links, ttoken) { + if (token->active || + time_uptime < token->last_active + token->timeout + 1) + continue; + TAILQ_REMOVE(&softc->tpc_tokens, token, links); + free(token->params, M_CTL); + free(token, M_CTL); + } + callout_schedule(&softc->tpc_timeout, hz); +} + +void +ctl_tpc_init(struct ctl_softc *softc) +{ + + TAILQ_INIT(&softc->tpc_tokens); + callout_init_mtx(&softc->tpc_timeout, &softc->ctl_lock, 0); + callout_reset(&softc->tpc_timeout, hz, tpc_timeout, softc); +} + void -ctl_tpc_init(struct ctl_lun *lun) +ctl_tpc_shutdown(struct ctl_softc *softc) +{ + struct tpc_token *token; + + callout_drain(&softc->tpc_timeout); + + /* Free ROD tokens. */ + mtx_lock(&softc->ctl_lock); + while ((token = TAILQ_FIRST(&softc->tpc_tokens)) != NULL) { + TAILQ_REMOVE(&softc->tpc_tokens, token, links); + free(token->params, M_CTL); + free(token, M_CTL); + } + mtx_unlock(&softc->ctl_lock); +} + +void +ctl_tpc_lun_init(struct ctl_lun *lun) { TAILQ_INIT(&lun->tpc_lists); } void -ctl_tpc_shutdown(struct ctl_lun *lun) +ctl_tpc_lun_shutdown(struct ctl_lun *lun) { struct tpc_list *list; + struct tpc_token *token, *ttoken; + /* Free lists for this LUN. */ while ((list = TAILQ_FIRST(&lun->tpc_lists)) != NULL) { TAILQ_REMOVE(&lun->tpc_lists, list, links); KASSERT(list->completed, ("Not completed TPC (%p) on shutdown", list)); free(list, M_CTL); } + + /* Free ROD tokens for this LUN. */ + mtx_lock(&control_softc->ctl_lock); + TAILQ_FOREACH_SAFE(token, &control_softc->tpc_tokens, links, ttoken) { + if (token->lun != lun->lun || token->active) + continue; + TAILQ_REMOVE(&control_softc->tpc_tokens, token, links); + free(token->params, M_CTL); + free(token, M_CTL); + } + mtx_unlock(&control_softc->ctl_lock); } int @@ -143,11 +244,16 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * { struct scsi_vpd_tpc *tpc_ptr; struct scsi_vpd_tpc_descriptor *d_ptr; + struct scsi_vpd_tpc_descriptor_bdrl *bdrl_ptr; struct scsi_vpd_tpc_descriptor_sc *sc_ptr; struct scsi_vpd_tpc_descriptor_sc_descr *scd_ptr; struct scsi_vpd_tpc_descriptor_pd *pd_ptr; struct scsi_vpd_tpc_descriptor_sd *sd_ptr; struct scsi_vpd_tpc_descriptor_sdid *sdid_ptr; + struct scsi_vpd_tpc_descriptor_rtf *rtf_ptr; + struct scsi_vpd_tpc_descriptor_rtf_block *rtfb_ptr; + struct scsi_vpd_tpc_descriptor_srt *srt_ptr; + struct scsi_vpd_tpc_descriptor_srtd *srtd_ptr; struct scsi_vpd_tpc_descriptor_gco *gco_ptr; struct ctl_lun *lun; int data_len; @@ -155,11 +261,16 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; data_len = sizeof(struct scsi_vpd_tpc) + + sizeof(struct scsi_vpd_tpc_descriptor_bdrl) + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sc) + - 2 * sizeof(struct scsi_vpd_tpc_descriptor_sc_descr) + 7, 4) + + 2 * sizeof(struct scsi_vpd_tpc_descriptor_sc_descr) + 11, 4) + sizeof(struct scsi_vpd_tpc_descriptor_pd) + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sd) + 4, 4) + roundup2(sizeof(struct scsi_vpd_tpc_descriptor_sdid) + 2, 4) + + sizeof(struct scsi_vpd_tpc_descriptor_rtf) + + sizeof(struct scsi_vpd_tpc_descriptor_rtf_block) + + sizeof(struct scsi_vpd_tpc_descriptor_srt) + + 2*sizeof(struct scsi_vpd_tpc_descriptor_srtd) + sizeof(struct scsi_vpd_tpc_descriptor_gco); ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); @@ -191,26 +302,44 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * tpc_ptr->page_code = SVPD_SCSI_TPC; scsi_ulto2b(data_len - 4, tpc_ptr->page_length); - /* Supported commands */ + /* Block Device ROD Limits */ d_ptr = (struct scsi_vpd_tpc_descriptor *)&tpc_ptr->descr[0]; + bdrl_ptr = (struct scsi_vpd_tpc_descriptor_bdrl *)d_ptr; + scsi_ulto2b(SVPD_TPC_BDRL, bdrl_ptr->desc_type); + scsi_ulto2b(sizeof(*bdrl_ptr) - 4, bdrl_ptr->desc_length); + scsi_ulto2b(TPC_MAX_SEGS, bdrl_ptr->maximum_ranges); + scsi_ulto4b(TPC_MAX_TOKEN_TIMEOUT, + bdrl_ptr->maximum_inactivity_timeout); + scsi_ulto4b(TPC_DFL_TOKEN_TIMEOUT, + bdrl_ptr->default_inactivity_timeout); + scsi_u64to8b(0, bdrl_ptr->maximum_token_transfer_size); + scsi_u64to8b(0, bdrl_ptr->optimal_transfer_count); + + /* Supported commands */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); sc_ptr = (struct scsi_vpd_tpc_descriptor_sc *)d_ptr; scsi_ulto2b(SVPD_TPC_SC, sc_ptr->desc_type); - sc_ptr->list_length = 2 * sizeof(*scd_ptr) + 7; + sc_ptr->list_length = 2 * sizeof(*scd_ptr) + 11; scsi_ulto2b(roundup2(1 + sc_ptr->list_length, 4), sc_ptr->desc_length); scd_ptr = &sc_ptr->descr[0]; scd_ptr->opcode = EXTENDED_COPY; - scd_ptr->sa_length = 3; + scd_ptr->sa_length = 5; scd_ptr->supported_service_actions[0] = EC_EC_LID1; scd_ptr->supported_service_actions[1] = EC_EC_LID4; - scd_ptr->supported_service_actions[2] = EC_COA; + scd_ptr->supported_service_actions[2] = EC_PT; + scd_ptr->supported_service_actions[3] = EC_WUT; + scd_ptr->supported_service_actions[4] = EC_COA; scd_ptr = (struct scsi_vpd_tpc_descriptor_sc_descr *) &scd_ptr->supported_service_actions[scd_ptr->sa_length]; scd_ptr->opcode = RECEIVE_COPY_STATUS; - scd_ptr->sa_length = 4; + scd_ptr->sa_length = 6; scd_ptr->supported_service_actions[0] = RCS_RCS_LID1; scd_ptr->supported_service_actions[1] = RCS_RCFD; scd_ptr->supported_service_actions[2] = RCS_RCS_LID4; scd_ptr->supported_service_actions[3] = RCS_RCOP; + scd_ptr->supported_service_actions[4] = RCS_RRTI; + scd_ptr->supported_service_actions[5] = RCS_RART; /* Parameter data. */ d_ptr = (struct scsi_vpd_tpc_descriptor *) @@ -244,6 +373,47 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * scsi_ulto2b(2, sdid_ptr->list_length); scsi_ulto2b(0xffff, &sdid_ptr->supported_descriptor_ids[0]); + /* ROD Token Features */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + rtf_ptr = (struct scsi_vpd_tpc_descriptor_rtf *)d_ptr; + scsi_ulto2b(SVPD_TPC_RTF, rtf_ptr->desc_type); + scsi_ulto2b(sizeof(*rtf_ptr) - 4 + sizeof(*rtfb_ptr), rtf_ptr->desc_length); + rtf_ptr->remote_tokens = 0; + scsi_ulto4b(TPC_MIN_TOKEN_TIMEOUT, rtf_ptr->minimum_token_lifetime); + scsi_ulto4b(UINT32_MAX, rtf_ptr->maximum_token_lifetime); + scsi_ulto4b(TPC_MAX_TOKEN_TIMEOUT, + rtf_ptr->maximum_token_inactivity_timeout); + scsi_ulto2b(sizeof(*rtfb_ptr), rtf_ptr->type_specific_features_length); + rtfb_ptr = (struct scsi_vpd_tpc_descriptor_rtf_block *) + &rtf_ptr->type_specific_features; + rtfb_ptr->type_format = SVPD_TPC_RTF_BLOCK; + scsi_ulto2b(sizeof(*rtfb_ptr) - 4, rtfb_ptr->desc_length); + scsi_ulto2b(0, rtfb_ptr->optimal_length_granularity); + scsi_u64to8b(0, rtfb_ptr->maximum_bytes); + scsi_u64to8b(0, rtfb_ptr->optimal_bytes); + scsi_u64to8b(TPC_MAX_IOCHUNK_SIZE, + rtfb_ptr->optimal_bytes_to_token_per_segment); + scsi_u64to8b(TPC_MAX_IOCHUNK_SIZE, + rtfb_ptr->optimal_bytes_from_token_per_segment); + + /* Supported ROD Tokens */ + d_ptr = (struct scsi_vpd_tpc_descriptor *) + (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); + srt_ptr = (struct scsi_vpd_tpc_descriptor_srt *)d_ptr; + scsi_ulto2b(SVPD_TPC_SRT, srt_ptr->desc_type); + scsi_ulto2b(sizeof(*srt_ptr) - 4 + 2*sizeof(*srtd_ptr), srt_ptr->desc_length); + scsi_ulto2b(2*sizeof(*srtd_ptr), srt_ptr->rod_type_descriptors_length); + srtd_ptr = (struct scsi_vpd_tpc_descriptor_srtd *) + &srt_ptr->rod_type_descriptors; + scsi_ulto4b(ROD_TYPE_AUR, srtd_ptr->rod_type); + srtd_ptr->flags = SVPD_TPC_SRTD_TIN | SVPD_TPC_SRTD_TOUT; + scsi_ulto2b(0, srtd_ptr->preference_indicator); + srtd_ptr++; + scsi_ulto4b(ROD_TYPE_BLOCK_ZERO, srtd_ptr->rod_type); + srtd_ptr->flags = SVPD_TPC_SRTD_TIN; + scsi_ulto2b(0, srtd_ptr->preference_indicator); + /* General Copy Operations */ d_ptr = (struct scsi_vpd_tpc_descriptor *) (&d_ptr->parameters[0] + scsi_2btoul(d_ptr->desc_length)); @@ -267,7 +437,6 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * int ctl_receive_copy_operating_parameters(struct ctl_scsiio *ctsio) { - struct ctl_lun *lun; struct scsi_receive_copy_operating_parameters *cdb; struct scsi_receive_copy_operating_parameters_data *data; int retval; @@ -276,7 +445,6 @@ ctl_receive_copy_operating_parameters(st CTL_DEBUG_PRINT(("ctl_report_supported_tmf\n")); cdb = (struct scsi_receive_copy_operating_parameters *)ctsio->cdb; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; retval = CTL_RETVAL_COMPLETE; @@ -661,6 +829,7 @@ complete: /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } else { + list->cursectors += list->segsectors; list->curbytes += list->segbytes; return (CTL_RETVAL_COMPLETE); } @@ -706,6 +875,7 @@ complete: list->buf = malloc(numbytes, M_CTL, M_WAITOK); list->segbytes = numbytes; + list->segsectors = numbytes / dstblock; donebytes = 0; TAILQ_INIT(&run); prun = &run; @@ -901,6 +1071,197 @@ complete: return (CTL_RETVAL_QUEUED); } +static off_t +tpc_ranges_length(struct scsi_range_desc *range, int nrange) +{ + off_t length = 0; + int r; + + for (r = 0; r < nrange; r++) + length += scsi_4btoul(range[r].length); + return (length); +} + +static int +tpc_skip_ranges(struct scsi_range_desc *range, int nrange, off_t skip, + int *srange, off_t *soffset) +{ + off_t off; + int r; + + r = 0; + off = 0; + while (r < nrange) { + if (skip - off < scsi_4btoul(range[r].length)) { + *srange = r; + *soffset = skip - off; + return (0); + } + off += scsi_4btoul(range[r].length); + r++; + } + return (-1); +} + +static int +tpc_process_wut(struct tpc_list *list) +{ + struct tpc_io *tio, *tior, *tiow; + struct runl run, *prun; + int drange, srange; + off_t doffset, soffset; + off_t srclba, dstlba, numbytes, donebytes, roundbytes; + uint32_t srcblock, dstblock; + + if (list->stage > 0) { +complete: + /* Cleanup after previous rounds. */ + while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { + TAILQ_REMOVE(&list->allio, tio, links); + ctl_free_io(tio->io); + free(tio, M_CTL); + } + free(list->buf, M_CTL); + if (list->abort) { + ctl_set_task_aborted(list->ctsio); + return (CTL_RETVAL_ERROR); + } else if (list->error) { + ctl_set_sense(list->ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + return (CTL_RETVAL_ERROR); + } + list->cursectors += list->segsectors; + list->curbytes += list->segbytes; + } + + /* Check where we are on destination ranges list. */ + if (tpc_skip_ranges(list->range, list->nrange, list->cursectors, + &drange, &doffset) != 0) + return (CTL_RETVAL_COMPLETE); + dstblock = list->lun->be_lun->blocksize; + + /* Special case: no token == Block device zero ROD token */ + if (list->token == NULL) { + srcblock = 1; + srclba = 0; + numbytes = INT64_MAX; + goto dstp; + } + + /* Check where we are on source ranges list. */ + srcblock = list->token->blocksize; + if (tpc_skip_ranges(list->token->range, list->token->nrange, + list->offset_into_rod + list->cursectors * dstblock / srcblock, + &srange, &soffset) != 0) { + ctl_set_sense(list->ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x0d, /*ascq*/ 0x04, SSD_ELEM_NONE); + return (CTL_RETVAL_ERROR); + } + + srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; + numbytes = srcblock * omin(TPC_MAX_IOCHUNK_SIZE / srcblock, + (scsi_4btoul(list->token->range[srange].length) - soffset)); +dstp: + dstlba = scsi_8btou64(list->range[drange].lba) + doffset; + numbytes = omin(numbytes, + dstblock * omin(TPC_MAX_IOCHUNK_SIZE / dstblock, + (scsi_4btoul(list->range[drange].length) - doffset))); + + if (numbytes % srcblock != 0 || numbytes % dstblock != 0) { + ctl_set_sense(list->ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x26, /*ascq*/ 0x0A, SSD_ELEM_NONE); + return (CTL_RETVAL_ERROR); + } + + list->buf = malloc(numbytes, M_CTL, M_WAITOK | + (list->token == NULL ? M_ZERO : 0)); + list->segbytes = numbytes; + list->segsectors = numbytes / dstblock; +//printf("Copy chunk of %ju sectors from %ju to %ju\n", list->segsectors, +// srclba, dstlba); + donebytes = 0; + TAILQ_INIT(&run); + prun = &run; + list->tbdio = 1; + TAILQ_INIT(&list->allio); + while (donebytes < numbytes) { + roundbytes = MIN(numbytes - donebytes, TPC_MAX_IO_SIZE); + + if (list->token == NULL) { + tior = NULL; + goto dstw; + } + tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); + TAILQ_INIT(&tior->run); + tior->list = list; + TAILQ_INSERT_TAIL(&list->allio, tior, links); + tior->io = tpcl_alloc_io(); + if (tior->io == NULL) { + list->error = 1; + goto complete; + } + ctl_scsi_read_write(tior->io, + /*data_ptr*/ &list->buf[donebytes], + /*data_len*/ roundbytes, + /*read_op*/ 1, + /*byte2*/ 0, + /*minimum_cdb_size*/ 0, + /*lba*/ srclba + donebytes / srcblock, + /*num_blocks*/ roundbytes / srcblock, + /*tag_type*/ CTL_TAG_SIMPLE, + /*control*/ 0); + tior->io->io_hdr.retries = 3; + tior->lun = list->token->lun; + tior->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tior; + +dstw: + tiow = malloc(sizeof(*tiow), M_CTL, M_WAITOK | M_ZERO); + TAILQ_INIT(&tiow->run); + tiow->list = list; + TAILQ_INSERT_TAIL(&list->allio, tiow, links); + tiow->io = tpcl_alloc_io(); + if (tiow->io == NULL) { + list->error = 1; + goto complete; + } + ctl_scsi_read_write(tiow->io, + /*data_ptr*/ &list->buf[donebytes], + /*data_len*/ roundbytes, + /*read_op*/ 0, + /*byte2*/ 0, + /*minimum_cdb_size*/ 0, + /*lba*/ dstlba + donebytes / dstblock, + /*num_blocks*/ roundbytes / dstblock, + /*tag_type*/ CTL_TAG_SIMPLE, + /*control*/ 0); + tiow->io->io_hdr.retries = 3; + tiow->lun = list->lun->lun; + tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; + + if (tior) { + TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); + TAILQ_INSERT_TAIL(prun, tior, rlinks); + prun = &tior->run; + } else { + TAILQ_INSERT_TAIL(prun, tiow, rlinks); + prun = &tiow->run; + } + donebytes += roundbytes; + } + + while ((tior = TAILQ_FIRST(&run)) != NULL) { + TAILQ_REMOVE(&run, tior, rlinks); + if (tpcl_queue(tior->io, tior->lun) != CTL_RETVAL_COMPLETE) + panic("tpcl_queue() error"); + } + + list->stage++; + return (CTL_RETVAL_QUEUED); +} + static void tpc_process(struct tpc_list *list) { @@ -909,33 +1270,43 @@ tpc_process(struct tpc_list *list) struct ctl_scsiio *ctsio = list->ctsio; int retval = CTL_RETVAL_COMPLETE; -//printf("ZZZ %d cscd, %d segs\n", list->ncscd, list->nseg); - while (list->curseg < list->nseg) { - seg = list->seg[list->curseg]; - switch (seg->type_code) { - case EC_SEG_B2B: - retval = tpc_process_b2b(list); - break; - case EC_SEG_VERIFY: - retval = tpc_process_verify(list); - break; - case EC_SEG_REGISTER_KEY: - retval = tpc_process_register_key(list); - break; - default: - ctl_set_sense(ctsio, /*current_error*/ 1, - /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x26, /*ascq*/ 0x09, SSD_ELEM_NONE); - goto done; - } + if (list->service_action == EC_WUT) { + retval = tpc_process_wut(list); if (retval == CTL_RETVAL_QUEUED) return; if (retval == CTL_RETVAL_ERROR) { list->error = 1; goto done; } - list->curseg++; - list->stage = 0; + } else { +//printf("ZZZ %d cscd, %d segs\n", list->ncscd, list->nseg); + while (list->curseg < list->nseg) { + seg = list->seg[list->curseg]; + switch (seg->type_code) { + case EC_SEG_B2B: + retval = tpc_process_b2b(list); + break; + case EC_SEG_VERIFY: + retval = tpc_process_verify(list); + break; + case EC_SEG_REGISTER_KEY: + retval = tpc_process_register_key(list); + break; + default: + ctl_set_sense(ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x26, /*ascq*/ 0x09, SSD_ELEM_NONE); + goto done; + } + if (retval == CTL_RETVAL_QUEUED) + return; + if (retval == CTL_RETVAL_ERROR) { + list->error = 1; + goto done; + } + list->curseg++; + list->stage = 0; + } } ctl_set_success(ctsio); @@ -944,12 +1315,20 @@ done: //printf("ZZZ done\n"); free(list->params, M_CTL); list->params = NULL; + if (list->token) { + mtx_lock(&control_softc->ctl_lock); + if (--list->token->active == 0) + list->token->last_active = time_uptime; + mtx_unlock(&control_softc->ctl_lock); + list->token = NULL; + } mtx_lock(&lun->lun_lock); if ((list->flags & EC_LIST_ID_USAGE_MASK) == EC_LIST_ID_USAGE_NONE) { TAILQ_REMOVE(&lun->tpc_lists, list, links); free(list, M_CTL); } else { list->completed = 1; + list->last_active = time_uptime; list->sense_data = ctsio->sense_data; list->sense_len = ctsio->sense_len; list->scsi_status = ctsio->scsi_status; @@ -1361,3 +1740,455 @@ done: return (CTL_RETVAL_COMPLETE); } +static void +tpc_create_token(struct ctl_lun *lun, struct ctl_port *port, off_t len, + struct scsi_token *token) +{ + static int id = 0; + struct scsi_vpd_id_descriptor *idd = NULL; + int targid_len; + + scsi_ulto4b(ROD_TYPE_AUR, token->type); + scsi_ulto2b(0x01f8, token->length); + scsi_u64to8b(atomic_fetchadd_int(&id, 1), &token->body[0]); + if (lun->lun_devid) + idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *) + lun->lun_devid->data, lun->lun_devid->len, + scsi_devid_is_lun_naa); + if (idd == NULL && lun->lun_devid) + idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *) + lun->lun_devid->data, lun->lun_devid->len, + scsi_devid_is_lun_eui64); + if (idd != NULL) + memcpy(&token->body[8], idd, 4 + idd->length); + scsi_u64to8b(0, &token->body[40]); + scsi_u64to8b(len, &token->body[48]); + if (port->target_devid) { + targid_len = port->target_devid->len; + memcpy(&token->body[120], port->target_devid->data, targid_len); + } else + targid_len = 32; + arc4rand(&token->body[120 + targid_len], 384 - targid_len, 0); +}; + +int +ctl_populate_token(struct ctl_scsiio *ctsio) +{ + struct scsi_populate_token *cdb; + struct scsi_populate_token_data *data; + struct ctl_lun *lun; + struct ctl_port *port; + struct tpc_list *list, *tlist; + struct tpc_token *token; + int len, lendesc; + + CTL_DEBUG_PRINT(("ctl_populate_token\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + port = control_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)]; + cdb = (struct scsi_populate_token *)ctsio->cdb; + len = scsi_4btoul(cdb->length); + + if (len < sizeof(struct scsi_populate_token_data) || + len > sizeof(struct scsi_populate_token_data) + + TPC_MAX_SEGS * sizeof(struct scsi_range_desc)) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, + /*field*/ 9, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + data = (struct scsi_populate_token_data *)ctsio->kern_data_ptr; + lendesc = scsi_2btoul(data->range_descriptor_length); + if (len < sizeof(struct scsi_populate_token_data) + lendesc) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, + /*field*/ 2, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } +/* + printf("PT(list=%u) flags=%x to=%d rt=%x len=%x\n", + scsi_4btoul(cdb->list_identifier), + data->flags, scsi_4btoul(data->inactivity_timeout), + scsi_4btoul(data->rod_type), + scsi_2btoul(data->range_descriptor_length)); +*/ + if ((data->flags & EC_PT_RTV) && + scsi_4btoul(data->rod_type) != ROD_TYPE_AUR) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, + /*field*/ 8, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } + + list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); + list->service_action = cdb->service_action; + list->init_port = ctsio->io_hdr.nexus.targ_port; + list->init_idx = ctl_get_resindex(&ctsio->io_hdr.nexus); + list->list_id = scsi_4btoul(cdb->list_identifier); + list->flags = data->flags; + list->ctsio = ctsio; + list->lun = lun; + mtx_lock(&lun->lun_lock); + tlist = tpc_find_list(lun, list->list_id, list->init_idx); + if (tlist != NULL && !tlist->completed) { + mtx_unlock(&lun->lun_lock); + free(list, M_CTL); + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, + /*bit*/ 0); + goto done; + } + if (tlist != NULL) { + TAILQ_REMOVE(&lun->tpc_lists, tlist, links); + free(tlist, M_CTL); + } + TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); + mtx_unlock(&lun->lun_lock); + + token = malloc(sizeof(*token), M_CTL, M_WAITOK | M_ZERO); + token->lun = lun->lun; + token->blocksize = lun->be_lun->blocksize; + token->params = ctsio->kern_data_ptr; + token->range = &data->desc[0]; + token->nrange = scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc); + tpc_create_token(lun, port, list->curbytes, + (struct scsi_token *)token->token); + token->active = 0; + token->last_active = time_uptime; + token->timeout = scsi_4btoul(data->inactivity_timeout); + if (token->timeout == 0) + token->timeout = TPC_DFL_TOKEN_TIMEOUT; + else if (token->timeout < TPC_MIN_TOKEN_TIMEOUT) + token->timeout = TPC_MIN_TOKEN_TIMEOUT; + else if (token->timeout > TPC_MAX_TOKEN_TIMEOUT) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 0, /*field*/ 4, /*bit_valid*/ 0, + /*bit*/ 0); + } + memcpy(list->res_token, token->token, sizeof(list->res_token)); + list->res_token_valid = 1; + list->cursectors = tpc_ranges_length(token->range, token->nrange); + list->curbytes = (off_t)list->cursectors * lun->be_lun->blocksize; + list->curseg = 0; + list->completed = 1; + list->last_active = time_uptime; + mtx_lock(&control_softc->ctl_lock); + TAILQ_INSERT_TAIL(&control_softc->tpc_tokens, token, links); + mtx_unlock(&control_softc->ctl_lock); + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + +done: + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) + free(ctsio->kern_data_ptr, M_CTL); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +int +ctl_write_using_token(struct ctl_scsiio *ctsio) +{ + struct scsi_write_using_token *cdb; + struct scsi_write_using_token_data *data; + struct ctl_lun *lun; + struct tpc_list *list, *tlist; + struct tpc_token *token; + int len, lendesc; + + CTL_DEBUG_PRINT(("ctl_write_using_token\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_write_using_token *)ctsio->cdb; + len = scsi_4btoul(cdb->length); + + if (len < sizeof(struct scsi_populate_token_data) || + len > sizeof(struct scsi_populate_token_data) + + TPC_MAX_SEGS * sizeof(struct scsi_range_desc)) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, + /*field*/ 9, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + data = (struct scsi_write_using_token_data *)ctsio->kern_data_ptr; + lendesc = scsi_2btoul(data->range_descriptor_length); + if (len < sizeof(struct scsi_populate_token_data) + lendesc) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, + /*field*/ 2, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } +/* + printf("WUT(list=%u) flags=%x off=%ju len=%x\n", + scsi_4btoul(cdb->list_identifier), + data->flags, scsi_8btou64(data->offset_into_rod), + scsi_2btoul(data->range_descriptor_length)); +*/ + list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); + list->service_action = cdb->service_action; + list->init_port = ctsio->io_hdr.nexus.targ_port; + list->init_idx = ctl_get_resindex(&ctsio->io_hdr.nexus); + list->list_id = scsi_4btoul(cdb->list_identifier); + list->flags = data->flags; + list->params = ctsio->kern_data_ptr; + list->range = &data->desc[0]; + list->nrange = scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc); + list->offset_into_rod = scsi_8btou64(data->offset_into_rod); + list->ctsio = ctsio; + list->lun = lun; + mtx_lock(&lun->lun_lock); + tlist = tpc_find_list(lun, list->list_id, list->init_idx); + if (tlist != NULL && !tlist->completed) { + mtx_unlock(&lun->lun_lock); + free(list, M_CTL); + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, + /*bit*/ 0); + goto done; + } + if (tlist != NULL) { + TAILQ_REMOVE(&lun->tpc_lists, tlist, links); + free(tlist, M_CTL); + } + TAILQ_INSERT_TAIL(&lun->tpc_lists, list, links); + mtx_unlock(&lun->lun_lock); + + /* Block device zero ROD token -> no token. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 03:47:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26A84F3D for ; Mon, 4 Aug 2014 03:47:15 +0000 (UTC) Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCAA4269B for ; Mon, 4 Aug 2014 03:47:14 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id rp18so8979292iec.5 for ; Sun, 03 Aug 2014 20:47:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=eS/zKehDsSOn/Rx0CsRsF5L+mp6Uyp/TMYhQKHugKJA=; b=dS15Kp1vXbgdFNFoc19ZHJmzG8jgIEZ4cUqqiHoEeMbG8HxU8vb0BwRCz7Cc4G9F2J WJbESoEyPmIxe9nSaXtnKVkxUFq69XVIpKolXz9cyXuT3plP2xk6TjzSP3A+q3cdXvhz Q1c9o5v46NwqlWXOcg2dLs5S6BNYxqVEUfJYRYICUxBpey8uAqwZVicmwNwdp5uEqTXy b3Ih5Ey1qH8n0Cr0lbLXKU2qtK/uAWyYGEN4GKuw3dcl6aq3M3Fgvsveu2/3pyMY+LbT bGdW4xoArzxhuppX9cuWeg2SqaBvkITqyD1I4niMtesSdnigxzI0y61/GghGRJseE8d3 3cgA== X-Gm-Message-State: ALoCoQm1zBSlfLMGZJnVzUQoFAWSGoqiZc9OYDxscg6QTF4CuoD/oGMUZ1ZDnMMPjMHy8uxguU/H X-Received: by 10.50.43.193 with SMTP id y1mr31808862igl.32.1407120859345; Sun, 03 Aug 2014 19:54:19 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id z4sm42287071igp.14.2014.08.03.19.54.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 19:54:18 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_89DBBDC5-E4C8-4CE1-9A39-D98AE8BE62ED"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib From: Warner Losh In-Reply-To: <6A2B0200-EB23-459B-8E3F-6B1151C90D0E@freebsd.org> Date: Sun, 3 Aug 2014 20:54:15 -0600 Message-Id: References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> <65378493-7F05-4314-9809-E689891F6067@gmail.com> <6A2B0200-EB23-459B-8E3F-6B1151C90D0E@freebsd.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Bruce Simpson , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 03:47:15 -0000 --Apple-Mail=_89DBBDC5-E4C8-4CE1-9A39-D98AE8BE62ED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 3, 2014, at 9:39 AM, Pedro Giffuni wrote: >=20 > Il giorno 03/ago/2014, alle ore 09:27, Warner Losh ha = scritto: >=20 >>=20 >> On Jul 21, 2014, at 12:51 PM, Pedro Giffuni wrote: >>=20 >>>=20 >>> Il giorno 21/lug/2014, alle ore 11:42, Bruce Simpson = ha scritto: >>>=20 >>>> On 21/07/2014 16:22, Pedro F. Giffuni wrote: >>>>> ] >>>>> Log: >>>>> Add re-entrant versions of the hash functions based on the GNU = api. >>>>>=20 >>>> What, if anything, can be done about qsort_r() API incompatibility? >>>=20 >>> qsort_r is non-standard and we did it first, plus we will want to = stay compatible with Apple :). >>>=20 >>> I guess we could do some ugly parameter swapping in the case where = _GNU_SOURCE >>> is defined, but I won=92t volunteer to do that. >>=20 >> Are there any ABI considerations for the change? >>=20 >=20 > I would keep the qsort_r() ABI unchanged and add a GNU-compatible = version that is used only when _GNU_SOURCE (but not _BSD_SOURCE) is = defined. >=20 > This would already be pretty messy by itself because some portable = code may define _GNU_SOURCE but still may try to use the Apple/BSD = interface under another #ifdef. Perhaps it=92s just better to leave our = headers alone and let the end-users do the wrapping. If there=92s no ABI change, then I don=92t care what we do about a = non-standard API. However, once we=92ve made an API public, standard or = do, we have to support that ABI essentially forever when libc is = involved. Warner --Apple-Mail=_89DBBDC5-E4C8-4CE1-9A39-D98AE8BE62ED Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJT3vXXAAoJEGwc0Sh9sBEAFWEP/3K8hwDJ+65zbTP+hz5C/qD0 FsSKOAZvocc29uzsRvq31uKw91+KMPRTBzwXmsBkdT7Z32XZ5YlpF5IA3DOXXfUf E3dbqd+lqXzvIqUZmWUvPaBWqhd5Jxb2un4qt5ZZDaYTTbttGPPYLuIyevn/vbk7 0Y8f18z8dO6jLbvGdjg11uDrKojYaQQXIqsK6XIKmVHX5lcJDNx0htrZ4QAo2hUc H3JM5Q7G3sJucN01OJrQZzlC/RC2RDh5ZQP2HbYvFWBxkFRWz0cD8XOIPjE9zS16 s448xczGUFJIKWdcN3pUFyIx3mXhbHp4bhBg0rr4VG8QWlwqTUBsOTA4RLALLB81 PjQhxHwFkeTyNXI6KuO8WOyCtsuai71JqrTTYivSXfPrKl3RwfqRewBw03qk4bmN AoZFrwMPtRF9ef8ropxo+BWamcfWd7QaBiJvJe31CgtKSX0YVTfg2nmDOgtnzaq1 lkv8Ctr/UhcDqeI7aPdBCRelasT75vNQkJ7Grx1iQ/rDpiudm/F870Qo4cXrVL2/ wQ/xvGjCWsU5+xMVG/IQVpSSsDvH24o5LEpU26nV7BEukKAGqGIa2eWsY/K5vvGt NGQ8qQsrAuyqX8rD7JxjM0SNHXWbZWI2S7EHQ/IVeFiHvg9JQ2PWYC+WmPV/v9BI +JRPvYfJPUym3QVXcxrr =CNMc -----END PGP SIGNATURE----- --Apple-Mail=_89DBBDC5-E4C8-4CE1-9A39-D98AE8BE62ED-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:21:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4953341F for ; Mon, 4 Aug 2014 04:21:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA23290C for ; Mon, 4 Aug 2014 04:21:33 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 5ade by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 04:21:32 +0000 From: Adrian Chadd Date: Mon, 4 Aug 2014 04:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269500 - head/sys/modules/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df0a4d.5ade.1dac29b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:21:33 -0000 Author: adrian Date: Mon Aug 4 04:21:32 2014 New Revision: 269500 URL: http://svnweb.freebsd.org/changeset/base/269500 Log: Make the ixgbe(4) module buildable outside of the tree. It defaults to RSS not being enabled. Modified: head/sys/modules/ixgbe/Makefile Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Mon Aug 4 04:00:48 2014 (r269499) +++ head/sys/modules/ixgbe/Makefile Mon Aug 4 04:21:32 2014 (r269500) @@ -6,7 +6,7 @@ KMOD = if_ixgbe SRCS = device_if.h bus_if.h pci_if.h -SRCS += opt_inet.h opt_inet6.h +SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += ixgbe.c ixv.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c @@ -24,6 +24,10 @@ opt_inet.h: opt_inet6.h: @echo "#define INET6 1" > ${.TARGET} .endif + +opt_rss.h: + @echo "" > ${.TARGET} + .endif .include From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:23:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24D6D574 for ; Mon, 4 Aug 2014 04:23:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E79DB29D0 for ; Mon, 4 Aug 2014 04:23:45 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 5af3 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 04:23:45 +0000 From: Adrian Chadd Date: Mon, 4 Aug 2014 04:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269501 - head/sys/modules/igb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df0ad1.5af3.39c08940@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:23:46 -0000 Author: adrian Date: Mon Aug 4 04:23:45 2014 New Revision: 269501 URL: http://svnweb.freebsd.org/changeset/base/269501 Log: Make igb(4) build outside of the kernel build. Ths defaults to RSS being disabled. Modified: head/sys/modules/igb/Makefile Modified: head/sys/modules/igb/Makefile ============================================================================== --- head/sys/modules/igb/Makefile Mon Aug 4 04:21:32 2014 (r269500) +++ head/sys/modules/igb/Makefile Mon Aug 4 04:23:45 2014 (r269501) @@ -4,7 +4,7 @@ .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_igb -SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h opt_rss.h SRCS += if_igb.c $(SHARED_SRCS) SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c @@ -33,6 +33,10 @@ opt_inet.h: opt_inet6.h: @echo "#define INET6 1" > ${.TARGET} .endif + +opt_rss.h: + @echo "" > ${.TARGET} + .endif .include From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:26:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4C0B6D6; Mon, 4 Aug 2014 04:26:55 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E909429E9; Mon, 4 Aug 2014 04:26:54 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id k14so7148790wgh.32 for ; Sun, 03 Aug 2014 21:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=JKt+shygX2eBb3IaySpciWder9BOck7Eqm2cvxINB1g=; b=hxSV75aZnCpBRZaVD2gRUqXOuZSIzJ9uDQO1MVBJiB1B+UBWzxb7QKVxZk08yxL7jB RaSyS/fxr7arRWazTAOX6VX8LIZaeE8y3za94w8F4i24H2gmRxbTRp4SbvP9mhr5Uwld m37ptCEEsBK6LOUm4DmRpdq2bK7zGXPo2K3SxJ+WJ33+AWrXq4PsiXBa7tGt6GUwIF5n Uaady1WZFVn1jCB9Xg9L+06hgELoiSxxA4UC0yZ5bm1YGk6Otlfv2MQvwwbe/bsJC0HH V68aV4PSZmYQK1i9L5PeHiN2q8gKzv2Lc44BBd7uLNXx/6c7GhcZofYGIesRvxWoIkGH i5jg== MIME-Version: 1.0 X-Received: by 10.180.98.165 with SMTP id ej5mr25218242wib.37.1407126413334; Sun, 03 Aug 2014 21:26:53 -0700 (PDT) Received: by 10.216.159.136 with HTTP; Sun, 3 Aug 2014 21:26:53 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <53df0ad1.5af3.39c08940@svn.freebsd.org> References: <53df0ad1.5af3.39c08940@svn.freebsd.org> Date: Mon, 4 Aug 2014 12:26:53 +0800 Message-ID: Subject: Re: svn commit: r269501 - head/sys/modules/igb From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:26:55 -0000 2014-08-04 12:23 GMT+08:00 Adrian Chadd : > Author: adrian > Date: Mon Aug 4 04:23:45 2014 > New Revision: 269501 > URL: http://svnweb.freebsd.org/changeset/base/269501 > > Log: > Make igb(4) build outside of the kernel build. > > Ths defaults to RSS being disabled. > > Modified: > head/sys/modules/igb/Makefile > > Modified: head/sys/modules/igb/Makefile > > ============================================================================== > --- head/sys/modules/igb/Makefile Mon Aug 4 04:21:32 2014 > (r269500) > +++ head/sys/modules/igb/Makefile Mon Aug 4 04:23:45 2014 > (r269501) > @@ -4,7 +4,7 @@ > > .PATH: ${.CURDIR}/../../dev/e1000 > KMOD = if_igb > -SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h > +SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h opt_rss.h > SRCS += if_igb.c $(SHARED_SRCS) > SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c > e1000_manage.c > SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c > e1000_82543.c > @@ -33,6 +33,10 @@ opt_inet.h: > opt_inet6.h: > @echo "#define INET6 1" > ${.TARGET} > .endif > + > +opt_rss.h: > + @echo "" > ${.TARGET} > + > .endif > > .include > Just for record, missed: Submitted by: araujo@ Best Regards, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:27:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95927813; Mon, 4 Aug 2014 04:27:20 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6FED29ED; Mon, 4 Aug 2014 04:27:19 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so4304463wiv.5 for ; Sun, 03 Aug 2014 21:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2Gt8ALL1jM1IVKkZdjuqcDrP/BjZICzSxMpeQYFz04g=; b=bdmzzp7Jc7B1NmJDSD3YStNaE9SSikfsG9FdiWlDdGKVotAuEksFb7xOJGnM0+J+Hm UeZ2hp5s1GiEpoPp3OFwT8+pgzBjzyNYPa0BjZjtETUo16DQHBYTyNyB9F7WP0Eu38OZ tivmap6fm9e4t3hADOs9i7jJkv9a1UmaoVJUZAZVyax7sWkt6As6tWxez0okgrQjx5+Q PzGiSn2Chft1l8fbeID0ZG19MpVbm3d3GKvqIuNOJoIdyYXjs9aD27hmSI+EBI2kF215 gbd7XE46EXwJWkhLlPNy5pvOerCMut813tJSgPjEha5rfcMy8P5+vEL3RAY2jQZd+NbM unsw== MIME-Version: 1.0 X-Received: by 10.194.142.148 with SMTP id rw20mr27089442wjb.69.1407126437906; Sun, 03 Aug 2014 21:27:17 -0700 (PDT) Received: by 10.216.159.136 with HTTP; Sun, 3 Aug 2014 21:27:17 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <201407200843.s6K8hsAW017327@svn.freebsd.org> References: <201407200843.s6K8hsAW017327@svn.freebsd.org> Date: Mon, 4 Aug 2014 12:27:17 +0800 Message-ID: Subject: Re: svn commit: r268917 - head/sys/dev/ixgbe From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:27:20 -0000 2014-07-20 16:43 GMT+08:00 Adrian Chadd : > Author: adrian > Date: Sun Jul 20 08:43:53 2014 > New Revision: 268917 > URL: http://svnweb.freebsd.org/changeset/base/268917 > > Log: > Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver. > > Modified: > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/ixgbe/ixgbe.c > > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) > +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 08:43:53 2014 (r268917) > @@ -4745,12 +4745,15 @@ ixgbe_rxeof(struct ix_queue *que) > case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX: > M_HASHTYPE_SET(sendmp, > M_HASHTYPE_RSS_TCP_IPV6_EX); > break; > - /* XXX no UDP support in RSS just yet */ > -#ifdef notyet > - case IGXBE_RXDADV_RSSTYPE_IPV4_UDP: > - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP: > - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX: > -#endif /* notyet */ > + case IXGBE_RXDADV_RSSTYPE_IPV4_UDP: > + M_HASHTYPE_SET(sendmp, > M_HASHTYPE_RSS_UDP_IPV4); > + break; > + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP: > + M_HASHTYPE_SET(sendmp, > M_HASHTYPE_RSS_UDP_IPV6); > + break; > + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX: > + M_HASHTYPE_SET(sendmp, > M_HASHTYPE_RSS_UDP_IPV6_EX); > + break; > default: > /* XXX fallthrough */ > M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE); > Just for record, missed: Submitted by: araujo@ Best Regards, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:27:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78AC8950; Mon, 4 Aug 2014 04:27:53 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89D4329F1; Mon, 4 Aug 2014 04:27:52 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hi2so4271325wib.5 for ; Sun, 03 Aug 2014 21:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Kq3Yuwe2cztO5EskoVHNfzjYQVIH7mEUtuQEqunnQhI=; b=neeP3YAQvbnh8Ddil4pehkvBNzwqI4VcOOoY1lMORr5nGoZGco9c7HqoTAP2S1GqWF +YPI7/IKGWtkw92xElqPUmfnkvENa24kpgDJb+acBpZmFzr0CrVTfkwMTWG+ehOfjBV8 mdVLz2lIpqkgKo+O5unHPZEuXOVg0y/71HdCFXcdHzynGwOL5MJZ8zYQKX++Zg2VgBNK 9e2/nPixJ8/cPQhrs+T/i1rNO6tf2cBITPKhWrF+lYZtzb8iPSGWvagrj23rBkrfpqii EdcTi9eeEwzrdS6EtAA6QXltxY6QjbCcRXlvKwnnTffTTXKPFbzs+7OzG8XNIMT04Fsv 7EGg== MIME-Version: 1.0 X-Received: by 10.180.92.73 with SMTP id ck9mr26549479wib.54.1407126470908; Sun, 03 Aug 2014 21:27:50 -0700 (PDT) Received: by 10.216.159.136 with HTTP; Sun, 3 Aug 2014 21:27:50 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: References: <201407200843.s6K8hsAW017327@svn.freebsd.org> Date: Mon, 4 Aug 2014 12:27:50 +0800 Message-ID: Subject: Re: svn commit: r268917 - head/sys/dev/ixgbe From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:27:53 -0000 2014-08-04 12:27 GMT+08:00 Marcelo Araujo : > > > > 2014-07-20 16:43 GMT+08:00 Adrian Chadd : > > Author: adrian >> Date: Sun Jul 20 08:43:53 2014 >> New Revision: 268917 >> URL: http://svnweb.freebsd.org/changeset/base/268917 >> >> Log: >> Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver. >> >> Modified: >> head/sys/dev/ixgbe/ixgbe.c >> >> Modified: head/sys/dev/ixgbe/ixgbe.c >> >> ============================================================================== >> --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) >> +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 08:43:53 2014 (r268917) >> @@ -4745,12 +4745,15 @@ ixgbe_rxeof(struct ix_queue *que) >> case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX: >> M_HASHTYPE_SET(sendmp, >> M_HASHTYPE_RSS_TCP_IPV6_EX); >> break; >> - /* XXX no UDP support in RSS just yet */ >> -#ifdef notyet >> - case IGXBE_RXDADV_RSSTYPE_IPV4_UDP: >> - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP: >> - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX: >> -#endif /* notyet */ >> + case IXGBE_RXDADV_RSSTYPE_IPV4_UDP: >> + M_HASHTYPE_SET(sendmp, >> M_HASHTYPE_RSS_UDP_IPV4); >> + break; >> + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP: >> + M_HASHTYPE_SET(sendmp, >> M_HASHTYPE_RSS_UDP_IPV6); >> + break; >> + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX: >> + M_HASHTYPE_SET(sendmp, >> M_HASHTYPE_RSS_UDP_IPV6_EX); >> + break; >> default: >> /* XXX fallthrough */ >> M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE); >> > > > Just for record, missed: > > Submitted by: araujo@ > > > Best Regards, > Ops, not this one :D -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:30:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55D9DAAB; Mon, 4 Aug 2014 04:30:06 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 785BC2A05; Mon, 4 Aug 2014 04:30:05 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id x12so6875066wgg.4 for ; Sun, 03 Aug 2014 21:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=jIdpvEiIKQcmjGxp2KKufDHtL9vUun7sEa9kgyuBf0g=; b=IcS8deiGuBVKozS+Ec9ROJn3jIIGj/aduHh5kat4nQsorz3sbWB6O9yat2vEENWKG0 VW38M+gVE43/i7FaHVvIxqO81WnNoMWxNhjog0B18JMAwpMjgPe6HYDAT+n59VrScMCb OlEfqMVR5dIcTnEsbezz63FP5eJ9rukbUPLD1OWQCR9f5/lcDpKWqvV72QuGpTc1cnlJ VZZC5jE/wQwFMfCZIVyfRKCJMG+A+0Y6BwtjEAGX5OS76EVVUAr8elDluHEv04vB3m0h +oTsLxQ1hoK6S1fahLGbhZ0ph0gZdIgoWVCOW2jFzyB93bnMhWFy0N92gg7K5s0atHCQ LKdA== MIME-Version: 1.0 X-Received: by 10.180.183.36 with SMTP id ej4mr25530630wic.77.1407126603558; Sun, 03 Aug 2014 21:30:03 -0700 (PDT) Received: by 10.216.159.136 with HTTP; Sun, 3 Aug 2014 21:30:03 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <53df0a4d.5ade.1dac29b@svn.freebsd.org> References: <53df0a4d.5ade.1dac29b@svn.freebsd.org> Date: Mon, 4 Aug 2014 12:30:03 +0800 Message-ID: Subject: Re: svn commit: r269500 - head/sys/modules/ixgbe From: Marcelo Araujo To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:30:06 -0000 2014-08-04 12:21 GMT+08:00 Adrian Chadd : > Author: adrian > Date: Mon Aug 4 04:21:32 2014 > New Revision: 269500 > URL: http://svnweb.freebsd.org/changeset/base/269500 > > Log: > Make the ixgbe(4) module buildable outside of the tree. > > It defaults to RSS not being enabled. > > Modified: > head/sys/modules/ixgbe/Makefile > > Modified: head/sys/modules/ixgbe/Makefile > > ============================================================================== > --- head/sys/modules/ixgbe/Makefile Mon Aug 4 04:00:48 2014 > (r269499) > +++ head/sys/modules/ixgbe/Makefile Mon Aug 4 04:21:32 2014 > (r269500) > @@ -6,7 +6,7 @@ > > KMOD = if_ixgbe > SRCS = device_if.h bus_if.h pci_if.h > -SRCS += opt_inet.h opt_inet6.h > +SRCS += opt_inet.h opt_inet6.h opt_rss.h > SRCS += ixgbe.c ixv.c > # Shared source > SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c > @@ -24,6 +24,10 @@ opt_inet.h: > opt_inet6.h: > @echo "#define INET6 1" > ${.TARGET} > .endif > + > +opt_rss.h: > + @echo "" > ${.TARGET} > + > .endif > > .include > This one, Just for record, missed: Submitted by: araujo@ Best Regards, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 04:46:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8E8BEB5 for ; Mon, 4 Aug 2014 04:46:07 +0000 (UTC) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD192BD7 for ; Mon, 4 Aug 2014 04:46:06 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id hn18so4670015igb.10 for ; Sun, 03 Aug 2014 21:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=6vHuLtPcGJA8xpIQ8H7OV6UPcXbmn3wOT2oxVnZyrvA=; b=NdnW/WBLo/PXzbdkfE37lb6sqgT56tBOalfYVh0EBi2rDYK95ZKOwVObhceyIDfYw3 Vf6w7fTybb3C0I2Rqc7UExQza4f75JP8VYbXUx+WqLpCtqpuvRCdMHLvvEd2YtvEVgVq hUES9+iRLVapFAM676bBQ3a2m7aHvgW0AgoHTzpvQdSBx6V0wG+UfvaDtFh45HIfbKcg or9TG9q+VaO0tYC7wiCE3+ySCJOFvLu5q/kbDvoSzNgqzVZoIcXdkAStRRjqt9w3ET0j pIwgaf92oAPPRT8M3iHflKbmMl0NlKyoyZhkoSa38QlzFNtB+KXG5ygsGfLKsIPhiR7/ MPYw== X-Gm-Message-State: ALoCoQnmN3PC6YkNqAMp7wLMqmxiXrPEYD6JDeoh2iTQL6JEG9eqXWCeSlfWoMVUglae+iF8sVsW X-Received: by 10.50.152.40 with SMTP id uv8mr29397351igb.40.1407127560097; Sun, 03 Aug 2014 21:46:00 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id n1sm43297034igp.1.2014.08.03.21.45.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 21:45:59 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_0EB8D3F2-395A-4B95-A2D0-56C54EB64444"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r267937 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/... From: Warner Losh In-Reply-To: <9989584F-4933-4E20-B274-57CF7256272A@gmail.com> Date: Sun, 3 Aug 2014 22:45:57 -0600 Message-Id: <87DB8CBC-4F3B-4F81-A377-0B7DB67F9A84@bsdimp.com> References: <201406262145.s5QLjnJH034761@svn.freebsd.org> <2037442.AGE2eZkv8p@pippin.baldwin.cx> <9989584F-4933-4E20-B274-57CF7256272A@gmail.com> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 04:46:07 -0000 --Apple-Mail=_0EB8D3F2-395A-4B95-A2D0-56C54EB64444 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 3, 2014, at 9:47 AM, Warner Losh wrote: >=20 > On Jul 28, 2014, at 9:23 PM, John Baldwin wrote: >=20 >> On Thursday 26 June 2014 21:45:49 Rui Paulo wrote: >>> Author: rpaulo >>> Date: Thu Jun 26 21:45:49 2014 >>> New Revision: 267937 >>> URL: http://svnweb.freebsd.org/changeset/base/267937 >>>=20 >>> Log: >>> MFV illumos >>>=20 >>> 4477 DTrace should speak JSON >>>=20 >>> MFC after: 2 weeks >>=20 >> This makes kernel builds depend on userland sources. This breaks a = lot of my=20 >> work trees where I only checkout 'sys', and breaks a generally = long-standing=20 >> feature that the kernel was self-contained (recent bmake breakage to = require=20 >> the '-m /usr/src/share/mk' hack aside). Perhaps you could copy = strtolctype.h >> to sys/cddl/contrib/opensolaris/common/util? We already duplicate=20 >> sys/cddl/contrib/opensolaris/common/avl/avl.c in a like manner, = presumably for=20 >> the same reason. >=20 > Just FYI: my intention is to remove that hack requirement, at least = for host !=3D kernel > version cases.. I=92ve had some issues with the =93fix=94 that wound = up with a different > set of hacks once the initial MAKESYSPATH is fixed. Ah, the modules issue=85 I didn=92t understand the breakage until I = tried it myself... https://phabric.freebsd.org/D529 will fix it, if anybody wants to comment on it. Warner --Apple-Mail=_0EB8D3F2-395A-4B95-A2D0-56C54EB64444 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJT3xAFAAoJEGwc0Sh9sBEA2AoQAINE+MjA/+l+Z5v1XYswqhK3 QV4vrBuTe922ONNQLRGN4hI00hTc2cF2SjeAZLpXvNGHv3gELYsFzvR9sk3aoG2U wzk/Ezd0twK/Q+xJHpDiEosaWUZacYxVSrKBrm3Esb5axmzb1l3uXRCgHnYB1pLX stqywXPb5anh1RjNb8T9hvrugMtAbgIXjxDipM6rwslyXzmlHm8zwvH8KErgb+7O 97vgOf1cRg2wB1G8boXANgO2q5Zd0ygsm1AYsXwECgH2/iCk1nAEALF7GzbJv1Pt 7HuKKIkGTwwDM6D9/tcun5DKbcesJZlLFp+4/Oau4Wf+Bgsh3fsG5TsbmZpcqgp1 XGuouOuJ2Izjvt1D8WUoQnnkO/tKdC8FM05IdvdT4A+Sdr7xLIurN2x9fB2tVaSK s8IlKzsqWFjgSuKLtKgCg5Rgp3+cxbf5ZGFy7HPdXnrbDGBFbQqCYPyXvHDB0BSK 9hTUOq0OrHL7PgkCvIopPT4aVrSshdH8JMJxGNOPi1nclyW80hH3xqbEtBwZaDUn GR4+z7u98l8crj2F1DFenJ50Xx2RwBxkAo7BQdp3UifBi56qQ11o0aLq6t7wqugm H10thUHRQPq/PbfzcSRfhrKuQ9RxFZ8cUFhxIlbpNLcoo+GY7PaGOU/S2S2l3uTy D6adNCb/1YY8uGrHWiSi =9yPU -----END PGP SIGNATURE----- --Apple-Mail=_0EB8D3F2-395A-4B95-A2D0-56C54EB64444-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 05:40:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 652DA8AD for ; Mon, 4 Aug 2014 05:40:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C39A217C for ; Mon, 4 Aug 2014 05:40:52 +0000 (UTC) Received: from davide (uid 1280) (envelope-from davide@FreeBSD.org) id 5437 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 05:40:52 +0000 From: Davide Italiano Date: Mon, 4 Aug 2014 05:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269502 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df1ce4.5437.7f1dcc16@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 05:40:52 -0000 Author: davide Date: Mon Aug 4 05:40:51 2014 New Revision: 269502 URL: http://svnweb.freebsd.org/changeset/base/269502 Log: Fix an overflow in getsockopt(). optval isn't big enough to hold sbintime_t. Re-introduce r255030 behaviour capping socket timeouts to INT_32 if they're too large. CR: https://phabric.freebsd.org/D433 Reported by: demon Reviewed by: bde [1], jhb [2] MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Aug 4 04:23:45 2014 (r269501) +++ head/sys/kern/uipc_socket.c Mon Aug 4 05:40:51 2014 (r269502) @@ -2544,8 +2544,10 @@ sosetopt(struct socket *so, struct socko error = EDOM; goto bad; } - val = tvtosbt(tv); - + if (tv.tv_sec > INT32_MAX) + val = SBT_MAX; + else + val = tvtosbt(tv); switch (sopt->sopt_name) { case SO_SNDTIMEO: so->so_snd.sb_timeo = val; @@ -2694,10 +2696,8 @@ integer: case SO_SNDTIMEO: case SO_RCVTIMEO: - optval = (sopt->sopt_name == SO_SNDTIMEO ? - so->so_snd.sb_timeo : so->so_rcv.sb_timeo); - - tv = sbttotv(optval); + tv = sbttotv(sopt->sopt_name == SO_SNDTIMEO ? + so->so_snd.sb_timeo : so->so_rcv.sb_timeo); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { struct timeval32 tv32; From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 05:45:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B97B50 for ; Mon, 4 Aug 2014 05:45:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A981222F for ; Mon, 4 Aug 2014 05:45:10 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 580b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 05:45:09 +0000 From: Garrett Cooper Date: Mon, 4 Aug 2014 05:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269503 - head/libexec/rtld-elf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df1de6.580b.1280cbff@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 05:45:10 -0000 Author: ngie Date: Mon Aug 4 05:45:09 2014 New Revision: 269503 URL: http://svnweb.freebsd.org/changeset/base/269503 Log: Remove hardcoded path to TESTSDIR (Makefile, ld_library_pathfds.c) at build time by using atf_tc_get_config_var(tc, "srcdir")) This will allow end-users to move the binaries to different locations after they've been built without having to rebuild the binaries with the new paths Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Modified: head/libexec/rtld-elf/tests/Makefile head/libexec/rtld-elf/tests/ld_library_pathfds.c Modified: head/libexec/rtld-elf/tests/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/Makefile Mon Aug 4 05:40:51 2014 (r269502) +++ head/libexec/rtld-elf/tests/Makefile Mon Aug 4 05:45:09 2014 (r269503) @@ -9,6 +9,4 @@ SUBDIR+= libpythagoras target ATF_TESTS_C= ld_library_pathfds -CFLAGS+= -DTESTSDIR="\"${TESTSDIR}\"" - .include Modified: head/libexec/rtld-elf/tests/ld_library_pathfds.c ============================================================================== --- head/libexec/rtld-elf/tests/ld_library_pathfds.c Mon Aug 4 05:40:51 2014 (r269502) +++ head/libexec/rtld-elf/tests/ld_library_pathfds.c Mon Aug 4 05:45:09 2014 (r269503) @@ -38,7 +38,7 @@ struct descriptors { int usr; }; -static void setup(struct descriptors *); +static void setup(struct descriptors *, const atf_tc_t *); static void expect_success(int binary, char *pathfds); static void expect_missing_library(int binary, char *pathfds); @@ -53,7 +53,7 @@ ATF_TC_BODY(missing_library, tc) { struct descriptors files; - setup(&files); + setup(&files, tc); expect_missing_library(files.binary, NULL); } @@ -64,7 +64,7 @@ ATF_TC_BODY(wrong_library_directories, t struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE( asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d", files.etc) > 0); @@ -78,7 +78,7 @@ ATF_TC_BODY(bad_library_directories, tc) struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE(asprintf(&pathfds, "::", files.etc) > 0); expect_missing_library(files.binary, pathfds); @@ -91,7 +91,7 @@ ATF_TC_BODY(single_library_directory, tc struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE( asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d", files.testdir) > 0); @@ -105,7 +105,7 @@ ATF_TC_BODY(first_library_directory, tc) struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE( asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d", files.testdir, files.etc) > 0); @@ -120,7 +120,7 @@ ATF_TC_BODY(middle_library_directory, tc struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE( asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d:%d", files.root, files.testdir, files.usr) > 0); @@ -135,7 +135,7 @@ ATF_TC_BODY(last_library_directory, tc) struct descriptors files; char *pathfds; - setup(&files); + setup(&files, tc); ATF_REQUIRE( asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d", files.root, files.testdir) > 0); @@ -161,10 +161,11 @@ ATF_TP_ADD_TCS(tp) static void -setup(struct descriptors *dp) +setup(struct descriptors *dp, const atf_tc_t *tc) { - ATF_REQUIRE((dp->testdir = opendir(TESTSDIR)) >= 0); + dp->testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); + ATF_REQUIRE(dp->testdir >= 0); ATF_REQUIRE( (dp->binary = openat(dp->testdir, "target", O_RDONLY)) >= 0); From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 05:46:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C400BCAA for ; Mon, 4 Aug 2014 05:46:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAA4223B for ; Mon, 4 Aug 2014 05:46:10 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 581f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 05:46:10 +0000 From: Garrett Cooper Date: Mon, 4 Aug 2014 05:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269504 - head/libexec/rtld-elf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df1e22.581f.3bb2e8e1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 05:46:10 -0000 Author: ngie Date: Mon Aug 4 05:46:10 2014 New Revision: 269504 URL: http://svnweb.freebsd.org/changeset/base/269504 Log: Fix a -Wsecurity warning with clang Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Modified: head/libexec/rtld-elf/tests/ld_library_pathfds.c Modified: head/libexec/rtld-elf/tests/ld_library_pathfds.c ============================================================================== --- head/libexec/rtld-elf/tests/ld_library_pathfds.c Mon Aug 4 05:45:09 2014 (r269503) +++ head/libexec/rtld-elf/tests/ld_library_pathfds.c Mon Aug 4 05:46:10 2014 (r269504) @@ -79,7 +79,7 @@ ATF_TC_BODY(bad_library_directories, tc) char *pathfds; setup(&files, tc); - ATF_REQUIRE(asprintf(&pathfds, "::", files.etc) > 0); + ATF_REQUIRE(asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=::") > 0); expect_missing_library(files.binary, pathfds); } From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 05:49:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E330E1D for ; Mon, 4 Aug 2014 05:49:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0466F225A for ; Mon, 4 Aug 2014 05:49:14 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5830 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 05:49:13 +0000 From: Garrett Cooper Date: Mon, 4 Aug 2014 05:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269505 - head/libexec/rtld-elf/tests/target X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df1ed9.5830.34b38bca@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 05:49:14 -0000 Author: ngie Date: Mon Aug 4 05:49:13 2014 New Revision: 269505 URL: http://svnweb.freebsd.org/changeset/base/269505 Log: Move a -L argument from LDADD to LDFLAGS Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Modified: head/libexec/rtld-elf/tests/target/Makefile Modified: head/libexec/rtld-elf/tests/target/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:46:10 2014 (r269504) +++ head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:49:13 2014 (r269505) @@ -6,7 +6,9 @@ PROG= target BINDIR= ${TESTSBASE}${TESTSDIR}/libexec/rtld-elf CFLAGS+= -I${.CURDIR}/../libpythagoras -LDADD= -L${.OBJDIR}/../libpythagoras -lpythagoras + +LDFLAGS+= -L${.OBJDIR}/../libpythagoras +LDADD= -lpythagoras MAN= From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 05:50:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4098FCB for ; Mon, 4 Aug 2014 05:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16C6E226B for ; Mon, 4 Aug 2014 05:50:22 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5b86 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 05:50:22 +0000 From: Garrett Cooper Date: Mon, 4 Aug 2014 05:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269506 - head/libexec/rtld-elf/tests/target X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df1f1e.5b86.410b3f9b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 05:50:22 -0000 Author: ngie Date: Mon Aug 4 05:50:21 2014 New Revision: 269506 URL: http://svnweb.freebsd.org/changeset/base/269506 Log: Fix BINDIR to not duplicate "${TESTSDIR} This should fix 'make release' with MK_TESTS != no Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Modified: head/libexec/rtld-elf/tests/target/Makefile Modified: head/libexec/rtld-elf/tests/target/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:49:13 2014 (r269505) +++ head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:50:21 2014 (r269506) @@ -3,7 +3,7 @@ .include PROG= target -BINDIR= ${TESTSBASE}${TESTSDIR}/libexec/rtld-elf +BINDIR= ${TESTSBASE}/libexec/rtld-elf CFLAGS+= -I${.CURDIR}/../libpythagoras From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 06:59:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B119A744; Mon, 4 Aug 2014 06:59:40 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67AA828D1; Mon, 4 Aug 2014 06:59:37 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id p10so9102000pdj.22 for ; Sun, 03 Aug 2014 23:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=uVip6nKnOLa/NiKxt/v/6eovavQalWzR3y3PD/DWpjk=; b=xdmbYp1YvqZ23Vsc3hlUaxb1rCM+9p08NRv/joRKNCvyu859ahcX1KpUH+i1exx6lN z3xM9awYUjldiTIfJ3pM7xHArm7O5jqoWUQl6o8JtLeGqOpGgcCe3k+QfgmeKGhqnrNM WXqosJwhSt9/MJHiumg4twOLjS+miWa3AT58s6uO4Gptqwpg3OCOCMXk8Wu80Bd5dH1d +7GwBYj8HMgp85UXKD8x9A6AYx6GMjMbUWJ0Usox6VQBhFJEDBXZ1j/mlNjjlL5JUGxO ulAvQWn9J21I3yUTWOYKilZFlV4o3cHdS6gHwTFVmtDRRaQ1LkHEuS3USwLcE7WiE0Mf qSzA== X-Received: by 10.66.251.170 with SMTP id zl10mr1641601pac.97.1407135576375; Sun, 03 Aug 2014 23:59:36 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:f056:12e5:5d06:cec? ([2601:8:ab80:7d6:f056:12e5:5d06:cec]) by mx.google.com with ESMTPSA id xk1sm60062111pac.21.2014.08.03.23.59.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 03 Aug 2014 23:59:35 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_BD35B580-5540-4FA5-B4EB-06E21C21CB1D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269506 - head/libexec/rtld-elf/tests/target From: Garrett Cooper In-Reply-To: <53df1f1e.5b86.410b3f9b@svn.freebsd.org> Date: Sun, 3 Aug 2014 23:59:36 -0700 Message-Id: References: <53df1f1e.5b86.410b3f9b@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Julio Merino , svn-src-all@freebsd.org, src-committers@freebsd.org, jonathan@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 06:59:40 -0000 --Apple-Mail=_BD35B580-5540-4FA5-B4EB-06E21C21CB1D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 3, 2014, at 10:50 PM, Garrett Cooper wrote: > Author: ngie > Date: Mon Aug 4 05:50:21 2014 > New Revision: 269506 > URL: http://svnweb.freebsd.org/changeset/base/269506 >=20 > Log: > Fix BINDIR to not duplicate "${TESTSDIR} >=20 > This should fix 'make release' with MK_TESTS !=3D no >=20 > Phabric: D525 (part of a larger patch) >=20 > Reviewed by: jmmv > Approved by: jmmv (co-mentor) My comment about this fixing =91make release=92 in the commit message is = incorrect; all this commit does is remove the obfuscation of ${TESTSDIR} = in ${BINDIR}. I need to do more digging and resolve this issue properly, as = demonstrated here so the kyua VMs are fixed again: = http://kyua3.nyi.freebsd.org/head/data/0-LATEST/output.log Thanks :)! -Garrett --Apple-Mail=_BD35B580-5540-4FA5-B4EB-06E21C21CB1D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJT3y9YAAoJEMZr5QU6S73ew4YH/0oGJLmsv/OoUAdfqh4O3dqO VSpBk1i98mzSKLFaFjon0UlMzeUDhqEClPOph/w7zYAcjXvoukrvz3Nu03RV7IUz lBjmTqtJvP8+ha0yEQRUoCFS13exO9uO3C25KZ5hGKl7DeKSu3t3LwEJwXATWpaU zlfDVFrSfwPPk5+JgfI+ih4z4Y9w7knycVoCo2LW7syBgR8aipA0s+z33vuU0do5 tz/yzP+kfI53jHpq2oX7/FsDPh1sHAw9ENYKrwkxPkgj8vfuuN7NLDRa5zM+O2gx Lp7IGlKupNIdMOF5cBvPByVTltby0qBsbLBeJQsZDKL/IfRfYysf0oWeW4Hb35o= =5Ell -----END PGP SIGNATURE----- --Apple-Mail=_BD35B580-5540-4FA5-B4EB-06E21C21CB1D-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:42:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 116C47E for ; Mon, 4 Aug 2014 08:42:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F395C26BC for ; Mon, 4 Aug 2014 08:42:29 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 58a4 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:42:29 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269507 - in head/sys: x86/xen xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4775.58a4.dae26d3@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:42:30 -0000 Author: royger Date: Mon Aug 4 08:42:29 2014 New Revision: 269507 URL: http://svnweb.freebsd.org/changeset/base/269507 Log: xen: implement event channel PIRQ support This allows Dom0 to manage physical hardware, redirecting the physical interrupts to event channels. Sponsored by: Citrix Systems R&D x86/xen/xen_intr.c: - Expand struct xenisrc to hold the level and triggering of PIRQ event channels. - Implement missing methods in xen_intr_pirq_pic. - Allow xen_intr_alloc_isrc to take a vector parameter that globally identifies the interrupt. This is only used for PIRQs that are bound to a specific hardware IRQ. - Introduce xen_register_pirq used to register IO APIC legacy PIRQ interrupts. - Add support for the dynamic PIRQ EOI map, this shared memory is modified by Xen (if it suppoorts that feature), and notifies the guest if an EOI is needed or not. If it's not available fall back to the old implementation using PHYSDEVOP_irq_status_query. - Rename xen_intr_isrc_count to xen_intr_auto_vector_count and replace it's usages. - Align static variables by name. xen/xen_intr.h: - Add prototype for xen_register_pirq. Modified: head/sys/x86/xen/xen_intr.c head/sys/xen/xen_intr.h Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Aug 4 05:50:21 2014 (r269506) +++ head/sys/x86/xen/xen_intr.c Mon Aug 4 08:42:29 2014 (r269507) @@ -104,6 +104,9 @@ DPCPU_DECLARE(struct vcpu_info *, vcpu_i #define is_valid_evtchn(x) ((x) != 0) +#define XEN_EEXIST 17 /* Xen "already exists" error */ +#define XEN_ALLOCATE_VECTOR 0 /* Allocate a vector for this event channel */ + struct xenisrc { struct intsrc xi_intsrc; enum evtchn_type xi_type; @@ -113,8 +116,9 @@ struct xenisrc { int xi_pirq; int xi_virq; u_int xi_close:1; /* close on unbind? */ - u_int xi_needs_eoi:1; u_int xi_shared:1; /* Shared with other domains. */ + u_int xi_activehi:1; + u_int xi_edgetrigger:1; }; #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) @@ -136,6 +140,9 @@ static void xen_intr_pirq_enable_source( static void xen_intr_pirq_disable_source(struct intsrc *isrc, int eoi); static void xen_intr_pirq_eoi_source(struct intsrc *isrc); static void xen_intr_pirq_enable_intr(struct intsrc *isrc); +static void xen_intr_pirq_disable_intr(struct intsrc *isrc); +static int xen_intr_pirq_config_intr(struct intsrc *isrc, + enum intr_trigger trig, enum intr_polarity pol); /** * PIC interface for all event channel port types except physical IRQs. @@ -163,18 +170,20 @@ struct pic xen_intr_pirq_pic = { .pic_disable_source = xen_intr_pirq_disable_source, .pic_eoi_source = xen_intr_pirq_eoi_source, .pic_enable_intr = xen_intr_pirq_enable_intr, - .pic_disable_intr = xen_intr_disable_intr, + .pic_disable_intr = xen_intr_pirq_disable_intr, .pic_vector = xen_intr_vector, .pic_source_pending = xen_intr_source_pending, .pic_suspend = xen_intr_suspend, .pic_resume = xen_intr_resume, - .pic_config_intr = xen_intr_config_intr, + .pic_config_intr = xen_intr_pirq_config_intr, .pic_assign_cpu = xen_intr_assign_cpu }; -static struct mtx xen_intr_isrc_lock; -static int xen_intr_isrc_count; -static struct xenisrc *xen_intr_port_to_isrc[NR_EVENT_CHANNELS]; +static struct mtx xen_intr_isrc_lock; +static int xen_intr_auto_vector_count; +static struct xenisrc *xen_intr_port_to_isrc[NR_EVENT_CHANNELS]; +static u_long *xen_intr_pirq_eoi_map; +static boolean_t xen_intr_pirq_eoi_map_enabled; /*------------------------- Private Functions --------------------------------*/ /** @@ -256,7 +265,7 @@ xen_intr_find_unused_isrc(enum evtchn_ty KASSERT(mtx_owned(&xen_intr_isrc_lock), ("Evtchn isrc lock not held")); - for (isrc_idx = 0; isrc_idx < xen_intr_isrc_count; isrc_idx ++) { + for (isrc_idx = 0; isrc_idx < xen_intr_auto_vector_count; isrc_idx ++) { struct xenisrc *isrc; u_int vector; @@ -282,27 +291,33 @@ xen_intr_find_unused_isrc(enum evtchn_ty * object or NULL. */ static struct xenisrc * -xen_intr_alloc_isrc(enum evtchn_type type) +xen_intr_alloc_isrc(enum evtchn_type type, int vector) { static int warned; struct xenisrc *isrc; - int vector; KASSERT(mtx_owned(&xen_intr_isrc_lock), ("Evtchn alloc lock not held")); - if (xen_intr_isrc_count > NR_EVENT_CHANNELS) { + if (xen_intr_auto_vector_count > NR_EVENT_CHANNELS) { if (!warned) { warned = 1; printf("xen_intr_alloc: Event channels exhausted.\n"); } return (NULL); } - vector = FIRST_EVTCHN_INT + xen_intr_isrc_count; - xen_intr_isrc_count++; + + if (type != EVTCHN_TYPE_PIRQ) { + vector = FIRST_EVTCHN_INT + xen_intr_auto_vector_count; + xen_intr_auto_vector_count++; + } + + KASSERT((intr_lookup_source(vector) == NULL), + ("Trying to use an already allocated vector")); mtx_unlock(&xen_intr_isrc_lock); isrc = malloc(sizeof(*isrc), M_XENINTR, M_WAITOK | M_ZERO); - isrc->xi_intsrc.is_pic = &xen_intr_pic; + isrc->xi_intsrc.is_pic = + (type == EVTCHN_TYPE_PIRQ) ? &xen_intr_pirq_pic : &xen_intr_pic; isrc->xi_vector = vector; isrc->xi_type = type; intr_register_source(&isrc->xi_intsrc); @@ -388,7 +403,7 @@ xen_intr_bind_isrc(struct xenisrc **isrc mtx_lock(&xen_intr_isrc_lock); isrc = xen_intr_find_unused_isrc(type); if (isrc == NULL) { - isrc = xen_intr_alloc_isrc(type); + isrc = xen_intr_alloc_isrc(type, XEN_ALLOCATE_VECTOR); if (isrc == NULL) { mtx_unlock(&xen_intr_isrc_lock); return (ENOSPC); @@ -570,7 +585,8 @@ static int xen_intr_init(void *dummy __unused) { struct xen_intr_pcpu_data *pcpu; - int i; + struct physdev_pirq_eoi_gmfn eoi_gmfn; + int i, rc; if (!xen_domain()) return (0); @@ -591,7 +607,20 @@ xen_intr_init(void *dummy __unused) xen_intr_intrcnt_add(i); } + /* Try to register PIRQ EOI map */ + xen_intr_pirq_eoi_map = malloc(PAGE_SIZE, M_XENINTR, M_WAITOK | M_ZERO); + eoi_gmfn.gmfn = atop(vtophys(xen_intr_pirq_eoi_map)); + rc = HYPERVISOR_physdev_op(PHYSDEVOP_pirq_eoi_gmfn_v2, &eoi_gmfn); + if (rc != 0 && bootverbose) + printf("Xen interrupts: unable to register PIRQ EOI map\n"); + else + xen_intr_pirq_eoi_map_enabled = true; + intr_register_pic(&xen_intr_pic); + intr_register_pic(&xen_intr_pirq_pic); + + if (bootverbose) + printf("Xen interrupt system initialized\n"); return (0); } @@ -696,7 +725,7 @@ xen_intr_resume(struct pic *unused, bool memset(xen_intr_port_to_isrc, 0, sizeof(xen_intr_port_to_isrc)); /* Free unused isrcs and rebind VIRQs and IPIs */ - for (isrc_idx = 0; isrc_idx < xen_intr_isrc_count; isrc_idx++) { + for (isrc_idx = 0; isrc_idx < xen_intr_auto_vector_count; isrc_idx++) { u_int vector; vector = FIRST_EVTCHN_INT + isrc_idx; @@ -916,6 +945,9 @@ xen_intr_pirq_disable_source(struct ints isrc = (struct xenisrc *)base_isrc; evtchn_mask_port(isrc->xi_port); + + if (eoi == PIC_EOI) + xen_intr_pirq_eoi_source(base_isrc); } /* @@ -944,7 +976,7 @@ xen_intr_pirq_eoi_source(struct intsrc * /* XXX Use shared page of flags for this. */ isrc = (struct xenisrc *)base_isrc; - if (isrc->xi_needs_eoi != 0) { + if (test_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map)) { struct physdev_eoi eoi = { .irq = isrc->xi_pirq }; (void)HYPERVISOR_physdev_op(PHYSDEVOP_eoi, &eoi); @@ -957,8 +989,116 @@ xen_intr_pirq_eoi_source(struct intsrc * * \param isrc The interrupt source to enable. */ static void -xen_intr_pirq_enable_intr(struct intsrc *isrc) +xen_intr_pirq_enable_intr(struct intsrc *base_isrc) { + struct xenisrc *isrc; + struct evtchn_bind_pirq bind_pirq; + struct physdev_irq_status_query irq_status; + int error; + + isrc = (struct xenisrc *)base_isrc; + + if (!xen_intr_pirq_eoi_map_enabled) { + irq_status.irq = isrc->xi_pirq; + error = HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, + &irq_status); + if (error) + panic("unable to get status of IRQ#%d", isrc->xi_pirq); + + if (irq_status.flags & XENIRQSTAT_needs_eoi) { + /* + * Since the dynamic PIRQ EOI map is not available + * mark the PIRQ as needing EOI unconditionally. + */ + set_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map); + } + } + + bind_pirq.pirq = isrc->xi_pirq; + bind_pirq.flags = isrc->xi_edgetrigger ? 0 : BIND_PIRQ__WILL_SHARE; + error = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); + if (error) + panic("unable to bind IRQ#%d", isrc->xi_pirq); + + isrc->xi_port = bind_pirq.port; + + mtx_lock(&xen_intr_isrc_lock); + KASSERT((xen_intr_port_to_isrc[bind_pirq.port] == NULL), + ("trying to override an already setup event channel port")); + xen_intr_port_to_isrc[bind_pirq.port] = isrc; + mtx_unlock(&xen_intr_isrc_lock); + + evtchn_unmask_port(isrc->xi_port); +} + +/* + * Disable an interrupt source. + * + * \param isrc The interrupt source to disable. + */ +static void +xen_intr_pirq_disable_intr(struct intsrc *base_isrc) +{ + struct xenisrc *isrc; + struct evtchn_close close; + int error; + + isrc = (struct xenisrc *)base_isrc; + + evtchn_mask_port(isrc->xi_port); + + close.port = isrc->xi_port; + error = HYPERVISOR_event_channel_op(EVTCHNOP_close, &close); + if (error) + panic("unable to close event channel %d IRQ#%d", + isrc->xi_port, isrc->xi_pirq); + + mtx_lock(&xen_intr_isrc_lock); + xen_intr_port_to_isrc[isrc->xi_port] = NULL; + mtx_unlock(&xen_intr_isrc_lock); + + isrc->xi_port = 0; +} + +/** + * Perform configuration of an interrupt source. + * + * \param isrc The interrupt source to configure. + * \param trig Edge or level. + * \param pol Active high or low. + * + * \returns 0 if no events are pending, otherwise non-zero. + */ +static int +xen_intr_pirq_config_intr(struct intsrc *base_isrc, enum intr_trigger trig, + enum intr_polarity pol) +{ + struct xenisrc *isrc = (struct xenisrc *)base_isrc; + struct physdev_setup_gsi setup_gsi; + int error; + + KASSERT(!(trig == INTR_TRIGGER_CONFORM || pol == INTR_POLARITY_CONFORM), + ("%s: Conforming trigger or polarity\n", __func__)); + + setup_gsi.gsi = isrc->xi_pirq; + setup_gsi.triggering = trig == INTR_TRIGGER_EDGE ? 0 : 1; + setup_gsi.polarity = pol == INTR_POLARITY_HIGH ? 0 : 1; + + error = HYPERVISOR_physdev_op(PHYSDEVOP_setup_gsi, &setup_gsi); + if (error == -XEN_EEXIST) { + if ((isrc->xi_edgetrigger && (trig != INTR_TRIGGER_EDGE)) || + (isrc->xi_activehi && (pol != INTR_POLARITY_HIGH))) + panic("unable to reconfigure interrupt IRQ#%d", + isrc->xi_pirq); + error = 0; + } + if (error) + panic("unable to configure IRQ#%d\n", isrc->xi_pirq); + + isrc->xi_activehi = pol == INTR_POLARITY_HIGH ? 1 : 0; + isrc->xi_edgetrigger = trig == INTR_TRIGGER_EDGE ? 1 : 0; + + return (0); } /*--------------------------- Public Functions -------------------------------*/ @@ -1181,6 +1321,50 @@ xen_intr_alloc_and_bind_ipi(device_t dev } int +xen_register_pirq(int vector, enum intr_trigger trig, enum intr_polarity pol) +{ + struct physdev_map_pirq map_pirq; + struct physdev_irq alloc_pirq; + struct xenisrc *isrc; + int error; + + if (vector == 0) + return (EINVAL); + + if (bootverbose) + printf("xen: register IRQ#%d\n", vector); + + map_pirq.domid = DOMID_SELF; + map_pirq.type = MAP_PIRQ_TYPE_GSI; + map_pirq.index = vector; + map_pirq.pirq = vector; + + error = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_pirq); + if (error) { + printf("xen: unable to map IRQ#%d\n", vector); + return (error); + } + + alloc_pirq.irq = vector; + alloc_pirq.vector = 0; + error = HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &alloc_pirq); + if (error) { + printf("xen: unable to alloc PIRQ for IRQ#%d\n", vector); + return (error); + } + + mtx_lock(&xen_intr_isrc_lock); + isrc = xen_intr_alloc_isrc(EVTCHN_TYPE_PIRQ, vector); + mtx_unlock(&xen_intr_isrc_lock); + KASSERT((isrc != NULL), ("xen: unable to allocate isrc for interrupt")); + isrc->xi_pirq = vector; + isrc->xi_activehi = pol == INTR_POLARITY_HIGH ? 1 : 0; + isrc->xi_edgetrigger = trig == INTR_TRIGGER_EDGE ? 1 : 0; + + return (0); +} + +int xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...) { char descr[MAXCOMLEN + 1]; Modified: head/sys/xen/xen_intr.h ============================================================================== --- head/sys/xen/xen_intr.h Mon Aug 4 05:50:21 2014 (r269506) +++ head/sys/xen/xen_intr.h Mon Aug 4 08:42:29 2014 (r269507) @@ -159,6 +159,18 @@ int xen_intr_alloc_and_bind_ipi(device_t xen_intr_handle_t *handlep); /** + * Register a physical interrupt vector and setup the interrupt source. + * + * \param vector The global vector to use. + * \param trig Default trigger method. + * \param pol Default polarity of the interrupt. + * + * \returns 0 on success, otherwise an errno. + */ +int xen_register_pirq(int vector, enum intr_trigger trig, + enum intr_polarity pol); + +/** * Unbind an interrupt handler from its interrupt source. * * \param handlep A pointer to the opaque handle that was initialized From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:43:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33CEC1FD for ; Mon, 4 Aug 2014 08:43:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0519626CA for ; Mon, 4 Aug 2014 08:43:28 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 58bb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:43:27 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269508 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df47af.58bb.34704d8@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:43:28 -0000 Author: royger Date: Mon Aug 4 08:43:27 2014 New Revision: 269508 URL: http://svnweb.freebsd.org/changeset/base/269508 Log: xen: mask all event channels on init Mask all event channels during initialization. This is done so that we don't receive spurious interrupts while dynamically registering new event channels. There's a small window during registration where an event channel can fire before we have attached a handler to it. Sponsored by: Citrix Systems R&D x86/xen/xen_intr.c: - Mask all event channels on init. Modified: head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Aug 4 08:42:29 2014 (r269507) +++ head/sys/x86/xen/xen_intr.c Mon Aug 4 08:43:27 2014 (r269508) @@ -584,6 +584,7 @@ xen_intr_handle_upcall(struct trapframe static int xen_intr_init(void *dummy __unused) { + shared_info_t *s = HYPERVISOR_shared_info; struct xen_intr_pcpu_data *pcpu; struct physdev_pirq_eoi_gmfn eoi_gmfn; int i, rc; @@ -607,6 +608,9 @@ xen_intr_init(void *dummy __unused) xen_intr_intrcnt_add(i); } + for (i = 0; i < nitems(s->evtchn_mask); i++) + atomic_store_rel_long(&s->evtchn_mask[i], ~0); + /* Try to register PIRQ EOI map */ xen_intr_pirq_eoi_map = malloc(PAGE_SIZE, M_XENINTR, M_WAITOK | M_ZERO); eoi_gmfn.gmfn = atop(vtophys(xen_intr_pirq_eoi_map)); From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:52:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15C38529 for ; Mon, 4 Aug 2014 08:52:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC37127CE for ; Mon, 4 Aug 2014 08:52:10 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5c07 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:52:10 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269509 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df49ba.5c07.4c7afef2@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:52:11 -0000 Author: royger Date: Mon Aug 4 08:52:10 2014 New Revision: 269509 URL: http://svnweb.freebsd.org/changeset/base/269509 Log: xen: add a DDB command to print event channel information Add a new DDB command to dump all registered event channels. Sponsored by: Citrix Systems R&D x86/xen/xen_intr.c: - Add a new xen_evtchn command to DDB in order to dump all information related to event channels. Modified: head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Aug 4 08:43:27 2014 (r269508) +++ head/sys/x86/xen/xen_intr.c Mon Aug 4 08:52:10 2014 (r269509) @@ -32,6 +32,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -62,6 +64,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef DDB +#include +#endif + static MALLOC_DEFINE(M_XENINTR, "xen_intr", "Xen Interrupt Services"); /** @@ -1427,3 +1433,74 @@ xen_intr_port(xen_intr_handle_t handle) return (isrc->xi_port); } + +#ifdef DDB +static const char * +xen_intr_print_type(enum evtchn_type type) +{ + static const char *evtchn_type_to_string[EVTCHN_TYPE_COUNT] = { + [EVTCHN_TYPE_UNBOUND] = "UNBOUND", + [EVTCHN_TYPE_PIRQ] = "PIRQ", + [EVTCHN_TYPE_VIRQ] = "VIRQ", + [EVTCHN_TYPE_IPI] = "IPI", + [EVTCHN_TYPE_PORT] = "PORT", + }; + + if (type >= EVTCHN_TYPE_COUNT) + return ("UNKNOWN"); + + return (evtchn_type_to_string[type]); +} + +static void +xen_intr_dump_port(struct xenisrc *isrc) +{ + struct xen_intr_pcpu_data *pcpu; + shared_info_t *s = HYPERVISOR_shared_info; + int i; + + db_printf("Port %d Type: %s\n", + isrc->xi_port, xen_intr_print_type(isrc->xi_type)); + if (isrc->xi_type == EVTCHN_TYPE_PIRQ) { + db_printf("\tPirq: %d ActiveHi: %d EdgeTrigger: %d " + "NeedsEOI: %d Shared: %d\n", + isrc->xi_pirq, isrc->xi_activehi, isrc->xi_edgetrigger, + !!test_bit(isrc->xi_pirq, xen_intr_pirq_eoi_map), + isrc->xi_shared); + } + if (isrc->xi_type == EVTCHN_TYPE_VIRQ) + db_printf("\tVirq: %d\n", isrc->xi_virq); + + db_printf("\tMasked: %d Pending: %d\n", + !!test_bit(isrc->xi_port, &s->evtchn_mask[0]), + !!test_bit(isrc->xi_port, &s->evtchn_pending[0])); + + db_printf("\tPer-CPU Masks: "); + CPU_FOREACH(i) { + pcpu = DPCPU_ID_PTR(i, xen_intr_pcpu); + db_printf("cpu#%d: %d ", i, + !!test_bit(isrc->xi_port, pcpu->evtchn_enabled)); + } + db_printf("\n"); +} + +DB_SHOW_COMMAND(xen_evtchn, db_show_xen_evtchn) +{ + int i; + + if (!xen_domain()) { + db_printf("Only available on Xen guests\n"); + return; + } + + for (i = 0; i < NR_EVENT_CHANNELS; i++) { + struct xenisrc *isrc; + + isrc = xen_intr_port_to_isrc[i]; + if (isrc == NULL) + continue; + + xen_intr_dump_port(isrc); + } +} +#endif /* DDB */ From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:54:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F347F796 for ; Mon, 4 Aug 2014 08:54:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4A9427EC for ; Mon, 4 Aug 2014 08:54:34 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5c56 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:54:34 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269510 - in head/sys/x86: x86 xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4a4a.5c56.2a5a30c5@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:54:35 -0000 Author: royger Date: Mon Aug 4 08:54:34 2014 New Revision: 269510 URL: http://svnweb.freebsd.org/changeset/base/269510 Log: xen: change order of Xen intr init and IO APIC registration This change inserts the Xen interrupt subsystem (event channels) initialization between the system interrupt initialization and the IO APIC source registration. This is needed when running on Dom0, that routes physical interrupts on top of event channels, so that the interrupt sources found during IO APIC initialization can be registered using the Xen interrupt subsystem. The resulting order in the SI_SUB_INTR stage is the following: - System intr initialization - Xen intr initalization - IO APIC source registration Sponsored by: Citrix Systems R&D x86/x86/local_apic.c: - Change order of apic_setup_io to be called after xen interrupt subsystem is setup. x86/xen/xen_intr.c: - Init Xen event channels before apic_setup_io. Modified: head/sys/x86/x86/local_apic.c head/sys/x86/xen/xen_intr.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Aug 4 08:52:10 2014 (r269509) +++ head/sys/x86/x86/local_apic.c Mon Aug 4 08:54:34 2014 (r269510) @@ -1449,7 +1449,7 @@ apic_setup_io(void *dummy __unused) /* Enable the MSI "pic". */ msi_init(); } -SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_SECOND, apic_setup_io, NULL); +SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); #ifdef SMP /* Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Mon Aug 4 08:52:10 2014 (r269509) +++ head/sys/x86/xen/xen_intr.c Mon Aug 4 08:54:34 2014 (r269510) @@ -634,7 +634,7 @@ xen_intr_init(void *dummy __unused) return (0); } -SYSINIT(xen_intr_init, SI_SUB_INTR, SI_ORDER_MIDDLE, xen_intr_init, NULL); +SYSINIT(xen_intr_init, SI_SUB_INTR, SI_ORDER_SECOND, xen_intr_init, NULL); /*--------------------------- Common PIC Functions ---------------------------*/ /** From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:56:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3E228FF for ; Mon, 4 Aug 2014 08:56:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B26C2809 for ; Mon, 4 Aug 2014 08:56:21 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5c6e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:56:21 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269511 - in head/sys/x86: acpica xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4ab5.5c6e.5f2645f5@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:56:21 -0000 Author: royger Date: Mon Aug 4 08:56:20 2014 New Revision: 269511 URL: http://svnweb.freebsd.org/changeset/base/269511 Log: xen: change quality of the MADT ACPI enumerator Lower the quality of the MADT ACPI enumerator, so on Xen Dom0 we can force the usage of the Xen mptable enumerator even when ACPI is detected. This is needed because Xen might restrict the number of vCPUs available to Dom0, but the MADT ACPI table parsed in FreeBSD is the native one (which enumerates all the CPUs available in the system). Sponsored by: Citrix Systems R&D Reviewed by: gibbs x86/acpica/madt.c: - Lower MADT enumerator quality to -50. x86/xen/pvcpu_enum.c: - Rise Xen PV enumerator to 0. Modified: head/sys/x86/acpica/madt.c head/sys/x86/xen/pvcpu_enum.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Mon Aug 4 08:54:34 2014 (r269510) +++ head/sys/x86/acpica/madt.c Mon Aug 4 08:56:20 2014 (r269511) @@ -102,7 +102,7 @@ madt_probe(void) madt_physaddr = acpi_find_table(ACPI_SIG_MADT); if (madt_physaddr == 0) return (ENXIO); - return (0); + return (-50); } /* Modified: head/sys/x86/xen/pvcpu_enum.c ============================================================================== --- head/sys/x86/xen/pvcpu_enum.c Mon Aug 4 08:54:34 2014 (r269510) +++ head/sys/x86/xen/pvcpu_enum.c Mon Aug 4 08:56:20 2014 (r269511) @@ -67,7 +67,7 @@ static struct apic_enumerator xenpv_enum static int xenpv_probe(void) { - return (-100); + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 08:58:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EBF0A96 for ; Mon, 4 Aug 2014 08:58:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF992837 for ; Mon, 4 Aug 2014 08:58:51 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5c85 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 08:58:51 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 08:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269512 - in head/sys/x86: acpica include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4b4b.5c85.6bb31891@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 08:58:51 -0000 Author: royger Date: Mon Aug 4 08:58:50 2014 New Revision: 269512 URL: http://svnweb.freebsd.org/changeset/base/269512 Log: x86/madt: make the interrupt override parser a public function Split a portion of the code in madt_parse_interrupt_override to a separate function, that is public and can be used from other code. This will be needed by the Xen port, since FreeBSD needs to parse the interrupt overrides and notify Xen about them. This commit should not introduce any functional change. Sponsored by: Citrix Systems R&D Reviewed by: jhb, gibbs x86/acpica/madt.c: - Introduce madt_parse_interrupt_values() that parses the intr information from ACPI and returns the triggering and the polarity. This is a subset of the functionality that used to be part of madt_parse_interrupt_override(). - Make madt_found_sci_override a global variable that can be used from other files. x86/include/acpica_machdep.h: - Prototype of madt_parse_interrupt_values. - Extern declaration of madt_found_sci_override. Modified: head/sys/x86/acpica/madt.c head/sys/x86/include/acpica_machdep.h Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Mon Aug 4 08:56:20 2014 (r269511) +++ head/sys/x86/acpica/madt.c Mon Aug 4 08:58:50 2014 (r269512) @@ -57,7 +57,7 @@ static struct lapic_info { u_int la_acpi_id:8; } lapics[MAX_APIC_ID + 1]; -static int madt_found_sci_override; +int madt_found_sci_override; static ACPI_TABLE_MADT *madt; static vm_paddr_t madt_physaddr; static vm_offset_t madt_length; @@ -380,41 +380,27 @@ madt_find_interrupt(int intr, void **api return (0); } -/* - * Parse an interrupt source override for an ISA interrupt. - */ -static void -madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr) +void +madt_parse_interrupt_values(void *entry, + enum intr_trigger *trig, enum intr_polarity *pol) { - void *new_ioapic, *old_ioapic; - u_int new_pin, old_pin; - enum intr_trigger trig; - enum intr_polarity pol; + ACPI_MADT_INTERRUPT_OVERRIDE *intr; char buf[64]; - if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 && - intr->GlobalIrq == 2) { - if (bootverbose) - printf("MADT: Skipping timer override\n"); - return; - } + intr = entry; + if (bootverbose) printf("MADT: Interrupt override: source %u, irq %u\n", intr->SourceIrq, intr->GlobalIrq); KASSERT(intr->Bus == 0, ("bus for interrupt overrides must be zero")); - if (madt_find_interrupt(intr->GlobalIrq, &new_ioapic, &new_pin) != 0) { - printf("MADT: Could not find APIC for vector %u (IRQ %u)\n", - intr->GlobalIrq, intr->SourceIrq); - return; - } /* * Lookup the appropriate trigger and polarity modes for this * entry. */ - trig = interrupt_trigger(intr->IntiFlags, intr->SourceIrq); - pol = interrupt_polarity(intr->IntiFlags, intr->SourceIrq); - + *trig = interrupt_trigger(intr->IntiFlags, intr->SourceIrq); + *pol = interrupt_polarity(intr->IntiFlags, intr->SourceIrq); + /* * If the SCI is identity mapped but has edge trigger and * active-hi polarity or the force_sci_lo tunable is set, @@ -424,29 +410,56 @@ madt_parse_interrupt_override(ACPI_MADT_ madt_found_sci_override = 1; if (getenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { if (tolower(buf[0]) == 'e') - trig = INTR_TRIGGER_EDGE; + *trig = INTR_TRIGGER_EDGE; else if (tolower(buf[0]) == 'l') - trig = INTR_TRIGGER_LEVEL; + *trig = INTR_TRIGGER_LEVEL; else panic( "Invalid trigger %s: must be 'edge' or 'level'", buf); printf("MADT: Forcing SCI to %s trigger\n", - trig == INTR_TRIGGER_EDGE ? "edge" : "level"); + *trig == INTR_TRIGGER_EDGE ? "edge" : "level"); } if (getenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { if (tolower(buf[0]) == 'h') - pol = INTR_POLARITY_HIGH; + *pol = INTR_POLARITY_HIGH; else if (tolower(buf[0]) == 'l') - pol = INTR_POLARITY_LOW; + *pol = INTR_POLARITY_LOW; else panic( "Invalid polarity %s: must be 'high' or 'low'", buf); printf("MADT: Forcing SCI to active %s polarity\n", - pol == INTR_POLARITY_HIGH ? "high" : "low"); + *pol == INTR_POLARITY_HIGH ? "high" : "low"); } } +} + +/* + * Parse an interrupt source override for an ISA interrupt. + */ +static void +madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr) +{ + void *new_ioapic, *old_ioapic; + u_int new_pin, old_pin; + enum intr_trigger trig; + enum intr_polarity pol; + + if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 && + intr->GlobalIrq == 2) { + if (bootverbose) + printf("MADT: Skipping timer override\n"); + return; + } + + if (madt_find_interrupt(intr->GlobalIrq, &new_ioapic, &new_pin) != 0) { + printf("MADT: Could not find APIC for vector %u (IRQ %u)\n", + intr->GlobalIrq, intr->SourceIrq); + return; + } + + madt_parse_interrupt_values(intr, &trig, &pol); /* Remap the IRQ if it is mapped to a different interrupt vector. */ if (intr->SourceIrq != intr->GlobalIrq) { Modified: head/sys/x86/include/acpica_machdep.h ============================================================================== --- head/sys/x86/include/acpica_machdep.h Mon Aug 4 08:56:20 2014 (r269511) +++ head/sys/x86/include/acpica_machdep.h Mon Aug 4 08:58:50 2014 (r269512) @@ -69,11 +69,18 @@ int acpi_release_global_lock(volatile ui (Acq) = acpi_release_global_lock(&((GLptr)->GlobalLock)); \ } while (0) +enum intr_trigger; +enum intr_polarity; + void acpi_SetDefaultIntrModel(int model); void acpi_cpu_c1(void); void *acpi_map_table(vm_paddr_t pa, const char *sig); void acpi_unmap_table(void *table); vm_paddr_t acpi_find_table(const char *sig); +void madt_parse_interrupt_values(void *entry, + enum intr_trigger *trig, enum intr_polarity *pol); + +extern int madt_found_sci_override; #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 09:01:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB7DACDF for ; Mon, 4 Aug 2014 09:01:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB74128E4 for ; Mon, 4 Aug 2014 09:01:21 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5c9d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 09:01:21 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 09:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269513 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4be1.5c9d.ebc9dd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 09:01:21 -0000 Author: royger Date: Mon Aug 4 09:01:21 2014 New Revision: 269513 URL: http://svnweb.freebsd.org/changeset/base/269513 Log: xen: implement support for mapping IO APIC interrupts on Xen Allow a privileged Xen guest (Dom0) to parse the MADT ACPI interrupt overrides and register them with the interrupt subsystem. Also add a Xen specific implementation for bus_config_intr that registers interrupts on demand for all the vectors less than FIRST_MSI_INT. Sponsored by: Citrix Systems R&D x86/xen/pvcpu_enum.c: - Use helper functions from x86/acpica/madt.c in order to parse interrupt overrides from the MADT. - Walk the MADT and register any interrupt override with the interrupt subsystem. x86/xen/xen_nexus.c: - Add a custom bus_config_intr method for Xen that intercepts calls to configure unset interrupts and registers them on the fly (if the vector is < FIRST_MSI_INT). Modified: head/sys/x86/xen/pvcpu_enum.c head/sys/x86/xen/xen_nexus.c Modified: head/sys/x86/xen/pvcpu_enum.c ============================================================================== --- head/sys/x86/xen/pvcpu_enum.c Mon Aug 4 08:58:50 2014 (r269512) +++ head/sys/x86/xen/pvcpu_enum.c Mon Aug 4 09:01:21 2014 (r269513) @@ -44,15 +44,25 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include + +#include + static int xenpv_probe(void); static int xenpv_probe_cpus(void); static int xenpv_setup_local(void); static int xenpv_setup_io(void); +static ACPI_TABLE_MADT *madt; +static vm_paddr_t madt_physaddr; +static vm_offset_t madt_length; + static struct apic_enumerator xenpv_enumerator = { "Xen PV", xenpv_probe, @@ -61,6 +71,55 @@ static struct apic_enumerator xenpv_enum xenpv_setup_io }; +/*--------------------- Helper functions to parse MADT -----------------------*/ + +/* + * Parse an interrupt source override for an ISA interrupt. + */ +static void +madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr) +{ + enum intr_trigger trig; + enum intr_polarity pol; + + if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 && + intr->GlobalIrq == 2) { + if (bootverbose) + printf("MADT: Skipping timer override\n"); + return; + } + + madt_parse_interrupt_values(intr, &trig, &pol); + + /* Register the IRQ with the polarity and trigger mode found. */ + xen_register_pirq(intr->GlobalIrq, trig, pol); +} + +/* + * Call the handler routine for each entry in the MADT table. + */ +static void +madt_walk_table(acpi_subtable_handler *handler, void *arg) +{ + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + handler, arg); +} + +/* + * Parse interrupt entries. + */ +static void +madt_parse_ints(ACPI_SUBTABLE_HEADER *entry, void *arg __unused) +{ + + if (entry->Type == ACPI_MADT_TYPE_INTERRUPT_OVERRIDE) + madt_parse_interrupt_override( + (ACPI_MADT_INTERRUPT_OVERRIDE *)entry); +} + +/*---------------------------- Xen PV enumerator -----------------------------*/ + /* * This enumerator will only be registered on PVH */ @@ -105,6 +164,40 @@ xenpv_setup_local(void) static int xenpv_setup_io(void) { + + if (xen_initial_domain()) { + int i; + + /* Map MADT */ + madt_physaddr = acpi_find_table(ACPI_SIG_MADT); + madt = acpi_map_table(madt_physaddr, ACPI_SIG_MADT); + madt_length = madt->Header.Length; + + /* Try to initialize ACPI so that we can access the FADT. */ + i = acpi_Startup(); + if (ACPI_FAILURE(i)) { + printf("MADT: ACPI Startup failed with %s\n", + AcpiFormatException(i)); + printf("Try disabling either ACPI or apic support.\n"); + panic("Using MADT but ACPI doesn't work"); + } + + /* Run through the table to see if there are any overrides. */ + madt_walk_table(madt_parse_ints, NULL); + + /* + * If there was not an explicit override entry for the SCI, + * force it to use level trigger and active-low polarity. + */ + if (!madt_found_sci_override) { + printf( + "MADT: Forcing active-low polarity and level trigger for SCI\n"); + xen_register_pirq(AcpiGbl_FADT.SciInterrupt, + INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); + } + + acpi_SetDefaultIntrModel(ACPI_INTR_APIC); + } return (0); } Modified: head/sys/x86/xen/xen_nexus.c ============================================================================== --- head/sys/x86/xen/xen_nexus.c Mon Aug 4 08:58:50 2014 (r269512) +++ head/sys/x86/xen/xen_nexus.c Mon Aug 4 09:01:21 2014 (r269513) @@ -36,8 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include /* * Xen nexus(4) driver. @@ -63,11 +65,33 @@ nexus_xen_attach(device_t dev) return (0); } +static int +nexus_xen_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + int ret; + + /* + * ISA and PCI intline IRQs are not preregistered on Xen, so + * intercept calls to configure those and register them on the fly. + */ + if ((irq < FIRST_MSI_INT) && (intr_lookup_source(irq) == NULL)) { + ret = xen_register_pirq(irq, trig, pol); + if (ret != 0) + return (ret); + nexus_add_irq(irq); + } + return (intr_config_intr(irq, trig, pol)); +} + static device_method_t nexus_xen_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_xen_probe), DEVMETHOD(device_attach, nexus_xen_attach), + /* INTR */ + DEVMETHOD(bus_config_intr, nexus_xen_config_intr), + { 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 09:02:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF353E56 for ; Mon, 4 Aug 2014 09:02:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 806BC28FD for ; Mon, 4 Aug 2014 09:02:49 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5feb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 09:02:49 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 09:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269514 - head/sys/dev/xen/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4c39.5feb.53a075b7@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 09:02:49 -0000 Author: royger Date: Mon Aug 4 09:02:49 2014 New Revision: 269514 URL: http://svnweb.freebsd.org/changeset/base/269514 Log: xen: Dom0 console fixes Minor fixes to make the Xen Dom0 console work. This includes always returning there's pending input in xencons_has_input, because on Dom0 there's no shared ring and we cannot test the indexes. The second fix is to use the CONSOLEIO_read hypercall in order to read input data from the Xen console. Sponsored by: Citrix Systems R&D dev/xen/console/xencons_ring.c: - Always return true in xencons_has_input for Dom0. - Implement Dom0 console support for xencons_handle_input. Modified: head/sys/dev/xen/console/xencons_ring.c Modified: head/sys/dev/xen/console/xencons_ring.c ============================================================================== --- head/sys/dev/xen/console/xencons_ring.c Mon Aug 4 09:01:21 2014 (r269513) +++ head/sys/dev/xen/console/xencons_ring.c Mon Aug 4 09:02:49 2014 (r269514) @@ -35,6 +35,7 @@ xen_intr_handle_t console_handle; extern struct mtx cn_mtx; extern device_t xencons_dev; extern bool cnsl_evt_reg; +#define DOM0_BUFFER_SIZE 16 static inline struct xencons_interface * xencons_interface(void) @@ -48,6 +49,18 @@ xencons_has_input(void) { struct xencons_interface *intf; + if (xen_initial_domain()) { + /* + * Since the Dom0 console works with hypercalls + * there's no way to know if there's input unless + * we actually try to retrieve it, so always return + * like there's pending data. Then if the hypercall + * returns no input, we can handle it without problems + * in xencons_handle_input(). + */ + return 1; + } + intf = xencons_interface(); return (intf->in_cons != intf->in_prod); @@ -98,6 +111,19 @@ xencons_handle_input(void *unused) XENCONS_RING_IDX cons, prod; CN_LOCK(cn_mtx); + + if (xen_initial_domain()) { + static char rbuf[DOM0_BUFFER_SIZE]; + int l; + + while ((l = HYPERVISOR_console_io(CONSOLEIO_read, + DOM0_BUFFER_SIZE, rbuf)) > 0) + xencons_rx(rbuf, l); + + CN_UNLOCK(cn_mtx); + return; + } + intf = xencons_interface(); cons = intf->in_cons; From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 09:05:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BBF3157 for ; Mon, 4 Aug 2014 09:05:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07F212922 for ; Mon, 4 Aug 2014 09:05:30 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5042 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 09:05:29 +0000 From: Roger Pau Monné Date: Mon, 4 Aug 2014 09:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269515 - in head/sys: dev/acpica x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53df4cd9.5042.238e5275@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 09:05:30 -0000 Author: royger Date: Mon Aug 4 09:05:28 2014 New Revision: 269515 URL: http://svnweb.freebsd.org/changeset/base/269515 Log: xen: add ACPI bus to xen_nexus when running as Dom0 Also disable a couple of ACPI devices that are not usable under Dom0. To this end a couple of booleans are added that allow disabling ACPI specific devices. Sponsored by: Citrix Systems R&D Reviewed by: jhb x86/xen/xen_nexus.c: - Return BUS_PROBE_SPECIFIC in the Xen Nexus attachement routine to force the usage of the Xen Nexus. - Attach the ACPI bus when running as Dom0. dev/acpica/acpi_cpu.c: dev/acpica/acpi_hpet.c: dev/acpica/acpi_timer.c - Add a variable that gates the addition of the devices. x86/include/init.h: - Declare variables that control the attachment of ACPI cpu, hpet and timer devices. Modified: head/sys/dev/acpica/acpi_cpu.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_timer.c head/sys/x86/include/init.h head/sys/x86/xen/xen_nexus.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Mon Aug 4 09:02:49 2014 (r269514) +++ head/sys/dev/acpica/acpi_cpu.c Mon Aug 4 09:05:28 2014 (r269515) @@ -133,6 +133,9 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_un &cpu_unordered, 0, "Do not use the MADT to match ACPI Processor objects to CPUs."); +/* Knob to disable acpi_cpu devices */ +bool acpi_cpu_disabled = false; + /* Platform hardware resource information. */ static uint32_t cpu_smi_cmd; /* Value to write to SMI_CMD. */ static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ @@ -220,7 +223,8 @@ acpi_cpu_probe(device_t dev) ACPI_OBJECT *obj; ACPI_STATUS status; - if (acpi_disabled("cpu") || acpi_get_type(dev) != ACPI_TYPE_PROCESSOR) + if (acpi_disabled("cpu") || acpi_get_type(dev) != ACPI_TYPE_PROCESSOR || + acpi_cpu_disabled) return (ENXIO); handle = acpi_get_handle(dev); Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Mon Aug 4 09:02:49 2014 (r269514) +++ head/sys/dev/acpica/acpi_hpet.c Mon Aug 4 09:05:28 2014 (r269515) @@ -113,6 +113,9 @@ static void hpet_test(struct hpet_softc static char *hpet_ids[] = { "PNP0103", NULL }; +/* Knob to disable acpi_hpet device */ +bool acpi_hpet_disabled = false; + static u_int hpet_get_timecount(struct timecounter *tc) { @@ -360,7 +363,7 @@ hpet_probe(device_t dev) { ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); - if (acpi_disabled("hpet")) + if (acpi_disabled("hpet") || acpi_hpet_disabled) return (ENXIO); if (acpi_get_handle(dev) != NULL && ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL) Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Mon Aug 4 09:02:49 2014 (r269514) +++ head/sys/dev/acpica/acpi_timer.c Mon Aug 4 09:05:28 2014 (r269515) @@ -65,6 +65,9 @@ static eventhandler_tag acpi_timer_eh; static u_int acpi_timer_frequency = 14318182 / 4; +/* Knob to disable acpi_timer device */ +bool acpi_timer_disabled = false; + static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); static int acpi_timer_attach(device_t dev); @@ -125,7 +128,7 @@ acpi_timer_identify(driver_t *driver, de ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("timer") || (acpi_quirks & ACPI_Q_TIMER) || - acpi_timer_dev) + acpi_timer_dev || acpi_timer_disabled) return_VOID; if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Mon Aug 4 09:02:49 2014 (r269514) +++ head/sys/x86/include/init.h Mon Aug 4 09:05:28 2014 (r269515) @@ -45,4 +45,13 @@ struct init_ops { extern struct init_ops init_ops; +/* Knob to disable acpi_cpu devices */ +extern bool acpi_cpu_disabled; + +/* Knob to disable acpi_hpet device */ +extern bool acpi_hpet_disabled; + +/* Knob to disable acpi_timer device */ +extern bool acpi_timer_disabled; + #endif /* __X86_INIT_H__ */ Modified: head/sys/x86/xen/xen_nexus.c ============================================================================== --- head/sys/x86/xen/xen_nexus.c Mon Aug 4 09:02:49 2014 (r269514) +++ head/sys/x86/xen/xen_nexus.c Mon Aug 4 09:05:28 2014 (r269515) @@ -35,6 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include + +#include #include #include @@ -51,18 +56,40 @@ nexus_xen_probe(device_t dev) if (!xen_pv_domain()) return (ENXIO); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_SPECIFIC); } static int nexus_xen_attach(device_t dev) { + int error; +#ifndef XEN + device_t acpi_dev; +#endif nexus_init_resources(); bus_generic_probe(dev); - bus_generic_attach(dev); - return (0); +#ifndef XEN + if (xen_initial_domain()) { + /* Disable some ACPI devices that are not usable by Dom0 */ + acpi_cpu_disabled = true; + acpi_hpet_disabled = true; + acpi_timer_disabled = true; + + acpi_dev = BUS_ADD_CHILD(dev, 10, "acpi", 0); + if (acpi_dev == NULL) + panic("Unable to add ACPI bus to Xen Dom0"); + } +#endif + + error = bus_generic_attach(dev); +#ifndef XEN + if (xen_initial_domain() && (error == 0)) + acpi_install_wakeup_handler(device_get_softc(acpi_dev)); +#endif + + return (error); } static int From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 09:24:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B842793E; Mon, 4 Aug 2014 09:24:04 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 795652BA7; Mon, 4 Aug 2014 09:24:04 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 068A478D955; Mon, 4 Aug 2014 19:23:55 +1000 (EST) Date: Mon, 4 Aug 2014 19:23:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper Subject: Re: svn commit: r269505 - head/libexec/rtld-elf/tests/target In-Reply-To: <53df1ed9.5830.34b38bca@svn.freebsd.org> Message-ID: <20140804185707.P7764@besplex.bde.org> References: <53df1ed9.5830.34b38bca@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=B4eAjodM c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=tydDgHasiwwA:10 a=6LNvDgAQAgwA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=STB_ahwqhOoAzwSsIzAA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 09:24:04 -0000 On Mon, 4 Aug 2014, Garrett Cooper wrote: > Log: > Move a -L argument from LDADD to LDFLAGS > > Phabric: D525 (part of a larger patch) > > Reviewed by: jmmv > Approved by: jmmv (co-mentor) > > Modified: > head/libexec/rtld-elf/tests/target/Makefile > > Modified: head/libexec/rtld-elf/tests/target/Makefile > ============================================================================== > --- head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:46:10 2014 (r269504) > +++ head/libexec/rtld-elf/tests/target/Makefile Mon Aug 4 05:49:13 2014 (r269505) > @@ -6,7 +6,9 @@ PROG= target > BINDIR= ${TESTSBASE}${TESTSDIR}/libexec/rtld-elf > > CFLAGS+= -I${.CURDIR}/../libpythagoras > -LDADD= -L${.OBJDIR}/../libpythagoras -lpythagoras > + > +LDFLAGS+= -L${.OBJDIR}/../libpythagoras > +LDADD= -lpythagoras > > MAN= I hope this fixes the error found by "make checkdpadd". -L is too hard for the current "make checkdpadd" to handle. Old aout versions worked better using linker support. They also found the correct dependencies (on shared libraries for shared linkage, not the pseudo-dependenci on the hard-coded static librar for shared linkage). "make checkdpadd" currently finds broken 143 makefiles with inconsistent DPADD. 62 of them are for clang. Most of these misuse DPADD for headers. The next largest source of errors is libtermcapw. LIBTERMCAPW is missing in bsd.libnames.mk. This breaks about 29 makefiles where LIBTERMCAP was blindly replaced by LIBTERMCAPW. bsd.libnames.mk and DPADD were unnecessary with the old aout versions. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 16:32:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA0E0288 for ; Mon, 4 Aug 2014 16:32:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7813D2754 for ; Mon, 4 Aug 2014 16:32:09 +0000 (UTC) Received: from smh (uid 1306) (envelope-from smh@FreeBSD.org) id 5ace by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 16:32:08 +0000 From: Steven Hartland Date: Mon, 4 Aug 2014 16:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269522 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfb588.5ace.5a8acca5@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 16:32:09 -0000 Author: smh Date: Mon Aug 4 16:32:08 2014 New Revision: 269522 URL: http://svnweb.freebsd.org/changeset/base/269522 Log: Added support for extra ifconfig args to jail ip4.addr & ip6.addr params This allows for CARP interfaces to be used in jails e.g. ip4.addr = "em0|10.10.1.20/32 vhid 1 pass MyPass advskew 100" Before this change using exec.prestart to configure a CARP address would result in the wrong MAC being broadcast on startup as jail creates IP aliases to support ip[4|6].addr before exec.prestart is executed. PR: 191832 Reviewed by: jamie MFC after: 1 week X-MFC-With: r269340 Phabric: D528 Sponsored by: Multiplay Modified: head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Mon Aug 4 15:36:23 2014 (r269521) +++ head/usr.sbin/jail/command.c Mon Aug 4 16:32:08 2014 (r269522) @@ -268,7 +268,7 @@ run_command(struct cfjail *j) pid_t pid; int argc, bg, clean, consfd, down, fib, i, injail, sjuser, timeout; #if defined(INET) || defined(INET6) - char *addr; + char *addr, *extrap, *p, *val; #endif static char *cleanenv; @@ -317,16 +317,30 @@ run_command(struct cfjail *j) switch (comparam) { #ifdef INET case IP__IP4_IFADDR: - argv = alloca(8 * sizeof(char *)); + argc = 0; + val = alloca(strlen(comstring->s) + 1); + strcpy(val, comstring->s); + cs = val; + extrap = NULL; + while ((p = strchr(cs, ' ')) != NULL && strlen(p) > 1) { + if (extrap == NULL) { + *p = '\0'; + extrap = p + 1; + } + cs = p + 1; + argc++; + } + + argv = alloca((8 + argc) * sizeof(char *)); *(const char **)&argv[0] = _PATH_IFCONFIG; - if ((cs = strchr(comstring->s, '|'))) { - argv[1] = alloca(cs - comstring->s + 1); - strlcpy(argv[1], comstring->s, cs - comstring->s + 1); + if ((cs = strchr(val, '|'))) { + argv[1] = alloca(cs - val + 1); + strlcpy(argv[1], val, cs - val + 1); addr = cs + 1; } else { *(const char **)&argv[1] = string_param(j->intparams[IP_INTERFACE]); - addr = comstring->s; + addr = val; } *(const char **)&argv[2] = "inet"; if (!(cs = strchr(addr, '/'))) { @@ -344,6 +358,15 @@ run_command(struct cfjail *j) argv[3] = addr; argc = 4; } + + if (!down) { + for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { + size_t len = strlen(cs) + 1; + argv[argc] = alloca(len); + strlcpy(argv[argc++], cs, len); + } + } + *(const char **)&argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; break; @@ -351,16 +374,30 @@ run_command(struct cfjail *j) #ifdef INET6 case IP__IP6_IFADDR: - argv = alloca(8 * sizeof(char *)); + argc = 0; + val = alloca(strlen(comstring->s) + 1); + strcpy(val, comstring->s); + cs = val; + extrap = NULL; + while ((p = strchr(cs, ' ')) != NULL && strlen(p) > 1) { + if (extrap == NULL) { + *p = '\0'; + extrap = p + 1; + } + cs = p + 1; + argc++; + } + + argv = alloca((8 + argc) * sizeof(char *)); *(const char **)&argv[0] = _PATH_IFCONFIG; - if ((cs = strchr(comstring->s, '|'))) { - argv[1] = alloca(cs - comstring->s + 1); - strlcpy(argv[1], comstring->s, cs - comstring->s + 1); + if ((cs = strchr(val, '|'))) { + argv[1] = alloca(cs - val + 1); + strlcpy(argv[1], val, cs - val + 1); addr = cs + 1; } else { *(const char **)&argv[1] = string_param(j->intparams[IP_INTERFACE]); - addr = comstring->s; + addr = val; } *(const char **)&argv[2] = "inet6"; argv[3] = addr; @@ -370,6 +407,15 @@ run_command(struct cfjail *j) argc = 6; } else argc = 4; + + if (!down) { + for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { + size_t len = strlen(cs) + 1; + argv[argc] = alloca(len); + strlcpy(argv[argc++], cs, len); + } + } + *(const char **)&argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; break; Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Mon Aug 4 15:36:23 2014 (r269521) +++ head/usr.sbin/jail/config.c Mon Aug 4 16:32:08 2014 (r269522) @@ -576,7 +576,9 @@ check_intparams(struct cfjail *j) /* * IP addresses may include an interface to set that address on, - * and a netmask/suffix for that address. + * a netmask/suffix for that address and options for ifconfig. + * These are copied to an internal command parameter and then stripped + * so they won't be passed on to jailparam_set. */ defif = string_param(j->intparams[IP_INTERFACE]) != NULL; #ifdef INET @@ -601,6 +603,10 @@ check_intparams(struct cfjail *j) *cs = '\0'; s->len = cs - s->s; } + if ((cs = strchr(s->s, ' ')) != NULL) { + *cs = '\0'; + s->len = cs - s->s; + } } } #endif @@ -625,6 +631,10 @@ check_intparams(struct cfjail *j) *cs = '\0'; s->len = cs - s->s; } + if ((cs = strchr(s->s, ' ')) != NULL) { + *cs = '\0'; + s->len = cs - s->s; + } } } #endif Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Mon Aug 4 15:36:23 2014 (r269521) +++ head/usr.sbin/jail/jail.8 Mon Aug 4 16:32:08 2014 (r269522) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2014 +.Dd August 4, 2014 .Dt JAIL 8 .Os .Sh NAME @@ -687,18 +687,24 @@ jail is created, and will be removed fro jail is removed. .It Va ip4.addr In addition to the IP addresses that are passed to the kernel, an -interface and/or a netmask may also be specified, in the form -.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . +interface, netmask and additional paramters (as supported by +.Xr ifconfig 8 Ns ) +may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask param ... . If an interface is given before the IP address, an alias for the address will be added to that interface, as it is with the .Va interface parameter. If a netmask in either dotted-quad or CIDR form is given after an IP address, it will be used when adding the IP alias. +If additional parameters are specified then they will also be used when +adding the IP alias. .It Va ip6.addr In addition to the IP addresses that are passed to the kernel, -an interface and/or a prefix may also be specified, in the form -.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . +an interface, prefix and additional parameters (as supported by +.Xr ifconfig 8 Ns ) +may also be specified, in the form +.Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix param ... . .It Va vnet.interface A network interface to give to a vnet-enabled jail after is it created. The interface will automatically be released when the jail is removed. @@ -1177,6 +1183,7 @@ environment of the first jail. .Xr pkill 1 , .Xr ps 1 , .Xr quota 1 , +.Xr ifconfig 8 , .Xr jail_set 2 , .Xr devfs 5 , .Xr fdescfs 5 , From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 16:41:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8199A763 for ; Mon, 4 Aug 2014 16:41:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51B452873 for ; Mon, 4 Aug 2014 16:41:07 +0000 (UTC) Received: from pfg (uid 1275) (envelope-from pfg@FreeBSD.org) id 5e19 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 16:41:07 +0000 From: Pedro F. Giffuni Date: Mon, 4 Aug 2014 16:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269523 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfb7a3.5e19.37746e44@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 16:41:07 -0000 Author: pfg Date: Mon Aug 4 16:41:06 2014 New Revision: 269523 URL: http://svnweb.freebsd.org/changeset/base/269523 Log: set EXT2_LINK_MAX to LINK_MAX In linux EXT4_LINK_MAX is now 64000. We can't really do that since i_nlink and va_nlink are signed so setting higher values is likely to cause trouble. This is a system limitation so set the EXT_LINK_MAX to what the system can handle. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_dir.h Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:32:08 2014 (r269522) +++ head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:41:06 2014 (r269523) @@ -72,7 +72,7 @@ struct ext2fs_direct_2 { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 +#define EXT2_LINK_MAX LINK_MAX /* * Ext2 directory file types. Only the low 3 bits are used. The From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 17:24:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDF7F6C1; Mon, 4 Aug 2014 17:24:47 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E14E2FC3; Mon, 4 Aug 2014 17:24:47 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id p10so9990047pdj.36 for ; Mon, 04 Aug 2014 10:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=nCMg5ZZpAb9KnUWcYaaYHKPT6Ay8NIam0ivtTUBKgwo=; b=GOKF43wJstschhwbqsyrjeIKAvY2E18rgBO4OhpznAHyp9K3lg+MG7x/UYNLhrO/So uRB00uKrtnUbLTqcpdup3X8Q8oUnOC2GS1kp/2yogzdqZ3qou/KLOnqHwI7Mlaj0ZiNW UQ1NSleZEE/XKphlHpu5V4dwjWXAc57UQusJv3pQ5sHx6Qwg6K0nzImPbjuHV2pxfXKO pjpYd9oti5E7WoeiISY6GIGqeuB+Sz/K2p9JERI0UM+LCoMxDUjwbI/0MenFqbwkyKGh 5WEHHIP8PqDGFt8Fq0tK87qNv03y82k+H1abWBkH1OohvKr+P3haJsqmXvlnuIlMPmen 0kxg== X-Received: by 10.68.113.133 with SMTP id iy5mr3814632pbb.135.1407173087139; Mon, 04 Aug 2014 10:24:47 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:e49e:2d44:7164:e687? ([2601:8:ab80:7d6:e49e:2d44:7164:e687]) by mx.google.com with ESMTPSA id np15sm8478890pdb.84.2014.08.04.10.24.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 10:24:46 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_0E4569D0-C2C9-4728-9A28-BE74818402F9"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269505 - head/libexec/rtld-elf/tests/target From: Garrett Cooper In-Reply-To: <20140804185707.P7764@besplex.bde.org> Date: Mon, 4 Aug 2014 10:24:44 -0700 Message-Id: References: <53df1ed9.5830.34b38bca@svn.freebsd.org> <20140804185707.P7764@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 17:24:47 -0000 --Apple-Mail=_0E4569D0-C2C9-4728-9A28-BE74818402F9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Bruce! On Aug 4, 2014, at 2:23 AM, Bruce Evans wrote: > On Mon, 4 Aug 2014, Garrett Cooper wrote: ... > I hope this fixes the error found by "make checkdpadd". -L is too = hard > for the current "make checkdpadd" to handle. Old aout versions worked > better using linker support. They also found the correct dependencies > (on shared libraries for shared linkage, not the pseudo-dependenci on > the hard-coded static librar for shared linkage). Thank you for the reminder about that make target :). > "make checkdpadd" currently finds broken 143 makefiles with = inconsistent > DPADD. 62 of them are for clang. Most of these misuse DPADD for > headers. The next largest source of errors is libtermcapw. = LIBTERMCAPW > is missing in bsd.libnames.mk. This breaks about 29 makefiles where > LIBTERMCAP was blindly replaced by LIBTERMCAPW. bsd.libnames.mk and > DPADD were unnecessary with the old aout versions. I=92ll file bugs for any issues I find and work with maintainers to fix = the issues. I=92m not sure if you=92re on Phabricator, but I=92d be = happy to add you to the reviews if you would like. Thanks! -Garrett --Apple-Mail=_0E4569D0-C2C9-4728-9A28-BE74818402F9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJT38HcAAoJEMZr5QU6S73eUtYIAJe0JVH2/KnnyuJTHzExxiY9 TlPUYYO22XTW7JWw3tBy8SU8KnU403+5slffJdHYg3WWHh2/DMWCNQs5Rs0Vhobl hWrTTEmOr5Rz6T2wRqiFb7iwra/kMF1Qb4s7DEYxycHFwApCNv0ROhWO+rpD/Bac 9JOo+cMjs8u8lSVpjLtJ5cknzl7opH/WkcFGC7xSIfKOBHYg2owH8K381J+2FMhM 3EK+XYQpI5AM9NcGlwYokU0yFThx4ugWXewR92nU3rl9ABNd0W76K0wXM0Mo4Iuz RqsTtDPmieyb9VFPGeWswNsWKCbdDYU7cijN7llhQ3uDREVPZrUFtICsyUx6yOE= =BwSf -----END PGP SIGNATURE----- --Apple-Mail=_0E4569D0-C2C9-4728-9A28-BE74818402F9-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 18:52:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 535C51E8 for ; Mon, 4 Aug 2014 18:52:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1692929D4 for ; Mon, 4 Aug 2014 18:52:27 +0000 (UTC) Received: from markj (uid 1309) (envelope-from markj@FreeBSD.org) id 5d3f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 18:52:26 +0000 From: Mark Johnston Date: Mon, 4 Aug 2014 18:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269524 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfd66a.5d3f.43006441@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 18:52:27 -0000 Author: markj Date: Mon Aug 4 18:52:26 2014 New Revision: 269524 URL: http://svnweb.freebsd.org/changeset/base/269524 Log: Preserve the errno value of an ioctl before calling free(3). Previously, errno was very occasionally being clobbered, resulting in a bogus error from dt_consume() and thus an error from dtrace(1). MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Mon Aug 4 16:41:06 2014 (r269523) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Mon Aug 4 18:52:26 2014 (r269524) @@ -2944,7 +2944,7 @@ dt_get_buf(dtrace_hdl_t *dtp, int cpu, d { dtrace_optval_t size; dtrace_bufdesc_t *buf = dt_zalloc(dtp, sizeof (*buf)); - int error; + int error, rval; if (buf == NULL) return (-1); @@ -2963,7 +2963,6 @@ dt_get_buf(dtrace_hdl_t *dtp, int cpu, d #else if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &buf) == -1) { #endif - dt_put_buf(dtp, buf); /* * If we failed with ENOENT, it may be because the * CPU was unconfigured -- this is okay. Any other @@ -2971,10 +2970,12 @@ dt_get_buf(dtrace_hdl_t *dtp, int cpu, d */ if (errno == ENOENT) { *bufp = NULL; - return (0); - } + rval = 0; + } else + rval = dt_set_errno(dtp, errno); - return (dt_set_errno(dtp, errno)); + dt_put_buf(dtp, buf); + return (rval); } error = dt_unring_buf(dtp, buf); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c Mon Aug 4 16:41:06 2014 (r269523) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c Mon Aug 4 18:52:26 2014 (r269524) @@ -39,7 +39,7 @@ static int dt_strdata_add(dtrace_hdl_t *dtp, dtrace_recdesc_t *rec, void ***data, int *max) { - int maxformat; + int maxformat, rval; dtrace_fmtdesc_t fmt; void *result; @@ -63,8 +63,9 @@ dt_strdata_add(dtrace_hdl_t *dtp, dtrace return (dt_set_errno(dtp, EDT_NOMEM)); if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) { + rval = dt_set_errno(dtp, errno); free(fmt.dtfd_string); - return (dt_set_errno(dtp, errno)); + return (rval); } while (rec->dtrd_format > (maxformat = *max)) { Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c Mon Aug 4 16:41:06 2014 (r269523) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c Mon Aug 4 18:52:26 2014 (r269524) @@ -184,7 +184,7 @@ dtrace_go(dtrace_hdl_t *dtp) { dtrace_enable_io_t args; void *dof; - int err; + int error, r; if (dtp->dt_active) return (dt_set_errno(dtp, EINVAL)); @@ -206,11 +206,12 @@ dtrace_go(dtrace_hdl_t *dtp) args.dof = dof; args.n_matched = 0; - err = dt_ioctl(dtp, DTRACEIOC_ENABLE, &args); + r = dt_ioctl(dtp, DTRACEIOC_ENABLE, &args); + error = errno; dtrace_dof_destroy(dtp, dof); - if (err == -1 && (errno != ENOTTY || dtp->dt_vector == NULL)) - return (dt_set_errno(dtp, errno)); + if (r == -1 && (error != ENOTTY || dtp->dt_vector == NULL)) + return (dt_set_errno(dtp, error)); if (dt_ioctl(dtp, DTRACEIOC_GO, &dtp->dt_beganon) == -1) { if (errno == EACCES) From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 19:01:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39395675; Mon, 4 Aug 2014 19:01:54 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id F05B12B16; Mon, 4 Aug 2014 19:01:53 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 2C04CD436BE; Tue, 5 Aug 2014 05:01:45 +1000 (EST) Date: Tue, 5 Aug 2014 05:01:39 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r269523 - head/sys/fs/ext2fs In-Reply-To: <53dfb7a3.5e19.37746e44@svn.freebsd.org> Message-ID: <20140805041657.A1066@besplex.bde.org> References: <53dfb7a3.5e19.37746e44@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=4TvIEQ0Y17sA:10 a=LETNmsYq37QA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=7AIIN_0c3wSrVntzkGMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 19:01:54 -0000 On Mon, 4 Aug 2014, Pedro F. Giffuni wrote: > Log: > set EXT2_LINK_MAX to LINK_MAX > > In linux EXT4_LINK_MAX is now 64000. We can't really do that > since i_nlink and va_nlink are signed so setting higher values > is likely to cause trouble. Hmm, va_nlink doesn't use nlink_t and is inconsistent with nlink_t since nlink_t is unsigned. The bug is nlink_t being unsigned. Signed for i_nlink is more reasonable although it is inconsistent with unsigned for e2di_nlink. The implementation might want to use the better arithmetic of signed types. However, it blindly converts from unsigned to signed when converting e2di_nlink to i_nlink, so it overflows for corrupt file systems with e2di_nlink larger than 32767. > This is a system limitation so set the EXT_LINK_MAX to > what the system can handle. > > MFC after: 3 days > > Modified: > head/sys/fs/ext2fs/ext2_dir.h > > Modified: head/sys/fs/ext2fs/ext2_dir.h > ============================================================================== > --- head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:32:08 2014 (r269522) > +++ head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:41:06 2014 (r269523) > @@ -72,7 +72,7 @@ struct ext2fs_direct_2 { > /* > * Maximal count of links to a file > */ > -#define EXT2_LINK_MAX 32000 > +#define EXT2_LINK_MAX LINK_MAX > > /* > * Ext2 directory file types. Only the low 3 bits are used. The This breaks ext2 where the limit is 32000. It allows creating corrupt file systems containing inodes with more than 32000 links. The corruption would be noticed by ext2fs implemenations with a non-broken limit and should be noticed by ext2fsck. The failure modes in the previous version of ext2fs in FreeBSD seem to be limited to operations that increase the link count further (including temporary increases for rename?). Old versions of ext2fs in FreeBSD had the same bug in a worse way. They defined EXT2_LINK_MAX as 32000 but never used it. They used the system LINK_MAX instead. Old versions of linux (2.6.10) have many bugs related to LINK_MAX, but not this one. {LINK_MAX} is variable. Thus LINK_MAX must not be defined in . But it is defined in , with a value of 127 that is too small for most file systems. Many nearby variable limits that must not be defined are defined (the worst one in practice is {OPEN_MAX}. Similarly in FreeBSD, except the LINK_MAX that must not be defined in is defined as large enough for all file systems. Back in linux, nlink_t is uint16_t on some arches including x86, but JFS_LINK_MAX is 0xffffffff. I can't see where pathconf() returns an fs-dependent (or file-dependent) limit. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 19:02:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBF8A7CE for ; Mon, 4 Aug 2014 19:02:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92AF22B1F for ; Mon, 4 Aug 2014 19:02:30 +0000 (UTC) Received: from markj (uid 1309) (envelope-from markj@FreeBSD.org) id 5093 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 19:02:30 +0000 From: Mark Johnston Date: Mon, 4 Aug 2014 19:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269525 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfd8c6.5093.750714e1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 19:02:30 -0000 Author: markj Date: Mon Aug 4 19:02:30 2014 New Revision: 269525 URL: http://svnweb.freebsd.org/changeset/base/269525 Log: Return 0 for the PPID of threads in process 0, as process 0 doesn't have a parent process. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Aug 4 18:52:26 2014 (r269524) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Aug 4 19:02:30 2014 (r269525) @@ -3415,7 +3415,10 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ return ((uint64_t)curthread->t_procp->p_ppid); #else - return ((uint64_t)curproc->p_pptr->p_pid); + if (curproc->p_pid == proc0.p_pid) + return (curproc->p_pid); + else + return (curproc->p_pptr->p_pid); #endif case DIF_VAR_TID: From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 19:42:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD55C4A2 for ; Mon, 4 Aug 2014 19:42:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC2B62091 for ; Mon, 4 Aug 2014 19:42:48 +0000 (UTC) Received: from hiren (uid 1318) (envelope-from hiren@FreeBSD.org) id 5ff1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 19:42:48 +0000 From: Hiren Panchasara Date: Mon, 4 Aug 2014 19:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269526 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfe238.5ff1.218d2d88@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 19:42:48 -0000 Author: hiren Date: Mon Aug 4 19:42:48 2014 New Revision: 269526 URL: http://svnweb.freebsd.org/changeset/base/269526 Log: Add a comment for easier code understanding. Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Mon Aug 4 19:02:30 2014 (r269525) +++ head/sys/netinet/tcp_timewait.c Mon Aug 4 19:42:48 2014 (r269526) @@ -275,6 +275,11 @@ tcp_twstart(struct tcpcb *tp) tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { + /* + * Reached limit on total number of TIMEWAIT connections + * allowed. Remove a connection from TIMEWAIT queue in LRU + * fashion to make room for this connection. + */ tw = tcp_tw_2msl_reuse(); if (tw == NULL) { tp = tcp_close(tp); From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 20:07:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E94478 for ; Mon, 4 Aug 2014 20:07:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C78023F5 for ; Mon, 4 Aug 2014 20:07:38 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 5881 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 20:07:36 +0000 From: Michael Tuexen Date: Mon, 4 Aug 2014 20:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269527 - in head: lib/libc/net sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfe808.5881.578e6c00@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 20:07:38 -0000 Author: tuexen Date: Mon Aug 4 20:07:35 2014 New Revision: 269527 URL: http://svnweb.freebsd.org/changeset/base/269527 Log: Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding sysctl controlling the negotiation of the RE-CONFIG extension. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/lib/libc/net/sctp_sys_calls.c Mon Aug 4 20:07:35 2014 (r269527) @@ -356,6 +356,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; + case SCTP_RECONFIG_SUPPORTED: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; case SCTP_NRSACK_SUPPORTED: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp.h Mon Aug 4 20:07:35 2014 (r269527) @@ -125,6 +125,7 @@ struct sctp_paramhdr { #define SCTP_PR_SUPPORTED 0x00000026 #define SCTP_NRSACK_SUPPORTED 0x00000027 #define SCTP_PKTDROP_SUPPORTED 0x00000028 +#define SCTP_RECONFIG_SUPPORTED 0x00000029 /* * read-only options Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_input.c Mon Aug 4 20:07:35 2014 (r269527) @@ -2787,6 +2787,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; + inp->reconfig_supported = (*inp_p)->reconfig_supported; inp->nrsack_supported = (*inp_p)->nrsack_supported; inp->pktdrop_supported = (*inp_p)->pktdrop_supported; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; @@ -5389,13 +5390,13 @@ process_control_chunks: *offset = length; return (NULL); } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * hmm, peer should have announced this, but * we will turn it on since he is sending us * a stream reset. */ - stcb->asoc.peer_supports_strreset = 1; + stcb->asoc.reconfig_supported = 1; } if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_output.c Mon Aug 4 20:07:35 2014 (r269527) @@ -4820,7 +4820,9 @@ sctp_send_initiate(struct sctp_inpcb *in if (stcb->asoc.pktdrop_supported == 1) { pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; } - pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + if (stcb->asoc.reconfig_supported == 1) { + pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + } if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } @@ -5926,7 +5928,10 @@ do_a_abort: ((asoc == NULL) && (inp->pktdrop_supported == 1))) { pr_supported->chunk_types[num_ext++] = SCTP_PACKET_DROPPED; } - pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + if (((asoc != NULL) && (asoc->reconfig_supported == 1)) || + ((asoc == NULL) && (inp->reconfig_supported == 1))) { + pr_supported->chunk_types[num_ext++] = SCTP_STREAM_RESET; + } if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { pr_supported->chunk_types[num_ext++] = SCTP_AUTHENTICATION; } Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_pcb.c Mon Aug 4 20:07:35 2014 (r269527) @@ -2485,6 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); + inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable); inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable); inp->pktdrop_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pktdrop_enable); /* init the small hash table we use to track asocid <-> tcb */ @@ -6086,6 +6087,7 @@ sctp_load_addresses_from_init(struct sct int got_random = 0, got_hmacs = 0, got_chklist = 0; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; @@ -6116,9 +6118,9 @@ sctp_load_addresses_from_init(struct sct } else { sa = src; } - /* Turn off ECN until we get through all params */ ecn_supported = 0; prsctp_supported = 0; + reconfig_supported = 0; nrsack_supported = 0; pktdrop_supported = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -6458,7 +6460,6 @@ sctp_load_addresses_from_init(struct sct return (-25); } stcb->asoc.peer_supports_asconf = 0; - stcb->asoc.peer_supports_strreset = 0; stcb->asoc.peer_supports_auth = 0; pr_supported = (struct sctp_supported_chunk_types_param *)phdr; num_ent = plen - sizeof(struct sctp_paramhdr); @@ -6478,7 +6479,7 @@ sctp_load_addresses_from_init(struct sct nrsack_supported = 1; break; case SCTP_STREAM_RESET: - stcb->asoc.peer_supports_strreset = 1; + reconfig_supported = 1; break; case SCTP_AUTHENTICATION: stcb->asoc.peer_supports_auth = 1; @@ -6620,6 +6621,7 @@ next_param: } stcb->asoc.ecn_supported &= ecn_supported; stcb->asoc.prsctp_supported &= prsctp_supported; + stcb->asoc.reconfig_supported &= reconfig_supported; stcb->asoc.nrsack_supported &= nrsack_supported; stcb->asoc.pktdrop_supported &= pktdrop_supported; /* validate authentication required parameters */ Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_pcb.h Mon Aug 4 20:07:35 2014 (r269527) @@ -408,6 +408,7 @@ struct sctp_inpcb { uint32_t sctp_cmt_on_off; uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; struct sctp_nonpad_sndrcvinfo def_send; Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_peeloff.c Mon Aug 4 20:07:35 2014 (r269527) @@ -120,6 +120,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; n_inp->ecn_supported = inp->ecn_supported; n_inp->prsctp_supported = inp->prsctp_supported; + n_inp->reconfig_supported = inp->reconfig_supported; n_inp->nrsack_supported = inp->nrsack_supported; n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_structs.h Mon Aug 4 20:07:35 2014 (r269527) @@ -1153,6 +1153,7 @@ struct sctp_association { /* Flags whether an extension is supported or not */ uint8_t ecn_supported; uint8_t prsctp_supported; + uint8_t reconfig_supported; uint8_t nrsack_supported; uint8_t pktdrop_supported; @@ -1163,8 +1164,6 @@ struct sctp_association { uint8_t peer_supports_asconf; /* peer authentication support flag */ uint8_t peer_supports_auth; - /* stream resets are supported by the peer */ - uint8_t peer_supports_strreset; uint8_t local_strreset_support; uint8_t peer_supports_nat; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_sysctl.c Mon Aug 4 20:07:35 2014 (r269527) @@ -55,6 +55,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT; + SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; @@ -602,6 +603,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); @@ -867,6 +869,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_PR_ENABLE_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, reconfig_enable, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_reconfig_enable), 0, sysctl_sctp_check, "IU", + SCTPCTL_RECONFIG_ENABLE_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nrsack_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_NRSACK_ENABLE_DESC); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_sysctl.h Mon Aug 4 20:07:35 2014 (r269527) @@ -46,6 +46,7 @@ struct sctp_sysctl { uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; uint32_t sctp_pr_enable; + uint32_t sctp_reconfig_enable; uint32_t sctp_nrsack_enable; uint32_t sctp_pktdrop_enable; uint32_t sctp_fr_max_burst_default; @@ -161,8 +162,14 @@ struct sctp_sysctl { #define SCTPCTL_PR_ENABLE_MAX 1 #define SCTPCTL_PR_ENABLE_DEFAULT 1 +/* reconfig_enable: Enable SCTP RE-CONFIG */ +#define SCTPCTL_RECONFIG_ENABLE_DESC "Enable SCTP RE-CONFIG" +#define SCTPCTL_RECONFIG_ENABLE_MIN 0 +#define SCTPCTL_RECONFIG_ENABLE_MAX 1 +#define SCTPCTL_RECONFIG_ENABLE_DEFAULT 1 + /* nrsack_enable: Enable NR_SACK */ -#define SCTPCTL_NRSACK_ENABLE_DESC "Enable NR_SACK" +#define SCTPCTL_NRSACK_ENABLE_DESC "Enable SCTP NR-SACK" #define SCTPCTL_NRSACK_ENABLE_MIN 0 #define SCTPCTL_NRSACK_ENABLE_MAX 1 #define SCTPCTL_NRSACK_ENABLE_DEFAULT 0 Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctp_usrreq.c Mon Aug 4 20:07:35 2014 (r269527) @@ -3348,6 +3348,33 @@ flags_out: } break; } + case SCTP_RECONFIG_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.reconfig_supported; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->reconfig_supported; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } case SCTP_NRSACK_SUPPORTED: { struct sctp_assoc_value *av; @@ -4274,7 +4301,7 @@ sctp_setopt(struct socket *so, int optna error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -4341,7 +4368,7 @@ sctp_setopt(struct socket *so, int optna error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -4410,7 +4437,7 @@ sctp_setopt(struct socket *so, int optna error = ENOENT; break; } - if (stcb->asoc.peer_supports_strreset == 0) { + if (stcb->asoc.reconfig_supported == 0) { /* * Peer does not support the chunk type. */ @@ -6023,6 +6050,35 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_RECONFIG_SUPPORTED: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + if (av->assoc_value == 0) { + inp->reconfig_supported = 0; + } else { + inp->reconfig_supported = 1; + } + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } case SCTP_NRSACK_SUPPORTED: { struct sctp_assoc_value *av; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Aug 4 19:42:48 2014 (r269526) +++ head/sys/netinet/sctputil.c Mon Aug 4 20:07:35 2014 (r269527) @@ -906,6 +906,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off; asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; + asoc->reconfig_supported = inp->reconfig_supported; asoc->nrsack_supported = inp->nrsack_supported; asoc->pktdrop_supported = inp->pktdrop_supported; asoc->sctp_cmt_pf = (uint8_t) 0; @@ -2631,7 +2632,7 @@ sctp_notify_assoc_change(uint16_t state, sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; } sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.peer_supports_strreset) { + if (stcb->asoc.reconfig_supported) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; } sac->sac_length += i; From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 20:50:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CAB01000 for ; Mon, 4 Aug 2014 20:50:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5AF2843 for ; Mon, 4 Aug 2014 20:50:47 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 5b15 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 20:50:47 +0000 From: Ian Lepore Date: Mon, 4 Aug 2014 20:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269528 - head/sys/gnu/dts/include/dt-bindings/clock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dff227.5b15.33a42c9b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 20:50:47 -0000 Author: ian Date: Mon Aug 4 20:50:46 2014 New Revision: 269528 URL: http://svnweb.freebsd.org/changeset/base/269528 Log: Bring in the latest standard defines for imx6 clocks referenced in dts files. Added: head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h (contents, props changed) Modified: head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h (contents, props changed) Modified: head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h Mon Aug 4 20:07:35 2014 (r269527) +++ head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h Mon Aug 4 20:50:46 2014 (r269528) @@ -145,6 +145,7 @@ #define IMX6SL_CLK_USDHC4 132 #define IMX6SL_CLK_PLL4_AUDIO_DIV 133 #define IMX6SL_CLK_SPBA 134 -#define IMX6SL_CLK_END 135 +#define IMX6SL_CLK_ENET 135 +#define IMX6SL_CLK_END 136 #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ Added: head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h Mon Aug 4 20:50:46 2014 (r269528) @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2014 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DT_BINDINGS_CLOCK_IMX6SX_H +#define __DT_BINDINGS_CLOCK_IMX6SX_H + +#define IMX6SX_CLK_DUMMY 0 +#define IMX6SX_CLK_CKIL 1 +#define IMX6SX_CLK_CKIH 2 +#define IMX6SX_CLK_OSC 3 +#define IMX6SX_CLK_PLL1_SYS 4 +#define IMX6SX_CLK_PLL2_BUS 5 +#define IMX6SX_CLK_PLL3_USB_OTG 6 +#define IMX6SX_CLK_PLL4_AUDIO 7 +#define IMX6SX_CLK_PLL5_VIDEO 8 +#define IMX6SX_CLK_PLL6_ENET 9 +#define IMX6SX_CLK_PLL7_USB_HOST 10 +#define IMX6SX_CLK_USBPHY1 11 +#define IMX6SX_CLK_USBPHY2 12 +#define IMX6SX_CLK_USBPHY1_GATE 13 +#define IMX6SX_CLK_USBPHY2_GATE 14 +#define IMX6SX_CLK_PCIE_REF 15 +#define IMX6SX_CLK_PCIE_REF_125M 16 +#define IMX6SX_CLK_ENET_REF 17 +#define IMX6SX_CLK_PLL2_PFD0 18 +#define IMX6SX_CLK_PLL2_PFD1 19 +#define IMX6SX_CLK_PLL2_PFD2 20 +#define IMX6SX_CLK_PLL2_PFD3 21 +#define IMX6SX_CLK_PLL3_PFD0 22 +#define IMX6SX_CLK_PLL3_PFD1 23 +#define IMX6SX_CLK_PLL3_PFD2 24 +#define IMX6SX_CLK_PLL3_PFD3 25 +#define IMX6SX_CLK_PLL2_198M 26 +#define IMX6SX_CLK_PLL3_120M 27 +#define IMX6SX_CLK_PLL3_80M 28 +#define IMX6SX_CLK_PLL3_60M 29 +#define IMX6SX_CLK_TWD 30 +#define IMX6SX_CLK_PLL4_POST_DIV 31 +#define IMX6SX_CLK_PLL4_AUDIO_DIV 32 +#define IMX6SX_CLK_PLL5_POST_DIV 33 +#define IMX6SX_CLK_PLL5_VIDEO_DIV 34 +#define IMX6SX_CLK_STEP 35 +#define IMX6SX_CLK_PLL1_SW 36 +#define IMX6SX_CLK_OCRAM_SEL 37 +#define IMX6SX_CLK_PERIPH_PRE 38 +#define IMX6SX_CLK_PERIPH2_PRE 39 +#define IMX6SX_CLK_PERIPH_CLK2_SEL 40 +#define IMX6SX_CLK_PERIPH2_CLK2_SEL 41 +#define IMX6SX_CLK_PCIE_AXI_SEL 42 +#define IMX6SX_CLK_GPU_AXI_SEL 43 +#define IMX6SX_CLK_GPU_CORE_SEL 44 +#define IMX6SX_CLK_EIM_SLOW_SEL 45 +#define IMX6SX_CLK_USDHC1_SEL 46 +#define IMX6SX_CLK_USDHC2_SEL 47 +#define IMX6SX_CLK_USDHC3_SEL 48 +#define IMX6SX_CLK_USDHC4_SEL 49 +#define IMX6SX_CLK_SSI1_SEL 50 +#define IMX6SX_CLK_SSI2_SEL 51 +#define IMX6SX_CLK_SSI3_SEL 52 +#define IMX6SX_CLK_QSPI1_SEL 53 +#define IMX6SX_CLK_PERCLK_SEL 54 +#define IMX6SX_CLK_VID_SEL 55 +#define IMX6SX_CLK_ESAI_SEL 56 +#define IMX6SX_CLK_LDB_DI0_DIV_SEL 57 +#define IMX6SX_CLK_LDB_DI1_DIV_SEL 58 +#define IMX6SX_CLK_CAN_SEL 59 +#define IMX6SX_CLK_UART_SEL 60 +#define IMX6SX_CLK_QSPI2_SEL 61 +#define IMX6SX_CLK_LDB_DI1_SEL 62 +#define IMX6SX_CLK_LDB_DI0_SEL 63 +#define IMX6SX_CLK_SPDIF_SEL 64 +#define IMX6SX_CLK_AUDIO_SEL 65 +#define IMX6SX_CLK_ENET_PRE_SEL 66 +#define IMX6SX_CLK_ENET_SEL 67 +#define IMX6SX_CLK_M4_PRE_SEL 68 +#define IMX6SX_CLK_M4_SEL 69 +#define IMX6SX_CLK_ECSPI_SEL 70 +#define IMX6SX_CLK_LCDIF1_PRE_SEL 71 +#define IMX6SX_CLK_LCDIF2_PRE_SEL 72 +#define IMX6SX_CLK_LCDIF1_SEL 73 +#define IMX6SX_CLK_LCDIF2_SEL 74 +#define IMX6SX_CLK_DISPLAY_SEL 75 +#define IMX6SX_CLK_CSI_SEL 76 +#define IMX6SX_CLK_CKO1_SEL 77 +#define IMX6SX_CLK_CKO2_SEL 78 +#define IMX6SX_CLK_CKO 79 +#define IMX6SX_CLK_PERIPH_CLK2 80 +#define IMX6SX_CLK_PERIPH2_CLK2 81 +#define IMX6SX_CLK_IPG 82 +#define IMX6SX_CLK_GPU_CORE_PODF 83 +#define IMX6SX_CLK_GPU_AXI_PODF 84 +#define IMX6SX_CLK_LCDIF1_PODF 85 +#define IMX6SX_CLK_QSPI1_PODF 86 +#define IMX6SX_CLK_EIM_SLOW_PODF 87 +#define IMX6SX_CLK_LCDIF2_PODF 88 +#define IMX6SX_CLK_PERCLK 89 +#define IMX6SX_CLK_VID_PODF 90 +#define IMX6SX_CLK_CAN_PODF 91 +#define IMX6SX_CLK_USDHC1_PODF 92 +#define IMX6SX_CLK_USDHC2_PODF 93 +#define IMX6SX_CLK_USDHC3_PODF 94 +#define IMX6SX_CLK_USDHC4_PODF 95 +#define IMX6SX_CLK_UART_PODF 96 +#define IMX6SX_CLK_ESAI_PRED 97 +#define IMX6SX_CLK_ESAI_PODF 98 +#define IMX6SX_CLK_SSI3_PRED 99 +#define IMX6SX_CLK_SSI3_PODF 100 +#define IMX6SX_CLK_SSI1_PRED 101 +#define IMX6SX_CLK_SSI1_PODF 102 +#define IMX6SX_CLK_QSPI2_PRED 103 +#define IMX6SX_CLK_QSPI2_PODF 104 +#define IMX6SX_CLK_SSI2_PRED 105 +#define IMX6SX_CLK_SSI2_PODF 106 +#define IMX6SX_CLK_SPDIF_PRED 107 +#define IMX6SX_CLK_SPDIF_PODF 108 +#define IMX6SX_CLK_AUDIO_PRED 109 +#define IMX6SX_CLK_AUDIO_PODF 110 +#define IMX6SX_CLK_ENET_PODF 111 +#define IMX6SX_CLK_M4_PODF 112 +#define IMX6SX_CLK_ECSPI_PODF 113 +#define IMX6SX_CLK_LCDIF1_PRED 114 +#define IMX6SX_CLK_LCDIF2_PRED 115 +#define IMX6SX_CLK_DISPLAY_PODF 116 +#define IMX6SX_CLK_CSI_PODF 117 +#define IMX6SX_CLK_LDB_DI0_DIV_3_5 118 +#define IMX6SX_CLK_LDB_DI0_DIV_7 119 +#define IMX6SX_CLK_LDB_DI1_DIV_3_5 120 +#define IMX6SX_CLK_LDB_DI1_DIV_7 121 +#define IMX6SX_CLK_CKO1_PODF 122 +#define IMX6SX_CLK_CKO2_PODF 123 +#define IMX6SX_CLK_PERIPH 124 +#define IMX6SX_CLK_PERIPH2 125 +#define IMX6SX_CLK_OCRAM 126 +#define IMX6SX_CLK_AHB 127 +#define IMX6SX_CLK_MMDC_PODF 128 +#define IMX6SX_CLK_ARM 129 +#define IMX6SX_CLK_AIPS_TZ1 130 +#define IMX6SX_CLK_AIPS_TZ2 131 +#define IMX6SX_CLK_APBH_DMA 132 +#define IMX6SX_CLK_ASRC_GATE 133 +#define IMX6SX_CLK_CAAM_MEM 134 +#define IMX6SX_CLK_CAAM_ACLK 135 +#define IMX6SX_CLK_CAAM_IPG 136 +#define IMX6SX_CLK_CAN1_IPG 137 +#define IMX6SX_CLK_CAN1_SERIAL 138 +#define IMX6SX_CLK_CAN2_IPG 139 +#define IMX6SX_CLK_CAN2_SERIAL 140 +#define IMX6SX_CLK_CPU_DEBUG 141 +#define IMX6SX_CLK_DCIC1 142 +#define IMX6SX_CLK_DCIC2 143 +#define IMX6SX_CLK_AIPS_TZ3 144 +#define IMX6SX_CLK_ECSPI1 145 +#define IMX6SX_CLK_ECSPI2 146 +#define IMX6SX_CLK_ECSPI3 147 +#define IMX6SX_CLK_ECSPI4 148 +#define IMX6SX_CLK_ECSPI5 149 +#define IMX6SX_CLK_EPIT1 150 +#define IMX6SX_CLK_EPIT2 151 +#define IMX6SX_CLK_ESAI_EXTAL 152 +#define IMX6SX_CLK_WAKEUP 153 +#define IMX6SX_CLK_GPT_BUS 154 +#define IMX6SX_CLK_GPT_SERIAL 155 +#define IMX6SX_CLK_GPU 156 +#define IMX6SX_CLK_OCRAM_S 157 +#define IMX6SX_CLK_CANFD 158 +#define IMX6SX_CLK_CSI 159 +#define IMX6SX_CLK_I2C1 160 +#define IMX6SX_CLK_I2C2 161 +#define IMX6SX_CLK_I2C3 162 +#define IMX6SX_CLK_OCOTP 163 +#define IMX6SX_CLK_IOMUXC 164 +#define IMX6SX_CLK_IPMUX1 165 +#define IMX6SX_CLK_IPMUX2 166 +#define IMX6SX_CLK_IPMUX3 167 +#define IMX6SX_CLK_TZASC1 168 +#define IMX6SX_CLK_LCDIF_APB 169 +#define IMX6SX_CLK_PXP_AXI 170 +#define IMX6SX_CLK_M4 171 +#define IMX6SX_CLK_ENET 172 +#define IMX6SX_CLK_DISPLAY_AXI 173 +#define IMX6SX_CLK_LCDIF2_PIX 174 +#define IMX6SX_CLK_LCDIF1_PIX 175 +#define IMX6SX_CLK_LDB_DI0 176 +#define IMX6SX_CLK_QSPI1 177 +#define IMX6SX_CLK_MLB 178 +#define IMX6SX_CLK_MMDC_P0_FAST 179 +#define IMX6SX_CLK_MMDC_P0_IPG 180 +#define IMX6SX_CLK_AXI 181 +#define IMX6SX_CLK_PCIE_AXI 182 +#define IMX6SX_CLK_QSPI2 183 +#define IMX6SX_CLK_PER1_BCH 184 +#define IMX6SX_CLK_PER2_MAIN 185 +#define IMX6SX_CLK_PWM1 186 +#define IMX6SX_CLK_PWM2 187 +#define IMX6SX_CLK_PWM3 188 +#define IMX6SX_CLK_PWM4 189 +#define IMX6SX_CLK_GPMI_BCH_APB 190 +#define IMX6SX_CLK_GPMI_BCH 191 +#define IMX6SX_CLK_GPMI_IO 192 +#define IMX6SX_CLK_GPMI_APB 193 +#define IMX6SX_CLK_ROM 194 +#define IMX6SX_CLK_SDMA 195 +#define IMX6SX_CLK_SPBA 196 +#define IMX6SX_CLK_SPDIF 197 +#define IMX6SX_CLK_SSI1_IPG 198 +#define IMX6SX_CLK_SSI2_IPG 199 +#define IMX6SX_CLK_SSI3_IPG 200 +#define IMX6SX_CLK_SSI1 201 +#define IMX6SX_CLK_SSI2 202 +#define IMX6SX_CLK_SSI3 203 +#define IMX6SX_CLK_UART_IPG 204 +#define IMX6SX_CLK_UART_SERIAL 205 +#define IMX6SX_CLK_SAI1 206 +#define IMX6SX_CLK_SAI2 207 +#define IMX6SX_CLK_USBOH3 208 +#define IMX6SX_CLK_USDHC1 209 +#define IMX6SX_CLK_USDHC2 210 +#define IMX6SX_CLK_USDHC3 211 +#define IMX6SX_CLK_USDHC4 212 +#define IMX6SX_CLK_EIM_SLOW 213 +#define IMX6SX_CLK_PWM8 214 +#define IMX6SX_CLK_VADC 215 +#define IMX6SX_CLK_GIS 216 +#define IMX6SX_CLK_I2C4 217 +#define IMX6SX_CLK_PWM5 218 +#define IMX6SX_CLK_PWM6 219 +#define IMX6SX_CLK_PWM7 220 +#define IMX6SX_CLK_CKO1 221 +#define IMX6SX_CLK_CKO2 222 +#define IMX6SX_CLK_IPP_DI0 223 +#define IMX6SX_CLK_IPP_DI1 224 +#define IMX6SX_CLK_ENET_AHB 225 +#define IMX6SX_CLK_OCRAM_PODF 226 +#define IMX6SX_CLK_GPT_3M 227 +#define IMX6SX_CLK_ENET_PTP 228 +#define IMX6SX_CLK_ENET_PTP_REF 229 +#define IMX6SX_CLK_ENET2_REF 230 +#define IMX6SX_CLK_ENET2_REF_125M 231 +#define IMX6SX_CLK_AUDIO 232 +#define IMX6SX_CLK_LVDS1_SEL 233 +#define IMX6SX_CLK_LVDS1_OUT 234 +#define IMX6SX_CLK_ASRC_IPG 235 +#define IMX6SX_CLK_ASRC_MEM 236 +#define IMX6SX_CLK_SAI1_IPG 237 +#define IMX6SX_CLK_SAI2_IPG 238 +#define IMX6SX_CLK_ESAI_IPG 239 +#define IMX6SX_CLK_ESAI_MEM 240 +#define IMX6SX_CLK_CLK_END 241 + +#endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */ From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 20:59:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43243444 for ; Mon, 4 Aug 2014 20:59:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B9328AD for ; Mon, 4 Aug 2014 20:59:00 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 5b5d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 20:59:00 +0000 From: John-Mark Gurney Date: Mon, 4 Aug 2014 20:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269529 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dff414.5b5d.21a3da9e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 20:59:00 -0000 Author: jmg Date: Mon Aug 4 20:58:59 2014 New Revision: 269529 URL: http://svnweb.freebsd.org/changeset/base/269529 Log: add xrefs for the other functions... There should be more text in this page talking about each of these links, but at least people know about them now... MFC after: 1 week Modified: head/lib/libc/iconv/iconv.3 Modified: head/lib/libc/iconv/iconv.3 ============================================================================== --- head/lib/libc/iconv/iconv.3 Mon Aug 4 20:50:46 2014 (r269528) +++ head/lib/libc/iconv/iconv.3 Mon Aug 4 20:58:59 2014 (r269529) @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 16, 2010 +.Dd August 4, 2014 .Dt ICONV 3 .Os .Sh NAME @@ -284,6 +284,10 @@ terminates with an incomplete character .El .Sh SEE ALSO .Xr iconv 1 , +.Xr __iconv_get_list 3 , +.Xr iconv_canonicalize 3 , +.Xr iconvctl 3 , +.Xr iconvlist 3 , .Xr mkcsmapper 1 , .Xr mkesdb 1 .Sh STANDARDS From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 21:12:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A686A789 for ; Mon, 4 Aug 2014 21:12:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C8432A89 for ; Mon, 4 Aug 2014 21:12:39 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 52dd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 21:12:39 +0000 From: John-Mark Gurney Date: Mon, 4 Aug 2014 21:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269530 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dff747.52dd.c75c018@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 21:12:39 -0000 Author: jmg Date: Mon Aug 4 21:12:38 2014 New Revision: 269530 URL: http://svnweb.freebsd.org/changeset/base/269530 Log: fix misordering... Obtained from: gjb MFC after: 1 week Modified: head/lib/libc/iconv/iconv.3 Modified: head/lib/libc/iconv/iconv.3 ============================================================================== --- head/lib/libc/iconv/iconv.3 Mon Aug 4 20:58:59 2014 (r269529) +++ head/lib/libc/iconv/iconv.3 Mon Aug 4 21:12:38 2014 (r269530) @@ -284,12 +284,12 @@ terminates with an incomplete character .El .Sh SEE ALSO .Xr iconv 1 , +.Xr mkcsmapper 1 , +.Xr mkesdb 1 , .Xr __iconv_get_list 3 , .Xr iconv_canonicalize 3 , .Xr iconvctl 3 , -.Xr iconvlist 3 , -.Xr mkcsmapper 1 , -.Xr mkesdb 1 +.Xr iconvlist 3 .Sh STANDARDS The .Fn iconv_open , From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 21:32:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B09AC65; Mon, 4 Aug 2014 21:32:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330562E8D; Mon, 4 Aug 2014 21:32:28 +0000 (UTC) Received: from [192.168.1.75] (75-48-77-17.lightspeed.cncrca.sbcglobal.net [75.48.77.17]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BD128B917; Mon, 4 Aug 2014 17:32:25 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269474 - in head: share/man/man4 sys/dev/vt From: John Baldwin In-Reply-To: <53de340e.52ce.7073778e@svn.freebsd.org> Date: Mon, 4 Aug 2014 14:32:23 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <53de340e.52ce.7073778e@svn.freebsd.org> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1878.6) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 04 Aug 2014 17:32:27 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 21:32:28 -0000 On Aug 3, 2014, at 6:07 AM, Aleksandr Rybalko wrote: > Author: ray > Date: Sun Aug 3 13:07:25 2014 > New Revision: 269474 > URL: http://svnweb.freebsd.org/changeset/base/269474 >=20 > Log: > Allow to disable some special key combinations handled by vt(4), like = debug > request, reboot request. >=20 > Requested by: Claude Buisson >=20 > Sponsored by: The FreeBSD Foundation I realize the API uses 'SPCL' as an abbreviation, but for user-facing = things like a sysctl and tunable, I think it might be better to spell it = out as "specialkeys" instead? --=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:03:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CB17D4B for ; Mon, 4 Aug 2014 22:03:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A31621FF for ; Mon, 4 Aug 2014 22:03:59 +0000 (UTC) Received: from mckusick (uid 740) (envelope-from mckusick@FreeBSD.org) id 554f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:03:58 +0000 From: Kirk McKusick Date: Mon, 4 Aug 2014 22:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269533 - in head/sys: kern ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0034f.554f.4192a68b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:03:59 -0000 Author: mckusick Date: Mon Aug 4 22:03:58 2014 New Revision: 269533 URL: http://svnweb.freebsd.org/changeset/base/269533 Log: Add support for multi-threading of soft updates. Replace a single soft updates thread with a thread per FFS-filesystem mount point. The threads are associated with the bufdaemon process. Reviewed by: kib Tested by: Peter Holm and Scott Long MFC after: 2 weeks Sponsored by: Netflix Modified: head/sys/kern/vfs_bio.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Aug 4 21:41:01 2014 (r269532) +++ head/sys/kern/vfs_bio.c Mon Aug 4 22:03:58 2014 (r269533) @@ -98,7 +98,8 @@ struct buf_ops buf_ops_bio = { struct buf *buf; /* buffer header pool */ caddr_t unmapped_buf; -static struct proc *bufdaemonproc; +/* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ +struct proc *bufdaemonproc; static int inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 4 21:41:01 2014 (r269532) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 4 22:03:58 2014 (r269533) @@ -908,9 +908,9 @@ static void add_to_worklist(struct workl static void wake_worklist(struct worklist *); static void wait_worklist(struct worklist *, char *); static void remove_from_worklist(struct worklist *); -static void softdep_flush(void); +static void softdep_flush(void *); static void softdep_flushjournal(struct mount *); -static int softdep_speedup(void); +static int softdep_speedup(struct ufsmount *); static void worklist_speedup(struct mount *); static int journal_mount(struct mount *, struct fs *, struct ucred *); static void journal_unmount(struct ufsmount *); @@ -962,18 +962,21 @@ static int softdep_count_dependencies(st /* * Global lock over all of soft updates. */ -static struct rwlock lk; -RW_SYSINIT(softdep_lock, &lk, "Softdep Lock"); +static struct mtx lk; +MTX_SYSINIT(softdep_lock, &lk, "Global Softdep Lock", MTX_DEF); + +#define ACQUIRE_GBLLOCK(lk) mtx_lock(lk) +#define FREE_GBLLOCK(lk) mtx_unlock(lk) +#define GBLLOCK_OWNED(lk) mtx_assert((lk), MA_OWNED) /* - * Allow per-filesystem soft-updates locking. - * For now all use the same global lock defined above. + * Per-filesystem soft-updates locking. */ -#define LOCK_PTR(ump) ((ump)->um_softdep->sd_fslock) -#define TRY_ACQUIRE_LOCK(ump) rw_try_wlock((ump)->um_softdep->sd_fslock) -#define ACQUIRE_LOCK(ump) rw_wlock((ump)->um_softdep->sd_fslock) -#define FREE_LOCK(ump) rw_wunlock((ump)->um_softdep->sd_fslock) -#define LOCK_OWNED(ump) rw_assert((ump)->um_softdep->sd_fslock, \ +#define LOCK_PTR(ump) (&(ump)->um_softdep->sd_fslock) +#define TRY_ACQUIRE_LOCK(ump) rw_try_wlock(&(ump)->um_softdep->sd_fslock) +#define ACQUIRE_LOCK(ump) rw_wlock(&(ump)->um_softdep->sd_fslock) +#define FREE_LOCK(ump) rw_wunlock(&(ump)->um_softdep->sd_fslock) +#define LOCK_OWNED(ump) rw_assert(&(ump)->um_softdep->sd_fslock, \ RA_WLOCKED) #define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) @@ -1178,7 +1181,7 @@ workitem_free(item, type) KASSERT(ump->softdep_curdeps[item->wk_type] > 0, ("workitem_free: %s: softdep_curdeps[%s] going negative", ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); - dep_current[item->wk_type]--; + atomic_subtract_long(&dep_current[item->wk_type], 1); ump->softdep_curdeps[item->wk_type] -= 1; free(item, DtoM(type)); } @@ -1196,11 +1199,13 @@ workitem_alloc(item, type, mp) item->wk_state = 0; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(ump); + ACQUIRE_GBLLOCK(&lk); dep_current[type]++; if (dep_current[type] > dep_highuse[type]) dep_highuse[type] = dep_current[type]; dep_total[type]++; + FREE_GBLLOCK(&lk); + ACQUIRE_LOCK(ump); ump->softdep_curdeps[type] += 1; ump->softdep_deps++; ump->softdep_accdeps++; @@ -1224,11 +1229,13 @@ workitem_reassign(item, newtype) KASSERT(dep_current[item->wk_type] > 0, ("workitem_reassign: %s: dep_current[%s] going negative", VFSTOUFS(item->wk_mp)->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); - dep_current[item->wk_type]--; + ACQUIRE_GBLLOCK(&lk); dep_current[newtype]++; + dep_current[item->wk_type]--; if (dep_current[newtype] > dep_highuse[newtype]) dep_highuse[newtype] = dep_current[newtype]; dep_total[newtype]++; + FREE_GBLLOCK(&lk); item->wk_type = newtype; } @@ -1236,13 +1243,10 @@ workitem_reassign(item, newtype) * Workitem queue management */ static int max_softdeps; /* maximum number of structs before slowdown */ -static int maxindirdeps = 50; /* max number of indirdeps before slowdown */ static int tickdelay = 2; /* number of ticks to pause during slowdown */ static int proc_waiting; /* tracks whether we have a timeout posted */ static int *stat_countp; /* statistic to count in proc_waiting timeout */ static struct callout softdep_callout; -static struct mount *req_pending; -#define ALLCLEAN ((struct mount *)-1) static int req_clear_inodedeps; /* syncer process flush some inodedeps */ static int req_clear_remove; /* syncer process flush some freeblks */ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ @@ -1250,7 +1254,7 @@ static int softdep_flushcache = 0; /* Sh /* * runtime statistics */ -static int stat_softdep_mounts; /* number of softdep mounted filesystems */ +static int stat_flush_threads; /* number of softdep flushing threads */ static int stat_worklist_push; /* number of worklist cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ @@ -1281,10 +1285,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, max &max_softdeps, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, tickdelay, CTLFLAG_RW, &tickdelay, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, maxindirdeps, CTLFLAG_RW, - &maxindirdeps, 0, ""); -SYSCTL_INT(_debug_softdep, OID_AUTO, softdep_mounts, CTLFLAG_RD, - &stat_softdep_mounts, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, + &stat_flush_threads, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW, &stat_worklist_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW, @@ -1344,53 +1346,67 @@ SYSCTL_DECL(_vfs_ffs); static int compute_summary_at_mount = 0; SYSCTL_INT(_vfs_ffs, OID_AUTO, compute_summary_at_mount, CTLFLAG_RW, &compute_summary_at_mount, 0, "Recompute summary at mount"); -static struct proc *softdepproc; -static struct kproc_desc softdep_kp = { - "softdepflush", - softdep_flush, - &softdepproc -}; -SYSINIT(sdproc, SI_SUB_KTHREAD_UPDATE, SI_ORDER_ANY, kproc_start, - &softdep_kp); - +static int print_threads = 0; +SYSCTL_INT(_debug_softdep, OID_AUTO, print_threads, CTLFLAG_RW, + &print_threads, 0, "Notify flusher thread start/stop"); + +/* List of all filesystems mounted with soft updates */ +static TAILQ_HEAD(, mount_softdeps) softdepmounts; + +/* + * This function cleans the worklist for a filesystem. + * Each filesystem running with soft dependencies gets its own + * thread to run in this function. The thread is started up in + * softdep_mount and shutdown in softdep_unmount. They show up + * as part of the kernel "bufdaemon" process whose process + * entry is available in bufdaemonproc. + */ +static int searchfailed; +extern struct proc *bufdaemonproc; static void -softdep_flush(void) +softdep_flush(addr) + void *addr; { - struct mount *nmp; struct mount *mp; - struct ufsmount *ump; struct thread *td; - int remaining; - int progress; + struct ufsmount *ump; td = curthread; td->td_pflags |= TDP_NORUNNINGBUF; - + mp = (struct mount *)addr; + ump = VFSTOUFS(mp); + atomic_add_int(&stat_flush_threads, 1); + if (print_threads) { + if (stat_flush_threads == 1) + printf("Running %s at pid %d\n", bufdaemonproc->p_comm, + bufdaemonproc->p_pid); + printf("Start thread %s\n", td->td_name); + } for (;;) { - kproc_suspend_check(softdepproc); - remaining = progress = 0; - mtx_lock(&mountlist_mtx); - for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { - nmp = TAILQ_NEXT(mp, mnt_list); - if (MOUNTEDSOFTDEP(mp) == 0) - continue; - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) - continue; - ump = VFSTOUFS(mp); - progress += softdep_process_worklist(mp, 0); - remaining += ump->softdep_on_worklist; - mtx_lock(&mountlist_mtx); - nmp = TAILQ_NEXT(mp, mnt_list); - vfs_unbusy(mp); - } - mtx_unlock(&mountlist_mtx); - if (remaining && progress) + while (softdep_process_worklist(mp, 0) > 0 || + (MOUNTEDSUJ(mp) && + VFSTOUFS(mp)->softdep_jblocks->jb_suspended)) + kthread_suspend_check(); + ACQUIRE_LOCK(ump); + if ((ump->softdep_flags & FLUSH_CLEANUP) == 0) + msleep(&ump->softdep_flushtd, LOCK_PTR(ump), PVM, + "sdflush", hz / 2); + ump->softdep_flags &= ~FLUSH_CLEANUP; + /* + * Check to see if we are done and need to exit. + */ + if ((ump->softdep_flags & FLUSH_EXIT) == 0) { + FREE_LOCK(ump); continue; - rw_wlock(&lk); - if (req_pending == NULL) - msleep(&req_pending, &lk, PVM, "sdflush", hz); - req_pending = NULL; - rw_wunlock(&lk); + } + ump->softdep_flags &= ~FLUSH_EXIT; + FREE_LOCK(ump); + wakeup(&ump->softdep_flags); + if (print_threads) + printf("Stop thread %s: searchfailed %d, did cleanups %d\n", td->td_name, searchfailed, ump->um_softdep->sd_cleanups); + atomic_subtract_int(&stat_flush_threads, 1); + kthread_exit(); + panic("kthread_exit failed\n"); } } @@ -1398,19 +1414,70 @@ static void worklist_speedup(mp) struct mount *mp; { - rw_assert(&lk, RA_WLOCKED); - if (req_pending == 0) { - req_pending = mp; - wakeup(&req_pending); + struct ufsmount *ump; + + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); + if ((ump->softdep_flags & (FLUSH_CLEANUP | FLUSH_EXIT)) == 0) { + ump->softdep_flags |= FLUSH_CLEANUP; + if (ump->softdep_flushtd->td_wchan == &ump->softdep_flushtd) + wakeup(&ump->softdep_flushtd); } } static int -softdep_speedup(void) +softdep_speedup(ump) + struct ufsmount *ump; { + struct ufsmount *altump; + struct mount_softdeps *sdp; - worklist_speedup(ALLCLEAN); + LOCK_OWNED(ump); + worklist_speedup(ump->um_mountp); bd_speedup(); + /* + * If we have global shortages, then we need other + * filesystems to help with the cleanup. Here we wakeup a + * flusher thread for a filesystem that is over its fair + * share of resources. + */ + if (req_clear_inodedeps || req_clear_remove) { + ACQUIRE_GBLLOCK(&lk); + TAILQ_FOREACH(sdp, &softdepmounts, sd_next) { + if ((altump = sdp->sd_ump) == ump) + continue; + if (((req_clear_inodedeps && + altump->softdep_curdeps[D_INODEDEP] > + max_softdeps / stat_flush_threads) || + (req_clear_remove && + altump->softdep_curdeps[D_DIRREM] > + (max_softdeps / 2) / stat_flush_threads)) && + TRY_ACQUIRE_LOCK(altump)) + break; + } + if (sdp == NULL) { + searchfailed++; + FREE_GBLLOCK(&lk); + } else { + /* + * Move to the end of the list so we pick a + * different one on out next try. + */ + TAILQ_REMOVE(&softdepmounts, sdp, sd_next); + TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); + FREE_GBLLOCK(&lk); + if ((altump->softdep_flags & + (FLUSH_CLEANUP | FLUSH_EXIT)) == 0) { + altump->softdep_flags |= FLUSH_CLEANUP; + altump->um_softdep->sd_cleanups++; + if (altump->softdep_flushtd->td_wchan == + &altump->softdep_flushtd) { + wakeup(&altump->softdep_flushtd); + } + } + FREE_LOCK(altump); + } + } return (speedup_syncer()); } @@ -2126,9 +2193,14 @@ inodedep_lookup(mp, inum, flags, inodede if ((flags & DEPALLOC) == 0) return (0); /* - * If we are over our limit, try to improve the situation. - */ - if (dep_current[D_INODEDEP] > max_softdeps && (flags & NODELAY) == 0) + * If the system is over its limit and our filesystem is + * responsible for more than our share of that usage and + * we are not in a rush, request some inodedep cleanup. + */ + while (dep_current[D_INODEDEP] > max_softdeps && + (flags & NODELAY) == 0 && + ump->softdep_curdeps[D_INODEDEP] > + max_softdeps / stat_flush_threads) request_cleanup(mp, FLUSH_INODES); FREE_LOCK(ump); inodedep = malloc(sizeof(struct inodedep), @@ -2320,6 +2392,7 @@ void softdep_initialize() { + TAILQ_INIT(&softdepmounts); max_softdeps = desiredvnodes * 4; /* initialise bioops hack */ @@ -2378,7 +2451,9 @@ softdep_mount(devvp, mp, fs, cred) ump = VFSTOUFS(mp); ump->um_softdep = sdp; MNT_IUNLOCK(mp); - LOCK_PTR(ump) = &lk; + rw_init(LOCK_PTR(ump), "Per-Filesystem Softdep Lock"); + TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next); + sdp->sd_ump = ump; LIST_INIT(&ump->softdep_workitem_pending); LIST_INIT(&ump->softdep_journal_pending); TAILQ_INIT(&ump->softdep_unlinked); @@ -2409,7 +2484,12 @@ softdep_mount(devvp, mp, fs, cred) softdep_unmount(mp); return (error); } - atomic_add_int(&stat_softdep_mounts, 1); + /* + * Start our flushing thread in the bufdaemon process. + */ + kproc_kthread_add(&softdep_flush, mp, &bufdaemonproc, + &ump->softdep_flushtd, 0, 0, "softdepflush", "%s worker", + mp->mnt_stat.f_mntonname); /* * When doing soft updates, the counters in the * superblock may have gotten out of sync. Recomputation @@ -2465,7 +2545,24 @@ softdep_unmount(mp) MNT_IUNLOCK(mp); journal_unmount(ump); } - atomic_subtract_int(&stat_softdep_mounts, 1); + /* + * Shut down our flushing thread. Check for NULL is if + * softdep_mount errors out before the thread has been created. + */ + if (ump->softdep_flushtd != NULL) { + ACQUIRE_LOCK(ump); + ump->softdep_flags |= FLUSH_EXIT; + wakeup(&ump->softdep_flushtd); + msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM | PDROP, + "sdwait", 0); + KASSERT((ump->softdep_flags & FLUSH_EXIT) == 0, + ("Thread shutdown failed")); + } + /* + * Free up our resources. + */ + rw_destroy(LOCK_PTR(ump)); + TAILQ_REMOVE(&softdepmounts, ump->um_softdep, sd_next); hashdestroy(ump->pagedep_hashtbl, M_PAGEDEP, ump->pagedep_hash_size); hashdestroy(ump->inodedep_hashtbl, M_INODEDEP, ump->inodedep_hash_size); hashdestroy(ump->newblk_hashtbl, M_NEWBLK, ump->newblk_hash_size); @@ -2788,7 +2885,7 @@ journal_space(ump, thresh) */ limit = (max_softdeps / 10) * 9; if (dep_current[D_INODEDEP] > limit && - ump->softdep_curdeps[D_INODEDEP] > limit / stat_softdep_mounts) + ump->softdep_curdeps[D_INODEDEP] > limit / stat_flush_threads) return (0); if (thresh) thresh = jblocks->jb_min; @@ -2813,7 +2910,7 @@ journal_suspend(ump) if ((mp->mnt_kern_flag & MNTK_SUSPEND) == 0) { stat_journal_min++; mp->mnt_kern_flag |= MNTK_SUSPEND; - mp->mnt_susp_owner = FIRST_THREAD_IN_PROC(softdepproc); + mp->mnt_susp_owner = ump->softdep_flushtd; } jblocks->jb_suspended = 1; MNT_IUNLOCK(mp); @@ -2888,7 +2985,7 @@ softdep_prealloc(vp, waitok) process_removes(vp); process_truncates(vp); if (journal_space(ump, 0) == 0) { - softdep_speedup(); + softdep_speedup(ump); if (journal_space(ump, 1) == 0) journal_suspend(ump); } @@ -2932,10 +3029,10 @@ softdep_prelink(dvp, vp) } process_removes(dvp); process_truncates(dvp); - softdep_speedup(); + softdep_speedup(ump); process_worklist_item(UFSTOVFS(ump), 2, LK_NOWAIT); if (journal_space(ump, 0) == 0) { - softdep_speedup(); + softdep_speedup(ump); if (journal_space(ump, 1) == 0) journal_suspend(ump); } @@ -3257,7 +3354,7 @@ softdep_process_journal(mp, needwk, flag if (flags != MNT_WAIT) break; printf("softdep: Out of journal space!\n"); - softdep_speedup(); + softdep_speedup(ump); msleep(jblocks, LOCK_PTR(ump), PRIBIO, "jblocks", hz); } FREE_LOCK(ump); @@ -3970,7 +4067,7 @@ free_freedep(freedep) /* * Allocate a new freework structure that may be a level in an indirect * when parent is not NULL or a top level block when it is. The top level - * freework structures are allocated without the soft updates lock held + * freework structures are allocated without the per-filesystem lock held * and before the freeblks is visible outside of softdep_setup_freeblocks(). */ static struct freework * @@ -4039,7 +4136,7 @@ cancel_jfreeblk(freeblks, blkno) /* * Allocate a new jfreeblk to journal top level block pointer when truncating - * a file. The caller must add this to the worklist when the soft updates + * a file. The caller must add this to the worklist when the per-filesystem * lock is held. */ static struct jfreeblk * @@ -7419,7 +7516,7 @@ softdep_freefile(pvp, ino, mode) clear_unlinked_inodedep(inodedep); /* * Re-acquire inodedep as we've dropped the - * soft updates lock in clear_unlinked_inodedep(). + * per-filesystem lock in clear_unlinked_inodedep(). */ inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); } @@ -7965,10 +8062,8 @@ indir_trunc(freework, dbn, lbn) * If we're goingaway, free the indirdep. Otherwise it will * linger until the write completes. */ - if (goingaway) { + if (goingaway) free_indirdep(indirdep); - ump->softdep_numindirdeps -= 1; - } } FREE_LOCK(ump); /* Initialize pointers depending on block size. */ @@ -8140,7 +8235,7 @@ cancel_allocindir(aip, bp, freeblks, tru * Create the mkdir dependencies for . and .. in a new directory. Link them * in to a newdirblk so any subsequent additions are tracked properly. The * caller is responsible for adding the mkdir1 dependency to the journal - * and updating id_mkdiradd. This function returns with the soft updates + * and updating id_mkdiradd. This function returns with the per-filesystem * lock held. */ static struct mkdir * @@ -8958,12 +9053,16 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre panic("newdirrem: whiteout"); dvp = ITOV(dp); /* - * If we are over our limit, try to improve the situation. + * If the system is over its limit and our filesystem is + * responsible for more than our share of that usage and + * we are not a snapshot, request some inodedep cleanup. * Limiting the number of dirrem structures will also limit * the number of freefile and freeblks structures. */ ACQUIRE_LOCK(ip->i_ump); - if (!IS_SNAPSHOT(ip) && dep_current[D_DIRREM] > max_softdeps / 2) + while (!IS_SNAPSHOT(ip) && dep_current[D_DIRREM] > max_softdeps / 2 && + ip->i_ump->softdep_curdeps[D_DIRREM] > + (max_softdeps / 2) / stat_flush_threads) (void) request_cleanup(ITOV(dp)->v_mount, FLUSH_BLOCKS); FREE_LOCK(ip->i_ump); dirrem = malloc(sizeof(struct dirrem), @@ -9914,7 +10013,7 @@ initiate_write_filepage(pagedep, bp) * Wait for all journal remove dependencies to hit the disk. * We can not allow any potentially conflicting directory adds * to be visible before removes and rollback is too difficult. - * The soft updates lock may be dropped and re-acquired, however + * The per-filesystem lock may be dropped and re-acquired, however * we hold the buf locked so the dependency can not go away. */ LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) @@ -10378,7 +10477,6 @@ cancel_indirdep(indirdep, bp, freeblks) LIST_REMOVE(indirdep, ir_next); } indirdep->ir_state |= GOINGAWAY; - VFSTOUFS(indirdep->ir_list.wk_mp)->softdep_numindirdeps += 1; /* * Pass in bp for blocks still have journal writes * pending so we can cancel them on their own. @@ -10805,7 +10903,7 @@ softdep_disk_write_complete(bp) ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { WORKLIST_REMOVE(wk); - dep_write[wk->wk_type]++; + atomic_add_long(&dep_write[wk->wk_type], 1); if (wk == owk) panic("duplicate worklist: %p\n", wk); owk = wk; @@ -11488,7 +11586,7 @@ diradd_inode_written(dap, inodedep) /* * Returns true if the bmsafemap will have rollbacks when written. Must only - * be called with the soft updates lock and the buf lock on the cg held. + * be called with the per-filesystem lock and the buf lock on the cg held. */ static int bmsafemap_backgroundwrite(bmsafemap, bp) @@ -12912,18 +13010,42 @@ softdep_slowdown(vp) if (journal_space(ump, 0) == 0) jlow = 1; } + /* + * If the system is under its limits and our filesystem is + * not responsible for more than our share of the usage and + * we are not low on journal space, then no need to slow down. + */ max_softdeps_hard = max_softdeps * 11 / 10; if (dep_current[D_DIRREM] < max_softdeps_hard / 2 && dep_current[D_INODEDEP] < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->softdep_numindirdeps < maxindirdeps && - dep_current[D_FREEBLKS] < max_softdeps_hard && jlow == 0) { + dep_current[D_INDIRDEP] < max_softdeps_hard / 1000 && + dep_current[D_FREEBLKS] < max_softdeps_hard && jlow == 0 && + ump->softdep_curdeps[D_DIRREM] < + (max_softdeps_hard / 2) / stat_flush_threads && + ump->softdep_curdeps[D_INODEDEP] < + max_softdeps_hard / stat_flush_threads && + ump->softdep_curdeps[D_INDIRDEP] < + (max_softdeps_hard / 1000) / stat_flush_threads && + ump->softdep_curdeps[D_FREEBLKS] < + max_softdeps_hard / stat_flush_threads) { FREE_LOCK(ump); return (0); } - if (VFSTOUFS(vp->v_mount)->softdep_numindirdeps >= maxindirdeps || jlow) - softdep_speedup(); + /* + * If the journal is low or our filesystem is over its limit + * then speedup the cleanup. + */ + if (ump->softdep_curdeps[D_INDIRDEP] < + (max_softdeps_hard / 1000) / stat_flush_threads || jlow) + softdep_speedup(ump); stat_sync_limit_hit += 1; FREE_LOCK(ump); + /* + * We only slow down the rate at which new dependencies are + * generated if we are not using journaling. With journaling, + * the cleanup should always be sufficient to keep things + * under control. + */ if (DOINGSUJ(vp)) return (0); return (1); @@ -12981,13 +13103,12 @@ softdep_request_cleanup(fs, vp, cred, re return (0); } /* - * If we are in need of resources, consider pausing for - * tickdelay to give ourselves some breathing room. + * If we are in need of resources, start by cleaning up + * any block removals associated with our inode. */ ACQUIRE_LOCK(ump); process_removes(vp); process_truncates(vp); - request_cleanup(UFSTOVFS(ump), resource); FREE_LOCK(ump); /* * Now clean up at least as many resources as we will need. @@ -13120,7 +13241,7 @@ request_cleanup(mp, resource) * Next, we attempt to speed up the syncer process. If that * is successful, then we allow the process to continue. */ - if (softdep_speedup() && + if (softdep_speedup(ump) && resource != FLUSH_BLOCKS_WAIT && resource != FLUSH_INODES_WAIT) return(0); @@ -13138,15 +13259,19 @@ request_cleanup(mp, resource) case FLUSH_INODES: case FLUSH_INODES_WAIT: + ACQUIRE_GBLLOCK(&lk); stat_ino_limit_push += 1; req_clear_inodedeps += 1; + FREE_GBLLOCK(&lk); stat_countp = &stat_ino_limit_hit; break; case FLUSH_BLOCKS: case FLUSH_BLOCKS_WAIT: + ACQUIRE_GBLLOCK(&lk); stat_blk_limit_push += 1; req_clear_remove += 1; + FREE_GBLLOCK(&lk); stat_countp = &stat_blk_limit_hit; break; @@ -13157,6 +13282,8 @@ request_cleanup(mp, resource) * Hopefully the syncer daemon will catch up and awaken us. * We wait at most tickdelay before proceeding in any case. */ + ACQUIRE_GBLLOCK(&lk); + FREE_LOCK(ump); proc_waiting += 1; if (callout_pending(&softdep_callout) == FALSE) callout_reset(&softdep_callout, tickdelay > 2 ? tickdelay : 2, @@ -13164,6 +13291,8 @@ request_cleanup(mp, resource) msleep((caddr_t)&proc_waiting, &lk, PPAUSE, "softupdate", 0); proc_waiting -= 1; + FREE_GBLLOCK(&lk); + ACQUIRE_LOCK(ump); return (1); } @@ -13177,16 +13306,13 @@ pause_timer(arg) void *arg; { - rw_assert(&lk, RA_WLOCKED); + GBLLOCK_OWNED(&lk); /* * The callout_ API has acquired mtx and will hold it around this * function call. */ - *stat_countp += 1; - wakeup_one(&proc_waiting); - if (proc_waiting > 0) - callout_reset(&softdep_callout, tickdelay > 2 ? tickdelay : 2, - pause_timer, 0); + *stat_countp += proc_waiting; + wakeup(&proc_waiting); } /* @@ -13197,7 +13323,6 @@ check_clear_deps(mp) struct mount *mp; { - rw_assert(&lk, RA_WLOCKED); /* * If we are suspended, it may be because of our using * too many inodedeps, so help clear them out. @@ -13207,16 +13332,22 @@ check_clear_deps(mp) /* * General requests for cleanup of backed up dependencies */ + ACQUIRE_GBLLOCK(&lk); if (req_clear_inodedeps) { req_clear_inodedeps -= 1; + FREE_GBLLOCK(&lk); clear_inodedeps(mp); - wakeup_one(&proc_waiting); + ACQUIRE_GBLLOCK(&lk); + wakeup(&proc_waiting); } if (req_clear_remove) { req_clear_remove -= 1; + FREE_GBLLOCK(&lk); clear_remove(mp); - wakeup_one(&proc_waiting); + ACQUIRE_GBLLOCK(&lk); + wakeup(&proc_waiting); } + FREE_GBLLOCK(&lk); } /* Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Mon Aug 4 21:41:01 2014 (r269532) +++ head/sys/ufs/ffs/softdep.h Mon Aug 4 22:03:58 2014 (r269533) @@ -1025,7 +1025,7 @@ TAILQ_HEAD(indir_hashhead, freework); * Allocated at mount and freed at unmount. */ struct mount_softdeps { - struct rwlock *sd_fslock; /* softdep lock */ + struct rwlock sd_fslock; /* softdep lock */ struct workhead sd_workitem_pending; /* softdep work queue */ struct worklist *sd_worklist_tail; /* Tail pointer for above */ struct workhead sd_journal_pending; /* journal work queue */ @@ -1046,15 +1046,24 @@ struct mount_softdeps { u_long sd_bmhashsize; /* bmsafemap hash table size-1*/ struct indir_hashhead *sd_indirhash; /* indir hash table */ u_long sd_indirhashsize; /* indir hash table size-1 */ - long sd_numindirdeps; /* outstanding indirdeps */ int sd_on_journal; /* Items on the journal list */ int sd_on_worklist; /* Items on the worklist */ int sd_deps; /* Total dependency count */ int sd_accdeps; /* accumulated dep count */ int sd_req; /* Wakeup when deps hits 0. */ + int sd_flags; /* comm with flushing thread */ + int sd_cleanups; /* Calls to cleanup */ + struct thread *sd_flushtd; /* thread handling flushing */ + TAILQ_ENTRY(mount_softdeps) sd_next; /* List of softdep filesystem */ + struct ufsmount *sd_ump; /* our ufsmount structure */ u_long sd_curdeps[D_LAST + 1]; /* count of current deps */ }; /* + * Flags for communicating with the syncer thread. + */ +#define FLUSH_EXIT 0x0001 /* time to exit */ +#define FLUSH_CLEANUP 0x0002 /* need to clear out softdep structures */ +/* * Keep the old names from when these were in the ufsmount structure. */ #define softdep_workitem_pending um_softdep->sd_workitem_pending @@ -1077,10 +1086,11 @@ struct mount_softdeps { #define bmsafemap_hash_size um_softdep->sd_bmhashsize #define indir_hashtbl um_softdep->sd_indirhash #define indir_hash_size um_softdep->sd_indirhashsize -#define softdep_numindirdeps um_softdep->sd_numindirdeps #define softdep_on_journal um_softdep->sd_on_journal #define softdep_on_worklist um_softdep->sd_on_worklist #define softdep_deps um_softdep->sd_deps #define softdep_accdeps um_softdep->sd_accdeps #define softdep_req um_softdep->sd_req +#define softdep_flags um_softdep->sd_flags +#define softdep_flushtd um_softdep->sd_flushtd #define softdep_curdeps um_softdep->sd_curdeps From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:10:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 180E7F03 for ; Mon, 4 Aug 2014 22:10:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED2162245 for ; Mon, 4 Aug 2014 22:10:08 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5577 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:10:08 +0000 From: Garrett Cooper Date: Mon, 4 Aug 2014 22:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269534 - in head: etc/mtree lib/libmp lib/libmp/tests tools/regression/lib/libmp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e004c0.5577.5ff813b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:10:09 -0000 Author: ngie Date: Mon Aug 4 22:10:07 2014 New Revision: 269534 URL: http://svnweb.freebsd.org/changeset/base/269534 Log: Integrate lib/libmp into the build/kyua - Remove the .t wrapper - Fix -Wreturn-type warnings with clang This change has been tested on amd64/i386 Phabric: D530 Reviewed by: jmmv Approved by: jmmv (co-mentor) MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Added: head/lib/libmp/tests/ head/lib/libmp/tests/Makefile (contents, props changed) head/lib/libmp/tests/legacy_test.c - copied, changed from r269429, head/tools/regression/lib/libmp/test-libmp.c Deleted: head/tools/regression/lib/libmp/ Modified: head/etc/mtree/BSD.tests.dist head/lib/libmp/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Aug 4 22:03:58 2014 (r269533) +++ head/etc/mtree/BSD.tests.dist Mon Aug 4 22:10:07 2014 (r269534) @@ -85,6 +85,8 @@ .. libcrypt .. + libmp + .. .. libexec atf Modified: head/lib/libmp/Makefile ============================================================================== --- head/lib/libmp/Makefile Mon Aug 4 22:03:58 2014 (r269533) +++ head/lib/libmp/Makefile Mon Aug 4 22:10:07 2014 (r269534) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= mp SHLIB_MAJOR= 7 DPADD= ${LIBCRYPTO} @@ -13,4 +15,8 @@ CFLAGS+= -I${.CURDIR}/../../crypto VERSION_DEF= ${.CURDIR}/../libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/lib/libmp/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libmp/tests/Makefile Mon Aug 4 22:10:07 2014 (r269534) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libmp + +TAP_TESTS_C+= legacy_test + +DPADD+= ${LIBCRYPTO} ${LIBMP} +LDADD+= -lcrypto -lmp + +.include Copied and modified: head/lib/libmp/tests/legacy_test.c (from r269429, head/tools/regression/lib/libmp/test-libmp.c) ============================================================================== --- head/tools/regression/lib/libmp/test-libmp.c Sat Aug 2 06:56:00 2014 (r269429, copy source) +++ head/lib/libmp/tests/legacy_test.c Mon Aug 4 22:10:07 2014 (r269534) @@ -46,7 +46,7 @@ testmcmp(const MINT *mp1, const MINT *mp printf("not ok - %d %s\n", ++tnr, tname); } -static int +static void testsimpel(void) { const char str42[] = "2a"; @@ -74,7 +74,7 @@ testsimpel(void) mp_mfree(t2); } -static int +static void testgcd(void) { @@ -82,7 +82,7 @@ testgcd(void) testmcmp(t0, c5, "gcd0"); } -static int +static void testmsqrt(void) { @@ -94,7 +94,7 @@ testmsqrt(void) testmcmp(t1, c6, "msqrt3"); } -static int +static void testdiv(void) { short ro; @@ -121,7 +121,7 @@ testdiv(void) mp_mfree(t2); } -static int +static void testmult(void) { @@ -131,7 +131,7 @@ testmult(void) testmcmp(t0, c42, "mmult1"); } -static int +static void testpow(void) { From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:32:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E20F742 for ; Mon, 4 Aug 2014 22:32:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40FA025E0 for ; Mon, 4 Aug 2014 22:32:17 +0000 (UTC) Received: from np (uid 1205) (envelope-from np@FreeBSD.org) id 5fa7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:32:17 +0000 From: Navdeep Parhar Date: Mon, 4 Aug 2014 22:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269537 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e009f1.5fa7.3ca65627@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:32:17 -0000 Author: np Date: Mon Aug 4 22:32:16 2014 New Revision: 269537 URL: http://svnweb.freebsd.org/changeset/base/269537 Log: cxgbe(4): Do not run any sleepable code in the SIOCSIFFLAGS handler when IFF_PROMISC or IFF_ALLMULTI is being flipped. bpf(4) holds its global mutex around ifpromisc in at least the bpf_dtor path. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 4 22:31:09 2014 (r269536) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 4 22:32:16 2014 (r269537) @@ -1178,7 +1178,7 @@ cxgbe_init(void *arg) static int cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) { - int rc = 0, mtu, flags; + int rc = 0, mtu, flags, can_sleep; struct port_info *pi = ifp->if_softc; struct adapter *sc = pi->adapter; struct ifreq *ifr = (struct ifreq *)data; @@ -1203,7 +1203,10 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned break; case SIOCSIFFLAGS: - rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4flg"); + can_sleep = 0; +redo_sifflags: + rc = begin_synchronized_op(sc, pi, + can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg"); if (rc) return (rc); @@ -1212,15 +1215,32 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned flags = pi->if_flags; if ((ifp->if_flags ^ flags) & (IFF_PROMISC | IFF_ALLMULTI)) { + if (can_sleep == 1) { + end_synchronized_op(sc, 0); + can_sleep = 0; + goto redo_sifflags; + } rc = update_mac_settings(ifp, XGMAC_PROMISC | XGMAC_ALLMULTI); } - } else + } else { + if (can_sleep == 0) { + end_synchronized_op(sc, LOCK_HELD); + can_sleep = 1; + goto redo_sifflags; + } rc = cxgbe_init_synchronized(pi); + } pi->if_flags = ifp->if_flags; - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (can_sleep == 0) { + end_synchronized_op(sc, LOCK_HELD); + can_sleep = 1; + goto redo_sifflags; + } rc = cxgbe_uninit_synchronized(pi); - end_synchronized_op(sc, 0); + } + end_synchronized_op(sc, can_sleep ? 0 : LOCK_HELD); break; case SIOCADDMULTI: From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:34:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BC389F for ; Mon, 4 Aug 2014 22:34:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98F212609 for ; Mon, 4 Aug 2014 22:34:16 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 5ffb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:34:13 +0000 From: Warner Losh Date: Mon, 4 Aug 2014 22:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269538 - in head/sys/modules: acl_nfs4 acl_posix1e alq cc/cc_cdg cc/cc_chd cc/cc_cubic cc/cc_hd cc/cc_htcp cc/cc_vegas drm2/radeonkms dtrace ibcore ip6_mroute_mod ip_mroute_mod khelp/h... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e00a66.5ffb.69db46a1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:34:16 -0000 Author: imp Date: Mon Aug 4 22:34:12 2014 New Revision: 269538 URL: http://svnweb.freebsd.org/changeset/base/269538 Log: Remove unnecessary inclusions of bsd.own.mk. Modified: head/sys/modules/acl_nfs4/Makefile head/sys/modules/acl_posix1e/Makefile head/sys/modules/alq/Makefile head/sys/modules/cc/cc_cdg/Makefile head/sys/modules/cc/cc_chd/Makefile head/sys/modules/cc/cc_cubic/Makefile head/sys/modules/cc/cc_hd/Makefile head/sys/modules/cc/cc_htcp/Makefile head/sys/modules/cc/cc_vegas/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/dtrace/Makefile head/sys/modules/ibcore/Makefile head/sys/modules/ip6_mroute_mod/Makefile head/sys/modules/ip_mroute_mod/Makefile head/sys/modules/khelp/h_ertt/Makefile head/sys/modules/siftr/Makefile Modified: head/sys/modules/acl_nfs4/Makefile ============================================================================== --- head/sys/modules/acl_nfs4/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/acl_nfs4/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../kern KMOD= acl_nfs4 SRCS= vnode_if.h subr_acl_nfs4.c Modified: head/sys/modules/acl_posix1e/Makefile ============================================================================== --- head/sys/modules/acl_posix1e/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/acl_posix1e/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../kern KMOD= acl_posix1e SRCS= vnode_if.h subr_acl_posix1e.c Modified: head/sys/modules/alq/Makefile ============================================================================== --- head/sys/modules/alq/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/alq/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../kern KMOD= alq SRCS= opt_mac.h vnode_if.h kern_alq.c Modified: head/sys/modules/cc/cc_cdg/Makefile ============================================================================== --- head/sys/modules/cc/cc_cdg/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_cdg/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_cdg SRCS= cc_cdg.c Modified: head/sys/modules/cc/cc_chd/Makefile ============================================================================== --- head/sys/modules/cc/cc_chd/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_chd/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_chd SRCS= cc_chd.c Modified: head/sys/modules/cc/cc_cubic/Makefile ============================================================================== --- head/sys/modules/cc/cc_cubic/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_cubic/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_cubic SRCS= cc_cubic.c Modified: head/sys/modules/cc/cc_hd/Makefile ============================================================================== --- head/sys/modules/cc/cc_hd/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_hd/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_hd SRCS= cc_hd.c Modified: head/sys/modules/cc/cc_htcp/Makefile ============================================================================== --- head/sys/modules/cc/cc_htcp/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_htcp/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_htcp SRCS= cc_htcp.c Modified: head/sys/modules/cc/cc_vegas/Makefile ============================================================================== --- head/sys/modules/cc/cc_vegas/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/cc/cc_vegas/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/cc KMOD= cc_vegas SRCS= cc_vegas.c Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/drm2/radeonkms/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../dev/drm2/radeon KMOD = radeonkms Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/dtrace/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,6 +1,5 @@ # $FreeBSD$ -.include .include "Makefile.inc" SUBDIR= dtmalloc \ Modified: head/sys/modules/ibcore/Makefile ============================================================================== --- head/sys/modules/ibcore/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/ibcore/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -2,8 +2,6 @@ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/core .PATH: ${.CURDIR}/../../ofed/include/linux -.include - KMOD = ibcore SRCS = addr.c cm_msgs.h iwcm.c mad_rmpp.h sa_query.c ucma.c uverbs_cmd.c SRCS+= agent.c local_sa.c iwcm.h multicast.c smi.c ud_header.c uverbs_main.c Modified: head/sys/modules/ip6_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip6_mroute_mod/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/ip6_mroute_mod/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netinet6 KMOD= ip6_mroute Modified: head/sys/modules/ip_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip_mroute_mod/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/ip_mroute_mod/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 KMOD= ip_mroute Modified: head/sys/modules/khelp/h_ertt/Makefile ============================================================================== --- head/sys/modules/khelp/h_ertt/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/khelp/h_ertt/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../../netinet/khelp KMOD= h_ertt SRCS= h_ertt.c Modified: head/sys/modules/siftr/Makefile ============================================================================== --- head/sys/modules/siftr/Makefile Mon Aug 4 22:32:16 2014 (r269537) +++ head/sys/modules/siftr/Makefile Mon Aug 4 22:34:12 2014 (r269538) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netinet KMOD= siftr SRCS= siftr.c From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:34:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F090A18 for ; Mon, 4 Aug 2014 22:34:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45B572616 for ; Mon, 4 Aug 2014 22:34:57 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 506c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:34:57 +0000 From: Warner Losh Date: Mon, 4 Aug 2014 22:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269539 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e00a91.506c.40f1d8f3@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:34:57 -0000 Author: imp Date: Mon Aug 4 22:34:56 2014 New Revision: 269539 URL: http://svnweb.freebsd.org/changeset/base/269539 Log: Include the kernel options after bsd.init.mk so that when we're compiling on older systems that define all the MK variables in bsd.own.mk we don't get the multiply defined error for options that live in both. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Aug 4 22:34:12 2014 (r269538) +++ head/sys/conf/kmod.mk Mon Aug 4 22:34:56 2014 (r269539) @@ -65,9 +65,10 @@ KMODLOAD?= /sbin/kldload KMODUNLOAD?= /sbin/kldunload OBJCOPY?= objcopy -# Grab all the options for a kernel build. -.include "kern.opts.mk" .include +# Grab all the options for a kernel build. For backwards compat, we need to +# do this after bsd.own.mk. +.include "kern.opts.mk" .include .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:36:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86F47BAE for ; Mon, 4 Aug 2014 22:36:41 +0000 (UTC) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396AC2633 for ; Mon, 4 Aug 2014 22:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1407191793; bh=YmrcpPNovCYMLUDdyifEl3Ckj6/bEjF4gkjl4gZPxc8=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=t+Zd6zORaKyVWf3BaUUTvcomJaDODi3VEpnryDuwP/qqW/yNaW8Ym266Ozf9nRwlWn2wItD0n4HtjXwKYNzoZtYw1DkANU0WOazKqop4HGCKggpZDB14um6S2QeE4OQziqwwh1S9j9nQEKZRKIMHys68KoFTWSoHNLveEln8HCJCQhokbDCsrptbML67WxJ303X+Q2ainrkZeUNDLobaByjhF8JYv+nqB0SprCZYR429WS5LQAR+XxhLONwIfNb339eyGD08nX90g4hfn81nDlWV7siQZizqhnohkzMuOegh4qnhS2HsztyMAX8z46CP/n/k47reaood0SxjrCe+oA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=kNRRGV69ygea84x+VBis4fEffNxE+Hf+AL91nmg9AdbWdSNRo+G1v4QuA9Qh2ZhFqg/mwQTnunkQHC+rw04uwD5FbtPQk3OONuzDJ7fZm3OqhPG1tgA6gcPJq5I64Wx9zThEgKLQhijKYXce2yuYOkJiBkwCJ/GdoRKvu/sdkHFLWRo2ozxGoSwp0VfJm4P44NxwzdfsHZTF81GEVXHKVucfy0RptM1l3JWw6zBxc8yekOeUuZWTROD/CBq0E273iRO/mb5KYM/Ui357zoeO0QMqztwOVa9QF57kyua91q4q6zg45TJXw6eKH9WAsnEKvgG0R8vkaXVYzcRJObM4xg==; Received: from [98.139.212.151] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 04 Aug 2014 22:36:33 -0000 Received: from [98.139.211.192] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 04 Aug 2014 22:36:33 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 04 Aug 2014 22:36:33 -0000 X-Yahoo-Newman-Id: 175547.78766.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _Wh02mYVM1mwk70VdR9kTV5QY3k6GodGwskUnx8W_A6HTky xnP377DtFuQSS1dmRFxD4fIJt16v6dSpDa7zDPVsTcfm4cc5U4y1JlM6XC7R iFS4Gdy1uRUHy8GMr1EaQgrhNTbSFvboK7gGUgBfb2Lpp5gbaLAPp62DB3xC ivP4CzJd9cCItvnxWgR1UAKpDACk_aGKICPmTQ7DWeR841vCz9QYX6PSTlKw 5QluzLtsNJ3kCtzWghZK.dLXQvaY4vSDSzSjX4UrcRNXuRlU2nAMZVRFM4QP wI6Ctxa5zmL9ivmEt6IlVNLdy55yjo6eCzeIrTlZO1AQv7tbYAAwlUcz0_YE Jis4vw2RSivQlVHnBz8CNArUCegN.3jOOg8E4AVxCBAOoGDmTa901KnNNpgQ SN3oBtGnxLVbFlMv668Us5k1rOVL78i9ub7FzJmf0X3lqSWsG6ZCxNbe5RMy xdO4HFeYWGiz1ry0lxPMsEUCnaNAwjGzQTFxxVS3bYmFBDVgRLR121oVGvvD 4xuR_d7HDnQ5R8bg3oCo_.PBDJ0A- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269523 - head/sys/fs/ext2fs From: Pedro Giffuni In-Reply-To: <20140805041657.A1066@besplex.bde.org> Date: Mon, 4 Aug 2014 17:36:30 -0500 Message-Id: <4637A4B5-F27E-488B-90E8-31B9A5DF2AAD@freebsd.org> References: <53dfb7a3.5e19.37746e44@svn.freebsd.org> <20140805041657.A1066@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:36:41 -0000 Il giorno 04/ago/2014, alle ore 14:01, Bruce Evans = ha scritto: > On Mon, 4 Aug 2014, Pedro F. Giffuni wrote: >=20 >> Log: >> set EXT2_LINK_MAX to LINK_MAX >>=20 >> In linux EXT4_LINK_MAX is now 64000. We can't really do that >> since i_nlink and va_nlink are signed so setting higher values >> is likely to cause trouble. >=20 > Hmm, va_nlink doesn't use nlink_t and is inconsistent with nlink_t > since nlink_t is unsigned. The bug is nlink_t being unsigned. > Signed for i_nlink is more reasonable although it is inconsistent > with unsigned for e2di_nlink. The implementation might want to > use the better arithmetic of signed types. However, it blindly > converts from unsigned to signed when converting e2di_nlink to > i_nlink, so it overflows for corrupt file systems with e2di_nlink > larger than 32767. >=20 While I agree in general, the correct type for e2di_nlink, is defined by = the linux implementation. It is very possible to find correct ext4 filesystems where e2di_nlink is = 50000. In fact the OpenBSD guys are claiming they can access such filesystems. >> This is a system limitation so set the EXT_LINK_MAX to >> what the system can handle. >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/fs/ext2fs/ext2_dir.h >>=20 >> Modified: head/sys/fs/ext2fs/ext2_dir.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:32:08 2014 = (r269522) >> +++ head/sys/fs/ext2fs/ext2_dir.h Mon Aug 4 16:41:06 2014 = (r269523) >> @@ -72,7 +72,7 @@ struct ext2fs_direct_2 { >> /* >> * Maximal count of links to a file >> */ >> -#define EXT2_LINK_MAX 32000 >> +#define EXT2_LINK_MAX LINK_MAX >>=20 >> /* >> * Ext2 directory file types. Only the low 3 bits are used. The >=20 > This breaks ext2 where the limit is 32000. It allows creating corrupt > file systems containing inodes with more than 32000 links. The > corruption would be noticed by ext2fs implemenations with a non-broken > limit and should be noticed by ext2fsck. The failure modes in the > previous version of ext2fs in FreeBSD seem to be limited to operations > that increase the link count further (including temporary increases = for > rename?). >=20 > Old versions of ext2fs in FreeBSD had the same bug in a worse way. = They > defined EXT2_LINK_MAX as 32000 but never used it. They used the = system > LINK_MAX instead. >=20 FWIW, NetBSD reuses the UFS value and I pretended to do the same. Reusing this value, gives us 767 more directories in ext4, which is not a huge difference but perhaps useful. It would=92ve also let us reuse = NetBSD=92s (possibly broken) ext2. The cleanest solution is probably to make the limit dynamical. I will revert this change and see if it=92s worth it. (probably not for = just 767 directories ?). Regards, Pedro. > Old versions of linux (2.6.10) have many bugs related to LINK_MAX, but > not this one. {LINK_MAX} is variable. Thus LINK_MAX must not be > defined in . But it is defined in , with a value > of 127 that is too small for most file systems. Many nearby variable > limits that must not be defined are defined (the worst one in practice > is {OPEN_MAX}. Similarly in FreeBSD, except the LINK_MAX that must > not be defined in is defined as large enough for all file > systems. Back in linux, nlink_t is uint16_t on some arches including > x86, but JFS_LINK_MAX is 0xffffffff. I can't see where pathconf() > returns an fs-dependent (or file-dependent) limit. >=20 > Bruce From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 22:37:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9382CCF0 for ; Mon, 4 Aug 2014 22:37:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D990263B for ; Mon, 4 Aug 2014 22:37:12 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 529c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 22:37:02 +0000 From: Warner Losh Date: Mon, 4 Aug 2014 22:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269540 - in head/sys: conf modules/an modules/arcnet modules/cam modules/carp modules/cxgb/cxgb modules/cxgb/iw_cxgb modules/cxgb/tom modules/cxgbe/if_cxgbe modules/cxgbe/iw_cxgbe modu... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e00b0f.529c.265fe830@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 22:37:12 -0000 Author: imp Date: Mon Aug 4 22:37:02 2014 New Revision: 269540 URL: http://svnweb.freebsd.org/changeset/base/269540 Log: Move most of the 15 variations on generating opt_inet.h and opt_inet6.h into kmod.mk by forcing almost everybody to eat the same dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h targets here too. Modified: head/sys/conf/kern.opts.mk head/sys/conf/kmod.mk head/sys/modules/an/Makefile head/sys/modules/arcnet/Makefile head/sys/modules/cam/Makefile head/sys/modules/carp/Makefile head/sys/modules/cxgb/cxgb/Makefile head/sys/modules/cxgb/iw_cxgb/Makefile head/sys/modules/cxgb/tom/Makefile head/sys/modules/cxgbe/if_cxgbe/Makefile head/sys/modules/cxgbe/iw_cxgbe/Makefile head/sys/modules/cxgbe/tom/Makefile head/sys/modules/dummynet/Makefile head/sys/modules/em/Makefile head/sys/modules/en/Makefile head/sys/modules/fatm/Makefile head/sys/modules/firewire/fwip/Makefile head/sys/modules/hatm/Makefile head/sys/modules/i40e/Makefile (contents, props changed) head/sys/modules/if_bridge/Makefile head/sys/modules/if_disc/Makefile head/sys/modules/if_faith/Makefile head/sys/modules/if_gif/Makefile head/sys/modules/if_gre/Makefile head/sys/modules/if_lagg/Makefile head/sys/modules/if_stf/Makefile head/sys/modules/if_tap/Makefile head/sys/modules/if_tun/Makefile head/sys/modules/igb/Makefile head/sys/modules/ip6_mroute_mod/Makefile head/sys/modules/ip_mroute_mod/Makefile head/sys/modules/ipdivert/Makefile head/sys/modules/ipfilter/Makefile head/sys/modules/ipfw/Makefile head/sys/modules/ipoib/Makefile head/sys/modules/ixgbe/Makefile head/sys/modules/krpc/Makefile head/sys/modules/linux/Makefile head/sys/modules/lmc/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlxen/Makefile head/sys/modules/mthca/Makefile head/sys/modules/netgraph/gif/Makefile head/sys/modules/netgraph/iface/Makefile head/sys/modules/netgraph/ipfw/Makefile head/sys/modules/netgraph/netflow/Makefile head/sys/modules/nfscl/Makefile head/sys/modules/nfsclient/Makefile head/sys/modules/nfslockd/Makefile head/sys/modules/nfsserver/Makefile head/sys/modules/patm/Makefile head/sys/modules/pf/Makefile head/sys/modules/pflog/Makefile head/sys/modules/pfsync/Makefile head/sys/modules/smbfs/Makefile head/sys/modules/snc/Makefile head/sys/modules/sppp/Makefile head/sys/modules/trm/Makefile head/sys/modules/virtio/network/Makefile head/sys/modules/vmware/vmxnet3/Makefile head/sys/modules/wlan/Makefile head/sys/modules/wlan_acl/Makefile head/sys/modules/wlan_amrr/Makefile head/sys/modules/wlan_ccmp/Makefile head/sys/modules/wlan_rssadapt/Makefile head/sys/modules/wlan_tkip/Makefile head/sys/modules/wlan_wep/Makefile head/sys/modules/wlan_xauth/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/conf/kern.opts.mk Mon Aug 4 22:37:02 2014 (r269540) @@ -18,6 +18,8 @@ __DEFAULT_YES_OPTIONS = \ ARM_EABI \ FORMAT_EXTENSIONS \ + INET \ + INET6 \ KERNEL_SYMBOLS # expanded inline from bsd.mkopt.mk: @@ -32,3 +34,17 @@ MK_${var}:= yes .endif .endfor .undef __DEFAULT_YES_OPTIONS + +# +# MK_*_SUPPORT options which default to "yes" unless their corresponding +# MK_* variable is set to "no". +# +.for var in \ + INET \ + INET6 +.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" +MK_${var}_SUPPORT:= no +.else +MK_${var}_SUPPORT:= yes +.endif +.endfor Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/conf/kmod.mk Mon Aug 4 22:37:02 2014 (r269540) @@ -315,6 +315,34 @@ unload: ${KMODUNLOAD} -v ${PROG} .endif +# Generate options files that otherwise would be built +# in substantially similar ways through the tree. Move +# the code here when they all produce identical results +# (or should) +.if !defined(KERNBUILDDIR) +opt_bpf.h: + echo "#define DEV_BPF 1" > ${.TARGET} +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} + @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} +.endif +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +opt_mrouting.h: + echo "#define MROUTING 1" > ${.TARGET} +opt_natm.h: + echo "#define NATM 1" > ${.TARGET} +opt_scsi.h: + echo "#define SCSI_DELAY 15000" > ${.TARGET} +opt_wlan.h: + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} + echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} + echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} +.endif + .if defined(KERNBUILDDIR) .PATH: ${KERNBUILDDIR} CFLAGS+= -I${KERNBUILDDIR} Modified: head/sys/modules/an/Makefile ============================================================================== --- head/sys/modules/an/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/an/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -7,9 +7,4 @@ SRCS= if_an.c if_an_pccard.c if_an_pci.c SRCS+= opt_inet.h device_if.h bus_if.h pci_if.h isa_if.h card_if.h SRCS+= pccarddevs.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/arcnet/Makefile ============================================================================== --- head/sys/modules/arcnet/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/arcnet/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -16,12 +16,4 @@ EXPORT_SYMS= arc_frag_init \ arc_output \ arc_storelladdr -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cam/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -43,9 +43,4 @@ SRCS+= ata_pmp.c EXPORT_SYMS= YES # XXX evaluate -.if !defined(KERNBUILDDIR) -opt_scsi.h: - echo "#define SCSI_DELAY 15000" > ${.TARGET} -.endif - .include Modified: head/sys/modules/carp/Makefile ============================================================================== --- head/sys/modules/carp/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/carp/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -3,23 +3,9 @@ .PATH: ${.CURDIR}/../../netinet .PATH: ${.CURDIR}/../../crypto -.include - KMOD= carp SRCS= ip_carp.c sha1.c SRCS+= device_if.h bus_if.h vnode_if.h SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h opt_ofed.h -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgb/cxgb/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - CXGB = ${.CURDIR}/../../../dev/cxgb .PATH: ${CXGB} ${CXGB}/common ${CXGB}/sys @@ -15,17 +13,4 @@ SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} - @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgb/iw_cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/iw_cxgb/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgb/iw_cxgb/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - CXGB = ${.CURDIR}/../../../dev/cxgb .PATH: ${CXGB}/ulp/iw_cxgb @@ -13,12 +11,4 @@ SRCS+= bus_if.h device_if.h opt_sched.h SRCS+= opt_inet.h opt_ofed.h vnode_if.h CFLAGS+= -I${CXGB} -I${.CURDIR}/../../../ofed/include -DLINUX_TYPES_DEFINED -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgb/tom/Makefile ============================================================================== --- head/sys/modules/cxgb/tom/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgb/tom/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - CXGB = ${.CURDIR}/../../../dev/cxgb .PATH: ${CXGB}/ulp/tom @@ -14,12 +12,4 @@ CFLAGS+= -g -I${CXGB} #CFLAGS+= -DDEBUG_PRINT -DDEBUG -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -2,8 +2,6 @@ # $FreeBSD$ # -.include - CXGBE= ${.CURDIR}/../../../dev/cxgbe .PATH: ${CXGBE} ${CXGBE}/common @@ -26,17 +24,4 @@ SRCS+= t4_tracer.c CFLAGS+= -I${CXGBE} -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} - @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgbe/iw_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/iw_cxgbe/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgbe/iw_cxgbe/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - CXGBE= ${.CURDIR}/../../../dev/cxgbe .PATH: ${CXGBE}/iw_cxgbe @@ -27,17 +25,4 @@ SRCS+= vnode_if.h CFLAGS+= -I${CXGBE} -I${.CURDIR}/../../../ofed/include -DLINUX_TYPES_DEFINED -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} - @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/cxgbe/tom/Makefile ============================================================================== --- head/sys/modules/cxgbe/tom/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/cxgbe/tom/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -2,8 +2,6 @@ # $FreeBSD$ # -.include - CXGBE= ${.CURDIR}/../../../dev/cxgbe .PATH: ${CXGBE}/tom @@ -22,17 +20,4 @@ SRCS+= t4_tom_l2t.c CFLAGS+= -I${CXGBE} -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} - @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/dummynet/Makefile ============================================================================== --- head/sys/modules/dummynet/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/dummynet/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= dummynet SRCS= ip_dummynet.c @@ -10,11 +8,4 @@ SRCS+= dn_heap.c dn_sched_fifo.c dn_sche SRCS+= dn_sched_prio.c SRCS+= opt_inet6.h -.if !defined(KERNBUILDDIR) -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/em/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_em SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h @@ -21,16 +19,4 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/en/Makefile ============================================================================== --- head/sys/modules/en/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/en/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -8,15 +8,4 @@ SRCS+= opt_inet.h opt_natm.h opt_ddb.h CFLAGS+= -DENABLE_BPF # CFLAGS+= -DINVARIANT_SUPPORT -DINVARIANTS -DEN_DEBUG=0 -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_natm.h: - echo "#define NATM 1" > ${.TARGET} - -# opt_ddb.h: -# echo "#define DDB 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/fatm/Makefile ============================================================================== --- head/sys/modules/fatm/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/fatm/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -9,12 +9,4 @@ SRCS= if_fatm.c device_if.h bus_if.h pci # CFLAGS+= -DFATM_DEBUG=0 -DINVARIANT_SUPPORT -DINVARIANTS -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_natm.h: - echo "#define NATM 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/firewire/fwip/Makefile ============================================================================== --- head/sys/modules/firewire/fwip/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/firewire/fwip/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -11,11 +11,6 @@ SRCS = bus_if.h device_if.h \ firewire.h firewirereg.h \ if_fwsubr.c -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -.endif - #CFLAGS += -DDEVICE_POLLING .include Modified: head/sys/modules/hatm/Makefile ============================================================================== --- head/sys/modules/hatm/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/hatm/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -11,12 +11,4 @@ SRCS= if_hatm.c if_hatm_intr.c if_hatm_i CFLAGS+= -DENABLE_BPF # CFLAGS+= -DHATM_DEBUG -DINVARIANT_SUPPORT -DINVARIANTS -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_natm.h: - echo "#define NATM 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/i40e/Makefile ============================================================================== --- head/sys/modules/i40e/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/i40e/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ #$FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/i40e KMOD = if_i40e @@ -18,16 +16,4 @@ CFLAGS += -DSMP # Debug messages / sysctls # CFLAGS += -DI40E_DEBUG -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/if_bridge/Makefile ============================================================================== --- head/sys/modules/if_bridge/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_bridge/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,19 +1,7 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../net KMOD= if_bridge SRCS= if_bridge.c opt_inet.h opt_inet6.h opt_carp.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/if_disc/Makefile ============================================================================== --- head/sys/modules/if_disc/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_disc/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -5,12 +5,4 @@ KMOD= if_disc SRCS= if_disc.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -#opt_inet6.h: -# echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/if_faith/Makefile ============================================================================== --- head/sys/modules/if_faith/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_faith/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -5,12 +5,4 @@ KMOD= if_faith SRCS= if_faith.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_gif/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -7,21 +7,10 @@ KMOD= if_gif SRCS= if_gif.c in_gif.c opt_inet.h opt_inet6.h opt_mrouting.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - -opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} -.else +.if defined(KERNBUILDDIR) OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h -.if empty(OPT_INET6) -MK_INET6_SUPPORT= no +.if !empty(OPT_INET6) +MK_INET6_SUPPORT=no .endif .endif Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_gre/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -5,12 +5,4 @@ KMOD= if_gre SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/if_lagg/Makefile ============================================================================== --- head/sys/modules/if_lagg/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_lagg/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,19 +1,7 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../net KMOD= if_lagg SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/if_stf/Makefile ============================================================================== --- head/sys/modules/if_stf/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_stf/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -5,12 +5,4 @@ KMOD= if_stf SRCS= if_stf.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/if_tap/Makefile ============================================================================== --- head/sys/modules/if_tap/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_tap/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -10,9 +10,6 @@ SRCS= if_tap.c opt_compat.h opt_inet.h v .if !defined(KERNBUILDDIR) opt_compat.h: echo "#define COMPAT_FREEBSD6 1" > ${.TARGET} - -opt_inet.h: - echo "#define INET 1" > ${.TARGET} .endif .include Modified: head/sys/modules/if_tun/Makefile ============================================================================== --- head/sys/modules/if_tun/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/if_tun/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -5,12 +5,4 @@ KMOD= if_tun SRCS= if_tun.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/igb/Makefile ============================================================================== --- head/sys/modules/igb/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/igb/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ #$FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/e1000 KMOD = if_igb SRCS = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h opt_rss.h @@ -23,20 +21,4 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 - # ALTQ. #CFLAGS += -DIGB_LEGACY_TX -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif - -opt_rss.h: - @echo "" > ${.TARGET} - -.endif - .include Modified: head/sys/modules/ip6_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip6_mroute_mod/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ip6_mroute_mod/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -7,11 +7,4 @@ KMOD= ip6_mroute SRCS= ip6_mroute.c SRCS+= opt_inet6.h opt_mrouting.h -.if !defined(KERNBUILDDIR) -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/ip_mroute_mod/Makefile ============================================================================== --- head/sys/modules/ip_mroute_mod/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ip_mroute_mod/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -7,11 +7,4 @@ KMOD= ip_mroute SRCS= ip_mroute.c SRCS+= opt_inet.h opt_mrouting.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -opt_mrouting.h: - echo "#define MROUTING 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/ipdivert/Makefile ============================================================================== --- head/sys/modules/ipdivert/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ipdivert/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,21 +1,8 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netinet KMOD= ipdivert SRCS= ip_divert.c opt_inet.h opt_inet6.h opt_sctp.h -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -.endif -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/ipfilter/Makefile ============================================================================== --- head/sys/modules/ipfilter/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ipfilter/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../contrib/ipfilter/netinet KMOD= ipl @@ -11,15 +9,6 @@ SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_s ip_nat6.c ip_rules.c ip_scan.c ip_dstlist.c radix_ipf.c SRCS+= opt_bpf.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_bpf.h: - echo "#define DEV_BPF 1" > ${.TARGET} - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif CFLAGS+= -I${.CURDIR}/../../contrib/ipfilter CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP # Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ipfw/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw @@ -20,15 +18,4 @@ CFLAGS+= -DIPFIREWALL #CFLAGS+= -DIPFIREWALL_DEFAULT_TO_ACCEPT # -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -.endif -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/ipoib/Makefile ============================================================================== --- head/sys/modules/ipoib/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ipoib/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -2,8 +2,6 @@ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/ulp/ipoib .PATH: ${.CURDIR}/../../ofed/include/linux -.include - KMOD = ipoib SRCS = device_if.h bus_if.h opt_ofed.h vnode_if.h opt_inet.h opt_inet6.h SRCS += ipoib_cm.c ipoib_ib.c ipoib_main.c ipoib_multicast.c ipoib_verbs.c ipoib.h @@ -14,18 +12,6 @@ CFLAGS+= -I${.CURDIR}/../ibcore CFLAGS+= -I${.CURDIR}/../../ofed/include/ CFLAGS+= -DINET6 -DINET -DOFED -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/ixgbe/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,7 +1,5 @@ #$FreeBSD$ -.include - .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = if_ixgbe @@ -14,20 +12,4 @@ SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif - -opt_rss.h: - @echo "" > ${.TARGET} - -.endif - .include Modified: head/sys/modules/krpc/Makefile ============================================================================== --- head/sys/modules/krpc/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/krpc/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -32,13 +32,4 @@ SRCS+= xdr.c \ SRCS+= opt_inet6.h -.if !defined(KERNBUILDDIR) -NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel - -.if ${NFS_INET6} > 0 -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/linux/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -56,8 +56,6 @@ linux${SFX}_genassym.o: linux${SFX}_gena ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} .if !defined(KERNBUILDDIR) -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} .if defined(KTR) CFLAGS+= -DKTR .endif Modified: head/sys/modules/lmc/Makefile ============================================================================== --- head/sys/modules/lmc/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/lmc/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -10,15 +10,9 @@ SRCS += opt_netgraph.h SRCS += opt_global.h SRCS += opt_bpf.h -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -opt_inet6.h: - echo "#define INET6 0" > ${.TARGET} opt_netgraph.h: echo "#define NETGRAPH 1" > ${.TARGET} opt_global.h: echo "#define ALTQ 1" > ${.TARGET} -opt_bpf.h: # FreeBSD-5: - echo "#define DEV_BPF 1" > ${.TARGET} .include Modified: head/sys/modules/mlx4/Makefile ============================================================================== --- head/sys/modules/mlx4/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/mlx4/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,8 +1,5 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 - -.include - .PATH: ${.CURDIR}/../../ofed/include/linux KMOD = mlx4 SRCS = device_if.h bus_if.h pci_if.h vnode_if.h @@ -12,18 +9,6 @@ SRCS+= pd.c port.c profile.c qp.c reset. CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/mlx4ib/Makefile ============================================================================== --- head/sys/modules/mlx4ib/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/mlx4ib/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -2,8 +2,6 @@ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 .PATH: ${.CURDIR}/../../ofed/include/linux -.include - KMOD = mlx4ib SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= linux_compat.c linux_radix.c linux_idr.c @@ -17,18 +15,6 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM CFLAGS+= -DINET6 -DINET -DOFED -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/mlxen/Makefile ============================================================================== --- head/sys/modules/mlxen/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/mlxen/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,8 +1,6 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 -.include - KMOD = mlxen SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS += en_cq.c en_frag.c en_main.c en_netdev.c en_port.c en_resources.c @@ -11,18 +9,6 @@ SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/mthca/Makefile ============================================================================== --- head/sys/modules/mthca/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/mthca/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -2,8 +2,6 @@ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mthca -.include - KMOD = mthca SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= mthca_allocator.c mthca_av.c mthca_catas.c mthca_cmd.c mthca_cq.c @@ -14,18 +12,6 @@ SRCS+= opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/include -.if !defined(KERNBUILDDIR) -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - @echo "#define INET 1" > ${.TARGET} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - @echo "#define INET6 1" > ${.TARGET} -.endif -.endif - .include CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} Modified: head/sys/modules/netgraph/gif/Makefile ============================================================================== --- head/sys/modules/netgraph/gif/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/netgraph/gif/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -3,12 +3,4 @@ KMOD= ng_gif SRCS= ng_gif.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/netgraph/iface/Makefile ============================================================================== --- head/sys/modules/netgraph/iface/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/netgraph/iface/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -4,12 +4,4 @@ KMOD= ng_iface SRCS= ng_iface.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif - .include Modified: head/sys/modules/netgraph/ipfw/Makefile ============================================================================== --- head/sys/modules/netgraph/ipfw/Makefile Mon Aug 4 22:34:56 2014 (r269539) +++ head/sys/modules/netgraph/ipfw/Makefile Mon Aug 4 22:37:02 2014 (r269540) @@ -1,20 +1,6 @@ # $FreeBSD$ -.include - KMOD= ng_ipfw SRCS= ng_ipfw.c opt_inet.h opt_inet6.h -.if !defined(KERNBUILDDIR) - -.if ${MK_INET_SUPPORT} != "no" -opt_inet.h: - echo "#define INET 1" > ${.TARGET} -.endif -.if ${MK_INET6_SUPPORT} != "no" -opt_inet6.h: - echo "#define INET6 1" > ${.TARGET} -.endif -.endif - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 23:00:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE74C209 for ; Mon, 4 Aug 2014 23:00:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9FFD27DF for ; Mon, 4 Aug 2014 23:00:14 +0000 (UTC) Received: from brooks (uid 898) (envelope-from brooks@FreeBSD.org) id 5a2d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 23:00:14 +0000 From: Brooks Davis Date: Mon, 4 Aug 2014 23:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269541 - in head: . sys/boot/kshim sys/boot/usb sys/boot/usb/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0107e.5a2d.60cf7add@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 23:00:15 -0000 Author: brooks Date: Mon Aug 4 23:00:13 2014 New Revision: 269541 URL: http://svnweb.freebsd.org/changeset/base/269541 Log: Merge from CheriBSD: Make the sysinit tool a build tool rather than building in with /usr/bin/cc and running it from OBJDIR. (It will be moved to usr.bin once a manpage is written and a few style cleanups are done.) Split the makefile bits for Hans' kernel shim layer into their own includable kshim.mk. Move USB support into a .mk file so loaders can include it. Added: head/sys/boot/kshim/ head/sys/boot/kshim/bsd_busspace.c - copied unchanged from r269540, head/sys/boot/usb/bsd_busspace.c head/sys/boot/kshim/bsd_global.h - copied unchanged from r269521, head/sys/boot/usb/bsd_global.h head/sys/boot/kshim/bsd_kernel.c - copied unchanged from r269521, head/sys/boot/usb/bsd_kernel.c head/sys/boot/kshim/bsd_kernel.h - copied unchanged from r269521, head/sys/boot/usb/bsd_kernel.h head/sys/boot/kshim/kshim.mk - copied, changed from r269521, head/sys/boot/usb/Makefile head/sys/boot/kshim/sysinit.h - copied unchanged from r269521, head/sys/boot/usb/tools/sysinit.h head/sys/boot/usb/tools/Makefile (contents, props changed) head/sys/boot/usb/usbcore.mk - copied, changed from r269521, head/sys/boot/usb/Makefile Deleted: head/sys/boot/usb/bsd_busspace.c head/sys/boot/usb/bsd_global.h head/sys/boot/usb/bsd_kernel.c head/sys/boot/usb/bsd_kernel.h head/sys/boot/usb/tools/sysinit.h Modified: head/Makefile.inc1 head/sys/boot/usb/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 4 22:37:02 2014 (r269540) +++ head/Makefile.inc1 Mon Aug 4 23:00:13 2014 (r269541) @@ -1406,7 +1406,8 @@ cross-tools: .MAKE usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ - ${_kgzip} + ${_kgzip} \ + sys/boot/usb/tools ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ ${MAKE} DIRPRFX=${_tool}/ obj && \ Copied: head/sys/boot/kshim/bsd_busspace.c (from r269540, head/sys/boot/usb/bsd_busspace.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/kshim/bsd_busspace.c Mon Aug 4 23:00:13 2014 (r269541, copy of r269540, head/sys/boot/usb/bsd_busspace.c) @@ -0,0 +1,207 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +struct burst { + uint32_t dw0; + uint32_t dw1; + uint32_t dw2; + uint32_t dw3; + uint32_t dw4; + uint32_t dw5; + uint32_t dw6; + uint32_t dw7; +}; + +void +bus_space_read_multi_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + while (count--) { + *datap++ = bus_space_read_1(t, h, offset); + } +} + +void +bus_space_read_multi_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t *datap, bus_size_t count) +{ + while (count--) { + *datap++ = bus_space_read_2(t, h, offset); + } +} + +void +bus_space_read_multi_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *datap++ = *((volatile uint32_t *)h); + } +} + +void +bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + while (count--) { + uint8_t temp = *datap++; + + bus_space_write_1(t, h, offset, temp); + } +} + +void +bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t *datap, bus_size_t count) +{ + while (count--) { + uint16_t temp = *datap++; + + bus_space_write_2(t, h, offset, temp); + } +} + +void +bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *((volatile uint32_t *)h) = *datap++; + } +} + +void +bus_space_write_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t data) +{ + *((volatile uint8_t *)(h + offset)) = data; +} + +void +bus_space_write_2(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint16_t data) +{ + *((volatile uint16_t *)(h + offset)) = data; +} + +void +bus_space_write_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t data) +{ + *((volatile uint32_t *)(h + offset)) = data; +} + +uint8_t +bus_space_read_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint8_t *)(h + offset))); +} + +uint16_t +bus_space_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint16_t *)(h + offset))); +} + +uint32_t +bus_space_read_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t offset) +{ + return (*((volatile uint32_t *)(h + offset))); +} + +void +bus_space_read_region_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *datap++ = *((volatile uint8_t *)h); + h += 1; + } +} + +void +bus_space_write_region_1(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + h += offset; + + while (count--) { + *((volatile uint8_t *)h) = *datap++; + h += 1; + } +} + +void +bus_space_read_region_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + enum { BURST = sizeof(struct burst) / 4 }; + + h += offset; + + while (count >= BURST) { + *(struct burst *)datap = *((/* volatile */ struct burst *)h); + + h += BURST * 4; + datap += BURST; + count -= BURST; + } + + while (count--) { + *datap++ = *((volatile uint32_t *)h); + h += 4; + } +} + +void +bus_space_write_region_4(bus_space_tag_t t, bus_space_handle_t h, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + enum { BURST = sizeof(struct burst) / 4 }; + + h += offset; + + while (count >= BURST) { + *((/* volatile */ struct burst *)h) = *(struct burst *)datap; + + h += BURST * 4; + datap += BURST; + count -= BURST; + } + + while (count--) { + *((volatile uint32_t *)h) = *datap++; + h += 4; + } +} Copied: head/sys/boot/kshim/bsd_global.h (from r269521, head/sys/boot/usb/bsd_global.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/kshim/bsd_global.h Mon Aug 4 23:00:13 2014 (r269541, copy of r269521, head/sys/boot/usb/bsd_global.h) @@ -0,0 +1,65 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BSD_GLOBAL_H_ +#define _BSD_GLOBAL_H_ + +#include + +#define USB_DEBUG_VAR usb_debug +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern struct usb_process usb_process[USB_PROC_MAX]; + +#endif /* _BSD_GLOBAL_H_ */ Copied: head/sys/boot/kshim/bsd_kernel.c (from r269521, head/sys/boot/usb/bsd_kernel.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/kshim/bsd_kernel.c Mon Aug 4 23:00:13 2014 (r269541, copy of r269521, head/sys/boot/usb/bsd_kernel.c) @@ -0,0 +1,1239 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +struct usb_process usb_process[USB_PROC_MAX]; + +static device_t usb_pci_root; + +/*------------------------------------------------------------------------* + * Implementation of mutex API + *------------------------------------------------------------------------*/ + +struct mtx Giant; + +static void +mtx_system_init(void *arg) +{ + mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE); +} +SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL); + +void +mtx_init(struct mtx *mtx, const char *name, const char *type, int opt) +{ + mtx->owned = 0; + mtx->parent = mtx; +} + +void +mtx_lock(struct mtx *mtx) +{ + mtx = mtx->parent; + mtx->owned++; +} + +void +mtx_unlock(struct mtx *mtx) +{ + mtx = mtx->parent; + mtx->owned--; +} + +int +mtx_owned(struct mtx *mtx) +{ + mtx = mtx->parent; + return (mtx->owned != 0); +} + +void +mtx_destroy(struct mtx *mtx) +{ + /* NOP */ +} + +/*------------------------------------------------------------------------* + * Implementation of shared/exclusive mutex API + *------------------------------------------------------------------------*/ + +void +sx_init_flags(struct sx *sx, const char *name, int flags) +{ + sx->owned = 0; +} + +void +sx_destroy(struct sx *sx) +{ + /* NOP */ +} + +void +sx_xlock(struct sx *sx) +{ + sx->owned++; +} + +void +sx_xunlock(struct sx *sx) +{ + sx->owned--; +} + +int +sx_xlocked(struct sx *sx) +{ + return (sx->owned != 0); +} + +/*------------------------------------------------------------------------* + * Implementaiton of condition variable API + *------------------------------------------------------------------------*/ + +void +cv_init(struct cv *cv, const char *desc) +{ + cv->sleeping = 0; +} + +void +cv_destroy(struct cv *cv) +{ + /* NOP */ +} + +void +cv_wait(struct cv *cv, struct mtx *mtx) +{ + cv_timedwait(cv, mtx, -1); +} + +int +cv_timedwait(struct cv *cv, struct mtx *mtx, int timo) +{ + int start = ticks; + int delta; + + if (cv->sleeping) + return (EWOULDBLOCK); /* not allowed */ + + cv->sleeping = 1; + + while (cv->sleeping) { + if (timo >= 0) { + delta = ticks - start; + if (delta >= timo || delta < 0) + break; + } + mtx_unlock(mtx); + + usb_idle(); + + mtx_lock(mtx); + } + + if (cv->sleeping) { + cv->sleeping = 0; + return (EWOULDBLOCK); /* not allowed */ + } + return (0); +} + +void +cv_signal(struct cv *cv) +{ + cv->sleeping = 0; +} + +void +cv_broadcast(struct cv *cv) +{ + cv->sleeping = 0; +} + +/*------------------------------------------------------------------------* + * Implementation of callout API + *------------------------------------------------------------------------*/ + +static void callout_proc_msg(struct usb_proc_msg *); + +volatile int ticks = 0; + +static LIST_HEAD(, callout) head_callout = LIST_HEAD_INITIALIZER(&head_callout); + +static struct mtx mtx_callout; +static struct usb_proc_msg callout_msg[2]; + +static void +callout_system_init(void *arg) +{ + mtx_init(&mtx_callout, "callout-mtx", NULL, MTX_DEF | MTX_RECURSE); + + callout_msg[0].pm_callback = &callout_proc_msg; + callout_msg[1].pm_callback = &callout_proc_msg; +} +SYSINIT(callout_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, callout_system_init, NULL); + +static void +callout_callback(struct callout *c) +{ + mtx_lock(c->mtx); + + mtx_lock(&mtx_callout); + if (c->entry.le_prev != NULL) { + LIST_REMOVE(c, entry); + c->entry.le_prev = NULL; + } + mtx_unlock(&mtx_callout); + + if (c->func) + (c->func) (c->arg); + + if (!(c->flags & CALLOUT_RETURNUNLOCKED)) + mtx_unlock(c->mtx); +} + +void +callout_process(int timeout) +{ + ticks += timeout; + usb_proc_msignal(usb_process + 2, &callout_msg[0], &callout_msg[1]); +} + +static void +callout_proc_msg(struct usb_proc_msg *pmsg) +{ + struct callout *c; + int delta; + +repeat: + mtx_lock(&mtx_callout); + + LIST_FOREACH(c, &head_callout, entry) { + + delta = c->timeout - ticks; + if (delta < 0) { + mtx_unlock(&mtx_callout); + + callout_callback(c); + + goto repeat; + } + } + mtx_unlock(&mtx_callout); +} + +void +callout_init_mtx(struct callout *c, struct mtx *mtx, int flags) +{ + memset(c, 0, sizeof(*c)); + + if (mtx == NULL) + mtx = &Giant; + + c->mtx = mtx; + c->flags = (flags & CALLOUT_RETURNUNLOCKED); +} + +void +callout_reset(struct callout *c, int to_ticks, + void (*func) (void *), void *arg) +{ + callout_stop(c); + + c->func = func; + c->arg = arg; + c->timeout = ticks + to_ticks; + + mtx_lock(&mtx_callout); + LIST_INSERT_HEAD(&head_callout, c, entry); + mtx_unlock(&mtx_callout); +} + +void +callout_stop(struct callout *c) +{ + mtx_lock(&mtx_callout); + + if (c->entry.le_prev != NULL) { + LIST_REMOVE(c, entry); + c->entry.le_prev = NULL; + } + mtx_unlock(&mtx_callout); + + c->func = NULL; + c->arg = NULL; +} + +void +callout_drain(struct callout *c) +{ + if (c->mtx == NULL) + return; /* not initialised */ + + mtx_lock(c->mtx); + callout_stop(c); + mtx_unlock(c->mtx); +} + +int +callout_pending(struct callout *c) +{ + int retval; + + mtx_lock(&mtx_callout); + retval = (c->entry.le_prev != NULL); + mtx_unlock(&mtx_callout); + + return (retval); +} + +/*------------------------------------------------------------------------* + * Implementation of device API + *------------------------------------------------------------------------*/ + +static const char unknown_string[] = { "unknown" }; + +static TAILQ_HEAD(, module_data) module_head = + TAILQ_HEAD_INITIALIZER(module_head); + +static uint8_t +devclass_equal(const char *a, const char *b) +{ + char ta, tb; + + if (a == b) + return (1); + + while (1) { + ta = *a; + tb = *b; + if (ta != tb) + return (0); + if (ta == 0) + break; + a++; + b++; + } + return (1); +} + +int +bus_generic_resume(device_t dev) +{ + return (0); +} + +int +bus_generic_shutdown(device_t dev) +{ + return (0); +} + +int +bus_generic_suspend(device_t dev) +{ + return (0); +} + +int +bus_generic_print_child(device_t dev, device_t child) +{ + return (0); +} + +void +bus_generic_driver_added(device_t dev, driver_t *driver) +{ + return; +} + +device_t +device_get_parent(device_t dev) +{ + return (dev ? dev->dev_parent : NULL); +} + +void +device_set_interrupt(device_t dev, driver_filter_t *filter, + driver_intr_t *fn, void *arg) +{ + dev->dev_irq_filter = filter; + dev->dev_irq_fn = fn; + dev->dev_irq_arg = arg; +} + +void +device_run_interrupts(device_t parent) +{ + device_t child; + + if (parent == NULL) + return; + + TAILQ_FOREACH(child, &parent->dev_children, dev_link) { + int status; + if (child->dev_irq_filter != NULL) + status = child->dev_irq_filter(child->dev_irq_arg); + else + status = FILTER_SCHEDULE_THREAD; + + if (status == FILTER_SCHEDULE_THREAD) { + if (child->dev_irq_fn != NULL) + (child->dev_irq_fn) (child->dev_irq_arg); + } + } +} + +void +device_set_ivars(device_t dev, void *ivars) +{ + dev->dev_aux = ivars; +} + +void * +device_get_ivars(device_t dev) +{ + return (dev ? dev->dev_aux : NULL); +} + +int +device_get_unit(device_t dev) +{ + return (dev ? dev->dev_unit : 0); +} + +int +bus_generic_detach(device_t dev) +{ + device_t child; + int error; + + if (!dev->dev_attached) + return (EBUSY); + + TAILQ_FOREACH(child, &dev->dev_children, dev_link) { + if ((error = device_detach(child)) != 0) + return (error); + } + return (0); +} + +const char * +device_get_nameunit(device_t dev) +{ + if (dev && dev->dev_nameunit[0]) + return (dev->dev_nameunit); + + return (unknown_string); +} + +static uint8_t +devclass_create(devclass_t *dc_pp) +{ + if (dc_pp == NULL) { + return (1); + } + if (dc_pp[0] == NULL) { + dc_pp[0] = malloc(sizeof(**(dc_pp)), + M_DEVBUF, M_WAITOK | M_ZERO); + + if (dc_pp[0] == NULL) { + return (1); + } + } + return (0); +} + +static const struct module_data * +devclass_find_create(const char *classname) +{ + const struct module_data *mod; + + TAILQ_FOREACH(mod, &module_head, entry) { + if (devclass_equal(mod->mod_name, classname)) { + if (devclass_create(mod->devclass_pp)) { + continue; + } + return (mod); + } + } + return (NULL); +} + +static uint8_t +devclass_add_device(const struct module_data *mod, device_t dev) +{ + device_t *pp_dev; + device_t *end; + uint8_t unit; + + pp_dev = mod->devclass_pp[0]->dev_list; + end = pp_dev + DEVCLASS_MAXUNIT; + unit = 0; + + while (pp_dev != end) { + if (*pp_dev == NULL) { + *pp_dev = dev; + dev->dev_unit = unit; + dev->dev_module = mod; + snprintf(dev->dev_nameunit, + sizeof(dev->dev_nameunit), + "%s%d", device_get_name(dev), unit); + return (0); + } + pp_dev++; + unit++; + } + DPRINTF("Could not add device to devclass.\n"); + return (1); +} + +static void +devclass_delete_device(const struct module_data *mod, device_t dev) +{ + if (mod == NULL) { + return; + } + mod->devclass_pp[0]->dev_list[dev->dev_unit] = NULL; + dev->dev_module = NULL; +} + +static device_t +make_device(device_t parent, const char *name) +{ + device_t dev = NULL; + const struct module_data *mod = NULL; + + if (name) { + + mod = devclass_find_create(name); + + if (!mod) { + + DPRINTF("%s:%d:%s: can't find device " + "class %s\n", __FILE__, __LINE__, + __FUNCTION__, name); + + goto done; + } + } + dev = malloc(sizeof(*dev), + M_DEVBUF, M_WAITOK | M_ZERO); + + if (dev == NULL) + goto done; + + dev->dev_parent = parent; + TAILQ_INIT(&dev->dev_children); + + if (name) { + dev->dev_fixed_class = 1; + if (devclass_add_device(mod, dev)) { + goto error; + } + } +done: + return (dev); + +error: + if (dev) { + free(dev, M_DEVBUF); + } + return (NULL); +} + +device_t +device_add_child(device_t dev, const char *name, int unit) +{ + device_t child; + + if (unit != -1) { + device_printf(dev, "Unit is not -1\n"); + } + child = make_device(dev, name); + if (child == NULL) { + device_printf(dev, "Could not add child '%s'\n", name); + goto done; + } + if (dev == NULL) { + /* no parent */ + goto done; + } + TAILQ_INSERT_TAIL(&dev->dev_children, child, dev_link); +done: + return (child); +} + +int +device_delete_child(device_t dev, device_t child) +{ + int error = 0; + device_t grandchild; + + /* remove children first */ + + while ((grandchild = TAILQ_FIRST(&child->dev_children))) { + error = device_delete_child(child, grandchild); + if (error) { + device_printf(dev, "Error deleting child!\n"); + goto done; + } + } + + error = device_detach(child); + + if (error) + goto done; + + devclass_delete_device(child->dev_module, child); + + if (dev != NULL) { + /* remove child from parent */ + TAILQ_REMOVE(&dev->dev_children, child, dev_link); + } + free(child, M_DEVBUF); + +done: + return (error); +} + +int +device_delete_children(device_t dev) +{ + device_t child; + int error = 0; + + while ((child = TAILQ_FIRST(&dev->dev_children))) { + error = device_delete_child(dev, child); + if (error) { + device_printf(dev, "Error deleting child!\n"); + break; + } + } + return (error); +} + +void +device_quiet(device_t dev) +{ + dev->dev_quiet = 1; +} + +const char * +device_get_desc(device_t dev) +{ + if (dev) + return &(dev->dev_desc[0]); + return (unknown_string); +} + +static int +default_method(void) +{ + /* do nothing */ + DPRINTF("Default method called\n"); + return (0); +} + +void * +device_get_method(device_t dev, const char *what) +{ + const struct device_method *mtod; + + mtod = dev->dev_module->driver->methods; + while (mtod->func != NULL) { + if (devclass_equal(mtod->desc, what)) { + return (mtod->func); + } + mtod++; + } + return ((void *)&default_method); +} + +const char * +device_get_name(device_t dev) +{ + if (dev == NULL) + return (unknown_string); + + return (dev->dev_module->driver->name); +} + +static int +device_allocate_softc(device_t dev) +{ + const struct module_data *mod; + + mod = dev->dev_module; + + if ((dev->dev_softc_alloc == 0) && + (mod->driver->size != 0)) { + dev->dev_sc = malloc(mod->driver->size, + M_DEVBUF, M_WAITOK | M_ZERO); + + if (dev->dev_sc == NULL) + return (ENOMEM); + + dev->dev_softc_alloc = 1; + } + return (0); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Aug 4 23:22:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BC6ACFB; Mon, 4 Aug 2014 23:22:25 +0000 (UTC) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EFFC2A97; Mon, 4 Aug 2014 23:22:24 +0000 (UTC) Received: by mail-qg0-f48.google.com with SMTP id i50so168272qgf.7 for ; Mon, 04 Aug 2014 16:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=4epv+fz1/+fcAA68LBpo+7gu4qCCqnVG9KI6siY4zdU=; b=JA5yHqBArdfTgt3ckYdoBO2tyBUDbsLmCpKE+PyDc9ebOavNa1HVhCUN+7MiaKCRfG UWtyJZYtJecGcwTPwmmOsHCknAqHc0D4iHgCt5+ae6FwYIHRadS4GNgCHSkrWhBtWmba 1KpVSjzvOE7Uv1OvR05/BGpWXWtdAGBkH2E7AxQREFGDscc00d6bpjF3e1epT1nrBM48 jIM9FSCT98GhZL3ACaUwun3ml6AkZwstKTxbU5tVLTDunCZBRXftgg+jPGibjamdJKBK X4+Na3y1hhpZJyCjeClpaMTTgpXujrEuPwK+2jQT0vADi9VJFgo21w3GOqELgFDYL5Zw 4Ekw== MIME-Version: 1.0 X-Received: by 10.224.120.138 with SMTP id d10mr5997510qar.55.1407194543829; Mon, 04 Aug 2014 16:22:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.41.6 with HTTP; Mon, 4 Aug 2014 16:22:23 -0700 (PDT) In-Reply-To: <53e00b0f.529c.265fe830@svn.freebsd.org> References: <53e00b0f.529c.265fe830@svn.freebsd.org> Date: Mon, 4 Aug 2014 16:22:23 -0700 X-Google-Sender-Auth: eJlc2w0xOxZAa1b2tgIgYyskvm8 Message-ID: Subject: Re: svn commit: r269540 - in head/sys: conf modules/an modules/arcnet modules/cam modules/carp modules/cxgb/cxgb modules/cxgb/iw_cxgb modules/cxgb/tom modules/cxgbe/if_cxgbe modules/cxgbe/iw_cxgbe modu... From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 23:22:25 -0000 [snip] Oh thank god! -a From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 00:04:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E70074E0; Tue, 5 Aug 2014 00:04:09 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id A85162F63; Tue, 5 Aug 2014 00:04:09 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id ABD851040B2E; Tue, 5 Aug 2014 10:03:59 +1000 (EST) Date: Tue, 5 Aug 2014 10:03:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r269474 - in head: share/man/man4 sys/dev/vt In-Reply-To: Message-ID: <20140805091730.N2827@besplex.bde.org> References: <53de340e.52ce.7073778e@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=9sZAoq1AbeMA:10 a=252g7Ztp5P0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=XOorSdqQf1jApBK8IO4A:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 00:04:10 -0000 On Mon, 4 Aug 2014, John Baldwin wrote: > On Aug 3, 2014, at 6:07 AM, Aleksandr Rybalko wrote: > >> Log: >> Allow to disable some special key combinations handled by vt(4), like debug >> request, reboot request. >> >> Requested by: Claude Buisson >> >> Sponsored by: The FreeBSD Foundation > > I realize the API uses 'SPCL' as an abbreviation, but for user-facing things like a sysctl and tunable, I think it might be better to spell it out as "specialkeys" instead? It is a bad name, and also gratuitously different from syscons where the names are: hw.syscons.kbd_reboot hw.syscons.kbd_debug hw.syscons.sc_no_suspend_vtswitch The namespace seems to be more organized than syscons'. It seems to share other configuration bugs with syscons. Debugger entry is gated by debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger. There are too many compile-time options to give defaults for the sysctls, but not enough to give usable ones. BREAK_TO_DEBUGGER) is misused to give the default for debug.kdb.break_to_debugger. The BREAK in it means a serial line break and is only indirectly related to breakpoint instructions or breaking into the debugger. Entering the debugger on serial line breaks is usually unwanted, since they happen when a serial console is unplugged, so BREAK_TO_DEBUGGER should rarely be configured. Misusing it to control the sysctl gives a wrong configuration for debugger entry from vt's when it is correctly configured to off. debug.kdb_alt_break_to_debugger defeats the vt sysctls in another way. It gives another way to enter the debugger, and due to the reboot misfeature in it, it also gives another way to reboot. It is correct but confusing for vt's to have per-device options for controlling debugger support. You might have a multiple consoles with only some secure enough to debug on. Serial consoles need per-device options even more, but have less than one -- the old global serial device options are abused for kdb defaults. So only the combination of an insecure vt with a secure serial console is supported -- you have to enable the global options to get any debugger support so can't do this if you have a secure vt and an insecure serial console. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 00:07:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A81064A for ; Tue, 5 Aug 2014 00:07:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51D7E2F80 for ; Tue, 5 Aug 2014 00:07:22 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 53c7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 00:07:22 +0000 From: Xin LI Date: Tue, 5 Aug 2014 00:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269543 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0203a.53c7.17282657@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 00:07:22 -0000 Author: delphij Date: Tue Aug 5 00:07:21 2014 New Revision: 269543 URL: http://svnweb.freebsd.org/changeset/base/269543 Log: MFV r269542: In vdev_get_stats, check that the vdev is not a hole before computing the fragmentation. This fixes a panic when removing log device. Illumos issue: 5049 panic when removing log device Author: Alex Reece MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Aug 4 23:57:46 2014 (r269542) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Aug 5 00:07:21 2014 (r269543) @@ -2766,8 +2766,9 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * ? vd->vdev_top->vdev_ashift : vd->vdev_ashift; vs->vs_logical_ashift = vd->vdev_logical_ashift; vs->vs_physical_ashift = vd->vdev_physical_ashift; - if (vd->vdev_aux == NULL && vd == vd->vdev_top) + if (vd->vdev_aux == NULL && vd == vd->vdev_top && !vd->vdev_ishole) { vs->vs_fragmentation = vd->vdev_mg->mg_fragmentation; + } /* * If we're getting stats on the root vdev, aggregate the I/O counts From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 01:25:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C29BC25 for ; Tue, 5 Aug 2014 01:25:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 139C526AD for ; Tue, 5 Aug 2014 01:25:15 +0000 (UTC) Received: from pfg (uid 1275) (envelope-from pfg@FreeBSD.org) id 5007 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 01:25:14 +0000 From: Pedro F. Giffuni Date: Tue, 5 Aug 2014 01:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269548 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0327a.5007.906f8e0@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 01:25:15 -0000 Author: pfg Date: Tue Aug 5 01:25:14 2014 New Revision: 269548 URL: http://svnweb.freebsd.org/changeset/base/269548 Log: Revert r269523: Providing a higher EXT2_LINK_MAX limit is a bad idea for ext2/3. Discussed with: bde Modified: head/sys/fs/ext2fs/ext2_dir.h Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Tue Aug 5 01:03:11 2014 (r269547) +++ head/sys/fs/ext2fs/ext2_dir.h Tue Aug 5 01:25:14 2014 (r269548) @@ -72,7 +72,7 @@ struct ext2fs_direct_2 { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX LINK_MAX +#define EXT2_LINK_MAX 32000 /* * Ext2 directory file types. Only the low 3 bits are used. The From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 01:32:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B0A6E95 for ; Tue, 5 Aug 2014 01:32:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2170C2765 for ; Tue, 5 Aug 2014 01:32:10 +0000 (UTC) Received: from peter (uid 633) (envelope-from peter@FreeBSD.org) id 5452 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 01:32:10 +0000 From: Peter Wemm Date: Tue, 5 Aug 2014 01:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269550 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0341a.5452.17e6e933@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 01:32:10 -0000 Author: peter Date: Tue Aug 5 01:32:09 2014 New Revision: 269550 URL: http://svnweb.freebsd.org/changeset/base/269550 Log: Check gethostname(2) return code - but even if it succeeds it may not null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet. Modified: head/usr.sbin/cron/cron/do_command.c Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Tue Aug 5 01:29:02 2014 (r269549) +++ head/usr.sbin/cron/cron/do_command.c Tue Aug 5 01:32:09 2014 (r269550) @@ -481,14 +481,17 @@ child_process(e, u) auto char mailcmd[MAX_COMMAND]; auto char hostname[MAXHOSTNAMELEN]; - (void) gethostname(hostname, MAXHOSTNAMELEN); + if (gethostname(hostname, MAXHOSTNAMELEN) == -1) + hostname[0] = '\0'; + hostname[sizeof(hostname) - 1] = '\0'; (void) snprintf(mailcmd, sizeof(mailcmd), MAILARGS, MAILCMD); if (!(mail = cron_popen(mailcmd, "w", e))) { warn("%s", MAILCMD); (void) _exit(ERROR_EXIT); } - fprintf(mail, "From: %s (Cron Daemon)\n", usernm); + fprintf(mail, "From: Cron Daemon <%s@%s>\n", + usernm, hostname); fprintf(mail, "To: %s\n", mailto); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 06:31:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70ACB8C4 for ; Tue, 5 Aug 2014 06:31:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B582617 for ; Tue, 5 Aug 2014 06:31:10 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5bee by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 06:31:10 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 06:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269563 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e07a2e.5bee.1ee4e2f8@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 06:31:10 -0000 Author: hselasky Date: Tue Aug 5 06:31:09 2014 New Revision: 269563 URL: http://svnweb.freebsd.org/changeset/base/269563 Log: Ensure we catch USB transfers which complete right away. Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Tue Aug 5 05:00:22 2014 (r269562) +++ head/sys/dev/usb/controller/saf1761_otg.c Tue Aug 5 06:31:09 2014 (r269563) @@ -1927,7 +1927,7 @@ saf1761_otg_start_standard_chain(struct /* poll one time */ saf1761_otg_xfer_do_fifo(sc, xfer); - if (xfer->td_transfer_cache != NULL) { + if (saf1761_otg_xfer_do_complete(sc, xfer) == 0) { /* * Only enable the endpoint interrupt when we are * actually waiting for data, hence we are dealing @@ -1943,9 +1943,6 @@ saf1761_otg_start_standard_chain(struct usbd_transfer_timeout_ms(xfer, &saf1761_otg_timeout, xfer->timeout); } - } else { - /* catch completion, if any */ - saf1761_otg_interrupt_complete_locked(sc); } USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 06:34:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5DC5A3F for ; Tue, 5 Aug 2014 06:34:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC95A264C for ; Tue, 5 Aug 2014 06:34:00 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5f3e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 06:34:00 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 06:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269564 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e07ad8.5f3e.1a10c6a4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 06:34:00 -0000 Author: hselasky Date: Tue Aug 5 06:33:59 2014 New Revision: 269564 URL: http://svnweb.freebsd.org/changeset/base/269564 Log: - Implement fast interrupt handler to save CPU usage. - Add support for striding register offsets. - Cleanup some register reads and writes to use existing register access macros. Modified: head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/uss820dci.h head/sys/dev/usb/controller/uss820dci_atmelarm.c Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Tue Aug 5 06:31:09 2014 (r269563) +++ head/sys/dev/usb/controller/uss820dci.c Tue Aug 5 06:33:59 2014 (r269564) @@ -81,6 +81,9 @@ #define USS820_DCI_PC2SC(pc) \ USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) +#define USS820_DCI_THREAD_IRQ \ + (USS820_SSR_SUSPEND | USS820_SSR_RESUME | USS820_SSR_RESET) + #ifdef USB_DEBUG static int uss820dcidebug = 0; @@ -243,24 +246,18 @@ uss820dci_set_address(struct uss820dci_s } static uint8_t -uss820dci_setup_rx(struct uss820dci_td *td) +uss820dci_setup_rx(struct uss820dci_softc *sc, struct uss820dci_td *td) { - struct uss820dci_softc *sc; struct usb_device_request req; uint16_t count; uint8_t rx_stat; uint8_t temp; /* select the correct endpoint */ - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_EPINDEX, td->ep_index); + USS820_WRITE_1(sc, USS820_EPINDEX, td->ep_index); /* read out FIFO status */ - rx_stat = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXSTAT); - - /* get pointer to softc */ - sc = USS820_DCI_PC2SC(td->pc); + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); DPRINTFN(5, "rx_stat=0x%02x rem=%u\n", rx_stat, td->remainder); @@ -282,10 +279,8 @@ uss820dci_setup_rx(struct uss820dci_td * 0xFF ^ USS820_RXSTAT_EDOVW, 0); /* get the packet byte count */ - count = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCNTL); - count |= (bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCNTH) << 8); + count = USS820_READ_1(sc, USS820_RXCNTL); + count |= (USS820_READ_1(sc, USS820_RXCNTH) << 8); count &= 0x3FF; /* verify data length */ @@ -300,12 +295,11 @@ uss820dci_setup_rx(struct uss820dci_td * goto setup_not_complete; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, - USS820_RXDAT, (void *)&req, sizeof(req)); + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + USS820_RXDAT * USS820_REG_STRIDE, (void *)&req, sizeof(req)); /* read out FIFO status */ - rx_stat = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXSTAT); + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); if (rx_stat & (USS820_RXSTAT_EDOVW | USS820_RXSTAT_STOVW)) { @@ -319,11 +313,9 @@ uss820dci_setup_rx(struct uss820dci_td * USS820_RXSTAT_STOVW), 0); /* set RXFFRC bit */ - temp = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCON); + temp = USS820_READ_1(sc, USS820_RXCON); temp |= USS820_RXCON_RXFFRC; - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_RXCON, temp); + USS820_WRITE_1(sc, USS820_RXCON, temp); /* copy data into real buffer */ usbd_copy_in(td->pc, 0, &req, sizeof(req)); @@ -351,11 +343,9 @@ uss820dci_setup_rx(struct uss820dci_td * setup_not_complete: /* set RXFFRC bit */ - temp = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCON); + temp = USS820_READ_1(sc, USS820_RXCON); temp |= USS820_RXCON_RXFFRC; - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_RXCON, temp); + USS820_WRITE_1(sc, USS820_RXCON, temp); /* FALLTHROUGH */ @@ -378,11 +368,10 @@ not_complete: USS820_RXSTAT_RXSETUP), 0); } return (1); /* not complete */ - } static uint8_t -uss820dci_data_rx(struct uss820dci_td *td) +uss820dci_data_rx(struct uss820dci_softc *sc, struct uss820dci_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -396,16 +385,14 @@ uss820dci_data_rx(struct uss820dci_td *t got_short = 0; /* select the correct endpoint */ - bus_space_write_1(td->io_tag, td->io_hdl, USS820_EPINDEX, td->ep_index); + USS820_WRITE_1(sc, USS820_EPINDEX, td->ep_index); /* check if any of the FIFO banks have data */ repeat: /* read out FIFO flag */ - rx_flag = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXFLG); + rx_flag = USS820_READ_1(sc, USS820_RXFLG); /* read out FIFO status */ - rx_stat = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXSTAT); + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); DPRINTFN(5, "rx_stat=0x%02x rx_flag=0x%02x rem=%u\n", rx_stat, rx_flag, td->remainder); @@ -449,11 +436,8 @@ repeat: return (1); /* not complete */ } /* get the packet byte count */ - count = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCNTL); - - count |= (bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCNTH) << 8); + count = USS820_READ_1(sc, USS820_RXCNTL); + count |= (USS820_READ_1(sc, USS820_RXCNTH) << 8); count &= 0x3FF; DPRINTFN(5, "count=0x%04x\n", count); @@ -484,8 +468,8 @@ repeat: buf_res.length = count; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, - USS820_RXDAT, buf_res.buffer, buf_res.length); + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + USS820_RXDAT * USS820_REG_STRIDE, buf_res.buffer, buf_res.length); /* update counters */ count -= buf_res.length; @@ -494,11 +478,9 @@ repeat: } /* set RXFFRC bit */ - rx_cntl = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXCON); + rx_cntl = USS820_READ_1(sc, USS820_RXCON); rx_cntl |= USS820_RXCON_RXFFRC; - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_RXCON, rx_cntl); + USS820_WRITE_1(sc, USS820_RXCON, rx_cntl); /* check if we are complete */ if ((td->remainder == 0) || got_short) { @@ -515,7 +497,7 @@ repeat: } static uint8_t -uss820dci_data_tx(struct uss820dci_td *td) +uss820dci_data_tx(struct uss820dci_softc *sc, struct uss820dci_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -525,19 +507,16 @@ uss820dci_data_tx(struct uss820dci_td *t uint8_t to; /* select the correct endpoint */ - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_EPINDEX, td->ep_index); + USS820_WRITE_1(sc, USS820_EPINDEX, td->ep_index); to = 2; /* don't loop forever! */ repeat: /* read out TX FIFO flags */ - tx_flag = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_TXFLG); + tx_flag = USS820_READ_1(sc, USS820_TXFLG); /* read out RX FIFO status last */ - rx_stat = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXSTAT); + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); DPRINTFN(5, "rx_stat=0x%02x tx_flag=0x%02x rem=%u\n", rx_stat, tx_flag, td->remainder); @@ -583,8 +562,8 @@ repeat: buf_res.length = count; } /* transmit data */ - bus_space_write_multi_1(td->io_tag, td->io_hdl, - USS820_TXDAT, buf_res.buffer, buf_res.length); + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + USS820_TXDAT * USS820_REG_STRIDE, buf_res.buffer, buf_res.length); /* update counters */ count -= buf_res.length; @@ -593,12 +572,10 @@ repeat: } /* post-write high packet byte count first */ - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_TXCNTH, count_copy >> 8); + USS820_WRITE_1(sc, USS820_TXCNTH, count_copy >> 8); /* post-write low packet byte count last */ - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_TXCNTL, count_copy); + USS820_WRITE_1(sc, USS820_TXCNTL, count_copy); /* * Enable TX output, which must happen after that we have written @@ -623,23 +600,19 @@ repeat: } static uint8_t -uss820dci_data_tx_sync(struct uss820dci_td *td) +uss820dci_data_tx_sync(struct uss820dci_softc *sc, struct uss820dci_td *td) { - struct uss820dci_softc *sc; uint8_t rx_stat; uint8_t tx_flag; /* select the correct endpoint */ - bus_space_write_1(td->io_tag, td->io_hdl, - USS820_EPINDEX, td->ep_index); + USS820_WRITE_1(sc, USS820_EPINDEX, td->ep_index); /* read out TX FIFO flag */ - tx_flag = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_TXFLG); + tx_flag = USS820_READ_1(sc, USS820_TXFLG); /* read out RX FIFO status last */ - rx_stat = bus_space_read_1(td->io_tag, td->io_hdl, - USS820_RXSTAT); + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); DPRINTFN(5, "rx_stat=0x%02x rem=%u\n", rx_stat, td->remainder); @@ -662,7 +635,6 @@ uss820dci_data_tx_sync(struct uss820dci_ USS820_TXFLG_TXFIF1)) { return (1); /* not complete */ } - sc = USS820_DCI_PC2SC(td->pc); if (sc->sc_dv_addr != 0xFF) { /* write function address */ uss820dci_set_address(sc, sc->sc_dv_addr); @@ -670,16 +642,20 @@ uss820dci_data_tx_sync(struct uss820dci_ return (0); /* complete */ } -static uint8_t +static void uss820dci_xfer_do_fifo(struct usb_xfer *xfer) { + struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus); struct uss820dci_td *td; DPRINTFN(9, "\n"); td = xfer->td_transfer_cache; + if (td == NULL) + return; + while (1) { - if ((td->func) (td)) { + if ((td->func) (sc, td)) { /* operation in progress */ break; } @@ -703,27 +679,47 @@ uss820dci_xfer_do_fifo(struct usb_xfer * td = td->obj_next; xfer->td_transfer_cache = td; } - return (1); /* not complete */ + return; done: /* compute all actual lengths */ + xfer->td_transfer_cache = NULL; + sc->sc_xfer_complete = 1; +} - uss820dci_standard_done(xfer); +static uint8_t +uss820dci_xfer_do_complete(struct usb_xfer *xfer) +{ + struct uss820dci_td *td; - return (0); /* complete */ + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + if (td == NULL) { + /* compute all actual lengths */ + uss820dci_standard_done(xfer); + return(1); + } + return (0); } static void -uss820dci_interrupt_poll(struct uss820dci_softc *sc) +uss820dci_interrupt_poll_locked(struct uss820dci_softc *sc) { struct usb_xfer *xfer; + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) + uss820dci_xfer_do_fifo(xfer); +} + +static void +uss820dci_interrupt_complete_locked(struct uss820dci_softc *sc) +{ + struct usb_xfer *xfer; repeat: TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!uss820dci_xfer_do_fifo(xfer)) { - /* queue has been modified */ + if (uss820dci_xfer_do_complete(xfer)) goto repeat; - } } } @@ -748,27 +744,51 @@ uss820dci_wait_suspend(struct uss820dci_ USS820_WRITE_1(sc, USS820_SCRATCH, scratch); } +int +uss820dci_filter_interrupt(void *arg) +{ + struct uss820dci_softc *sc = arg; + int retval = FILTER_HANDLED; + uint8_t ssr; + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + ssr = USS820_READ_1(sc, USS820_SSR); + uss820dci_update_shared_1(sc, USS820_SSR, USS820_DCI_THREAD_IRQ, 0); + + if (ssr & USS820_DCI_THREAD_IRQ) + retval = FILTER_SCHEDULE_THREAD; + + /* poll FIFOs, if any */ + uss820dci_interrupt_poll_locked(sc); + + if (sc->sc_xfer_complete != 0) + retval = FILTER_SCHEDULE_THREAD; + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + + return (retval); +} + void -uss820dci_interrupt(struct uss820dci_softc *sc) +uss820dci_interrupt(void *arg) { + struct uss820dci_softc *sc = arg; uint8_t ssr; uint8_t event; USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); ssr = USS820_READ_1(sc, USS820_SSR); - ssr &= (USS820_SSR_SUSPEND | - USS820_SSR_RESUME | - USS820_SSR_RESET); - /* acknowledge all interrupts */ - uss820dci_update_shared_1(sc, USS820_SSR, 0, 0); + uss820dci_update_shared_1(sc, USS820_SSR, ~USS820_DCI_THREAD_IRQ, 0); /* check for any bus state change interrupts */ - if (ssr) { + if (ssr & USS820_DCI_THREAD_IRQ) { event = 0; @@ -820,9 +840,13 @@ uss820dci_interrupt(struct uss820dci_sof /* acknowledge all SBI1 interrupts */ uss820dci_update_shared_1(sc, USS820_SBI1, 0, 0); - /* poll all active transfers */ - uss820dci_interrupt_poll(sc); + if (sc->sc_xfer_complete != 0) { + sc->sc_xfer_complete = 0; + /* complete FIFOs, if any */ + uss820dci_interrupt_complete_locked(sc); + } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1050,11 +1074,16 @@ uss820dci_intr_set(struct usb_xfer *xfer static void uss820dci_start_standard_chain(struct usb_xfer *xfer) { + struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus); + DPRINTFN(9, "\n"); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* poll one time */ - if (uss820dci_xfer_do_fifo(xfer)) { + uss820dci_xfer_do_fifo(xfer); + if (uss820dci_xfer_do_complete(xfer) == 0) { /* * Only enable the endpoint interrupt when we are * actually waiting for data, hence we are dealing @@ -1071,6 +1100,7 @@ uss820dci_start_standard_chain(struct us &uss820dci_timeout, xfer->timeout); } } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1204,16 +1234,22 @@ done: static void uss820dci_device_done(struct usb_xfer *xfer, usb_error_t error) { + struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { uss820dci_intr_set(xfer, 0); } /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1246,6 +1282,7 @@ uss820dci_set_stall(struct usb_device *u /* should not happen */ return; } + USB_BUS_SPIN_LOCK(&sc->sc_bus); USS820_WRITE_1(sc, USS820_EPINDEX, ep_no); if (ep_dir == UE_DIR_IN) { @@ -1254,6 +1291,7 @@ uss820dci_set_stall(struct usb_device *u temp = USS820_EPCON_RXSTL; } uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, temp); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1266,6 +1304,8 @@ uss820dci_clear_stall_sub(struct uss820d /* clearing stall is not needed */ return; } + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* select endpoint index */ USS820_WRITE_1(sc, USS820_EPINDEX, ep_no); @@ -1304,6 +1344,7 @@ uss820dci_clear_stall_sub(struct uss820d temp &= ~USS820_RXCON_RXCLR; USS820_WRITE_1(sc, USS820_RXCON, temp); } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1540,7 +1581,10 @@ uss820dci_do_poll(struct usb_bus *bus) struct uss820dci_softc *sc = USS820_DCI_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); - uss820dci_interrupt_poll(sc); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + uss820dci_interrupt_poll_locked(sc); + uss820dci_interrupt_complete_locked(sc); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -2304,8 +2348,6 @@ uss820dci_xfer_setup(struct usb_setup_pa td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ - td->io_tag = sc->sc_io_tag; - td->io_hdl = sc->sc_io_hdl; td->max_packet_size = xfer->max_packet_size; td->ep_index = ep_no; if (pf->support_multi_buffer && Modified: head/sys/dev/usb/controller/uss820dci.h ============================================================================== --- head/sys/dev/usb/controller/uss820dci.h Tue Aug 5 06:31:09 2014 (r269563) +++ head/sys/dev/usb/controller/uss820dci.h Tue Aug 5 06:33:59 2014 (r269564) @@ -255,19 +255,22 @@ #define USS820_UNK1 0x1f /* Unknown */ #define USS820_UNK1_UNKNOWN 0xFF +#ifndef USS820_REG_STRIDE +#define USS820_REG_STRIDE 1 +#endif + #define USS820_READ_1(sc, reg) \ - bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) + bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg) * USS820_REG_STRIDE) #define USS820_WRITE_1(sc, reg, data) \ - bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) + bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg) * USS820_REG_STRIDE, (data)) struct uss820dci_td; +struct uss820dci_softc; -typedef uint8_t (uss820dci_cmd_t)(struct uss820dci_td *td); +typedef uint8_t (uss820dci_cmd_t)(struct uss820dci_softc *, struct uss820dci_td *td); struct uss820dci_td { - bus_space_tag_t io_tag; - bus_space_handle_t io_hdl; struct uss820dci_td *obj_next; uss820dci_cmd_t *func; struct usb_page_cache *pc; @@ -336,6 +339,8 @@ struct uss820dci_softc { bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; + uint32_t sc_xfer_complete; + uint8_t sc_rt_addr; /* root HUB address */ uint8_t sc_dv_addr; /* device address */ uint8_t sc_conf; /* root HUB config */ @@ -349,6 +354,7 @@ struct uss820dci_softc { usb_error_t uss820dci_init(struct uss820dci_softc *sc); void uss820dci_uninit(struct uss820dci_softc *sc); -void uss820dci_interrupt(struct uss820dci_softc *sc); +driver_filter_t uss820dci_filter_interrupt; +driver_intr_t uss820dci_interrupt; #endif /* _USS820_DCI_H_ */ Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Aug 5 06:31:09 2014 (r269563) +++ head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Aug 5 06:33:59 2014 (r269564) @@ -136,13 +136,8 @@ uss820_atmelarm_attach(device_t dev) } device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); -#if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)uss820dci_interrupt, sc, &sc->sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)uss820dci_interrupt, sc, &sc->sc_intr_hdl); -#endif + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + uss820dci_filter_interrupt, uss820dci_interrupt, sc, &sc->sc_intr_hdl); if (err) { sc->sc_intr_hdl = NULL; goto error; From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 06:37:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 200DEC6E for ; Tue, 5 Aug 2014 06:37:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA88F266A for ; Tue, 5 Aug 2014 06:37:07 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5faa by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 06:37:07 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 06:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269565 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e07b93.5faa.366fa3db@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 06:37:08 -0000 Author: hselasky Date: Tue Aug 5 06:37:07 2014 New Revision: 269565 URL: http://svnweb.freebsd.org/changeset/base/269565 Log: Rename driver name a bit to avoid unit number confusion in dmesg. MFC after: 3 days Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci_atmelarm.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Tue Aug 5 06:33:59 2014 (r269564) +++ head/sys/dev/usb/controller/usb_controller.c Tue Aug 5 06:37:07 2014 (r269565) @@ -130,7 +130,7 @@ DRIVER_MODULE(usbus, xhci, usb_driver, u /* Device Only Drivers */ DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, musbotg, usb_driver, usb_devclass, 0, 0); -DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, uss820dci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, octusb, usb_driver, usb_devclass, 0, 0); /* Dual Mode Drivers */ Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Aug 5 06:33:59 2014 (r269564) +++ head/sys/dev/usb/controller/uss820dci_atmelarm.c Tue Aug 5 06:37:07 2014 (r269565) @@ -77,15 +77,15 @@ static device_method_t uss820dci_methods }; static driver_t uss820dci_driver = { - .name = "uss820", + .name = "uss820dci", .methods = uss820dci_methods, .size = sizeof(struct uss820dci_softc), }; static devclass_t uss820dci_devclass; -DRIVER_MODULE(uss820, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); -MODULE_DEPEND(uss820, usb, 1, 1, 1); +DRIVER_MODULE(uss820dci, atmelarm, uss820dci_driver, uss820dci_devclass, 0, 0); +MODULE_DEPEND(uss820dci, usb, 1, 1, 1); static const char *const uss820_desc = "USS820 USB Device Controller"; From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 06:38:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93AD2DAF for ; Tue, 5 Aug 2014 06:38:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63D0C2671 for ; Tue, 5 Aug 2014 06:38:21 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5fbd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 06:38:21 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 06:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269566 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e07bdd.5fbd.2b1c48bd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 06:38:21 -0000 Author: hselasky Date: Tue Aug 5 06:38:21 2014 New Revision: 269566 URL: http://svnweb.freebsd.org/changeset/base/269566 Log: Fix for deadlock in USB device side mode. MFC after: 3 days Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Aug 5 06:37:07 2014 (r269565) +++ head/sys/dev/usb/usb_device.c Tue Aug 5 06:38:21 2014 (r269566) @@ -448,6 +448,17 @@ usb_endpoint_foreach(struct usb_device * return (NULL); } +#if USB_HAVE_UGEN +static uint16_t +usb_get_refcount(struct usb_device *udev) +{ + if (usb_proc_is_called_from(USB_BUS_EXPLORE_PROC(udev->bus)) || + usb_proc_is_called_from(USB_BUS_CONTROL_XFER_PROC(udev->bus))) + return (1); + return (2); +} +#endif + /*------------------------------------------------------------------------* * usb_wait_pending_ref_locked * @@ -460,9 +471,7 @@ static void usb_wait_pending_ref_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); @@ -493,9 +502,7 @@ static void usb_ref_restore_locked(struct usb_device *udev) { #if USB_HAVE_UGEN - const uint16_t refcount = - usb_proc_is_called_from( - USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + const uint16_t refcount = usb_get_refcount(udev); DPRINTF("Refcount = %d\n", (int)refcount); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 07:03:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81E315B3 for ; Tue, 5 Aug 2014 07:03:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F8F8293C for ; Tue, 5 Aug 2014 07:03:18 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5c76 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 07:03:17 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 07:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269567 - in head/sys: boot/usb conf dev/usb dev/usb/template modules/usb/template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e081b5.5c76.4a0ed79e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 07:03:18 -0000 Author: hselasky Date: Tue Aug 5 07:03:16 2014 New Revision: 269567 URL: http://svnweb.freebsd.org/changeset/base/269567 Log: Add new USB phone descriptor template for USB device side mode. MFC after: 3 days Added: head/sys/dev/usb/template/usb_template_phone.c (contents, props changed) Modified: head/sys/boot/usb/usbcore.mk head/sys/conf/files head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/template/Makefile Modified: head/sys/boot/usb/usbcore.mk ============================================================================== --- head/sys/boot/usb/usbcore.mk Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/boot/usb/usbcore.mk Tue Aug 5 07:03:16 2014 (r269567) @@ -141,6 +141,7 @@ KSRCS+= usb_template_modem.c KSRCS+= usb_template_mouse.c KSRCS+= usb_template_kbd.c KSRCS+= usb_template_audio.c +KSRCS+= usb_template_phone.c # # USB mass storage support Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/conf/files Tue Aug 5 07:03:16 2014 (r269567) @@ -2514,6 +2514,7 @@ dev/usb/template/usb_template_modem.c op dev/usb/template/usb_template_mouse.c optional usb_template dev/usb/template/usb_template_msc.c optional usb_template dev/usb/template/usb_template_mtp.c optional usb_template +dev/usb/template/usb_template_phone.c optional usb_template # # USB END # Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/dev/usb/template/usb_template.c Tue Aug 5 07:03:16 2014 (r269567) @@ -135,7 +135,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got a CDC union descriptor */ - if ((raw[0] >= sizeof(struct usb_cdc_union_descriptor)) && + if ((raw[0] == sizeof(struct usb_cdc_union_descriptor)) && (raw[1] == UDESC_CS_INTERFACE) && (raw[2] == UDESCSUB_CDC_UNION)) { struct usb_cdc_union_descriptor *ud = (void *)dst; @@ -150,7 +150,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got an interface association descriptor */ - if ((raw[0] >= sizeof(struct usb_interface_assoc_descriptor)) && + if ((raw[0] == sizeof(struct usb_interface_assoc_descriptor)) && (raw[1] == UDESC_IFACE_ASSOC)) { struct usb_interface_assoc_descriptor *iad = (void *)dst; @@ -162,7 +162,7 @@ usb_make_raw_desc(struct usb_temp_setup /* check if we have got a call management descriptor */ - if ((raw[0] >= sizeof(struct usb_cdc_cm_descriptor)) && + if ((raw[0] == sizeof(struct usb_cdc_cm_descriptor)) && (raw[1] == UDESC_CS_INTERFACE) && (raw[2] == UDESCSUB_CDC_CM)) { struct usb_cdc_cm_descriptor *ccd = (void *)dst; @@ -1368,6 +1368,9 @@ usb_temp_setup_by_index(struct usb_devic case USB_TEMP_MOUSE: err = usb_temp_setup(udev, &usb_template_mouse); break; + case USB_TEMP_PHONE: + err = usb_temp_setup(udev, &usb_template_phone); + break; default: return (USB_ERR_INVAL); } Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/dev/usb/template/usb_template.h Tue Aug 5 07:03:16 2014 (r269567) @@ -105,6 +105,7 @@ extern const struct usb_temp_device_desc extern const struct usb_temp_device_desc usb_template_mouse; extern const struct usb_temp_device_desc usb_template_msc; extern const struct usb_temp_device_desc usb_template_mtp; +extern const struct usb_temp_device_desc usb_template_phone; usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); Added: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_phone.c Tue Aug 5 07:03:16 2014 (r269567) @@ -0,0 +1,419 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky. 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This file contains the USB template for an USB phone device. + */ + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + +enum { + INDEX_PHONE_LANG, + INDEX_PHONE_MIXER, + INDEX_PHONE_RECORD, + INDEX_PHONE_PLAYBACK, + INDEX_PHONE_PRODUCT, + INDEX_PHONE_HID, + INDEX_PHONE_MAX, +}; + +#define STRING_PHONE_PRODUCT \ + "U\0S\0B\0 \0P\0h\0o\0n\0e\0 \0D\0e\0v\0i\0c\0e" + +#define STRING_PHONE_MIXER \ + "M\0i\0x\0e\0r\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_RECORD \ + "R\0e\0c\0o\0r\0d\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_PLAYBACK \ + "P\0l\0a\0y\0b\0a\0c\0k\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +#define STRING_PHONE_HID \ + "H\0I\0D\0 \0i\0n\0t\0e\0r\0f\0a\0c\0e" + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_PHONE_MIXER, string_phone_mixer); +USB_MAKE_STRING_DESC(STRING_PHONE_RECORD, string_phone_record); +USB_MAKE_STRING_DESC(STRING_PHONE_PLAYBACK, string_phone_playback); +USB_MAKE_STRING_DESC(STRING_PHONE_PRODUCT, string_phone_product); +USB_MAKE_STRING_DESC(STRING_PHONE_HID, string_phone_hid); + +/* prototypes */ + +/* + * Phone Mixer description structures + * + * Some of the phone descriptors were dumped from no longer in + * production Yealink VOIP USB phone adapter: + */ +static uint8_t phone_hid_descriptor[] = { + 0x05, 0x0b, 0x09, 0x01, 0xa1, 0x01, 0x05, 0x09, + 0x19, 0x01, 0x29, 0x3f, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x80, 0x81, 0x00, 0x05, 0x08, + 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x80, 0x91, 0x00, 0xc0 +}; + +static const uint8_t phone_raw_desc_0[] = { + 0x0a, 0x24, 0x01, 0x00, 0x01, 0x4a, 0x00, 0x02, + 0x01, 0x02 +}; + +static const uint8_t phone_raw_desc_1[] = { + 0x0c, 0x24, 0x02, 0x01, 0x01, 0x02, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_2[] = { + 0x0c, 0x24, 0x02, 0x02, 0x01, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_3[] = { + 0x09, 0x24, 0x03, 0x03, 0x01, 0x03, 0x00, 0x06, + 0x00 +}; + +static const uint8_t phone_raw_desc_4[] = { + 0x09, 0x24, 0x03, 0x04, 0x01, 0x01, 0x00, 0x05, + 0x00 +}; + +static const uint8_t phone_raw_desc_5[] = { + 0x0b, 0x24, 0x06, 0x05, 0x01, 0x02, 0x03, 0x00, + 0x03, 0x00, 0x00 +}; + +static const uint8_t phone_raw_desc_6[] = { + 0x0b, 0x24, 0x06, 0x06, 0x02, 0x02, 0x03, 0x00, + 0x03, 0x00, 0x00 +}; + +static const void *phone_raw_iface_0_desc[] = { + phone_raw_desc_0, + phone_raw_desc_1, + phone_raw_desc_2, + phone_raw_desc_3, + phone_raw_desc_4, + phone_raw_desc_5, + phone_raw_desc_6, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = phone_raw_iface_0_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_MIXER, +}; + +static const uint8_t phone_raw_desc_20[] = { + 0x07, 0x24, 0x01, 0x04, 0x01, 0x01, 0x00 +}; + +static const uint8_t phone_raw_desc_21[] = { + 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01, + /* 8kHz */ + 0x40, 0x1f, 0x00 +}; + +static const uint8_t phone_raw_desc_22[] = { + 0x07, 0x25, 0x01, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *phone_raw_iface_1_desc[] = { + phone_raw_desc_20, + phone_raw_desc_21, + NULL, +}; + +static const void *phone_raw_ep_1_desc[] = { + phone_raw_desc_22, + NULL, +}; + +static const struct usb_temp_packet_size phone_isoc_mps = { + .mps[USB_SPEED_FULL] = 0x10, + .mps[USB_SPEED_HIGH] = 0x10, +}; + +static const struct usb_temp_interval phone_isoc_interval = { + .bInterval[USB_SPEED_FULL] = 1, /* 1:1 */ + .bInterval[USB_SPEED_HIGH] = 4, /* 1:8 */ +}; + +static const struct usb_temp_endpoint_desc phone_isoc_in_ep = { + .ppRawDesc = phone_raw_ep_1_desc, + .pPacketSize = &phone_isoc_mps, + .pIntervals = &phone_isoc_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_ISOCHRONOUS, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_1_ep[] = { + &phone_isoc_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_1_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_PLAYBACK, +}; + +static const struct usb_temp_interface_desc phone_iface_1_alt_1 = { + .ppEndpoints = phone_iface_1_ep, + .ppRawDesc = phone_raw_iface_1_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_PLAYBACK, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t phone_raw_desc_30[] = { + 0x07, 0x24, 0x01, 0x02, 0x01, 0x01, 0x00 +}; + +static const uint8_t phone_raw_desc_31[] = { + 0x0b, 0x24, 0x02, 0x01, 0x01, 0x02, 0x10, 0x01, + /* 8kHz */ + 0x40, 0x1f, 0x00 +}; + +static const uint8_t phone_raw_desc_32[] = { + 0x07, 0x25, 0x01, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *phone_raw_iface_2_desc[] = { + phone_raw_desc_30, + phone_raw_desc_31, + NULL, +}; + +static const void *phone_raw_ep_2_desc[] = { + phone_raw_desc_32, + NULL, +}; + +static const struct usb_temp_endpoint_desc phone_isoc_out_ep = { + .ppRawDesc = phone_raw_ep_2_desc, + .pPacketSize = &phone_isoc_mps, + .pIntervals = &phone_isoc_interval, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_ISOCHRONOUS, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_2_ep[] = { + &phone_isoc_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_2_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_RECORD, +}; + +static const struct usb_temp_interface_desc phone_iface_2_alt_1 = { + .ppEndpoints = phone_iface_2_ep, + .ppRawDesc = phone_raw_iface_2_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_RECORD, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t phone_hid_raw_desc_0[] = { + 0x09, 0x21, 0x00, 0x01, 0x00, 0x01, 0x22, sizeof(phone_hid_descriptor), + 0x00 +}; + +static const void *phone_hid_desc_0[] = { + phone_hid_raw_desc_0, + NULL, +}; + +static const struct usb_temp_packet_size phone_hid_mps = { + .mps[USB_SPEED_FULL] = 0x10, + .mps[USB_SPEED_HIGH] = 0x10, +}; + +static const struct usb_temp_interval phone_hid_interval = { + .bInterval[USB_SPEED_FULL] = 2, /* 2ms */ + .bInterval[USB_SPEED_HIGH] = 2, /* 2ms */ +}; + +static const struct usb_temp_endpoint_desc phone_hid_in_ep = { + .pPacketSize = &phone_hid_mps, + .pIntervals = &phone_hid_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc *phone_iface_3_ep[] = { + &phone_hid_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc phone_iface_3 = { + .ppEndpoints = phone_iface_3_ep, + .ppRawDesc = phone_hid_desc_0, + .bInterfaceClass = 3, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0, + .iInterface = INDEX_PHONE_HID, +}; + +static const struct usb_temp_interface_desc *phone_interfaces[] = { + &phone_iface_0, + &phone_iface_1_alt_0, + &phone_iface_1_alt_1, + &phone_iface_2_alt_0, + &phone_iface_2_alt_1, + &phone_iface_3, + NULL, +}; + +static const struct usb_temp_config_desc phone_config_desc = { + .ppIfaceDesc = phone_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PHONE_PRODUCT, +}; + +static const struct usb_temp_config_desc *phone_configs[] = { + &phone_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t phone_get_string_desc; +static usb_temp_get_vendor_desc_t phone_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_phone = { + .getStringDesc = &phone_get_string_desc, + .getVendorDesc = &phone_get_vendor_desc, + .ppConfigDesc = phone_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0xb001, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_IN_INTERFACE, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PHONE_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * phone_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +phone_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + if ((req->bmRequestType == 0x81) && (req->bRequest == 0x06) && + (req->wValue[0] == 0x00) && (req->wValue[1] == 0x22) && + (req->wIndex[1] == 0) && (req->wIndex[0] == 3 /* iface */)) { + + *plen = sizeof(phone_hid_descriptor); + return (phone_hid_descriptor); + } + return (NULL); +} + +/*------------------------------------------------------------------------* + * phone_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +phone_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_PHONE_MAX] = { + [INDEX_PHONE_LANG] = &usb_string_lang_en, + [INDEX_PHONE_MIXER] = &string_phone_mixer, + [INDEX_PHONE_RECORD] = &string_phone_record, + [INDEX_PHONE_PLAYBACK] = &string_phone_playback, + [INDEX_PHONE_PRODUCT] = &string_phone_product, + [INDEX_PHONE_HID] = &string_phone_hid, + }; + + if (string_index == 0) { + return (&usb_string_lang_en); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_PHONE_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/dev/usb/usb_ioctl.h Tue Aug 5 07:03:16 2014 (r269567) @@ -64,6 +64,7 @@ enum { USB_TEMP_AUDIO, /* USB Audio */ USB_TEMP_KBD, /* USB Keyboard */ USB_TEMP_MOUSE, /* USB Mouse */ + USB_TEMP_PHONE, /* USB Phone */ USB_TEMP_MAX, }; Modified: head/sys/modules/usb/template/Makefile ============================================================================== --- head/sys/modules/usb/template/Makefile Tue Aug 5 06:38:21 2014 (r269566) +++ head/sys/modules/usb/template/Makefile Tue Aug 5 07:03:16 2014 (r269567) @@ -38,6 +38,7 @@ SRCS= opt_bus.h opt_usb.h device_if.h bu usb_template_modem.c \ usb_template_mouse.c \ usb_template_msc.c \ - usb_template_mtp.c + usb_template_mtp.c \ + usb_template_phone.c .include From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 08:24:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B4EE9E6 for ; Tue, 5 Aug 2014 08:24:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FEDE2458 for ; Tue, 5 Aug 2014 08:24:42 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 5ae1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 08:24:41 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 08:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269569 - in head/sys/dev/usb: controller serial wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e094ca.5ae1.3eda4229@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 08:24:42 -0000 Author: n_hibma Date: Tue Aug 5 08:24:41 2014 New Revision: 269569 URL: http://svnweb.freebsd.org/changeset/base/269569 Log: Remove unused defines. Fix some device_printf's that were missing '\n' at the end or had speling errors. PR: 145319 Submitted by: rozhuk.im gmail.com Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue Aug 5 08:00:01 2014 (r269568) +++ head/sys/dev/usb/controller/ehci.c Tue Aug 5 08:24:41 2014 (r269569) @@ -210,7 +210,7 @@ ehci_reset(ehci_softc_t *sc) return (0); } } - device_printf(sc->sc_bus.bdev, "Reset timeout\n"); + device_printf(sc->sc_bus.bdev, "reset timeout\n"); return (USB_ERR_IOERROR); } @@ -285,7 +285,7 @@ ehci_init_sub(struct ehci_softc *sc) } } if (hcr) { - device_printf(sc->sc_bus.bdev, "Run timeout\n"); + device_printf(sc->sc_bus.bdev, "run timeout\n"); return (USB_ERR_IOERROR); } return (USB_ERR_NORMAL_COMPLETION); Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Aug 5 08:00:01 2014 (r269568) +++ head/sys/dev/usb/serial/u3g.c Tue Aug 5 08:24:41 2014 (r269569) @@ -76,15 +76,6 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3G_CONFIG_INDEX 0 #define U3G_BSIZE 2048 -#define U3GSP_GPRS 0 -#define U3GSP_EDGE 1 -#define U3GSP_CDMA 2 -#define U3GSP_UMTS 3 -#define U3GSP_HSDPA 4 -#define U3GSP_HSUPA 5 -#define U3GSP_HSPA 6 -#define U3GSP_MAX 7 - /* Eject methods; See also usb_quirks.h:UQ_MSC_EJECT_* */ #define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ #define U3GINIT_SIERRA 2 /* Requires Sierra init command */ @@ -890,7 +881,7 @@ u3g_attach(device_t dev) sc->sc_iface[nports] = id->bInterfaceNumber; if (bootverbose && sc->sc_xfer[nports][U3G_INTR]) { - device_printf(dev, "port %d supports modem control", + device_printf(dev, "port %d supports modem control\n", nports); } Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Tue Aug 5 08:00:01 2014 (r269568) +++ head/sys/dev/usb/serial/uftdi.c Tue Aug 5 08:24:41 2014 (r269569) @@ -1034,7 +1034,7 @@ uftdi_devtype_setup(struct uftdi_softc * } else { sc->sc_devtype = DEVT_232R; device_printf(sc->sc_dev, "Warning: unknown FTDI " - "device type, bcdDevice=0x%04x, assuming 232R", + "device type, bcdDevice=0x%04x, assuming 232R\n", uaa->info.bcdDevice); } sc->sc_ucom.sc_portno = 0; Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Tue Aug 5 08:00:01 2014 (r269568) +++ head/sys/dev/usb/wlan/if_upgt.c Tue Aug 5 08:24:41 2014 (r269569) @@ -428,7 +428,7 @@ upgt_get_stats(struct upgt_softc *sc) data_cmd = upgt_getbuf(sc); if (data_cmd == NULL) { - device_printf(sc->sc_dev, "%s: out of buffer.\n", __func__); + device_printf(sc->sc_dev, "%s: out of buffers.\n", __func__); return; } From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 08:29:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14567CA2 for ; Tue, 5 Aug 2014 08:29:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB15B2488 for ; Tue, 5 Aug 2014 08:29:16 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 5b34 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 08:29:16 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 08:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269571 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e095dc.5b34.272bcf02@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 08:29:17 -0000 Author: n_hibma Date: Tue Aug 5 08:29:16 2014 New Revision: 269571 URL: http://svnweb.freebsd.org/changeset/base/269571 Log: Add ID for Novatel MC990D to u3g. PR: 145319 Submitted by: rozhuk.im gmail.com MFC after: 3 days Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Aug 5 08:28:29 2014 (r269570) +++ head/sys/dev/usb/serial/u3g.c Tue Aug 5 08:29:16 2014 (r269571) @@ -336,6 +336,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC679, 0), U3G_DEV(NOVATEL, MC950D, 0), + U3G_DEV(NOVATEL, MC990D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Aug 5 08:28:29 2014 (r269570) +++ head/sys/dev/usb/usbdevs Tue Aug 5 08:29:16 2014 (r269571) @@ -3231,6 +3231,7 @@ product NOVATEL EU740 0x2410 Expedite E product NOVATEL EU870D 0x2420 Expedite EU870D product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA +product NOVATEL MC990D 0x7001 Novatel MC990D product NOVATEL ZEROCD 0x5010 Novatel ZeroCD product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 08:48:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35D9C2F6 for ; Tue, 5 Aug 2014 08:48:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC112642 for ; Tue, 5 Aug 2014 08:48:25 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 52ff by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 08:48:24 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 08:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269575 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e09a58.52ff.1054f858@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 08:48:25 -0000 Author: n_hibma Date: Tue Aug 5 08:48:24 2014 New Revision: 269575 URL: http://svnweb.freebsd.org/changeset/base/269575 Log: Reset the error value in the softc before starting a BBB transfer. PR: 145319 Submitted by: rozhuk.im gmail.com MFC after: 3 days Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Aug 5 08:30:38 2014 (r269574) +++ head/sys/dev/usb/usb_msctest.c Tue Aug 5 08:48:24 2014 (r269575) @@ -485,6 +485,7 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; + sc->error = 0; sc->cmd_len = cmd_len; memset(&sc->cbw->CBWCDB, 0, sizeof(sc->cbw->CBWCDB)); memcpy(&sc->cbw->CBWCDB, cmd_ptr, cmd_len); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 09:35:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4AEBE1 for ; Tue, 5 Aug 2014 09:35:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 976112B9E for ; Tue, 5 Aug 2014 09:35:26 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 5552 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 09:35:25 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 09:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269576 - in head/sys/dev/usb: . quirk serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0a55e.5552.63f51aa0@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 09:35:26 -0000 Author: n_hibma Date: Tue Aug 5 09:35:25 2014 New Revision: 269576 URL: http://svnweb.freebsd.org/changeset/base/269576 Log: Add a second Huawei SCSI eject command as USB mode switch config files sometimes use one or the other. Maybe newer Huawei modems switched. Add a quirk for it as well. PR: 145319 Submitted by: rozhuk.im gmail.com Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Aug 5 08:48:24 2014 (r269575) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Aug 5 09:35:25 2014 (r269576) @@ -562,6 +562,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_EJECT_WAIT] = "UQ_MSC_EJECT_WAIT", [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", + [UQ_MSC_EJECT_HUAWEISCSI2] = "UQ_MSC_EJECT_HUAWEISCSI2", [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Tue Aug 5 08:48:24 2014 (r269575) +++ head/sys/dev/usb/quirk/usb_quirk.h Tue Aug 5 09:35:25 2014 (r269576) @@ -102,6 +102,7 @@ enum { UQ_MSC_EJECT_WAIT, /* wait for the device to eject */ UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ + UQ_MSC_EJECT_HUAWEISCSI2, /* ejects after Huawei SCSI 2 command */ UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Aug 5 08:48:24 2014 (r269575) +++ head/sys/dev/usb/serial/u3g.c Tue Aug 5 09:35:25 2014 (r269576) @@ -86,7 +86,8 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GINIT_WAIT 7 /* Device reappears after a delay */ #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ -#define U3GINIT_TCT 10 /* Requires TCT Mobile init command */ +#define U3GINIT_HUAWEISCSI2 10 /* Requires Huawei SCSI init command (2) */ +#define U3GINIT_TCT 11 /* Requires TCT Mobile init command */ enum { U3G_BULK_WR, @@ -720,6 +721,8 @@ u3g_test_autoinst(void *arg, struct usb_ method = U3GINIT_WAIT; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) method = U3GINIT_HUAWEISCSI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2)) + method = U3GINIT_HUAWEISCSI2; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) method = U3GINIT_TCT; else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) @@ -740,6 +743,9 @@ u3g_test_autoinst(void *arg, struct usb_ case U3GINIT_HUAWEISCSI: error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI); break; + case U3GINIT_HUAWEISCSI2: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2); + break; case U3GINIT_SCSIEJECT: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); break; Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Aug 5 08:48:24 2014 (r269575) +++ head/sys/dev/usb/usb_msctest.c Tue Aug 5 09:35:25 2014 (r269576) @@ -103,6 +103,9 @@ static uint8_t scsi_cmotech_eject[] = static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_huawei_eject2[] = { 0x11, 0x06, 0x20, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; static uint8_t scsi_sync_cache[] = { 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -840,6 +843,11 @@ usb_msc_eject(struct usb_device *udev, u &scsi_huawei_eject, sizeof(scsi_huawei_eject), USB_MS_HZ); break; + case MSC_EJECT_HUAWEI2: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject2, sizeof(scsi_huawei_eject2), + USB_MS_HZ); + break; case MSC_EJECT_TCT: /* * TCTMobile needs DIR_IN flag. To get it, we Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Tue Aug 5 08:48:24 2014 (r269575) +++ head/sys/dev/usb/usb_msctest.h Tue Aug 5 09:35:25 2014 (r269576) @@ -33,6 +33,7 @@ enum { MSC_EJECT_ZTESTOR, MSC_EJECT_CMOTECH, MSC_EJECT_HUAWEI, + MSC_EJECT_HUAWEI2, MSC_EJECT_TCT, }; From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 09:44:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F025423 for ; Tue, 5 Aug 2014 09:44:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8967A2D13 for ; Tue, 5 Aug 2014 09:44:14 +0000 (UTC) Received: from glebius (uid 1025) (envelope-from glebius@FreeBSD.org) id 5936 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 09:44:11 +0000 From: Gleb Smirnoff Date: Tue, 5 Aug 2014 09:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0a76b.5936.428818a9@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 09:44:14 -0000 Author: glebius Date: Tue Aug 5 09:44:10 2014 New Revision: 269577 URL: http://svnweb.freebsd.org/changeset/base/269577 Log: Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c The MD allocators were very common, however there were some minor differencies. These differencies were all consolidated in the MI allocator, under ifdefs. The defines from machine/vmparam.h turn on features required for a particular machine. For details look in the comment in sys/sf_buf.h. As result no MD code left in sys/*/*/vm_machdep.c. Some arches still have machine/sf_buf.h, which is usually quite small. Tested by: glebius (i386), tuexen (arm32), kevlo (arm32) Reviewed by: kib Sponsored by: Netflix Sponsored by: Nginx, Inc. Added: head/sys/kern/subr_sfbuf.c (contents, props changed) Deleted: head/sys/powerpc/include/sf_buf.h head/sys/sparc64/include/sf_buf.h Modified: head/sys/amd64/include/sf_buf.h head/sys/arm/arm/vm_machdep.c head/sys/arm/include/sf_buf.h head/sys/arm/include/vmparam.h head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/i386/i386/vm_machdep.c head/sys/i386/include/sf_buf.h head/sys/i386/include/vmparam.h head/sys/mips/include/sf_buf.h head/sys/mips/include/vmparam.h head/sys/mips/mips/vm_machdep.c head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/vm_machdep.c head/sys/sparc64/include/vmparam.h head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/sf_buf.h Modified: head/sys/amd64/include/sf_buf.h ============================================================================== --- head/sys/amd64/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/amd64/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) @@ -29,42 +29,23 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#include -#include -#include - /* * On this machine, the only purpose for which sf_buf is used is to implement * an opaque pointer required by the machine-independent parts of the kernel. * That pointer references the vm_page that is "mapped" by the sf_buf. The * actual mapping is provided by the direct virtual-to-physical mapping. */ -struct sf_buf; - -static inline struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) -{ - - return ((struct sf_buf *)m); -} - -static inline void -sf_buf_free(struct sf_buf *sf) -{ -} - -static __inline vm_offset_t +static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); } -static __inline vm_page_t +static inline vm_page_t sf_buf_page(struct sf_buf *sf) { return ((vm_page_t)sf); } - #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -83,42 +82,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct switchframe) == 24); CTASSERT(sizeof(struct trapframe) == 80); -#ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) -#endif - -static int nsfbufs; -static int nsfbufspeak; -static int nsfbufsused; - -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, - "Maximum number of sendfile(2) sf_bufs available"); -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, - "Number of sendfile(2) sf_bufs at peak usage"); -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, - "Number of sendfile(2) sf_bufs in use"); - -static void sf_buf_init(void *arg); -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); - -LIST_HEAD(sf_head, sf_buf); - -/* - * A hash table of active sendfile(2) buffers - */ -static struct sf_head *sf_buf_active; -static u_long sf_buf_hashmask; - -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) - -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; -static u_int sf_buf_alloc_want; - -/* - * A lock used to synchronize access to the hash table and free list - */ -static struct mtx sf_buf_lock; - /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -184,106 +147,6 @@ cpu_thread_swapout(struct thread *td) { } -/* - * Detatch mapped page and release resources back to the system. - */ -void -sf_buf_free(struct sf_buf *sf) -{ - - mtx_lock(&sf_buf_lock); - sf->ref_count--; - if (sf->ref_count == 0) { - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); - nsfbufsused--; - pmap_kremove(sf->kva); - sf->m = NULL; - LIST_REMOVE(sf, list_entry); - if (sf_buf_alloc_want > 0) - wakeup(&sf_buf_freelist); - } - mtx_unlock(&sf_buf_lock); -} - -/* - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) - */ -static void -sf_buf_init(void *arg) -{ - struct sf_buf *sf_bufs; - vm_offset_t sf_base; - int i; - - nsfbufs = NSFBUFS; - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); - - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); - TAILQ_INIT(&sf_buf_freelist); - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, - M_NOWAIT | M_ZERO); - for (i = 0; i < nsfbufs; i++) { - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); - } - sf_buf_alloc_want = 0; - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); -} - -/* - * Get an sf_buf from the freelist. Will block if none are available. - */ -struct sf_buf * -sf_buf_alloc(struct vm_page *m, int flags) -{ - struct sf_head *hash_list; - struct sf_buf *sf; - int error; - - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; - mtx_lock(&sf_buf_lock); - LIST_FOREACH(sf, hash_list, list_entry) { - if (sf->m == m) { - sf->ref_count++; - if (sf->ref_count == 1) { - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - } - goto done; - } - } - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { - if (flags & SFB_NOWAIT) - goto done; - sf_buf_alloc_want++; - SFSTAT_INC(sf_allocwait); - error = msleep(&sf_buf_freelist, &sf_buf_lock, - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); - sf_buf_alloc_want--; - - - /* - * If we got a signal, don't risk going back to sleep. - */ - if (error) - goto done; - } - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - if (sf->m != NULL) - LIST_REMOVE(sf, list_entry); - LIST_INSERT_HEAD(hash_list, sf, list_entry); - sf->ref_count = 1; - sf->m = m; - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); -done: - mtx_unlock(&sf_buf_lock); - return (sf); -} - void cpu_set_syscall_retval(struct thread *td, int error) { Modified: head/sys/arm/include/sf_buf.h ============================================================================== --- head/sys/arm/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/arm/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) @@ -29,33 +29,18 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#include - -struct vm_page; - -struct sf_buf { - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ - struct vm_page *m; /* currently mapped page */ - vm_offset_t kva; /* va of mapping */ - int ref_count; /* usage of this mapping */ -}; - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) +static inline void +sf_buf_map(struct sf_buf *sf, int flags) { - return (sf->kva); + pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); } -static __inline struct vm_page * -sf_buf_page(struct sf_buf *sf) +static inline int +sf_buf_unmap(struct sf_buf *sf) { - return (sf->m); + pmap_kremove(sf->kva); + return (1); } - -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); -void sf_buf_free(struct sf_buf *sf); - #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/arm/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) @@ -170,4 +170,7 @@ extern vm_offset_t vm_max_kernel_address #define VM_MAX_AUTOTUNE_MAXUSERS 384 #endif +#define SFBUF +#define SFBUF_MAP + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.arm Tue Aug 5 09:44:10 2014 (r269577) @@ -77,6 +77,7 @@ font.h optional sc \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard +kern/subr_sfbuf.c standard libkern/arm/aeabi_unwind.c standard libkern/arm/divsi3.S standard libkern/arm/ffs.S standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.i386 Tue Aug 5 09:44:10 2014 (r269577) @@ -520,6 +520,7 @@ isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip +kern/subr_sfbuf.c standard libkern/divdi3.c standard libkern/flsll.c standard libkern/memmove.c standard Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.mips Tue Aug 5 09:44:10 2014 (r269577) @@ -51,6 +51,7 @@ mips/mips/vm_machdep.c standard kern/kern_clocksource.c standard kern/link_elf_obj.c standard kern/subr_dummy_vdso_tc.c standard +kern/subr_sfbuf.c optional mips | mipsel | mipsn32 # gcc/clang runtime libkern/ffsl.c standard Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.pc98 Tue Aug 5 09:44:10 2014 (r269577) @@ -205,6 +205,7 @@ i386/svr4/svr4_machdep.c optional compat kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip +kern/subr_sfbuf.c standard libkern/divdi3.c standard libkern/flsll.c standard libkern/memmove.c standard Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.powerpc Tue Aug 5 09:44:10 2014 (r269577) @@ -71,6 +71,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt aim kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr +kern/subr_sfbuf.c standard libkern/ashldi3.c optional powerpc libkern/ashrdi3.c optional powerpc libkern/bcmp.c standard Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/conf/files.sparc64 Tue Aug 5 09:44:10 2014 (r269577) @@ -64,6 +64,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr +kern/subr_sfbuf.c standard libkern/ffs.c standard libkern/ffsl.c standard libkern/fls.c standard Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) @@ -118,38 +118,6 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif -static int nsfbufs; -static int nsfbufspeak; -static int nsfbufsused; - -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, - "Maximum number of sendfile(2) sf_bufs available"); -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, - "Number of sendfile(2) sf_bufs at peak usage"); -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, - "Number of sendfile(2) sf_bufs in use"); - -static void sf_buf_init(void *arg); -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); - -LIST_HEAD(sf_head, sf_buf); - -/* - * A hash table of active sendfile(2) buffers - */ -static struct sf_head *sf_buf_active; -static u_long sf_buf_hashmask; - -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) - -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; -static u_int sf_buf_alloc_want; - -/* - * A lock used to synchronize access to the hash table and free list - */ -static struct mtx sf_buf_lock; - extern int _ucodesel, _udatasel; /* @@ -750,121 +718,12 @@ cpu_reset_real() } /* - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) - */ -static void -sf_buf_init(void *arg) -{ - struct sf_buf *sf_bufs; - vm_offset_t sf_base; - int i; - - nsfbufs = NSFBUFS; - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); - - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); - TAILQ_INIT(&sf_buf_freelist); - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, - M_NOWAIT | M_ZERO); - for (i = 0; i < nsfbufs; i++) { - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); - } - sf_buf_alloc_want = 0; - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); -} - -/* - * Invalidate the cache lines that may belong to the page, if - * (possibly old) mapping of the page by sf buffer exists. Returns - * TRUE when mapping was found and cache invalidated. - */ -boolean_t -sf_buf_invalidate_cache(vm_page_t m) -{ - struct sf_head *hash_list; - struct sf_buf *sf; - boolean_t ret; - - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; - ret = FALSE; - mtx_lock(&sf_buf_lock); - LIST_FOREACH(sf, hash_list, list_entry) { - if (sf->m == m) { - /* - * Use pmap_qenter to update the pte for - * existing mapping, in particular, the PAT - * settings are recalculated. - */ - pmap_qenter(sf->kva, &m, 1); - pmap_invalidate_cache_range(sf->kva, sf->kva + - PAGE_SIZE); - ret = TRUE; - break; - } - } - mtx_unlock(&sf_buf_lock); - return (ret); -} - -/* * Get an sf_buf from the freelist. May block if none are available. */ -struct sf_buf * -sf_buf_alloc(struct vm_page *m, int flags) +void +sf_buf_map(struct sf_buf *sf, int flags) { pt_entry_t opte, *ptep; - struct sf_head *hash_list; - struct sf_buf *sf; -#ifdef SMP - cpuset_t other_cpus; - u_int cpuid; -#endif - int error; - - KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, - ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; - mtx_lock(&sf_buf_lock); - LIST_FOREACH(sf, hash_list, list_entry) { - if (sf->m == m) { - sf->ref_count++; - if (sf->ref_count == 1) { - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); - } -#ifdef SMP - goto shootdown; -#else - goto done; -#endif - } - } - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { - if (flags & SFB_NOWAIT) - goto done; - sf_buf_alloc_want++; - SFSTAT_INC(sf_allocwait); - error = msleep(&sf_buf_freelist, &sf_buf_lock, - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); - sf_buf_alloc_want--; - - /* - * If we got a signal, don't risk going back to sleep. - */ - if (error) - goto done; - } - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); - if (sf->m != NULL) - LIST_REMOVE(sf, list_entry); - LIST_INSERT_HEAD(hash_list, sf, list_entry); - sf->ref_count = 1; - sf->m = m; - nsfbufsused++; - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); /* * Update the sf_buf's virtual-to-physical mapping, flushing the @@ -876,11 +735,11 @@ sf_buf_alloc(struct vm_page *m, int flag ptep = vtopte(sf->kva); opte = *ptep; #ifdef XEN - PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag - | PG_RW | PG_V | pmap_cache_bits(m->md.pat_mode, 0)); + PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(sf->m)) | pgeflag + | PG_RW | PG_V | pmap_cache_bits(sf->m->md.pat_mode, 0)); #else - *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V | - pmap_cache_bits(m->md.pat_mode, 0); + *ptep = VM_PAGE_TO_PHYS(sf->m) | pgeflag | PG_RW | PG_V | + pmap_cache_bits(sf->m->md.pat_mode, 0); #endif /* @@ -892,7 +751,21 @@ sf_buf_alloc(struct vm_page *m, int flag #ifdef SMP if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) CPU_ZERO(&sf->cpumask); -shootdown: + + sf_buf_shootdown(sf, flags); +#else + if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) + pmap_invalidate_page(kernel_pmap, sf->kva); +#endif +} + +#ifdef SMP +void +sf_buf_shootdown(struct sf_buf *sf, int flags) +{ + cpuset_t other_cpus; + u_int cpuid; + sched_pin(); cpuid = PCPU_GET(cpuid); if (!CPU_ISSET(cpuid, &sf->cpumask)) { @@ -909,42 +782,50 @@ shootdown: } } sched_unpin(); -#else - if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) - pmap_invalidate_page(kernel_pmap, sf->kva); -#endif -done: - mtx_unlock(&sf_buf_lock); - return (sf); } +#endif /* - * Remove a reference from the given sf_buf, adding it to the free - * list when its reference count reaches zero. A freed sf_buf still, - * however, retains its virtual-to-physical mapping until it is - * recycled or reactivated by sf_buf_alloc(9). + * MD part of sf_buf_free(). */ -void -sf_buf_free(struct sf_buf *sf) +int +sf_buf_unmap(struct sf_buf *sf) { - - mtx_lock(&sf_buf_lock); - sf->ref_count--; - if (sf->ref_count == 0) { - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); - nsfbufsused--; #ifdef XEN + /* + * Xen doesn't like having dangling R/W mappings + */ + pmap_qremove(sf->kva, 1); + return (1); +#else + return (0); +#endif +} + +static void +sf_buf_invalidate(struct sf_buf *sf) +{ + vm_page_t m = sf->m; + + /* + * Use pmap_qenter to update the pte for + * existing mapping, in particular, the PAT + * settings are recalculated. + */ + pmap_qenter(sf->kva, &m, 1); + pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE); +} + /* - * Xen doesn't like having dangling R/W mappings + * Invalidate the cache lines that may belong to the page, if + * (possibly old) mapping of the page by sf buffer exists. Returns + * TRUE when mapping was found and cache invalidated. */ - pmap_qremove(sf->kva, 1); - sf->m = NULL; - LIST_REMOVE(sf, list_entry); -#endif - if (sf_buf_alloc_want > 0) - wakeup(&sf_buf_freelist); - } - mtx_unlock(&sf_buf_lock); +boolean_t +sf_buf_invalidate_cache(vm_page_t m) +{ + + return (sf_buf_process_page(m, sf_buf_invalidate)); } /* Modified: head/sys/i386/include/sf_buf.h ============================================================================== --- head/sys/i386/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/i386/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003, 2005 Alan L. Cox + * Copyright (c) 2014 Gleb Smirnoff * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,39 +29,8 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#include -#include - -struct vm_page; - -struct sf_buf { - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ - struct vm_page *m; /* currently mapped page */ - vm_offset_t kva; /* va of mapping */ - int ref_count; /* usage of this mapping */ -#ifdef SMP - cpuset_t cpumask; /* cpus on which mapping is valid */ -#endif -}; - -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); -void sf_buf_free(struct sf_buf *sf); - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) -{ - - return (sf->kva); -} - -static __inline struct vm_page * -sf_buf_page(struct sf_buf *sf) -{ - - return (sf->m); -} - -boolean_t sf_buf_invalidate_cache(vm_page_t m); +void sf_buf_map(struct sf_buf *, int); +int sf_buf_unmap(struct sf_buf *); +boolean_t sf_buf_invalidate_cache(vm_page_t); #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/i386/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) @@ -198,4 +198,9 @@ #define VM_MAX_AUTOTUNE_MAXUSERS 384 #endif +#define SFBUF +#define SFBUF_MAP +#define SFBUF_CPUSET +#define SFBUF_PROCESS_PAGE + #endif /* _MACHINE_VMPARAM_H_ */ Added: head/sys/kern/subr_sfbuf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_sfbuf.c Tue Aug 5 09:44:10 2014 (r269577) @@ -0,0 +1,226 @@ +/*- + * Copyright (c) 2014 Gleb Smirnoff + * Copyright (c) 2003, 2005 Alan L. Cox + * 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifndef NSFBUFS +#define NSFBUFS (512 + maxusers * 16) +#endif + +static int nsfbufs; +static int nsfbufspeak; +static int nsfbufsused; + +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, + "Maximum number of sendfile(2) sf_bufs available"); +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, + "Number of sendfile(2) sf_bufs at peak usage"); +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, + "Number of sendfile(2) sf_bufs in use"); + +static void sf_buf_init(void *arg); +SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); + +LIST_HEAD(sf_head, sf_buf); + +/* + * A hash table of active sendfile(2) buffers + */ +static struct sf_head *sf_buf_active; +static u_long sf_buf_hashmask; + +#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) + +static TAILQ_HEAD(, sf_buf) sf_buf_freelist; +static u_int sf_buf_alloc_want; + +/* + * A lock used to synchronize access to the hash table and free list + */ +static struct mtx sf_buf_lock; + +/* + * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) + */ +static void +sf_buf_init(void *arg) +{ + struct sf_buf *sf_bufs; + vm_offset_t sf_base; + int i; + +#ifdef SFBUF_OPTIONAL_DIRECT_MAP + if (SFBUF_OPTIONAL_DIRECT_MAP) + return; +#endif + + nsfbufs = NSFBUFS; + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); + + sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); + TAILQ_INIT(&sf_buf_freelist); + sf_base = kva_alloc(nsfbufs * PAGE_SIZE); + sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, + M_NOWAIT | M_ZERO); + KASSERT(sf_bufs, ("%s: malloc failure", __func__)); + for (i = 0; i < nsfbufs; i++) { + sf_bufs[i].kva = sf_base + i * PAGE_SIZE; + TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); + } + sf_buf_alloc_want = 0; + mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); +} + +/* + * Get an sf_buf from the freelist. May block if none are available. + */ +struct sf_buf * +sf_buf_alloc(struct vm_page *m, int flags) +{ + struct sf_head *hash_list; + struct sf_buf *sf; + int error; + +#ifdef SFBUF_OPTIONAL_DIRECT_MAP + if (SFBUF_OPTIONAL_DIRECT_MAP) + return ((struct sf_buf *)m); +#endif + + KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, + ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; + mtx_lock(&sf_buf_lock); + LIST_FOREACH(sf, hash_list, list_entry) { + if (sf->m == m) { + sf->ref_count++; + if (sf->ref_count == 1) { + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); + nsfbufsused++; + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); + } +#if defined(SMP) && defined(SFBUF_CPUSET) + sf_buf_shootdown(sf, flags); +#endif + goto done; + } + } + while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { + if (flags & SFB_NOWAIT) + goto done; + sf_buf_alloc_want++; + SFSTAT_INC(sf_allocwait); + error = msleep(&sf_buf_freelist, &sf_buf_lock, + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); + sf_buf_alloc_want--; + + /* + * If we got a signal, don't risk going back to sleep. + */ + if (error) + goto done; + } + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); + if (sf->m != NULL) + LIST_REMOVE(sf, list_entry); + LIST_INSERT_HEAD(hash_list, sf, list_entry); + sf->ref_count = 1; + sf->m = m; + nsfbufsused++; + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); + sf_buf_map(sf, flags); +done: + mtx_unlock(&sf_buf_lock); + return (sf); +} + +/* + * Remove a reference from the given sf_buf, adding it to the free + * list when its reference count reaches zero. A freed sf_buf still, + * however, retains its virtual-to-physical mapping until it is + * recycled or reactivated by sf_buf_alloc(9). + */ +void +sf_buf_free(struct sf_buf *sf) +{ + +#ifdef SFBUF_OPTIONAL_DIRECT_MAP + if (SFBUF_OPTIONAL_DIRECT_MAP) + return; +#endif + + mtx_lock(&sf_buf_lock); + sf->ref_count--; + if (sf->ref_count == 0) { + TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); + nsfbufsused--; + if (sf_buf_unmap(sf)) { + sf->m = NULL; + LIST_REMOVE(sf, list_entry); + } + if (sf_buf_alloc_want > 0) + wakeup(&sf_buf_freelist); + } + mtx_unlock(&sf_buf_lock); +} + +#ifdef SFBUF_PROCESS_PAGE +/* + * Run callback function on sf_buf that holds a certain page. + */ +boolean_t +sf_buf_process_page(vm_page_t m, void (*cb)(struct sf_buf *)) +{ + struct sf_head *hash_list; + struct sf_buf *sf; + + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; + mtx_lock(&sf_buf_lock); + LIST_FOREACH(sf, hash_list, list_entry) { + if (sf->m == m) { + cb(sf); + mtx_unlock(&sf_buf_lock); + return (TRUE); + } + } + mtx_unlock(&sf_buf_lock); + return (FALSE); +} +#endif /* SFBUF_PROCESS_PAGE */ Modified: head/sys/mips/include/sf_buf.h ============================================================================== --- head/sys/mips/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/mips/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) @@ -29,31 +29,9 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ -#ifdef __mips_n64 -#include -#include -#include -#else -#include -#endif - -#ifdef __mips_n64 -/* In 64 bit the whole memory is directly mapped */ -struct sf_buf; +#ifdef __mips_n64 /* In 64 bit the whole memory is directly mapped */ -static inline struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) -{ - - return ((struct sf_buf *)m); -} - -static inline void -sf_buf_free(struct sf_buf *sf) -{ -} - -static __inline vm_offset_t +static inline vm_offset_t sf_buf_kva(struct sf_buf *sf) { vm_page_t m; @@ -62,38 +40,12 @@ sf_buf_kva(struct sf_buf *sf) return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); } -static __inline struct vm_page * +static inline struct vm_page * sf_buf_page(struct sf_buf *sf) { return ((vm_page_t)sf); } -#else /* ! __mips_n64 */ -struct vm_page; - -struct sf_buf { - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ - struct vm_page *m; /* currently mapped page */ - vm_offset_t kva; /* va of mapping */ -}; - -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); -void sf_buf_free(struct sf_buf *sf); - -static __inline vm_offset_t -sf_buf_kva(struct sf_buf *sf) -{ - - return (sf->kva); -} - -static __inline struct vm_page * -sf_buf_page(struct sf_buf *sf) -{ - - return (sf->m); -} #endif /* __mips_n64 */ - #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/mips/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) @@ -187,4 +187,8 @@ #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ +#ifndef __mips_n64 +#define SFBUF +#endif + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) +++ head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) @@ -76,9 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __mips_n64 -#include -#endif /* Duplicated from asm.h */ #if defined(__mips_o32) @@ -92,38 +89,6 @@ __FBSDID("$FreeBSD$"); #define CALLFRAME_SIZ (SZREG * 4) #endif -#ifndef __mips_n64 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 09:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0BFD7AD for ; Tue, 5 Aug 2014 09:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96F412F44 for ; Tue, 5 Aug 2014 09:59:16 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 5cd0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 09:59:16 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 09:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269578 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0aaf4.5cd0.77eae445@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 09:59:16 -0000 Author: n_hibma Date: Tue Aug 5 09:59:16 2014 New Revision: 269578 URL: http://svnweb.freebsd.org/changeset/base/269578 Log: Return USB_ERR_INVAL if the eject method is not known. PR: 145319 Submitted by: rozhuk.im gmail.com Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Aug 5 09:44:10 2014 (r269577) +++ head/sys/dev/usb/usb_msctest.c Tue Aug 5 09:59:16 2014 (r269578) @@ -859,9 +859,10 @@ usb_msc_eject(struct usb_device *udev, u break; default: DPRINTF("Unknown eject method (%d)\n", method); - err = 0; - break; + bbb_detach(sc); + return (USB_ERR_INVAL); } + DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); bbb_detach(sc); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 10:29:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 073A6D99 for ; Tue, 5 Aug 2014 10:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DADF421E4 for ; Tue, 5 Aug 2014 10:29:01 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 554b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 10:29:01 +0000 From: Roger Pau Monné Date: Tue, 5 Aug 2014 10:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269580 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0b1ed.554b.6d8ca33b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 10:29:02 -0000 Author: royger Date: Tue Aug 5 10:29:01 2014 New Revision: 269580 URL: http://svnweb.freebsd.org/changeset/base/269580 Log: vm_phys: improve robustness of fictitious ranges With the current implementation of managed fictitious ranges when also using VM_PHYSSEG_DENSE, a user could try to register a fictitious range that starts inside of vm_page_array, but then overrruns it (because the end of the fictitious range is greater than vm_page_array_size + first_page). This would result in PHYS_TO_VM_PAGE returning unallocated pages from past the end of vm_page_array. The same could happen if a user tried to register a segment that starts outside of vm_page_array but ends inside of it. In order to fix this, allow vm_phys_fictitious_{reg/unreg}_range to use a set of pages from vm_page_array, and allocate the rest. Sponsored by: Citrix Systems R&D Reviewed by: kib, alc vm/vm_phys.c: - Allow registering/unregistering fictitious ranges that overrun vm_page_array. Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Tue Aug 5 10:08:59 2014 (r269579) +++ head/sys/vm/vm_phys.c Tue Aug 5 10:29:01 2014 (r269580) @@ -591,36 +591,91 @@ vm_phys_fictitious_to_vm_page(vm_paddr_t return (m); } +static inline void +vm_phys_fictitious_init_range(vm_page_t range, vm_paddr_t start, + long page_count, vm_memattr_t memattr) +{ + long i; + + for (i = 0; i < page_count; i++) { + vm_page_initfake(&range[i], start + PAGE_SIZE * i, memattr); + range[i].oflags &= ~VPO_UNMANAGED; + range[i].busy_lock = VPB_UNBUSIED; + } +} + int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr) { struct vm_phys_fictitious_seg *seg; vm_page_t fp; - long i, page_count; + long page_count; #ifdef VM_PHYSSEG_DENSE - long pi; + long pi, pe; + long dpage_count; #endif + KASSERT(start < end, + ("Start of segment isn't less than end (start: %jx end: %jx)", + (uintmax_t)start, (uintmax_t)end)); + page_count = (end - start) / PAGE_SIZE; #ifdef VM_PHYSSEG_DENSE pi = atop(start); - if (pi >= first_page && pi < vm_page_array_size + first_page) { - if (atop(end) >= vm_page_array_size + first_page) - return (EINVAL); + pe = atop(end); + if (pi >= first_page && (pi - first_page) < vm_page_array_size) { fp = &vm_page_array[pi - first_page]; - } else + if ((pe - first_page) > vm_page_array_size) { + /* + * We have a segment that starts inside + * of vm_page_array, but ends outside of it. + * + * Use vm_page_array pages for those that are + * inside of the vm_page_array range, and + * allocate the remaining ones. + */ + dpage_count = vm_page_array_size - (pi - first_page); + vm_phys_fictitious_init_range(fp, start, dpage_count, + memattr); + page_count -= dpage_count; + start += ptoa(dpage_count); + goto alloc; + } + /* + * We can allocate the full range from vm_page_array, + * so there's no need to register the range in the tree. + */ + vm_phys_fictitious_init_range(fp, start, page_count, memattr); + return (0); + } else if (pe > first_page && (pe - first_page) < vm_page_array_size) { + /* + * We have a segment that ends inside of vm_page_array, + * but starts outside of it. + */ + fp = &vm_page_array[0]; + dpage_count = pe - first_page; + vm_phys_fictitious_init_range(fp, ptoa(first_page), dpage_count, + memattr); + end -= ptoa(dpage_count); + page_count -= dpage_count; + goto alloc; + } else if (pi < first_page && pe > (first_page + vm_page_array_size)) { + /* + * Trying to register a fictitious range that expands before + * and after vm_page_array. + */ + return (EINVAL); + } else { +alloc: #endif - { fp = malloc(page_count * sizeof(struct vm_page), M_FICT_PAGES, M_WAITOK | M_ZERO); +#ifdef VM_PHYSSEG_DENSE } - for (i = 0; i < page_count; i++) { - vm_page_initfake(&fp[i], start + PAGE_SIZE * i, memattr); - fp[i].oflags &= ~VPO_UNMANAGED; - fp[i].busy_lock = VPB_UNBUSIED; - } +#endif + vm_phys_fictitious_init_range(fp, start, page_count, memattr); seg = malloc(sizeof(*seg), M_FICT_PAGES, M_WAITOK | M_ZERO); seg->start = start; @@ -639,11 +694,45 @@ vm_phys_fictitious_unreg_range(vm_paddr_ { struct vm_phys_fictitious_seg *seg, tmp; #ifdef VM_PHYSSEG_DENSE - long pi; + long pi, pe; #endif + KASSERT(start < end, + ("Start of segment isn't less than end (start: %jx end: %jx)", + (uintmax_t)start, (uintmax_t)end)); + #ifdef VM_PHYSSEG_DENSE pi = atop(start); + pe = atop(end); + if (pi >= first_page && (pi - first_page) < vm_page_array_size) { + if ((pe - first_page) <= vm_page_array_size) { + /* + * This segment was allocated using vm_page_array + * only, there's nothing to do since those pages + * were never added to the tree. + */ + return; + } + /* + * We have a segment that starts inside + * of vm_page_array, but ends outside of it. + * + * Calculate how many pages were added to the + * tree and free them. + */ + start = ptoa(first_page + vm_page_array_size); + } else if (pe > first_page && (pe - first_page) < vm_page_array_size) { + /* + * We have a segment that ends inside of vm_page_array, + * but starts outside of it. + */ + end = ptoa(first_page); + } else if (pi < first_page && pe > (first_page + vm_page_array_size)) { + /* Since it's not possible to register such a range, panic. */ + panic( + "Unregistering not registered fictitious range [%#jx:%#jx]", + (uintmax_t)start, (uintmax_t)end); + } #endif tmp.start = start; tmp.end = 0; @@ -658,10 +747,7 @@ vm_phys_fictitious_unreg_range(vm_paddr_ } RB_REMOVE(fict_tree, &vm_phys_fictitious_tree, seg); rw_wunlock(&vm_phys_fictitious_reg_lock); -#ifdef VM_PHYSSEG_DENSE - if (pi < first_page || atop(end) >= vm_page_array_size) -#endif - free(seg->first_page, M_FICT_PAGES); + free(seg->first_page, M_FICT_PAGES); free(seg, M_FICT_PAGES); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 10:31:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEA3972; Tue, 5 Aug 2014 10:31:59 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DABF22AC; Tue, 5 Aug 2014 10:31:59 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1B98325D37C7; Tue, 5 Aug 2014 10:31:56 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3FF23C261FA; Tue, 5 Aug 2014 10:31:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 0shm1PxNoCuF; Tue, 5 Aug 2014 10:31:51 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id F1B59C261F6; Tue, 5 Aug 2014 10:31:48 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269540 - in head/sys: conf modules/an modules/arcnet modules/cam modules/carp modules/cxgb/cxgb modules/cxgb/iw_cxgb modules/cxgb/tom modules/cxgbe/if_cxgbe modules/cxgbe/iw_cxgbe modu... From: "Bjoern A. Zeeb" In-Reply-To: <53e00b0f.529c.265fe830@svn.freebsd.org> Date: Tue, 5 Aug 2014 10:31:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <53e00b0f.529c.265fe830@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 10:31:59 -0000 On 04 Aug 2014, at 22:37 , Warner Losh wrote: > Author: imp > Date: Mon Aug 4 22:37:02 2014 > New Revision: 269540 > URL: http://svnweb.freebsd.org/changeset/base/269540 >=20 > Log: > Move most of the 15 variations on generating opt_inet.h and > opt_inet6.h into kmod.mk by forcing almost everybody to eat the same > dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h > targets here too. >=20 > Modified: > head/sys/conf/kern.opts.mk > head/sys/conf/kmod.mk > head/sys/modules/an/Makefile > head/sys/modules/arcnet/Makefile > head/sys/modules/cam/Makefile > head/sys/modules/carp/Makefile > head/sys/modules/cxgb/cxgb/Makefile > head/sys/modules/cxgb/iw_cxgb/Makefile > head/sys/modules/cxgb/tom/Makefile > head/sys/modules/cxgbe/if_cxgbe/Makefile > head/sys/modules/cxgbe/iw_cxgbe/Makefile > head/sys/modules/cxgbe/tom/Makefile > head/sys/modules/dummynet/Makefile > head/sys/modules/em/Makefile > head/sys/modules/en/Makefile > head/sys/modules/fatm/Makefile > head/sys/modules/firewire/fwip/Makefile > head/sys/modules/hatm/Makefile > head/sys/modules/i40e/Makefile (contents, props changed) > head/sys/modules/if_bridge/Makefile > head/sys/modules/if_disc/Makefile > head/sys/modules/if_faith/Makefile > head/sys/modules/if_gif/Makefile > head/sys/modules/if_gre/Makefile > head/sys/modules/if_lagg/Makefile > head/sys/modules/if_stf/Makefile > head/sys/modules/if_tap/Makefile > head/sys/modules/if_tun/Makefile > head/sys/modules/igb/Makefile > head/sys/modules/ip6_mroute_mod/Makefile > head/sys/modules/ip_mroute_mod/Makefile > head/sys/modules/ipdivert/Makefile > head/sys/modules/ipfilter/Makefile > head/sys/modules/ipfw/Makefile > head/sys/modules/ipoib/Makefile > head/sys/modules/ixgbe/Makefile > head/sys/modules/krpc/Makefile > head/sys/modules/linux/Makefile > head/sys/modules/lmc/Makefile > head/sys/modules/mlx4/Makefile > head/sys/modules/mlx4ib/Makefile > head/sys/modules/mlxen/Makefile > head/sys/modules/mthca/Makefile > head/sys/modules/netgraph/gif/Makefile > head/sys/modules/netgraph/iface/Makefile > head/sys/modules/netgraph/ipfw/Makefile > head/sys/modules/netgraph/netflow/Makefile > head/sys/modules/nfscl/Makefile > head/sys/modules/nfsclient/Makefile > head/sys/modules/nfslockd/Makefile > head/sys/modules/nfsserver/Makefile > head/sys/modules/patm/Makefile > head/sys/modules/pf/Makefile > head/sys/modules/pflog/Makefile > head/sys/modules/pfsync/Makefile > head/sys/modules/smbfs/Makefile > head/sys/modules/snc/Makefile > head/sys/modules/sppp/Makefile > head/sys/modules/trm/Makefile > head/sys/modules/virtio/network/Makefile > head/sys/modules/vmware/vmxnet3/Makefile > head/sys/modules/wlan/Makefile > head/sys/modules/wlan_acl/Makefile > head/sys/modules/wlan_amrr/Makefile > head/sys/modules/wlan_ccmp/Makefile > head/sys/modules/wlan_rssadapt/Makefile > head/sys/modules/wlan_tkip/Makefile > head/sys/modules/wlan_wep/Makefile > head/sys/modules/wlan_xauth/Makefile This broke a couple of kernel builds during universe: mips AP91 kernel failed, check _.mips.AP91 for details mips AP93 kernel failed, check _.mips.AP93 for details mips AR724X_BASE kernel failed, check _.mips.AR724X_BASE for details mips ENH200 kernel failed, check _.mips.ENH200 for details mips DIR-825B1 kernel failed, check _.mips.DIR-825B1 for details mips PB92 kernel failed, check _.mips.PB92 for details mips PICOSTATION_M2HP kernel failed, check _.mips.PICOSTATION_M2HP for = details mips WZR-300HP kernel failed, check _.mips.WZR-300HP for details arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details They all seem to not define INET6 and AP91 errors look like this; all = seem to barf in the if_gif module built. Please investigate and = unbreak. Would be really nice if these commits were tested to build = and still give the same results upfront. I am mostly worried about the = latter actually. -------------------------------------------------------------- >>> Kernel build for AP91 started on Tue Aug 5 07:06:20 UTC 2014 -------------------------------------------------------------- =3D=3D=3D> AP91 -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- Kernel build directory is = /storage/head/obj//mips.mips/scratch/tmp/bz/head.svn/sys/AP91 Don't forget to do ``make cleandepend && make depend'' -------------------------------------------------------------- >>> stage 2.1: cleaning up the object tree -------------------------------------------------------------- bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" -------------------------------------------------------------- >>> stage 2.2: rebuilding the object tree -------------------------------------------------------------- bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" -------------------------------------------------------------- >>> stage 2.3: build tools -------------------------------------------------------------- -------------------------------------------------------------- >>> stage 3.1: making dependencies -------------------------------------------------------------- bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:76: = error: 'GIF_HLIM' undeclared here (not in a function) /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:92: = error: 'in6_gif_input' undeclared here (not in a function) /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:93: = error: 'rip6_output' undeclared here (not in a function) /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:94: = error: 'rip6_ctloutput' undeclared here (not in a function) /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:95: = error: 'rip6_usrreqs' undeclared here (not in a function) cc1: warnings being treated as errors = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:102: = warning: no previous prototype for 'in6_gif_output' = [-Wmissing-prototypes] /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c: In = function 'in6_gif_output': = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:104: = error: 'struct gif_softc' has no member named 'gif_ro6' = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:192: = error: invalid application of 'sizeof' to incomplete type 'struct = ip6_hdr' = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:215: = error: dereferencing pointer to incomplete type = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: dereferencing pointer to incomplete type = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: 'IPV6_VERSION_MASK' undeclared (first use in this function) = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: (Each undeclared identifier is reported only once = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: for each function it appears in.) = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:217: = error: dereferencing pointer to incomplete type = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:217: = error: =91IPV6_VERSION=92 undeclared (first use in this function) . . . [stripped another several dozen lines] --- in6_gif.o --- *** [in6_gif.o] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules/if_gif --- all_subdir_if_gif --- *** [all_subdir_if_gif] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules --- modules-all --- *** [modules-all] Error code 1 bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91 linking kernel.debug text data bss dec hex filename 2708527 198924 147936 3055387 2e9f1b kernel.debug --- buildkernel --- *** [buildkernel] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn --- buildkernel --- *** [buildkernel] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 10:48:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAC1A486 for ; Tue, 5 Aug 2014 10:48:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B9A24CC for ; Tue, 5 Aug 2014 10:48:53 +0000 (UTC) Received: from bz (uid 1027) (envelope-from bz@FreeBSD.org) id 5bf3 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 10:48:53 +0000 From: Bjoern A. Zeeb Date: Tue, 5 Aug 2014 10:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269581 - head/sys/modules/if_gif X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0b695.5bf3.27b1f078@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 10:48:54 -0000 Author: bz Date: Tue Aug 5 10:48:53 2014 New Revision: 269581 URL: http://svnweb.freebsd.org/changeset/base/269581 Log: Revert the logic change from r269540. If the opt_inet6.h file is empty we set MK_INET6_SUPPORT to no, not if we do define INET6. This way we do not try to build IPv6 parts in if the kernel doesn't support them. This unbreaks several kernel configurations building modules but no INET6. Modified: head/sys/modules/if_gif/Makefile Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Tue Aug 5 10:29:01 2014 (r269580) +++ head/sys/modules/if_gif/Makefile Tue Aug 5 10:48:53 2014 (r269581) @@ -9,7 +9,7 @@ SRCS= if_gif.c in_gif.c opt_inet.h opt_i .if defined(KERNBUILDDIR) OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h -.if !empty(OPT_INET6) +.if empty(OPT_INET6) MK_INET6_SUPPORT=no .endif .endif From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 10:52:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F01B36EC; Tue, 5 Aug 2014 10:52:11 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F79D2583; Tue, 5 Aug 2014 10:52:11 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3280225D3892; Tue, 5 Aug 2014 10:52:09 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5C4C5C26201; Tue, 5 Aug 2014 10:52:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id s0mDWbJtlVF6; Tue, 5 Aug 2014 10:52:04 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 28895C261FE; Tue, 5 Aug 2014 10:52:02 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269540 - in head/sys: conf modules/an modules/arcnet modules/cam modules/carp modules/cxgb/cxgb modules/cxgb/iw_cxgb modules/cxgb/tom modules/cxgbe/if_cxgbe modules/cxgbe/iw_cxgbe modu... From: "Bjoern A. Zeeb" In-Reply-To: Date: Tue, 5 Aug 2014 10:52:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <998B3BD1-A9BD-40DA-B13A-15636D3DCFF0@FreeBSD.org> References: <53e00b0f.529c.265fe830@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 10:52:12 -0000 On 05 Aug 2014, at 10:31 , Bjoern A. Zeeb wrote: >=20 > On 04 Aug 2014, at 22:37 , Warner Losh wrote: >=20 >> Author: imp >> Date: Mon Aug 4 22:37:02 2014 >> New Revision: 269540 >> URL: http://svnweb.freebsd.org/changeset/base/269540 >>=20 >> Log: >> Move most of the 15 variations on generating opt_inet.h and >> opt_inet6.h into kmod.mk by forcing almost everybody to eat the same >> dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h >> targets here too. >>=20 >> Modified: >> head/sys/conf/kern.opts.mk >> head/sys/conf/kmod.mk >> head/sys/modules/an/Makefile >> head/sys/modules/arcnet/Makefile >> head/sys/modules/cam/Makefile >> head/sys/modules/carp/Makefile >> head/sys/modules/cxgb/cxgb/Makefile >> head/sys/modules/cxgb/iw_cxgb/Makefile >> head/sys/modules/cxgb/tom/Makefile >> head/sys/modules/cxgbe/if_cxgbe/Makefile >> head/sys/modules/cxgbe/iw_cxgbe/Makefile >> head/sys/modules/cxgbe/tom/Makefile >> head/sys/modules/dummynet/Makefile >> head/sys/modules/em/Makefile >> head/sys/modules/en/Makefile >> head/sys/modules/fatm/Makefile >> head/sys/modules/firewire/fwip/Makefile >> head/sys/modules/hatm/Makefile >> head/sys/modules/i40e/Makefile (contents, props changed) >> head/sys/modules/if_bridge/Makefile >> head/sys/modules/if_disc/Makefile >> head/sys/modules/if_faith/Makefile >> head/sys/modules/if_gif/Makefile >> head/sys/modules/if_gre/Makefile >> head/sys/modules/if_lagg/Makefile >> head/sys/modules/if_stf/Makefile >> head/sys/modules/if_tap/Makefile >> head/sys/modules/if_tun/Makefile >> head/sys/modules/igb/Makefile >> head/sys/modules/ip6_mroute_mod/Makefile >> head/sys/modules/ip_mroute_mod/Makefile >> head/sys/modules/ipdivert/Makefile >> head/sys/modules/ipfilter/Makefile >> head/sys/modules/ipfw/Makefile >> head/sys/modules/ipoib/Makefile >> head/sys/modules/ixgbe/Makefile >> head/sys/modules/krpc/Makefile >> head/sys/modules/linux/Makefile >> head/sys/modules/lmc/Makefile >> head/sys/modules/mlx4/Makefile >> head/sys/modules/mlx4ib/Makefile >> head/sys/modules/mlxen/Makefile >> head/sys/modules/mthca/Makefile >> head/sys/modules/netgraph/gif/Makefile >> head/sys/modules/netgraph/iface/Makefile >> head/sys/modules/netgraph/ipfw/Makefile >> head/sys/modules/netgraph/netflow/Makefile >> head/sys/modules/nfscl/Makefile >> head/sys/modules/nfsclient/Makefile >> head/sys/modules/nfslockd/Makefile >> head/sys/modules/nfsserver/Makefile >> head/sys/modules/patm/Makefile >> head/sys/modules/pf/Makefile >> head/sys/modules/pflog/Makefile >> head/sys/modules/pfsync/Makefile >> head/sys/modules/smbfs/Makefile >> head/sys/modules/snc/Makefile >> head/sys/modules/sppp/Makefile >> head/sys/modules/trm/Makefile >> head/sys/modules/virtio/network/Makefile >> head/sys/modules/vmware/vmxnet3/Makefile >> head/sys/modules/wlan/Makefile >> head/sys/modules/wlan_acl/Makefile >> head/sys/modules/wlan_amrr/Makefile >> head/sys/modules/wlan_ccmp/Makefile >> head/sys/modules/wlan_rssadapt/Makefile >> head/sys/modules/wlan_tkip/Makefile >> head/sys/modules/wlan_wep/Makefile >> head/sys/modules/wlan_xauth/Makefile >=20 > This broke a couple of kernel builds during universe: >=20 > mips AP91 kernel failed, check _.mips.AP91 for details > mips AP93 kernel failed, check _.mips.AP93 for details > mips AR724X_BASE kernel failed, check _.mips.AR724X_BASE for details > mips ENH200 kernel failed, check _.mips.ENH200 for details > mips DIR-825B1 kernel failed, check _.mips.DIR-825B1 for details > mips PB92 kernel failed, check _.mips.PB92 for details > mips PICOSTATION_M2HP kernel failed, check _.mips.PICOSTATION_M2HP for = details > mips WZR-300HP kernel failed, check _.mips.WZR-300HP for details > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details >=20 >=20 > They all seem to not define INET6 and AP91 errors look like this; all = seem to barf in the if_gif module built. Please investigate and = unbreak. Would be really nice if these commits were tested to build = and still give the same results upfront. I am mostly worried about the = latter actually. I should have fixed the build in r269581. The other concern remains. > -------------------------------------------------------------- >>>> Kernel build for AP91 started on Tue Aug 5 07:06:20 UTC 2014 > -------------------------------------------------------------- > =3D=3D=3D> AP91 > -------------------------------------------------------------- >>>> stage 1: configuring the kernel > -------------------------------------------------------------- > Kernel build directory is = /storage/head/obj//mips.mips/scratch/tmp/bz/head.svn/sys/AP91 > Don't forget to do ``make cleandepend && make depend'' > -------------------------------------------------------------- >>>> stage 2.1: cleaning up the object tree > -------------------------------------------------------------- > bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" > -------------------------------------------------------------- >>>> stage 2.2: rebuilding the object tree > -------------------------------------------------------------- > bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" >=20 > -------------------------------------------------------------- >>>> stage 2.3: build tools > -------------------------------------------------------------- > -------------------------------------------------------------- >>>> stage 3.1: making dependencies > -------------------------------------------------------------- > bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" > -------------------------------------------------------------- >>>> stage 3.2: building everything > -------------------------------------------------------------- > bmake: "/scratch/tmp/bz/head.svn/sys/modules/if_gif/Makefile" line 11: = warning: Couldn't read shell's output for "cat = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91/opt_inet6.h" > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:76: = error: 'GIF_HLIM' undeclared here (not in a function) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:92: = error: 'in6_gif_input' undeclared here (not in a function) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:93: = error: 'rip6_output' undeclared here (not in a function) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:94: = error: 'rip6_ctloutput' undeclared here (not in a function) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:95: = error: 'rip6_usrreqs' undeclared here (not in a function) > cc1: warnings being treated as errors > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:102: = warning: no previous prototype for 'in6_gif_output' = [-Wmissing-prototypes] > /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c: = In function 'in6_gif_output': > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:104: = error: 'struct gif_softc' has no member named 'gif_ro6' > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:192: = error: invalid application of 'sizeof' to incomplete type 'struct = ip6_hdr' > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:215: = error: dereferencing pointer to incomplete type > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: dereferencing pointer to incomplete type > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: 'IPV6_VERSION_MASK' undeclared (first use in this function) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: (Each undeclared identifier is reported only once > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:216: = error: for each function it appears in.) > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:217: = error: dereferencing pointer to incomplete type > = /scratch/tmp/bz/head.svn/sys/modules/if_gif/../../netinet6/in6_gif.c:217: = error: =91IPV6_VERSION=92 undeclared (first use in this function) > . . . > [stripped another several dozen lines] > --- in6_gif.o --- > *** [in6_gif.o] Error code 1 >=20 > bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules/if_gif > --- all_subdir_if_gif --- > *** [all_subdir_if_gif] Error code 1 >=20 > bmake: stopped in /scratch/tmp/bz/head.svn/sys/modules > --- modules-all --- > *** [modules-all] Error code 1 >=20 > bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/AP91 > linking kernel.debug > text data bss dec hex filename > 2708527 198924 147936 3055387 2e9f1b kernel.debug > --- buildkernel --- > *** [buildkernel] Error code 1 >=20 > bmake: stopped in /scratch/tmp/bz/head.svn > --- buildkernel --- > *** [buildkernel] Error code 1 >=20 > bmake: stopped in /scratch/tmp/bz/head.svn >=20 >=20 >=20 >=20 >=20 >=20 > =97=20 > Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, = 1983 >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 11:50:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C2C6E6B for ; Tue, 5 Aug 2014 11:50:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E34302B92 for ; Tue, 5 Aug 2014 11:50:16 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 554f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 11:50:16 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 11:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269582 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0c4f8.554f.7d534c18@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 11:50:17 -0000 Author: n_hibma Date: Tue Aug 5 11:50:16 2014 New Revision: 269582 URL: http://svnweb.freebsd.org/changeset/base/269582 Log: don't OR integer error values together as this does not make sense. Instead bail on the first failed command. Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Aug 5 10:48:53 2014 (r269581) +++ head/sys/dev/usb/serial/u3g.c Tue Aug 5 11:50:16 2014 (r269582) @@ -754,7 +754,8 @@ u3g_test_autoinst(void *arg, struct usb_ break; case U3GINIT_ZTESTOR: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); - error |= usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR); + if (error == 0) + error = usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR); break; case U3GINIT_CMOTECH: error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 12:04:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25663575 for ; Tue, 5 Aug 2014 12:04:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF1B22F59 for ; Tue, 5 Aug 2014 12:04:40 +0000 (UTC) Received: from bz (uid 1027) (envelope-from bz@FreeBSD.org) id 58ac by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 12:04:40 +0000 From: Bjoern A. Zeeb Date: Tue, 5 Aug 2014 12:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269583 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0c858.58ac.ffb65c4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 12:04:41 -0000 Author: bz Date: Tue Aug 5 12:04:40 2014 New Revision: 269583 URL: http://svnweb.freebsd.org/changeset/base/269583 Log: Provide -o vers= support for mount_nfs. Our mount_nfs does use -o nfsv<2|3|4> or -2 or -3 to specify the version. OSX (these days), Solaris, and Linux use -o vers=<2,3,4>. With the upcoming autofs support we can make a lot of (entrerprisy) setups getting mount options from LDAP just work by providing -o vers= compatibility. PR: 192379 Reviewed by: wblock, bjk (man page), rmacklem, emaste MFC after: 3 days Sponsored by: DARPA,AFRL Modified: head/sbin/mount_nfs/mount_nfs.8 head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Tue Aug 5 11:50:16 2014 (r269582) +++ head/sbin/mount_nfs/mount_nfs.8 Tue Aug 5 12:04:40 2014 (r269583) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd December 7, 2013 +.Dd August 5, 2014 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -371,6 +371,14 @@ tune the timeout interval.) .It Cm udp Use UDP transport. +.It Cm vers Ns = Ns Aq Ar vers_number +Use the specified version number for NFS requests. +See the +.Cm nfsv2 , +.Cm nfsv3 , +and +.Cm nfsv4 +options for details. .It Cm wcommitsize Ns = Ns Aq Ar value Set the maximum pending write commit size to the specified value. This determines the maximum amount of pending write data that the NFS @@ -466,6 +474,26 @@ Same as Same as .Fl o Cm retrans Ns = Ns Aq Ar value .El +.Pp +The following +.Fl o +named options are equivalent to other +.Fl o +named options and are supported for compatibility with other +operating systems (e.g., Linux, Solaris, and OSX) to ease usage of +.Xr autofs 5 +support. +.Bl -tag -width indent +.It Fl o Cm vers Ns = Ns 2 +Same as +.Fl o Cm nfsv2 +.It Fl o Cm vers Ns = Ns 3 +Same as +.Fl o Cm nfsv3 +.It Fl o Cm vers Ns = Ns 4 +Same as +.Fl o Cm nfsv4 +.El .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Tue Aug 5 11:50:16 2014 (r269582) +++ head/sbin/mount_nfs/mount_nfs.c Tue Aug 5 12:04:40 2014 (r269583) @@ -310,6 +310,32 @@ main(int argc, char *argv[]) if (*p || num <= 0) errx(1, "illegal maxgroups value -- %s", val); //set_rpc_maxgrouplist(num); + } else if (strcmp(opt, "vers") == 0) { + num = strtol(val, &p, 10); + if (*p || num <= 0) + errx(1, "illegal vers value -- " + "%s", val); + switch (num) { + case 2: + mountmode = V2; + break; + case 3: + mountmode = V3; + build_iovec(&iov, &iovlen, + "nfsv3", NULL, 0); + break; + case 4: + mountmode = V4; + fstype = "nfs"; + nfsproto = IPPROTO_TCP; + if (portspec == NULL) + portspec = "2049"; + break; + default: + errx(1, "illegal nfs version " + "value -- %s", val); + } + pass_flag_to_nmount=0; } if (pass_flag_to_nmount) build_iovec(&iov, &iovlen, opt, val, From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 12:08:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D129757 for ; Tue, 5 Aug 2014 12:08:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280B92FB5 for ; Tue, 5 Aug 2014 12:08:51 +0000 (UTC) Received: from n_hibma (uid 745) (envelope-from n_hibma@FreeBSD.org) id 58c8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 12:08:50 +0000 From: Nick Hibma Date: Tue, 5 Aug 2014 12:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269584 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0c952.58c8.6c9734e6@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 12:08:51 -0000 Author: n_hibma Date: Tue Aug 5 12:08:50 2014 New Revision: 269584 URL: http://svnweb.freebsd.org/changeset/base/269584 Log: Add support for Huawei E3272 modems which are supported by the CDC ethernet class. Note: This is untested as I do not have a device like this. That is reflected in the MFC timeout. PR: 192345 Submitted by: rozhuk.im gmail.com MFC after: 4 weeks Modified: head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Tue Aug 5 12:04:40 2014 (r269583) +++ head/sys/dev/usb/net/if_cdce.c Tue Aug 5 12:08:50 2014 (r269584) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #define USB_DEBUG_VAR cdce_debug #include #include +#include #include "usb_if.h" #include @@ -251,8 +252,11 @@ static driver_t cdce_driver = { }; static devclass_t cdce_devclass; +static eventhandler_tag cdce_etag; -DRIVER_MODULE(cdce, uhub, cdce_driver, cdce_devclass, NULL, 0); +static int cdce_driver_loaded(struct module *, int, void *); + +DRIVER_MODULE(cdce, uhub, cdce_driver, cdce_devclass, cdce_driver_loaded, 0); MODULE_VERSION(cdce, 1); MODULE_DEPEND(cdce, uether, 1, 1, 1); MODULE_DEPEND(cdce, usb, 1, 1, 1); @@ -267,6 +271,10 @@ static const struct usb_ether_methods cd .ue_setpromisc = cdce_setpromisc, }; +static const STRUCT_USB_HOST_ID cdce_switch_devs[] = { + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3272_INIT, MSC_EJECT_HUAWEI2)}, +}; + static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_ACERLABS, USB_PRODUCT_ACERLABS_M5632, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_AMBIT, USB_PRODUCT_AMBIT_NTL_250, CDCE_FLAG_NO_UNION)}, @@ -281,6 +289,16 @@ static const STRUCT_USB_HOST_ID cdce_hos {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLA300, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC700, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, + + {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x16), + USB_DRIVER_INFO(0)}, + {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x46), + USB_DRIVER_INFO(0)}, + {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x76), + USB_DRIVER_INFO(0)}, }; static const STRUCT_USB_DUAL_ID cdce_dual_devs[] = { @@ -474,6 +492,48 @@ cdce_ncm_init(struct cdce_softc *sc) } #endif +static void +cdce_test_autoinst(void *arg, struct usb_device *udev, + struct usb_attach_arg *uaa) +{ + struct usb_interface *iface; + struct usb_interface_descriptor *id; + + if (uaa->dev_state != UAA_DEV_READY) + return; + + iface = usbd_get_iface(udev, 0); + if (iface == NULL) + return; + id = iface->idesc; + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return; + if (usbd_lookup_id_by_uaa(cdce_switch_devs, sizeof(cdce_switch_devs), uaa)) + return; /* no device match */ + + if (usb_msc_eject(udev, 0, USB_GET_DRIVER_INFO(uaa)) == 0) { + /* success, mark the udev as disappearing */ + uaa->dev_state = UAA_DEV_EJECTING; + } +} + +static int +cdce_driver_loaded(struct module *mod, int what, void *arg) +{ + switch (what) { + case MOD_LOAD: + /* register our autoinstall handler */ + cdce_etag = EVENTHANDLER_REGISTER(usb_dev_configured, + cdce_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); + return (0); + case MOD_UNLOAD: + EVENTHANDLER_DEREGISTER(usb_dev_configured, cdce_etag); + return (0); + default: + return (EOPNOTSUPP); + } +} + static int cdce_probe(device_t dev) { Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Aug 5 12:04:40 2014 (r269583) +++ head/sys/dev/usb/usbdevs Tue Aug 5 12:08:50 2014 (r269584) @@ -2342,9 +2342,11 @@ product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI K4505_INIT 0x1521 K4505 Initial +product HUAWEI E3272_INIT 0x155b LTE modem initial product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial +product HUAWEI E3272 0x1c1e LTE modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 13:01:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7BEC880 for ; Tue, 5 Aug 2014 13:01:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D19D26D3 for ; Tue, 5 Aug 2014 13:01:22 +0000 (UTC) Received: from cy (uid 918) (envelope-from cy@FreeBSD.org) id 5ad6 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 13:01:22 +0000 From: Cy Schubert Date: Tue, 5 Aug 2014 13:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269585 - in head: sbin/ipf sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0d5a2.5ad6.714bf468@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 13:01:22 -0000 Author: cy Date: Tue Aug 5 13:01:21 2014 New Revision: 269585 URL: http://svnweb.freebsd.org/changeset/base/269585 Log: Honour WITH and WITHOUT_INET6_SUPPORT. Approved by: glebius (mentor) MFC after: 3 days Modified: head/sbin/ipf/Makefile.inc head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sbin/ipf/Makefile.inc ============================================================================== --- head/sbin/ipf/Makefile.inc Tue Aug 5 12:08:50 2014 (r269584) +++ head/sbin/ipf/Makefile.inc Tue Aug 5 13:01:21 2014 (r269585) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + WARNS?= 2 NO_WFORMAT= NO_WARRAY_BOUNDS= @@ -10,6 +12,12 @@ CFLAGS+= -I${.CURDIR}/../../../sys CFLAGS+= -I${.CURDIR}/../../../sys/contrib/ipfilter CFLAGS+= -DSTATETOP -D__UIO_EXPOSE +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DUSE_INET6 +.else +CFLAGS+= -DNOINET6 +.endif + LIBIPF= ${.OBJDIR}/../libipf/libipf.a DPADD+= ${LIBIPF} ${LIBKVM} LDADD+= ${LIBIPF} -lkvm Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 5 12:08:50 2014 (r269584) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 5 13:01:21 2014 (r269585) @@ -118,6 +118,10 @@ struct ether_addr { # if defined(INET6) && !defined(USE_INET6) # define USE_INET6 # endif +# else +# if !defined(USE_INET6) && !defined(NOINET6) +# define USE_INET6 +# endif # endif # if defined(_KERNEL) From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 13:36:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E09490E for ; Tue, 5 Aug 2014 13:36:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4019A2CCE for ; Tue, 5 Aug 2014 13:36:27 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 59a2 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 13:36:27 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 13:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269586 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0dddb.59a2.68ef8cdf@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 13:36:27 -0000 Author: hselasky Date: Tue Aug 5 13:36:26 2014 New Revision: 269586 URL: http://svnweb.freebsd.org/changeset/base/269586 Log: - Ensure code which only applies to the control endpoint is not run for other endpoints in the data transfer path. - Ensure all bits of the "EPCON" register is written during initialisation. MFC after: 3 days Modified: head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Tue Aug 5 13:01:21 2014 (r269585) +++ head/sys/dev/usb/controller/uss820dci.c Tue Aug 5 13:36:26 2014 (r269586) @@ -400,7 +400,7 @@ repeat: if (rx_stat & (USS820_RXSTAT_RXSETUP | USS820_RXSTAT_RXSOVW | USS820_RXSTAT_EDOVW)) { - if (td->remainder == 0) { + if (td->remainder == 0 && td->ep_index == 0) { /* * We are actually complete and have * received the next SETUP @@ -515,21 +515,24 @@ repeat: /* read out TX FIFO flags */ tx_flag = USS820_READ_1(sc, USS820_TXFLG); - /* read out RX FIFO status last */ - rx_stat = USS820_READ_1(sc, USS820_RXSTAT); + DPRINTFN(5, "tx_flag=0x%02x rem=%u\n", tx_flag, td->remainder); - DPRINTFN(5, "rx_stat=0x%02x tx_flag=0x%02x rem=%u\n", - rx_stat, tx_flag, td->remainder); + if (td->ep_index == 0) { + /* read out RX FIFO status last */ + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); - if (rx_stat & (USS820_RXSTAT_RXSETUP | - USS820_RXSTAT_RXSOVW | - USS820_RXSTAT_EDOVW)) { - /* - * The current transfer was aborted - * by the USB Host - */ - td->error = 1; - return (0); /* complete */ + DPRINTFN(5, "rx_stat=0x%02x\n", rx_stat); + + if (rx_stat & (USS820_RXSTAT_RXSETUP | + USS820_RXSTAT_RXSOVW | + USS820_RXSTAT_EDOVW)) { + /* + * The current transfer was aborted by the USB + * Host: + */ + td->error = 1; + return (0); /* complete */ + } } if (tx_flag & (USS820_TXFLG_TXOVF | USS820_TXFLG_TXURF)) { @@ -611,20 +614,21 @@ uss820dci_data_tx_sync(struct uss820dci_ /* read out TX FIFO flag */ tx_flag = USS820_READ_1(sc, USS820_TXFLG); - /* read out RX FIFO status last */ - rx_stat = USS820_READ_1(sc, USS820_RXSTAT); - - DPRINTFN(5, "rx_stat=0x%02x rem=%u\n", rx_stat, td->remainder); - - if (rx_stat & (USS820_RXSTAT_RXSETUP | - USS820_RXSTAT_RXSOVW | - USS820_RXSTAT_EDOVW)) { - DPRINTFN(5, "faking complete\n"); - /* Race condition */ - return (0); /* complete */ + if (td->ep_index == 0) { + /* read out RX FIFO status last */ + rx_stat = USS820_READ_1(sc, USS820_RXSTAT); + + DPRINTFN(5, "rx_stat=0x%02x rem=%u\n", rx_stat, td->remainder); + + if (rx_stat & (USS820_RXSTAT_RXSETUP | + USS820_RXSTAT_RXSOVW | + USS820_RXSTAT_EDOVW)) { + DPRINTFN(5, "faking complete\n"); + /* Race condition */ + return (0); /* complete */ + } } - DPRINTFN(5, "tx_flag=0x%02x rem=%u\n", - tx_flag, td->remainder); + DPRINTFN(5, "tx_flag=0x%02x rem=%u\n", tx_flag, td->remainder); if (tx_flag & (USS820_TXFLG_TXOVF | USS820_TXFLG_TXURF)) { @@ -635,7 +639,7 @@ uss820dci_data_tx_sync(struct uss820dci_ USS820_TXFLG_TXFIF1)) { return (1); /* not complete */ } - if (sc->sc_dv_addr != 0xFF) { + if (td->ep_index == 0 && sc->sc_dv_addr != 0xFF) { /* write function address */ uss820dci_set_address(sc, sc->sc_dv_addr); } @@ -1528,7 +1532,7 @@ uss820dci_init(struct uss820dci_softc *s temp = USS820_EPCON_RXEPEN | USS820_EPCON_TXEPEN; } - uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, temp); + uss820dci_update_shared_1(sc, USS820_EPCON, 0, temp); } USB_BUS_UNLOCK(&sc->sc_bus); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 14:30:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB75095A for ; Tue, 5 Aug 2014 14:30:07 +0000 (UTC) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 968262508 for ; Tue, 5 Aug 2014 14:30:07 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id ft15so1451678pdb.31 for ; Tue, 05 Aug 2014 07:30:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=78JprRbcANJLLsbw2m93p9TFSS6B9bH31oilMY5mD9Y=; b=U1wCv8rijrOrtwnpB6/gIZQI8MtTqf4mmwDj4MvyUUxoMEDeOEqaDidNiol1WBJ3R6 KpDGfPrWOkSZ8APgZzxNVwe1QqoyRGps8z4t5W8o6ItI69oLmV2AicRQZFncikCmo9M8 2PejApye2NA5cIiOESPhMr316gTgtmc/0Q8KPg0flzQP3UZ4vGUi/CoHHfUZyWVF9EJv KHdNiXX2wD1UGwvMZ3IoOLwbJF7yV+4QRD+am67E0GCGFm02gtjeW1ap/drP4JOhHQ0m Up63m5okWfFWsStjkSWpb/DzG1lyCq2FtfAmEbTEgaC90QYcH7CrMLo6Z6TndYK8ys1X LO/w== X-Gm-Message-State: ALoCoQmcS/nLuwFA9jvtWhFLM315R8ca/HfJupKGV4n9eNIPqJgbafqi/tqfQdeCT/ZM0sWcPUaD X-Received: by 10.70.35.15 with SMTP id d15mr4789353pdj.48.1407249000944; Tue, 05 Aug 2014 07:30:00 -0700 (PDT) Received: from [10.64.25.9] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id mn2sm2239582pbc.64.2014.08.05.07.29.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 07:30:00 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_1246B2AD-3F1F-4E76-9180-F33B3A4FEF27"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269540 - in head/sys: conf modules/an modules/arcnet modules/cam modules/carp modules/cxgb/cxgb modules/cxgb/iw_cxgb modules/cxgb/tom modules/cxgbe/if_cxgbe modules/cxgbe/iw_cxgbe modu... From: Warner Losh In-Reply-To: <998B3BD1-A9BD-40DA-B13A-15636D3DCFF0@FreeBSD.org> Date: Tue, 5 Aug 2014 08:29:57 -0600 Message-Id: <608EE963-4680-47AC-932E-D3ABD5BC5BCD@bsdimp.com> References: <53e00b0f.529c.265fe830@svn.freebsd.org> <998B3BD1-A9BD-40DA-B13A-15636D3DCFF0@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 14:30:07 -0000 --Apple-Mail=_1246B2AD-3F1F-4E76-9180-F33B3A4FEF27 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 5, 2014, at 4:52 AM, Bjoern A. Zeeb wrote: >=20 > On 05 Aug 2014, at 10:31 , Bjoern A. Zeeb wrote: >=20 >>=20 >> On 04 Aug 2014, at 22:37 , Warner Losh wrote: >>=20 >>> Author: imp >>> Date: Mon Aug 4 22:37:02 2014 >>> New Revision: 269540 >>> URL: http://svnweb.freebsd.org/changeset/base/269540 >>>=20 >>> Log: >>> Move most of the 15 variations on generating opt_inet.h and >>> opt_inet6.h into kmod.mk by forcing almost everybody to eat the same >>> dogfood. While at it, consolidate the opt_bpf.h and opt_mroute.h >>> targets here too. >>>=20 >>> Modified: >>> head/sys/conf/kern.opts.mk >>> head/sys/conf/kmod.mk >>> head/sys/modules/an/Makefile >>> head/sys/modules/arcnet/Makefile >>> head/sys/modules/cam/Makefile >>> head/sys/modules/carp/Makefile >>> head/sys/modules/cxgb/cxgb/Makefile >>> head/sys/modules/cxgb/iw_cxgb/Makefile >>> head/sys/modules/cxgb/tom/Makefile >>> head/sys/modules/cxgbe/if_cxgbe/Makefile >>> head/sys/modules/cxgbe/iw_cxgbe/Makefile >>> head/sys/modules/cxgbe/tom/Makefile >>> head/sys/modules/dummynet/Makefile >>> head/sys/modules/em/Makefile >>> head/sys/modules/en/Makefile >>> head/sys/modules/fatm/Makefile >>> head/sys/modules/firewire/fwip/Makefile >>> head/sys/modules/hatm/Makefile >>> head/sys/modules/i40e/Makefile (contents, props changed) >>> head/sys/modules/if_bridge/Makefile >>> head/sys/modules/if_disc/Makefile >>> head/sys/modules/if_faith/Makefile >>> head/sys/modules/if_gif/Makefile >>> head/sys/modules/if_gre/Makefile >>> head/sys/modules/if_lagg/Makefile >>> head/sys/modules/if_stf/Makefile >>> head/sys/modules/if_tap/Makefile >>> head/sys/modules/if_tun/Makefile >>> head/sys/modules/igb/Makefile >>> head/sys/modules/ip6_mroute_mod/Makefile >>> head/sys/modules/ip_mroute_mod/Makefile >>> head/sys/modules/ipdivert/Makefile >>> head/sys/modules/ipfilter/Makefile >>> head/sys/modules/ipfw/Makefile >>> head/sys/modules/ipoib/Makefile >>> head/sys/modules/ixgbe/Makefile >>> head/sys/modules/krpc/Makefile >>> head/sys/modules/linux/Makefile >>> head/sys/modules/lmc/Makefile >>> head/sys/modules/mlx4/Makefile >>> head/sys/modules/mlx4ib/Makefile >>> head/sys/modules/mlxen/Makefile >>> head/sys/modules/mthca/Makefile >>> head/sys/modules/netgraph/gif/Makefile >>> head/sys/modules/netgraph/iface/Makefile >>> head/sys/modules/netgraph/ipfw/Makefile >>> head/sys/modules/netgraph/netflow/Makefile >>> head/sys/modules/nfscl/Makefile >>> head/sys/modules/nfsclient/Makefile >>> head/sys/modules/nfslockd/Makefile >>> head/sys/modules/nfsserver/Makefile >>> head/sys/modules/patm/Makefile >>> head/sys/modules/pf/Makefile >>> head/sys/modules/pflog/Makefile >>> head/sys/modules/pfsync/Makefile >>> head/sys/modules/smbfs/Makefile >>> head/sys/modules/snc/Makefile >>> head/sys/modules/sppp/Makefile >>> head/sys/modules/trm/Makefile >>> head/sys/modules/virtio/network/Makefile >>> head/sys/modules/vmware/vmxnet3/Makefile >>> head/sys/modules/wlan/Makefile >>> head/sys/modules/wlan_acl/Makefile >>> head/sys/modules/wlan_amrr/Makefile >>> head/sys/modules/wlan_ccmp/Makefile >>> head/sys/modules/wlan_rssadapt/Makefile >>> head/sys/modules/wlan_tkip/Makefile >>> head/sys/modules/wlan_wep/Makefile >>> head/sys/modules/wlan_xauth/Makefile >>=20 >> This broke a couple of kernel builds during universe: >>=20 >> mips AP91 kernel failed, check _.mips.AP91 for details >> mips AP93 kernel failed, check _.mips.AP93 for details >> mips AR724X_BASE kernel failed, check _.mips.AR724X_BASE for details >> mips ENH200 kernel failed, check _.mips.ENH200 for details >> mips DIR-825B1 kernel failed, check _.mips.DIR-825B1 for details >> mips PB92 kernel failed, check _.mips.PB92 for details >> mips PICOSTATION_M2HP kernel failed, check _.mips.PICOSTATION_M2HP = for details >> mips WZR-300HP kernel failed, check _.mips.WZR-300HP for details >> arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details >>=20 >>=20 >> They all seem to not define INET6 and AP91 errors look like this; = all seem to barf in the if_gif module built. Please investigate and = unbreak. Would be really nice if these commits were tested to build = and still give the same results upfront. I am mostly worried about the = latter actually. >=20 > I should have fixed the build in r269581. The other concern remains. Thanks Bjoern=85 I had a different, working change that I ran through Universe earlier in = my development process. I reworked it though as part of teasing = different changes apart of a larger change set, though, and the error = crept in there. That=92s my bad. Thanks for fixing it. Warner --Apple-Mail=_1246B2AD-3F1F-4E76-9180-F33B3A4FEF27 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJT4OplAAoJEGwc0Sh9sBEA4xoQAKGd4mD4vQBIDAj63UovgA2j nGUSNkJs/8D0y1UA9W2u6B6fkyJdUXqks+a188s3Vy6LLfS5U99LAnSAoR7hrOQS dRWyyWgARKpW5KEgr7w+AH1RJqqeR50ig3NT8m9GnE97benrGBa/9AEfDawMVMot kpgRgcY7OkDDMGiNeqBrZsU0Jrq3uR46sFfq6SmzTCrucRp+rWrykyCMxFsL5jAZ 00VuAQoVQk/S4fTeu56RCQ0+OyyKOomCI3midcpzJ4WsKDk/Fle3WOpao2azNwrn mhh2XxmkO4wJ9D7CvrPyoIbuSA1oxuwKU0MFQxL3zXGxtXDKmcsQBPMiT8aHxguR HItID6KyLUA55sqx1EhAdniPDE6pALhwj8YRzsPE/hBP/LaZ4Xcjt4HBOkBEY9gO IoyB3Pk5Zj28PEa5rSFXXiM8sv2bQIoJh8KhSyiFEBjAn6+uiJ5sV17xUdz1TRfv 324WR8sxwRYzXQVjomxfRUvaaFJvf82SAmImbuxIaKT02COxw+yl+hQIEwnhB/x7 TGwa4V2M9+tG9aa2AquUYZ2NdNQB9BRBxdOb5yL4q5+zCbyqSH5PcaMWk+zECXBP o0xJINnukCjP4TbqkideimWHcYnPP3WP9qcx9xAarFQGNKCREhxbpGCcxEl3WHhx 9mRb9tsFof7TVoHcl//y =E+op -----END PGP SIGNATURE----- --Apple-Mail=_1246B2AD-3F1F-4E76-9180-F33B3A4FEF27-- From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 15:01:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 171E9734 for ; Tue, 5 Aug 2014 15:01:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB5A528F1 for ; Tue, 5 Aug 2014 15:01:30 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 5b9a by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 15:01:30 +0000 From: Alexander Motin Date: Tue, 5 Aug 2014 15:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269587 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e0f1ca.5b9a.164ad074@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 15:01:31 -0000 Author: mav Date: Tue Aug 5 15:01:30 2014 New Revision: 269587 URL: http://svnweb.freebsd.org/changeset/base/269587 Log: Reimplement WRITE USING TOKEN with Block Zero token using WRITE SAME. On my ZVOL of SSDs that increases speed of zero writing in that way from 1 to 2.5GB/s by reducing CPU overhead. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_util.c head/sys/cam/ctl/ctl_util.h Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue Aug 5 13:36:26 2014 (r269586) +++ head/sys/cam/ctl/ctl_tpc.c Tue Aug 5 15:01:30 2014 (r269587) @@ -828,11 +828,10 @@ complete: /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); - } else { - list->cursectors += list->segsectors; - list->curbytes += list->segbytes; - return (CTL_RETVAL_COMPLETE); } + list->cursectors += list->segsectors; + list->curbytes += list->segbytes; + return (CTL_RETVAL_COMPLETE); } TAILQ_INIT(&list->allio); @@ -1141,14 +1140,6 @@ complete: return (CTL_RETVAL_COMPLETE); dstblock = list->lun->be_lun->blocksize; - /* Special case: no token == Block device zero ROD token */ - if (list->token == NULL) { - srcblock = 1; - srclba = 0; - numbytes = INT64_MAX; - goto dstp; - } - /* Check where we are on source ranges list. */ srcblock = list->token->blocksize; if (tpc_skip_ranges(list->token->range, list->token->nrange, @@ -1163,7 +1154,6 @@ complete: srclba = scsi_8btou64(list->token->range[srange].lba) + soffset; numbytes = srcblock * omin(TPC_MAX_IOCHUNK_SIZE / srcblock, (scsi_4btoul(list->token->range[srange].length) - soffset)); -dstp: dstlba = scsi_8btou64(list->range[drange].lba) + doffset; numbytes = omin(numbytes, dstblock * omin(TPC_MAX_IOCHUNK_SIZE / dstblock, @@ -1190,10 +1180,6 @@ dstp: while (donebytes < numbytes) { roundbytes = MIN(numbytes - donebytes, TPC_MAX_IO_SIZE); - if (list->token == NULL) { - tior = NULL; - goto dstw; - } tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); tior->list = list; @@ -1217,7 +1203,6 @@ dstp: tior->lun = list->token->lun; tior->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tior; -dstw: tiow = malloc(sizeof(*tiow), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tiow->run); tiow->list = list; @@ -1241,14 +1226,9 @@ dstw: tiow->lun = list->lun->lun; tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; - if (tior) { - TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); - TAILQ_INSERT_TAIL(prun, tior, rlinks); - prun = &tior->run; - } else { - TAILQ_INSERT_TAIL(prun, tiow, rlinks); - prun = &tiow->run; - } + TAILQ_INSERT_TAIL(&tior->run, tiow, rlinks); + TAILQ_INSERT_TAIL(prun, tior, rlinks); + prun = &tior->run; donebytes += roundbytes; } @@ -1262,6 +1242,89 @@ dstw: return (CTL_RETVAL_QUEUED); } +static int +tpc_process_zero_wut(struct tpc_list *list) +{ + struct tpc_io *tio, *tiow; + struct runl run, *prun; + int r; + uint32_t dstblock, len; + + if (list->stage > 0) { +complete: + /* Cleanup after previous rounds. */ + while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { + TAILQ_REMOVE(&list->allio, tio, links); + ctl_free_io(tio->io); + free(tio, M_CTL); + } + free(list->buf, M_CTL); + if (list->abort) { + ctl_set_task_aborted(list->ctsio); + return (CTL_RETVAL_ERROR); + } else if (list->error) { + ctl_set_sense(list->ctsio, /*current_error*/ 1, + /*sense_key*/ SSD_KEY_COPY_ABORTED, + /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + return (CTL_RETVAL_ERROR); + } + list->cursectors += list->segsectors; + list->curbytes += list->segbytes; + return (CTL_RETVAL_COMPLETE); + } + + dstblock = list->lun->be_lun->blocksize; + list->buf = malloc(dstblock, M_CTL, M_WAITOK | M_ZERO); + TAILQ_INIT(&run); + prun = &run; + list->tbdio = 1; + TAILQ_INIT(&list->allio); + list->segsectors = 0; + for (r = 0; r < list->nrange; r++) { + len = scsi_4btoul(list->range[r].length); + if (len == 0) + continue; + + tiow = malloc(sizeof(*tiow), M_CTL, M_WAITOK | M_ZERO); + TAILQ_INIT(&tiow->run); + tiow->list = list; + TAILQ_INSERT_TAIL(&list->allio, tiow, links); + tiow->io = tpcl_alloc_io(); + if (tiow->io == NULL) { + list->error = 1; + goto complete; + } + ctl_scsi_write_same(tiow->io, + /*data_ptr*/ list->buf, + /*data_len*/ dstblock, + /*byte2*/ 0, + /*lba*/ scsi_8btou64(list->range[r].lba), + /*num_blocks*/ len, + /*tag_type*/ CTL_TAG_SIMPLE, + /*control*/ 0); + tiow->io->io_hdr.retries = 3; + tiow->lun = list->lun->lun; + tiow->io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = tiow; + + TAILQ_INSERT_TAIL(prun, tiow, rlinks); + prun = &tiow->run; + list->segsectors += len; + } + list->segbytes = list->segsectors * dstblock; + + if (TAILQ_EMPTY(&run)) + goto complete; + + while ((tiow = TAILQ_FIRST(&run)) != NULL) { + TAILQ_REMOVE(&run, tiow, rlinks); + if (tpcl_queue(tiow->io, tiow->lun) != CTL_RETVAL_COMPLETE) + panic("tpcl_queue() error"); + } + + list->stage++; + return (CTL_RETVAL_QUEUED); +} + static void tpc_process(struct tpc_list *list) { @@ -1271,7 +1334,10 @@ tpc_process(struct tpc_list *list) int retval = CTL_RETVAL_COMPLETE; if (list->service_action == EC_WUT) { - retval = tpc_process_wut(list); + if (list->token != NULL) + retval = tpc_process_wut(list); + else + retval = tpc_process_zero_wut(list); if (retval == CTL_RETVAL_QUEUED) return; if (retval == CTL_RETVAL_ERROR) { Modified: head/sys/cam/ctl/ctl_util.c ============================================================================== --- head/sys/cam/ctl/ctl_util.c Tue Aug 5 13:36:26 2014 (r269586) +++ head/sys/cam/ctl/ctl_util.c Tue Aug 5 15:01:30 2014 (r269587) @@ -345,6 +345,37 @@ ctl_scsi_read_write(union ctl_io *io, ui } void +ctl_scsi_write_same(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, + uint8_t byte2, uint64_t lba, uint32_t num_blocks, + ctl_tag_type tag_type, uint8_t control) +{ + struct ctl_scsiio *ctsio; + struct scsi_write_same_16 *cdb; + + ctl_scsi_zero_io(io); + + io->io_hdr.io_type = CTL_IO_SCSI; + ctsio = &io->scsiio; + ctsio->cdb_len = sizeof(*cdb); + cdb = (struct scsi_write_same_16 *)ctsio->cdb; + cdb->opcode = WRITE_SAME_16; + cdb->byte2 = byte2; + scsi_u64to8b(lba, cdb->addr); + scsi_ulto4b(num_blocks, cdb->length); + cdb->group = 0; + cdb->control = control; + + io->io_hdr.io_type = CTL_IO_SCSI; + io->io_hdr.flags = CTL_FLAG_DATA_OUT; + ctsio->tag_type = tag_type; + ctsio->ext_data_ptr = data_ptr; + ctsio->ext_data_len = data_len; + ctsio->ext_sg_entries = 0; + ctsio->ext_data_filled = 0; + ctsio->sense_len = SSD_FULL_SIZE; +} + +void ctl_scsi_read_capacity(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, uint32_t addr, int reladr, int pmi, ctl_tag_type tag_type, uint8_t control) Modified: head/sys/cam/ctl/ctl_util.h ============================================================================== --- head/sys/cam/ctl/ctl_util.h Tue Aug 5 13:36:26 2014 (r269586) +++ head/sys/cam/ctl/ctl_util.h Tue Aug 5 15:01:30 2014 (r269587) @@ -61,6 +61,10 @@ void ctl_scsi_read_write(union ctl_io *i int minimum_cdb_size, uint64_t lba, uint32_t num_blocks, ctl_tag_type tag_type, uint8_t control); +void ctl_scsi_write_same(union ctl_io *io, uint8_t *data_ptr, + uint32_t data_len, uint8_t byte2, + uint64_t lba, uint32_t num_blocks, + ctl_tag_type tag_type, uint8_t control); void ctl_scsi_read_capacity(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, uint32_t addr, int reladr, int pmi, ctl_tag_type tag_type, uint8_t control); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 16:31:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCFDA547 for ; Tue, 5 Aug 2014 16:31:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A15CE24F2 for ; Tue, 5 Aug 2014 16:31:03 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 5c8b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 16:31:03 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 16:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269594 - in head/sys/dev: fdt ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e106c7.5c8b.75d2360@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 16:31:03 -0000 Author: ian Date: Tue Aug 5 16:31:03 2014 New Revision: 269594 URL: http://svnweb.freebsd.org/changeset/base/269594 Log: Set ofwbus and simplebus to attach during BUS_PASS_BUS. Modified: head/sys/dev/fdt/simplebus.c head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Tue Aug 5 16:30:13 2014 (r269593) +++ head/sys/dev/fdt/simplebus.c Tue Aug 5 16:31:03 2014 (r269594) @@ -121,8 +121,10 @@ static driver_t simplebus_driver = { sizeof(struct simplebus_softc) }; static devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); -DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, 0); +EARLY_DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, + 0, 0, BUS_PASS_BUS); +EARLY_DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, + 0, 0, BUS_PASS_BUS); static int simplebus_probe(device_t dev) Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Tue Aug 5 16:30:13 2014 (r269593) +++ head/sys/dev/ofw/ofwbus.c Tue Aug 5 16:31:03 2014 (r269594) @@ -136,7 +136,8 @@ static driver_t ofwbus_driver = { sizeof(struct ofwbus_softc) }; static devclass_t ofwbus_devclass; -DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0); +EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0, + BUS_PASS_BUS); MODULE_VERSION(ofwbus, 1); static const char *const ofwbus_excl_name[] = { From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 17:22:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3723D713 for ; Tue, 5 Aug 2014 17:22:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F5FE2B35 for ; Tue, 5 Aug 2014 17:22:49 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 5f53 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 17:22:49 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 17:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269596 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e112e9.5f53.7b85315a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 17:22:49 -0000 Author: ian Date: Tue Aug 5 17:22:48 2014 New Revision: 269596 URL: http://svnweb.freebsd.org/changeset/base/269596 Log: Define names that drivers can use to adjust their position relative to other drivers within a BUS_PASS. Reviewed by: imp Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Aug 5 16:44:27 2014 (r269595) +++ head/sys/sys/bus.h Tue Aug 5 17:22:48 2014 (r269596) @@ -568,6 +568,12 @@ void bus_data_generation_update(void); #define BUS_PASS_SCHEDULER 60 /* Start scheduler. */ #define BUS_PASS_DEFAULT __INT_MAX /* Everything else. */ +#define BUS_PASS_ORDER_FIRST 0 +#define BUS_PASS_ORDER_EARLY 2 +#define BUS_PASS_ORDER_MIDDLE 5 +#define BUS_PASS_ORDER_LATE 7 +#define BUS_PASS_ORDER_LAST 9 + extern int bus_current_pass; void bus_set_pass(int pass); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 17:32:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CE699B1 for ; Tue, 5 Aug 2014 17:32:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6D52CAB for ; Tue, 5 Aug 2014 17:32:48 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 53a1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 17:32:48 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 17:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269597 - in head/sys/dev: fdt ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e11540.53a1.5dab12e3@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 17:32:48 -0000 Author: ian Date: Tue Aug 5 17:32:47 2014 New Revision: 269597 URL: http://svnweb.freebsd.org/changeset/base/269597 Log: Adjust ofwbus and simplebus to attach at BUS_PASS_ORDER_MIDDLE, so that a platform can attach some other bus first if necessary. Modified: head/sys/dev/fdt/simplebus.c head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Tue Aug 5 17:22:48 2014 (r269596) +++ head/sys/dev/fdt/simplebus.c Tue Aug 5 17:32:47 2014 (r269597) @@ -124,7 +124,7 @@ static devclass_t simplebus_devclass; EARLY_DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0, BUS_PASS_BUS); EARLY_DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, - 0, 0, BUS_PASS_BUS); + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); static int simplebus_probe(device_t dev) Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Tue Aug 5 17:22:48 2014 (r269596) +++ head/sys/dev/ofw/ofwbus.c Tue Aug 5 17:32:47 2014 (r269597) @@ -137,7 +137,7 @@ static driver_t ofwbus_driver = { }; static devclass_t ofwbus_devclass; EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, ofwbus_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); static const char *const ofwbus_excl_name[] = { From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 17:39:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D01C2B66 for ; Tue, 5 Aug 2014 17:39:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC2BE2CF9 for ; Tue, 5 Aug 2014 17:39:58 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 53c1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 17:39:58 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 17:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269598 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e116ee.53c1.73941333@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 17:39:58 -0000 Author: ian Date: Tue Aug 5 17:39:58 2014 New Revision: 269598 URL: http://svnweb.freebsd.org/changeset/base/269598 Log: Set the pl310 L2 cache driver to attach during the middle of BUS_PASS_CPU. Because that's earlier than interrupts are available, set up deferred configuration of interrupts (which are used only for debugging). Modified: head/sys/arm/arm/pl310.c head/sys/arm/include/pl310.h Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue Aug 5 17:32:47 2014 (r269597) +++ head/sys/arm/arm/pl310.c Tue Aug 5 17:39:58 2014 (r269598) @@ -378,6 +378,44 @@ pl310_set_way_sizes(struct pl310_softc * g_l2cache_size = g_way_size * g_ways_assoc; } +/* + * Setup interrupt handling. This is done only if the cache controller is + * disabled, for debugging. We set counters so when a cache event happens we'll + * get interrupted and be warned that something is wrong, because no cache + * events should happen if we're disabled. + */ +static void +pl310_config_intr(void *arg) +{ + struct pl310_softc * sc; + + sc = arg; + + /* activate the interrupt */ + bus_setup_intr(sc->sc_dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + pl310_filter, NULL, sc, &sc->sc_irq_h); + + /* Cache Line Eviction for Counter 0 */ + pl310_write4(sc, PL310_EVENT_COUNTER0_CONF, + EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_CO); + /* Data Read Request for Counter 1 */ + pl310_write4(sc, PL310_EVENT_COUNTER1_CONF, + EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ); + + /* Enable and clear pending interrupts */ + pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR); + pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL); + + /* Enable counters and reset C0 and C1 */ + pl310_write4(sc, PL310_EVENT_COUNTER_CTRL, + EVENT_COUNTER_CTRL_ENABLED | + EVENT_COUNTER_CTRL_C0_RESET | + EVENT_COUNTER_CTRL_C1_RESET); + + config_intrhook_disestablish(sc->sc_ich); + free(sc->sc_ich, M_DEVBUF); +} + static int pl310_probe(device_t dev) { @@ -416,10 +454,6 @@ pl310_attach(device_t dev) pl310_softc = sc; mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN); - /* activate the interrupt */ - bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - pl310_filter, NULL, sc, &sc->sc_irq_h); - cache_id = pl310_read4(sc, PL310_CACHE_ID); sc->sc_rtl_revision = (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK; @@ -466,28 +500,14 @@ pl310_attach(device_t dev) if (bootverbose) pl310_print_config(sc); } else { - /* - * Set counters so when cache event happens we'll get interrupt - * and be warned that something is off. - */ - - /* Cache Line Eviction for Counter 0 */ - pl310_write4(sc, PL310_EVENT_COUNTER0_CONF, - EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_CO); - /* Data Read Request for Counter 1 */ - pl310_write4(sc, PL310_EVENT_COUNTER1_CONF, - EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ); - - /* Enable and clear pending interrupts */ - pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR); - pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL); - - /* Enable counters and reset C0 and C1 */ - pl310_write4(sc, PL310_EVENT_COUNTER_CTRL, - EVENT_COUNTER_CTRL_ENABLED | - EVENT_COUNTER_CTRL_C0_RESET | - EVENT_COUNTER_CTRL_C1_RESET); - + malloc(sizeof(*sc->sc_ich), M_DEVBUF, M_WAITOK); + sc->sc_ich->ich_func = pl310_config_intr; + sc->sc_ich->ich_arg = sc; + if (config_intrhook_establish(sc->sc_ich) != 0) { + device_printf(dev, + "config_intrhook_establish failed\n"); + return(ENXIO); + } device_printf(dev, "L2 Cache disabled\n"); } @@ -514,4 +534,6 @@ static driver_t pl310_driver = { }; static devclass_t pl310_devclass; -DRIVER_MODULE(pl310, simplebus, pl310_driver, pl310_devclass, 0, 0); +EARLY_DRIVER_MODULE(pl310, simplebus, pl310_driver, pl310_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE); + Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue Aug 5 17:32:47 2014 (r269597) +++ head/sys/arm/include/pl310.h Tue Aug 5 17:39:58 2014 (r269598) @@ -137,6 +137,8 @@ #define POWER_CTRL_ENABLE_GATING (1 << 0) #define POWER_CTRL_ENABLE_STANDBY (1 << 1) +struct intr_config_hook; + struct pl310_softc { device_t sc_dev; struct resource *sc_mem_res; @@ -145,6 +147,7 @@ struct pl310_softc { int sc_enabled; struct mtx sc_mtx; u_int sc_rtl_revision; + struct intr_config_hook *sc_ich; }; /** From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:05:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EF241AA for ; Tue, 5 Aug 2014 18:05:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36089208E for ; Tue, 5 Aug 2014 18:05:32 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5de9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:05:32 +0000 From: Garrett Cooper Date: Tue, 5 Aug 2014 18:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269599 - head/libexec/rtld-elf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e11cec.5de9.2df9f7fa@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:05:32 -0000 Author: ngie Date: Tue Aug 5 18:05:31 2014 New Revision: 269599 URL: http://svnweb.freebsd.org/changeset/base/269599 Log: Remove unnecessary .PATH directive All of the sources for the tests are contained in the current working directory and the subdirectories Phabric: D537 Reviewed by: jmmv Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Modified: head/libexec/rtld-elf/tests/Makefile Modified: head/libexec/rtld-elf/tests/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/Makefile Tue Aug 5 17:39:58 2014 (r269598) +++ head/libexec/rtld-elf/tests/Makefile Tue Aug 5 18:05:31 2014 (r269599) @@ -5,8 +5,6 @@ TESTSDIR= ${TESTSBASE}/libexec/rtld-elf SUBDIR+= libpythagoras target -.PATH: ${.CURDIR:H:H:H:H}/tests - ATF_TESTS_C= ld_library_pathfds .include From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:09:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA22350C for ; Tue, 5 Aug 2014 18:09:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C76B20CD for ; Tue, 5 Aug 2014 18:09:39 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5e31 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:09:39 +0000 From: Garrett Cooper Date: Tue, 5 Aug 2014 18:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269600 - head/libexec/rtld-elf/tests/libpythagoras X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e11de3.5e31.1d167686@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:09:39 -0000 Author: ngie Date: Tue Aug 5 18:09:39 2014 New Revision: 269600 URL: http://svnweb.freebsd.org/changeset/base/269600 Log: Similar to r269506, fix LIBDIR to not duplicate TESTSDIR Phabric: D536 Reviewed by: jmmv Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Modified: head/libexec/rtld-elf/tests/libpythagoras/Makefile Modified: head/libexec/rtld-elf/tests/libpythagoras/Makefile ============================================================================== --- head/libexec/rtld-elf/tests/libpythagoras/Makefile Tue Aug 5 18:05:31 2014 (r269599) +++ head/libexec/rtld-elf/tests/libpythagoras/Makefile Tue Aug 5 18:09:39 2014 (r269600) @@ -5,8 +5,8 @@ LIB= pythagoras SHLIB_MAJOR= 0 -LIBDIR= ${TESTSBASE}${TESTSDIR}/libexec/rtld-elf -SHLIBDIR= ${TESTSBASE}${TESTSDIR}/libexec/rtld-elf +LIBDIR= ${TESTSBASE}/libexec/rtld-elf +SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf SRCS= pythagoras.c From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:19:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74C6C885 for ; Tue, 5 Aug 2014 18:19:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5735121E6 for ; Tue, 5 Aug 2014 18:19:52 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 529c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:19:52 +0000 From: Nathan Whitehorn Date: Tue, 5 Aug 2014 18:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269601 - in head/sys: conf dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e12048.529c.76a204bd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:19:52 -0000 Author: nwhitehorn Date: Tue Aug 5 18:19:51 2014 New Revision: 269601 URL: http://svnweb.freebsd.org/changeset/base/269601 Log: Add a simple unaccelerated vt(4) framebuffer driver for Sun framebuffers handled by creator(4) (Sun Creator 3D, Elite 3D, etc.). This provides vt(4) consoles on all devices currently supported by syscons on sparc64. The driver should also be easily adaptable to support newer Sun framebuffers such as the XVR-500 and higher. Many thanks to dumbbell@ (Jean-Sebastien Pedron) for testing this remotely during development. Added: head/sys/dev/fb/creator_vt.c (contents, props changed) Modified: head/sys/conf/files.sparc64 Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Tue Aug 5 18:09:39 2014 (r269600) +++ head/sys/conf/files.sparc64 Tue Aug 5 18:19:51 2014 (r269601) @@ -35,6 +35,7 @@ dev/atkbdc/psm.c optional psm atkbdc dev/auxio/auxio.c optional auxio sbus | auxio ebus dev/esp/esp_sbus.c optional esp sbus dev/fb/creator.c optional creator sc +dev/fb/creator_vt.c optional creator vt dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc Added: head/sys/dev/fb/creator_vt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fb/creator_vt.c Tue Aug 5 18:19:51 2014 (r269601) @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2014 Nathan Whitehorn + * 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "creatorreg.h" + +static vd_probe_t creatorfb_probe; +static vd_init_t creatorfb_init; +static vd_blank_t creatorfb_blank; +static vd_bitbltchr_t creatorfb_bitbltchr; + +static const struct vt_driver vt_creatorfb_driver = { + .vd_name = "creatorfb", + .vd_probe = creatorfb_probe, + .vd_init = creatorfb_init, + .vd_blank = creatorfb_blank, + .vd_bitbltchr = creatorfb_bitbltchr, + .vd_maskbitbltchr = creatorfb_bitbltchr, + .vd_fb_ioctl = vt_fb_ioctl, + .vd_fb_mmap = vt_fb_mmap, + .vd_priority = VD_PRIORITY_SPECIFIC +}; + +struct creatorfb_softc { + struct fb_info fb; + struct bus_space_tag memt[1]; + bus_space_handle_t memh; +}; + +static struct creatorfb_softc creatorfb_conssoftc; +VT_DRIVER_DECLARE(vt_creatorfb, vt_creatorfb_driver); + +static int +creatorfb_probe(struct vt_device *vd) +{ + phandle_t chosen, node; + ihandle_t stdout; + char type[64], name[64]; + + chosen = OF_finddevice("/chosen"); + OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); + node = OF_instance_to_package(stdout); + if (node == -1) { + /* + * The "/chosen/stdout" does not exist try + * using "screen" directly. + */ + node = OF_finddevice("screen"); + } + OF_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, "display") != 0) + return (CN_DEAD); + + OF_getprop(node, "name", name, sizeof(name)); + if (strcmp(name, "SUNW,ffb") != 0 && strcmp(name, "SUNW,afb") != 0) + return (CN_DEAD); + + /* Looks OK... */ + return (CN_INTERNAL); +} + +static int +creatorfb_init(struct vt_device *vd) +{ + struct creatorfb_softc *sc; + phandle_t chosen; + phandle_t node; + ihandle_t handle; + uint32_t height, width; + char type[64], name[64]; + bus_addr_t phys; + int space; + + /* Initialize softc */ + vd->vd_softc = sc = &creatorfb_conssoftc; + + chosen = OF_finddevice("/chosen"); + OF_getprop(chosen, "stdout", &handle, sizeof(ihandle_t)); + node = OF_instance_to_package(handle); + if (node == -1) { + /* + * The "/chosen/stdout" does not exist try + * using "screen" directly. + */ + node = OF_finddevice("screen"); + handle = OF_open("screen"); + } + OF_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, "display") != 0) + return (CN_DEAD); + + OF_getprop(node, "name", name, sizeof(name)); + if (strcmp(name, "SUNW,ffb") != 0 && strcmp(name, "SUNW,afb") != 0) + return (CN_DEAD); + + /* Make sure we have needed properties */ + if (OF_getproplen(node, "height") != sizeof(height) || + OF_getproplen(node, "width") != sizeof(width)) + return (CN_DEAD); + + OF_getprop(node, "height", &height, sizeof(height)); + OF_getprop(node, "width", &width, sizeof(width)); + + sc->fb.fb_height = height; + sc->fb.fb_width = width; + sc->fb.fb_bpp = sc->fb.fb_depth = 32; + sc->fb.fb_stride = 8192; /* Fixed */ + sc->fb.fb_size = sc->fb.fb_height * sc->fb.fb_stride; + + /* Map linear framebuffer */ + if (OF_decode_addr(node, FFB_DFB24, &space, &phys) != 0) + return (CN_DEAD); + sc->fb.fb_pbase = phys; + sc->memh = sparc64_fake_bustag(space, phys, &sc->memt[0]); + + /* 32-bit VGA palette */ + vt_generate_vga_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, + 255, 16, 255, 8, 255, 0); + + vt_fb_init(vd); + + return (CN_INTERNAL); +} + +static void +creatorfb_blank(struct vt_device *vd, term_color_t color) +{ + struct creatorfb_softc *sc; + uint32_t c; + int i; + + sc = vd->vd_softc; + c = sc->fb.fb_cmap[color]; + + for (i = 0; i < sc->fb.fb_height; i++) + bus_space_set_region_4(sc->memt, sc->memh, i*sc->fb.fb_stride, + c, sc->fb.fb_width); +} + +static void +creatorfb_bitbltchr(struct vt_device *vd, const uint8_t *src, + const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, + unsigned int width, unsigned int height, term_color_t fg, term_color_t bg) +{ + struct creatorfb_softc *sc = vd->vd_softc; + u_long line; + uint32_t fgc, bgc; + int c; + uint8_t b, m; + + fgc = sc->fb.fb_cmap[fg]; + bgc = sc->fb.fb_cmap[bg]; + b = m = 0; + + /* Don't try to put off screen pixels */ + if (((left + width) > vd->vd_width) || ((top + height) > + vd->vd_height)) + return; + + line = (sc->fb.fb_stride * top) + 4*left; + for (; height > 0; height--) { + for (c = 0; c < width; c++) { + if (c % 8 == 0) + b = *src++; + else + b <<= 1; + if (mask != NULL) { + if (c % 8 == 0) + m = *mask++; + else + m <<= 1; + /* Skip pixel write if mask not set. */ + if ((m & 0x80) == 0) + continue; + } + bus_space_write_4(sc->memt, sc->memh, line + 4*c, + (b & 0x80) ? fgc : bgc); + } + line += sc->fb.fb_stride; + } +} + From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:35:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE8A8EB1 for ; Tue, 5 Aug 2014 18:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7EE24DD for ; Tue, 5 Aug 2014 18:35:34 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 59cd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:35:34 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 18:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269602 - head/sys/dev/usb/gadget X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e123f6.59cd.1ec0630f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:35:34 -0000 Author: hselasky Date: Tue Aug 5 18:35:34 2014 New Revision: 269602 URL: http://svnweb.freebsd.org/changeset/base/269602 Log: Add handler for read-back of USB audio volume levels. Modified: head/sys/dev/usb/gadget/g_audio.c Modified: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- head/sys/dev/usb/gadget/g_audio.c Tue Aug 5 18:19:51 2014 (r269601) +++ head/sys/dev/usb/gadget/g_audio.c Tue Aug 5 18:35:34 2014 (r269602) @@ -587,6 +587,16 @@ g_audio_handle_request(device_t dev, *plen = 0; } return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x81 /* get value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_volume_setting); + *pptr = &sc->sc_volume_setting; + } else { + *plen = 0; + } + return (0); } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && (req->bRequest == 0x01 /* set value */ )) { From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:41:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F215146 for ; Tue, 5 Aug 2014 18:41:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3920C2551 for ; Tue, 5 Aug 2014 18:41:29 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 5d33 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:41:27 +0000 From: Garrett Cooper Date: Tue, 5 Aug 2014 18:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269603 - in head: etc/mtree lib/libnv lib/libnv/tests tools/regression/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e12558.5d33.563f584f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:41:29 -0000 Author: ngie Date: Tue Aug 5 18:41:27 2014 New Revision: 269603 URL: http://svnweb.freebsd.org/changeset/base/269603 Log: Integrate lib/libnv into the build/kyua Rename all of the TAP test applications from to _test to match the convention described in the TestSuite wiki page Phabric: D538 Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Added: head/lib/libnv/tests/ head/lib/libnv/tests/Makefile (contents, props changed) head/lib/libnv/tests/nvlist_add_test.c - copied unchanged from r269562, head/tools/regression/lib/libnv/nvlist_add.c head/lib/libnv/tests/nvlist_exists_test.c - copied unchanged from r269545, head/tools/regression/lib/libnv/nvlist_exists.c head/lib/libnv/tests/nvlist_free_test.c - copied unchanged from r269545, head/tools/regression/lib/libnv/nvlist_free.c head/lib/libnv/tests/nvlist_get_test.c - copied unchanged from r269545, head/tools/regression/lib/libnv/nvlist_get.c head/lib/libnv/tests/nvlist_move_test.c - copied unchanged from r269545, head/tools/regression/lib/libnv/nvlist_move.c head/lib/libnv/tests/nvlist_send_recv_test.c - copied unchanged from r269545, head/tools/regression/lib/libnv/nvlist_send_recv.c Deleted: head/tools/regression/lib/libnv/ Modified: head/etc/mtree/BSD.tests.dist head/lib/libnv/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Aug 5 18:35:34 2014 (r269602) +++ head/etc/mtree/BSD.tests.dist Tue Aug 5 18:41:27 2014 (r269603) @@ -87,6 +87,8 @@ .. libmp .. + libnv + .. .. libexec atf Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Tue Aug 5 18:35:34 2014 (r269602) +++ head/lib/libnv/Makefile Tue Aug 5 18:41:27 2014 (r269603) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= nv SHLIBDIR?= /lib SHLIB_MAJOR= 0 @@ -158,4 +160,8 @@ MLINKS+=nv.3 nvlist_existsv.3 \ WARNS?= 6 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/lib/libnv/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/Makefile Tue Aug 5 18:41:27 2014 (r269603) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libnv + +TAP_TESTS_C+= nvlist_add_test +TAP_TESTS_C+= nvlist_exists_test +TAP_TESTS_C+= nvlist_free_test +TAP_TESTS_C+= nvlist_get_test +TAP_TESTS_C+= nvlist_move_test +TAP_TESTS_C+= nvlist_send_recv_test + +DPADD+= ${LIBNV} +LDADD+= -lnv + +WARNS?= 6 + +.include Copied: head/lib/libnv/tests/nvlist_add_test.c (from r269562, head/tools/regression/lib/libnv/nvlist_add.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_add_test.c Tue Aug 5 18:41:27 2014 (r269603, copy of r269562, head/tools/regression/lib/libnv/nvlist_add.c) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * 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 AUTHORS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include + +static int ntest = 1; + +#define CHECK(expr) do { \ + if ((expr)) \ + printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ + else \ + printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ + ntest++; \ +} while (0) + +int +main(void) +{ + const nvlist_t *cnvl; + nvlist_t *nvl; + + printf("1..94\n"); + + nvl = nvlist_create(0); + + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + nvlist_add_null(nvl, "nvlist/null"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool/true")); + nvlist_add_bool(nvl, "nvlist/bool/true", true); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool/true")); + + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool/false")); + nvlist_add_bool(nvl, "nvlist/bool/false", false); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool/false")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/0")); + nvlist_add_number(nvl, "nvlist/number/0", 0); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/0")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/1")); + nvlist_add_number(nvl, "nvlist/number/1", 1); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/1")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/-1")); + nvlist_add_number(nvl, "nvlist/number/-1", -1); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/-1")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/UINT64_MAX")); + nvlist_add_number(nvl, "nvlist/number/UINT64_MAX", UINT64_MAX); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/UINT64_MAX")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/INT64_MIN")); + nvlist_add_number(nvl, "nvlist/number/INT64_MIN", INT64_MIN); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/INT64_MIN")); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/INT64_MAX")); + nvlist_add_number(nvl, "nvlist/number/INT64_MAX", INT64_MAX); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_number(nvl, "nvlist/number/INT64_MAX")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/")); + nvlist_add_string(nvl, "nvlist/string/", ""); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/string/")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/x")); + nvlist_add_string(nvl, "nvlist/string/x", "x"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/string/x")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz")); + nvlist_add_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/stringf/")); + nvlist_add_stringf(nvl, "nvlist/stringf/", "%s", ""); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/stringf/x")); + nvlist_add_stringf(nvl, "nvlist/stringf/x", "%s", "x"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/x")); + + CHECK(!nvlist_exists_string(nvl, "nvlist/stringf/666Xabc")); + nvlist_add_stringf(nvl, "nvlist/stringf/666Xabc", "%d%c%s", 666, 'X', "abc"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/666Xabc")); + + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO")); + nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO")); + + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary/x")); + nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary/x")); + + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz")); + nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz")); + + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool/true")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool/false")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/0")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/1")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/-1")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/UINT64_MAX")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/INT64_MIN")); + CHECK(nvlist_exists_number(nvl, "nvlist/number/INT64_MAX")); + CHECK(nvlist_exists_string(nvl, "nvlist/string/")); + CHECK(nvlist_exists_string(nvl, "nvlist/string/x")); + CHECK(nvlist_exists_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz")); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/")); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/x")); + CHECK(nvlist_exists_string(nvl, "nvlist/stringf/666Xabc")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary/x")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + + cnvl = nvlist_get_nvlist(nvl, "nvlist/nvlist"); + CHECK(nvlist_exists_null(cnvl, "nvlist/null")); + CHECK(nvlist_exists_bool(cnvl, "nvlist/bool/true")); + CHECK(nvlist_exists_bool(cnvl, "nvlist/bool/false")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/0")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/1")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/-1")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/UINT64_MAX")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/INT64_MIN")); + CHECK(nvlist_exists_number(cnvl, "nvlist/number/INT64_MAX")); + CHECK(nvlist_exists_string(cnvl, "nvlist/string/")); + CHECK(nvlist_exists_string(cnvl, "nvlist/string/x")); + CHECK(nvlist_exists_string(cnvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz")); + CHECK(nvlist_exists_string(cnvl, "nvlist/stringf/")); + CHECK(nvlist_exists_string(cnvl, "nvlist/stringf/x")); + CHECK(nvlist_exists_string(cnvl, "nvlist/stringf/666Xabc")); + CHECK(nvlist_exists_descriptor(cnvl, "nvlist/descriptor/STDERR_FILENO")); + CHECK(nvlist_exists_binary(cnvl, "nvlist/binary/x")); + CHECK(nvlist_exists_binary(cnvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz")); + + nvlist_destroy(nvl); + + return (0); +} Copied: head/lib/libnv/tests/nvlist_exists_test.c (from r269545, head/tools/regression/lib/libnv/nvlist_exists.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_exists_test.c Tue Aug 5 18:41:27 2014 (r269603, copy of r269545, head/tools/regression/lib/libnv/nvlist_exists.c) @@ -0,0 +1,321 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * 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 AUTHORS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include + +static int ntest = 1; + +#define CHECK(expr) do { \ + if ((expr)) \ + printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ + else \ + printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ + ntest++; \ +} while (0) + +int +main(void) +{ + nvlist_t *nvl; + + printf("1..232\n"); + + nvl = nvlist_create(0); + + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/null")); + CHECK(!nvlist_exists_number(nvl, "nvlist/null")); + CHECK(!nvlist_exists_string(nvl, "nvlist/null")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/null")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/null")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/null")); + nvlist_add_null(nvl, "nvlist/null"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/null")); + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/null")); + CHECK(!nvlist_exists_number(nvl, "nvlist/null")); + CHECK(!nvlist_exists_string(nvl, "nvlist/null")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/null")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/null")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/null")); + + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_null(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_string(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/bool")); + nvlist_add_bool(nvl, "nvlist/bool", true); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_null(nvl, "nvlist/bool")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_string(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/bool")); + + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists_null(nvl, "nvlist/number")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/number")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/number")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/number")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/number")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/number")); + nvlist_add_number(nvl, "nvlist/number", 0); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists_null(nvl, "nvlist/number")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/number")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/number")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/number")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/number")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/number")); + + CHECK(!nvlist_exists(nvl, "nvlist/string")); + CHECK(!nvlist_exists_null(nvl, "nvlist/string")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/string")); + CHECK(!nvlist_exists_number(nvl, "nvlist/string")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/string")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/string")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/string")); + nvlist_add_string(nvl, "nvlist/string", "test"); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/string")); + CHECK(!nvlist_exists_null(nvl, "nvlist/string")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/string")); + CHECK(!nvlist_exists_number(nvl, "nvlist/string")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/string")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/string")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/string")); + + CHECK(!nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_null(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_number(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_string(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/nvlist")); + nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_null(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_number(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_string(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/nvlist")); + + CHECK(!nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_null(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_number(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_string(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/descriptor")); + nvlist_add_descriptor(nvl, "nvlist/descriptor", STDERR_FILENO); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_null(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_number(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_string(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/descriptor")); + + CHECK(!nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_number(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_string(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary")); + nvlist_add_binary(nvl, "nvlist/binary", "test", 4); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_number(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_string(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/binary")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + CHECK(nvlist_exists(nvl, "nvlist/null")); + CHECK(nvlist_exists(nvl, "nvlist/bool")); + CHECK(nvlist_exists(nvl, "nvlist/number")); + CHECK(nvlist_exists(nvl, "nvlist/string")); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_null(nvl, "nvlist/null"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(nvlist_exists(nvl, "nvlist/bool")); + CHECK(nvlist_exists(nvl, "nvlist/number")); + CHECK(nvlist_exists(nvl, "nvlist/string")); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_bool(nvl, "nvlist/bool"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(nvlist_exists(nvl, "nvlist/number")); + CHECK(nvlist_exists(nvl, "nvlist/string")); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_number(nvl, "nvlist/number"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(nvlist_exists(nvl, "nvlist/string")); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_string(nvl, "nvlist/string"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists(nvl, "nvlist/string")); + CHECK(nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_nvlist(nvl, "nvlist/nvlist"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists(nvl, "nvlist/string")); + CHECK(!nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_descriptor(nvl, "nvlist/descriptor"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists(nvl, "nvlist/string")); + CHECK(!nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_binary(nvl, "nvlist/binary"); + CHECK(!nvlist_exists(nvl, "nvlist/null")); + CHECK(!nvlist_exists(nvl, "nvlist/bool")); + CHECK(!nvlist_exists(nvl, "nvlist/number")); + CHECK(!nvlist_exists(nvl, "nvlist/string")); + CHECK(!nvlist_exists(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists(nvl, "nvlist/binary")); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary")); + + CHECK(nvlist_empty(nvl)); + + nvlist_destroy(nvl); + + return (0); +} Copied: head/lib/libnv/tests/nvlist_free_test.c (from r269545, head/tools/regression/lib/libnv/nvlist_free.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_free_test.c Tue Aug 5 18:41:27 2014 (r269603, copy of r269545, head/tools/regression/lib/libnv/nvlist_free.c) @@ -0,0 +1,221 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * 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 AUTHORS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include + +static int ntest = 1; + +#define CHECK(expr) do { \ + if ((expr)) \ + printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ + else \ + printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ + ntest++; \ +} while (0) + +int +main(void) +{ + nvlist_t *nvl; + + printf("1..114\n"); + + nvl = nvlist_create(0); + + nvlist_add_null(nvl, "nvlist/null"); + nvlist_add_bool(nvl, "nvlist/bool", true); + nvlist_add_number(nvl, "nvlist/number", 0); + nvlist_add_string(nvl, "nvlist/string", "test"); + nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); + nvlist_add_descriptor(nvl, "nvlist/descriptor", STDERR_FILENO); + nvlist_add_binary(nvl, "nvlist/binary", "test", 4); + + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_null(nvl, "nvlist/null"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_bool(nvl, "nvlist/bool"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_number(nvl, "nvlist/number"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_string(nvl, "nvlist/string"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_nvlist(nvl, "nvlist/nvlist"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_descriptor(nvl, "nvlist/descriptor"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free_binary(nvl, "nvlist/binary"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary")); + + CHECK(nvlist_empty(nvl)); + + nvlist_add_null(nvl, "nvlist/null"); + nvlist_add_bool(nvl, "nvlist/bool", true); + nvlist_add_number(nvl, "nvlist/number", 0); + nvlist_add_string(nvl, "nvlist/string", "test"); + nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); + nvlist_add_descriptor(nvl, "nvlist/descriptor", STDERR_FILENO); + nvlist_add_binary(nvl, "nvlist/binary", "test", 4); + + CHECK(nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/null"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/bool"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/number"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/string"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/nvlist"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/descriptor"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(nvlist_exists_binary(nvl, "nvlist/binary")); + + nvlist_free(nvl, "nvlist/binary"); + CHECK(!nvlist_exists_null(nvl, "nvlist/null")); + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool")); + CHECK(!nvlist_exists_number(nvl, "nvlist/number")); + CHECK(!nvlist_exists_string(nvl, "nvlist/string")); + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor")); + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary")); + + CHECK(nvlist_empty(nvl)); + + nvlist_destroy(nvl); + + return (0); +} Copied: head/lib/libnv/tests/nvlist_get_test.c (from r269545, head/tools/regression/lib/libnv/nvlist_get.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_get_test.c Tue Aug 5 18:41:27 2014 (r269603, copy of r269545, head/tools/regression/lib/libnv/nvlist_get.c) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * 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 AUTHORS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include + +static int ntest = 1; + +#define CHECK(expr) do { \ + if ((expr)) \ + printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ + else \ + printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ + ntest++; \ +} while (0) + +#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) + +int +main(void) +{ + const nvlist_t *cnvl; + nvlist_t *nvl; + size_t size; + + printf("1..83\n"); + + nvl = nvlist_create(0); + + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool/true")); + nvlist_add_bool(nvl, "nvlist/bool/true", true); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_get_bool(nvl, "nvlist/bool/true") == true); + + CHECK(!nvlist_exists_bool(nvl, "nvlist/bool/false")); + nvlist_add_bool(nvl, "nvlist/bool/false", false); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_get_bool(nvl, "nvlist/bool/false") == false); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/0")); + nvlist_add_number(nvl, "nvlist/number/0", 0); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_get_number(nvl, "nvlist/number/0") == 0); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/1")); + nvlist_add_number(nvl, "nvlist/number/1", 1); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_get_number(nvl, "nvlist/number/1") == 1); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/-1")); + nvlist_add_number(nvl, "nvlist/number/-1", -1); + CHECK(nvlist_error(nvl) == 0); + CHECK((int)nvlist_get_number(nvl, "nvlist/number/-1") == -1); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/UINT64_MAX")); + nvlist_add_number(nvl, "nvlist/number/UINT64_MAX", UINT64_MAX); + CHECK(nvlist_error(nvl) == 0); + CHECK(nvlist_get_number(nvl, "nvlist/number/UINT64_MAX") == UINT64_MAX); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/INT64_MIN")); + nvlist_add_number(nvl, "nvlist/number/INT64_MIN", INT64_MIN); + CHECK(nvlist_error(nvl) == 0); + CHECK((int64_t)nvlist_get_number(nvl, "nvlist/number/INT64_MIN") == INT64_MIN); + + CHECK(!nvlist_exists_number(nvl, "nvlist/number/INT64_MAX")); + nvlist_add_number(nvl, "nvlist/number/INT64_MAX", INT64_MAX); + CHECK(nvlist_error(nvl) == 0); + CHECK((int64_t)nvlist_get_number(nvl, "nvlist/number/INT64_MAX") == INT64_MAX); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/")); + nvlist_add_string(nvl, "nvlist/string/", ""); + CHECK(nvlist_error(nvl) == 0); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/"), "") == 0); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/x")); + nvlist_add_string(nvl, "nvlist/string/x", "x"); + CHECK(nvlist_error(nvl) == 0); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/x"), "x") == 0); + + CHECK(!nvlist_exists_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz")); + nvlist_add_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz"); + CHECK(nvlist_error(nvl) == 0); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz"), "abcdefghijklmnopqrstuvwxyz") == 0); + + CHECK(!nvlist_exists_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO")); + nvlist_add_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO", STDERR_FILENO); + CHECK(nvlist_error(nvl) == 0); + CHECK(fd_is_valid(nvlist_get_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO"))); + + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary/x")); + nvlist_add_binary(nvl, "nvlist/binary/x", "x", 1); + CHECK(nvlist_error(nvl) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/x", NULL), "x", 1) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/x", &size), "x", 1) == 0); + CHECK(size == 1); + + CHECK(!nvlist_exists_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz")); + nvlist_add_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")); + CHECK(nvlist_error(nvl) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", NULL), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", &size), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); + + CHECK(!nvlist_exists_nvlist(nvl, "nvlist/nvlist")); + nvlist_add_nvlist(nvl, "nvlist/nvlist", nvl); + CHECK(nvlist_error(nvl) == 0); + cnvl = nvlist_get_nvlist(nvl, "nvlist/nvlist"); + CHECK(nvlist_get_bool(cnvl, "nvlist/bool/true") == true); + CHECK(nvlist_get_bool(cnvl, "nvlist/bool/false") == false); + CHECK(nvlist_get_number(cnvl, "nvlist/number/0") == 0); + CHECK(nvlist_get_number(cnvl, "nvlist/number/1") == 1); + CHECK((int)nvlist_get_number(cnvl, "nvlist/number/-1") == -1); + CHECK(nvlist_get_number(cnvl, "nvlist/number/UINT64_MAX") == UINT64_MAX); + CHECK((int64_t)nvlist_get_number(cnvl, "nvlist/number/INT64_MIN") == INT64_MIN); + CHECK((int64_t)nvlist_get_number(cnvl, "nvlist/number/INT64_MAX") == INT64_MAX); + CHECK(strcmp(nvlist_get_string(cnvl, "nvlist/string/"), "") == 0); + CHECK(strcmp(nvlist_get_string(cnvl, "nvlist/string/x"), "x") == 0); + CHECK(strcmp(nvlist_get_string(cnvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz"), "abcdefghijklmnopqrstuvwxyz") == 0); + /* TODO */ + CHECK(memcmp(nvlist_get_binary(cnvl, "nvlist/binary/x", NULL), "x", 1) == 0); + CHECK(memcmp(nvlist_get_binary(cnvl, "nvlist/binary/x", &size), "x", 1) == 0); + CHECK(size == 1); + CHECK(memcmp(nvlist_get_binary(cnvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", NULL), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(memcmp(nvlist_get_binary(cnvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", &size), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); + + CHECK(nvlist_get_bool(nvl, "nvlist/bool/true") == true); + CHECK(nvlist_get_bool(nvl, "nvlist/bool/false") == false); + CHECK(nvlist_get_number(nvl, "nvlist/number/0") == 0); + CHECK(nvlist_get_number(nvl, "nvlist/number/1") == 1); + CHECK((int)nvlist_get_number(nvl, "nvlist/number/-1") == -1); + CHECK(nvlist_get_number(nvl, "nvlist/number/UINT64_MAX") == UINT64_MAX); + CHECK((int64_t)nvlist_get_number(nvl, "nvlist/number/INT64_MIN") == INT64_MIN); + CHECK((int64_t)nvlist_get_number(nvl, "nvlist/number/INT64_MAX") == INT64_MAX); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/"), "") == 0); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/x"), "x") == 0); + CHECK(strcmp(nvlist_get_string(nvl, "nvlist/string/abcdefghijklmnopqrstuvwxyz"), "abcdefghijklmnopqrstuvwxyz") == 0); + CHECK(fd_is_valid(nvlist_get_descriptor(nvl, "nvlist/descriptor/STDERR_FILENO"))); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/x", NULL), "x", 1) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/x", &size), "x", 1) == 0); + CHECK(size == 1); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", NULL), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(memcmp(nvlist_get_binary(nvl, "nvlist/binary/abcdefghijklmnopqrstuvwxyz", &size), "abcdefghijklmnopqrstuvwxyz", sizeof("abcdefghijklmnopqrstuvwxyz")) == 0); + CHECK(size == sizeof("abcdefghijklmnopqrstuvwxyz")); + + nvlist_destroy(nvl); + + return (0); +} Copied: head/lib/libnv/tests/nvlist_move_test.c (from r269545, head/tools/regression/lib/libnv/nvlist_move.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_move_test.c Tue Aug 5 18:41:27 2014 (r269603, copy of r269545, head/tools/regression/lib/libnv/nvlist_move.c) @@ -0,0 +1,161 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * 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. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:48:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BB9E46D for ; Tue, 5 Aug 2014 18:48:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4162645 for ; Tue, 5 Aug 2014 18:48:13 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5d82 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:48:12 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 18:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269604 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e126ec.5d82.5b1833df@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:48:13 -0000 Author: hselasky Date: Tue Aug 5 18:48:12 2014 New Revision: 269604 URL: http://svnweb.freebsd.org/changeset/base/269604 Log: - Implement fast interrupt handler to save CPU usage. - Cleanup some register reads and writes to use existing register access macros. - Ensure code which only applies to the control endpoint is not run for other endpoints in the data transfer path. MFC after: 3 days Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/at91dci.h head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/at91dci_fdt.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Tue Aug 5 18:41:27 2014 (r269603) +++ head/sys/dev/usb/controller/at91dci.c Tue Aug 5 18:48:12 2014 (r269604) @@ -91,6 +91,9 @@ #define AT9100_DCI_PC2SC(pc) \ AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) +#define AT9100_DCI_THREAD_IRQ \ + (AT91_UDP_INT_BUS | AT91_UDP_INT_END_BR | AT91_UDP_INT_RXRSM | AT91_UDP_INT_RXSUSP) + #ifdef USB_DEBUG static int at91dcidebug = 0; @@ -296,17 +299,15 @@ at91dci_set_address(struct at91dci_softc } static uint8_t -at91dci_setup_rx(struct at91dci_td *td) +at91dci_setup_rx(struct at91dci_softc *sc, struct at91dci_td *td) { - struct at91dci_softc *sc; struct usb_device_request req; uint32_t csr; uint32_t temp; uint16_t count; /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -338,7 +339,7 @@ at91dci_setup_rx(struct at91dci_td *td) goto not_complete; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, (void *)&req, sizeof(req)); /* copy data into real buffer */ @@ -347,9 +348,6 @@ at91dci_setup_rx(struct at91dci_td *td) td->offset = sizeof(req); td->remainder = 0; - /* get pointer to softc */ - sc = AT9100_DCI_PC2SC(td->pc); - /* sneak peek the set address */ if ((req.bmRequestType == UT_WRITE_DEVICE) && (req.bRequest == UR_SET_ADDRESS)) { @@ -367,8 +365,7 @@ at91dci_setup_rx(struct at91dci_td *td) /* write the direction of the control transfer */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); return (0); /* complete */ not_complete: @@ -383,15 +380,13 @@ not_complete: if (temp) { DPRINTFN(5, "clearing 0x%08x\n", temp); AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ - } static uint8_t -at91dci_data_rx(struct at91dci_td *td) +at91dci_data_rx(struct at91dci_softc *sc, struct at91dci_td *td) { struct usb_page_search buf_res; uint32_t csr; @@ -406,8 +401,7 @@ at91dci_data_rx(struct at91dci_td *td) /* check if any of the FIFO banks have data */ repeat: /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -436,8 +430,7 @@ repeat: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } @@ -470,7 +463,7 @@ repeat: buf_res.length = count; } /* receive data */ - bus_space_read_multi_1(td->io_tag, td->io_hdl, + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); /* update counters */ @@ -495,8 +488,7 @@ repeat: /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); /* * NOTE: We may have to delay a little bit before @@ -518,7 +510,7 @@ repeat: } static uint8_t -at91dci_data_tx(struct at91dci_td *td) +at91dci_data_tx(struct at91dci_softc *sc, struct at91dci_td *td) { struct usb_page_search buf_res; uint32_t csr; @@ -531,8 +523,7 @@ at91dci_data_tx(struct at91dci_td *td) repeat: /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x rem=%u\n", csr, td->remainder); @@ -552,8 +543,7 @@ repeat: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } else { @@ -569,7 +559,6 @@ repeat: count = td->remainder; } while (count > 0) { - usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ @@ -577,7 +566,7 @@ repeat: buf_res.length = count; } /* transmit data */ - bus_space_write_multi_1(td->io_tag, td->io_hdl, + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); /* update counters */ @@ -588,8 +577,7 @@ repeat: /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); /* check remainder */ if (td->remainder == 0) { @@ -605,19 +593,13 @@ repeat: } static uint8_t -at91dci_data_tx_sync(struct at91dci_td *td) +at91dci_data_tx_sync(struct at91dci_softc *sc, struct at91dci_td *td) { - struct at91dci_softc *sc; uint32_t csr; uint32_t temp; -#if 0 -repeat: -#endif - /* read out FIFO status */ - csr = bus_space_read_4(td->io_tag, td->io_hdl, - td->status_reg); + csr = AT91_UDP_READ_4(sc, td->status_reg); DPRINTFN(5, "csr=0x%08x\n", csr); @@ -637,8 +619,7 @@ repeat: if (!(csr & AT91_UDP_CSR_TXCOMP)) { goto not_complete; } - sc = AT9100_DCI_PC2SC(td->pc); - if (sc->sc_dv_addr != 0xFF) { + if (td->status_reg == AT91_UDP_CSR(0) && sc->sc_dv_addr != 0xFF) { /* * The AT91 has a special requirement with regard to * setting the address and that is to write the new @@ -648,8 +629,7 @@ repeat: } /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); return (0); /* complete */ @@ -657,24 +637,26 @@ not_complete: if (temp) { /* write command */ AT91_CSR_ACK(csr, temp); - bus_space_write_4(td->io_tag, td->io_hdl, - td->status_reg, csr); + AT91_UDP_WRITE_4(sc, td->status_reg, csr); } return (1); /* not complete */ } -static uint8_t +static void at91dci_xfer_do_fifo(struct usb_xfer *xfer) { - struct at91dci_softc *sc; + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); struct at91dci_td *td; uint8_t temp; DPRINTFN(9, "\n"); td = xfer->td_transfer_cache; + if (td == NULL) + return; + while (1) { - if ((td->func) (td)) { + if ((td->func) (sc, td)) { /* operation in progress */ break; } @@ -704,10 +686,9 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf if (temp & 1) td->fifo_bank = 1; } - return (1); /* not complete */ + return; done: - sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpointno & UE_ADDR); /* update FIFO bank flag and multi buffer */ @@ -718,23 +699,42 @@ done: } /* compute all actual lengths */ + xfer->td_transfer_cache = NULL; + sc->sc_xfer_complete = 1; +} - at91dci_standard_done(xfer); +static uint8_t +at91dci_xfer_do_complete(struct usb_xfer *xfer) +{ + struct at91dci_td *td; - return (0); /* complete */ + DPRINTFN(9, "\n"); + td = xfer->td_transfer_cache; + if (td == NULL) { + /* compute all actual lengths */ + at91dci_standard_done(xfer); + return(1); + } + return (0); } static void -at91dci_interrupt_poll(struct at91dci_softc *sc) +at91dci_interrupt_poll_locked(struct at91dci_softc *sc) { struct usb_xfer *xfer; + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) + at91dci_xfer_do_fifo(xfer); +} + +static void +at91dci_interrupt_complete_locked(struct at91dci_softc *sc) +{ + struct usb_xfer *xfer; repeat: TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!at91dci_xfer_do_fifo(xfer)) { - /* queue has been modified */ + if (at91dci_xfer_do_complete(xfer)) goto repeat; - } } } @@ -764,20 +764,47 @@ at91dci_vbus_interrupt(struct at91dci_so } } +int +at91dci_filter_interrupt(void *arg) +{ + struct at91dci_softc *sc = arg; + int retval = FILTER_HANDLED; + uint32_t status; + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + status = AT91_UDP_READ_4(sc, AT91_UDP_ISR); + status &= AT91_UDP_INT_DEFAULT; + + if (status & AT9100_DCI_THREAD_IRQ) + retval = FILTER_SCHEDULE_THREAD; + + /* acknowledge interrupts */ + AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, status & ~AT9100_DCI_THREAD_IRQ); + + /* poll FIFOs, if any */ + at91dci_interrupt_poll_locked(sc); + + if (sc->sc_xfer_complete != 0) + retval = FILTER_SCHEDULE_THREAD; + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + + return (retval); +} + void -at91dci_interrupt(struct at91dci_softc *sc) +at91dci_interrupt(void *arg) { + struct at91dci_softc *sc = arg; uint32_t status; USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); status = AT91_UDP_READ_4(sc, AT91_UDP_ISR); - status &= AT91_UDP_INT_DEFAULT; + status &= AT9100_DCI_THREAD_IRQ; - if (!status) { - USB_BUS_UNLOCK(&sc->sc_bus); - return; - } /* acknowledge interrupts */ AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, status); @@ -837,14 +864,12 @@ at91dci_interrupt(struct at91dci_softc * /* complete root HUB interrupt endpoint */ at91dci_root_intr(sc); } - /* check for any endpoint interrupts */ - - if (status & AT91_UDP_INT_EPS) { - - DPRINTFN(5, "real endpoint interrupt 0x%08x\n", status); - at91dci_interrupt_poll(sc); + if (sc->sc_xfer_complete != 0) { + sc->sc_xfer_complete = 0; + at91dci_interrupt_complete_locked(sc); } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1049,12 +1074,17 @@ at91dci_timeout(void *arg) static void at91dci_start_standard_chain(struct usb_xfer *xfer) { + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); + DPRINTFN(9, "\n"); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* poll one time */ - if (at91dci_xfer_do_fifo(xfer)) { + at91dci_xfer_do_fifo(xfer); + + if (at91dci_xfer_do_complete(xfer) == 0) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpointno & UE_ADDR; /* @@ -1075,6 +1105,7 @@ at91dci_start_standard_chain(struct usb_ &at91dci_timeout, xfer->timeout); } } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1216,6 +1247,8 @@ at91dci_device_done(struct usb_xfer *xfe DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { ep_no = (xfer->endpointno & UE_ADDR); @@ -1224,8 +1257,11 @@ at91dci_device_done(struct usb_xfer *xfe DPRINTFN(15, "disable interrupts on endpoint %d\n", ep_no); } + /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1248,11 +1284,14 @@ at91dci_set_stall(struct usb_device *ude /* set FORCESTALL */ sc = AT9100_DCI_BUS2SC(udev->bus); + + USB_BUS_SPIN_LOCK(&sc->sc_bus); csr_reg = (ep->edesc->bEndpointAddress & UE_ADDR); csr_reg = AT91_UDP_CSR(csr_reg); csr_val = AT91_UDP_READ_4(sc, csr_reg); AT91_CSR_ACK(csr_val, AT91_UDP_CSR_FORCESTALL); AT91_UDP_WRITE_4(sc, csr_reg, csr_val); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1269,6 +1308,9 @@ at91dci_clear_stall_sub(struct at91dci_s /* clearing stall is not needed */ return; } + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* compute CSR register offset */ csr_reg = AT91_UDP_CSR(ep_no); @@ -1349,6 +1391,8 @@ at91dci_clear_stall_sub(struct at91dci_s /* enable endpoint */ AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(ep_no), csr_val); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1484,7 +1528,10 @@ at91dci_do_poll(struct usb_bus *bus) struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); - at91dci_interrupt_poll(sc); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + at91dci_interrupt_poll_locked(sc); + at91dci_interrupt_complete_locked(sc); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -2239,8 +2286,6 @@ at91dci_xfer_setup(struct usb_setup_para td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ - td->io_tag = sc->sc_io_tag; - td->io_hdl = sc->sc_io_hdl; td->max_packet_size = xfer->max_packet_size; td->status_reg = AT91_UDP_CSR(ep_no); td->fifo_reg = AT91_UDP_FDR(ep_no); Modified: head/sys/dev/usb/controller/at91dci.h ============================================================================== --- head/sys/dev/usb/controller/at91dci.h Tue Aug 5 18:41:27 2014 (r269603) +++ head/sys/dev/usb/controller/at91dci.h Tue Aug 5 18:48:12 2014 (r269604) @@ -133,12 +133,11 @@ bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) struct at91dci_td; +struct at91dci_softc; -typedef uint8_t (at91dci_cmd_t)(struct at91dci_td *td); +typedef uint8_t (at91dci_cmd_t)(struct at91dci_softc *sc, struct at91dci_td *td); struct at91dci_td { - bus_space_tag_t io_tag; - bus_space_handle_t io_hdl; struct at91dci_td *obj_next; at91dci_cmd_t *func; struct usb_page_cache *pc; @@ -221,6 +220,8 @@ struct at91dci_softc { void (*sc_pull_down) (void *arg); void *sc_pull_arg; + uint32_t sc_xfer_complete; + uint8_t sc_rt_addr; /* root HUB address */ uint8_t sc_dv_addr; /* device address */ uint8_t sc_conf; /* root HUB config */ @@ -235,7 +236,8 @@ struct at91dci_softc { usb_error_t at91dci_init(struct at91dci_softc *sc); void at91dci_uninit(struct at91dci_softc *sc); -void at91dci_interrupt(struct at91dci_softc *sc); +driver_filter_t at91dci_filter_interrupt; +driver_intr_t at91dci_interrupt; void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on); #endif /* _AT9100_DCI_H_ */ Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 5 18:41:27 2014 (r269603) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 5 18:48:12 2014 (r269604) @@ -212,8 +212,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + at91dci_filter_interrupt, at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; Modified: head/sys/dev/usb/controller/at91dci_fdt.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_fdt.c Tue Aug 5 18:41:27 2014 (r269603) +++ head/sys/dev/usb/controller/at91dci_fdt.c Tue Aug 5 18:48:12 2014 (r269604) @@ -218,13 +218,8 @@ at91_udp_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + at91dci_filter_interrupt, at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); if (err) { sc->sc_dci.sc_intr_hdl = NULL; goto error; From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 18:51:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF862644 for ; Tue, 5 Aug 2014 18:51:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5B97270A for ; Tue, 5 Aug 2014 18:51:52 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 50f3 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:51:52 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 18:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269605 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e127c8.50f3.3c5653e1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:51:53 -0000 Author: ian Date: Tue Aug 5 18:51:51 2014 New Revision: 269605 URL: http://svnweb.freebsd.org/changeset/base/269605 Log: Attach arm generic interrupt and timer drivers in the middle of BUS_PASS_INTERRUPT and BUS_PASS_TIMER, respectively. Modified: head/sys/arm/arm/generic_timer.c head/sys/arm/arm/gic.c head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/pl190.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Tue Aug 5 18:48:12 2014 (r269604) +++ head/sys/arm/arm/generic_timer.c Tue Aug 5 18:51:51 2014 (r269605) @@ -343,7 +343,8 @@ static driver_t arm_tmr_driver = { static devclass_t arm_tmr_devclass; -DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); +EARLY_DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); void DELAY(int usec) Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Tue Aug 5 18:48:12 2014 (r269604) +++ head/sys/arm/arm/gic.c Tue Aug 5 18:51:51 2014 (r269605) @@ -264,7 +264,8 @@ static driver_t arm_gic_driver = { static devclass_t arm_gic_devclass; -DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0); +EARLY_DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); static void gic_post_filter(void *arg) Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Tue Aug 5 18:48:12 2014 (r269604) +++ head/sys/arm/arm/mpcore_timer.c Tue Aug 5 18:51:51 2014 (r269605) @@ -382,7 +382,8 @@ static driver_t arm_tmr_driver = { static devclass_t arm_tmr_devclass; -DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); +EARLY_DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0, + BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); /* * Handle a change in clock frequency. The mpcore timer runs at half the CPU Modified: head/sys/arm/arm/pl190.c ============================================================================== --- head/sys/arm/arm/pl190.c Tue Aug 5 18:48:12 2014 (r269604) +++ head/sys/arm/arm/pl190.c Tue Aug 5 18:51:51 2014 (r269605) @@ -152,7 +152,8 @@ static driver_t pl190_intc_driver = { static devclass_t pl190_intc_devclass; -DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass, 0, 0); +EARLY_DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); int arm_get_next_irq(int last_irq) From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 19:06:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75314AFC for ; Tue, 5 Aug 2014 19:06:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA412881 for ; Tue, 5 Aug 2014 19:06:46 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 55bd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 19:06:46 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 19:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269606 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e12b46.55bd.7fdfcac6@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 19:06:46 -0000 Author: ian Date: Tue Aug 5 19:06:45 2014 New Revision: 269606 URL: http://svnweb.freebsd.org/changeset/base/269606 Log: Add an arm option, ARM_DEVICE_MULTIPASS, used to opt-in to multi-pass device attachment on arm platforms. If this is defined, nexus attaches early in BUS_PASS_BUS, and other busses and devices attach later, in the pass number they are set up for. Without it defined, nexus attaches in BUS_PASS_DEFAULT and thus so does everything else, which is status quo. Arm platforms which use FDT data to enumerate devices have been relying on devices being attached in the exact order they're listed in the dts source file. That's one of things currently preventing us from using vendor-supplied fdt data (because then we don't control the order of the devices in the data). Multi-pass attachment can go a long way towards solving that problem by ensuring things like clock and interrupt drivers are attached before the more mundane devices that need them. The long-term goal is to have all arm fdt-based platforms using multipass. This option is a bridge to that, letting us enable it selectively as platforms are converted and tested (the alternative being to just throw a big switch and try to fight fires as they're reported). Modified: head/sys/arm/arm/nexus.c head/sys/conf/options.arm Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Tue Aug 5 18:51:51 2014 (r269605) +++ head/sys/arm/arm/nexus.c Tue Aug 5 19:06:45 2014 (r269606) @@ -125,7 +125,12 @@ static driver_t nexus_driver = { nexus_methods, 1 /* no softc */ }; +#ifdef ARM_DEVICE_MULTIPASS +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); +#else DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +#endif static int nexus_probe(device_t dev) Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Aug 5 18:51:51 2014 (r269605) +++ head/sys/conf/options.arm Tue Aug 5 19:06:45 2014 (r269606) @@ -1,6 +1,7 @@ #$FreeBSD$ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h +ARM_DEVICE_MULTIPASS opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 19:10:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D219C9C for ; Tue, 5 Aug 2014 19:10:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13DA9292A for ; Tue, 5 Aug 2014 19:10:54 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 591e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 19:10:54 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 19:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269607 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e12c3e.591e.6b85d06d@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 19:10:54 -0000 Author: ian Date: Tue Aug 5 19:10:53 2014 New Revision: 269607 URL: http://svnweb.freebsd.org/changeset/base/269607 Log: Cache the imx6 SoC type in a static var so that it only has to be figured out by sniffing hardware registers once. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Aug 5 19:06:45 2014 (r269606) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Aug 5 19:10:53 2014 (r269607) @@ -146,12 +146,16 @@ u_int imx_soc_type() { uint32_t digprog, hwsoc; uint32_t *pcr; + static u_int soctype; const vm_offset_t SCU_CONFIG_PHYSADDR = 0x00a00004; #define HWSOC_MX6SL 0x60 #define HWSOC_MX6DL 0x61 #define HWSOC_MX6SOLO 0x62 #define HWSOC_MX6Q 0x63 + if (soctype != 0) + return (soctype); + digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG_SL); hwsoc = (digprog >> IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) & IMX6_ANALOG_DIGPROG_SOCTYPE_MASK; @@ -175,20 +179,25 @@ u_int imx_soc_type() switch (hwsoc) { case HWSOC_MX6SL: - return (IMXSOC_6SL); + soctype = IMXSOC_6SL; + break; case HWSOC_MX6SOLO: - return (IMXSOC_6S); + soctype = IMXSOC_6S; + break; case HWSOC_MX6DL: - return (IMXSOC_6DL); + soctype = IMXSOC_6DL; + break; case HWSOC_MX6Q : - return (IMXSOC_6Q); + soctype = IMXSOC_6Q; + break; default: printf("imx_soc_type: Don't understand hwsoc 0x%02x, " "digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog); + soctype = IMXSOC_6Q; break; } - return (IMXSOC_6Q); + return (soctype); } /* From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 19:43:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2749137C for ; Tue, 5 Aug 2014 19:43:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17E102D28 for ; Tue, 5 Aug 2014 19:43:45 +0000 (UTC) Received: from gjb (uid 1237) (envelope-from gjb@FreeBSD.org) id 53d1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 19:43:45 +0000 From: Glen Barber Date: Tue, 5 Aug 2014 19:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269608 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e133f1.53d1.3d51ed61@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 19:43:45 -0000 Author: gjb Date: Tue Aug 5 19:43:44 2014 New Revision: 269608 URL: http://svnweb.freebsd.org/changeset/base/269608 Log: Add device ID for the Chicony USB 2.0 HD UVC Webcam found on the Asus X550LA. Reviewed by: sbruno Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Aug 5 19:10:53 2014 (r269607) +++ head/sys/dev/usb/usbdevs Tue Aug 5 19:43:44 2014 (r269608) @@ -1379,6 +1379,7 @@ product CHIC CYPRESS 0x0003 Cypress USB product CHICONY KB8933 0x0001 KB-8933 keyboard product CHICONY KU0325 0x0116 KU-0325 keyboard product CHICONY CNF7129 0xb071 Notebook Web Camera +product CHICONY HDUVCCAM 0xb40a HD UVC WebCam product CHICONY RTL8188CUS_1 0xaff7 RTL8188CUS product CHICONY RTL8188CUS_2 0xaff8 RTL8188CUS product CHICONY RTL8188CUS_3 0xaff9 RTL8188CUS From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 22:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84F866D1; Tue, 5 Aug 2014 22:06:11 +0000 (UTC) Received: from mail-pd0-x235.google.com (mail-pd0-x235.google.com [IPv6:2607:f8b0:400e:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 456342D17; Tue, 5 Aug 2014 22:06:11 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id g10so2069389pdj.12 for ; Tue, 05 Aug 2014 15:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=gmnnMPS70Yuaw5078cNsEHD3t13zIx0z44fktOyN61Y=; b=bzaD3C96yvXvXTPrCijPjIxfEXD/aUsdHpmG9FtZaJchrP6+HmWFV6PoAECYLc7LXG YramFlsGbekeJGEib1lSeyMSaaDuA7LFjgoI2707zIz14Z25UhEe7DwPC/JOSqlIlywj ay+GTimYKCsM2xzUbonYoYE+tunufAT/klPgyK7uE4x5iOLDGs5WLpJLupgrlHKme6rs jLrgU1DuDLpnBtTB4iDZYhc+nHlqEnnvq+tNGqZu7trzPmkffjsWH7/618DRfkcpcHYO 8kpLFVsYa56b7hXohjolIllIPGBpsu/PAsb4zk32weOOmqTr4QZm8uuGbHo4mzSmMoSY cPmA== X-Received: by 10.66.146.35 with SMTP id sz3mr6725875pab.148.1407276370744; Tue, 05 Aug 2014 15:06:10 -0700 (PDT) Received: from ?IPv6:2601:8:ab80:7d6:a1b6:3b04:cfef:8b0a? ([2601:8:ab80:7d6:a1b6:3b04:cfef:8b0a]) by mx.google.com with ESMTPSA id fk13sm4531544pdb.39.2014.08.05.15.06.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 15:06:09 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_EA719593-3018-48BB-A66B-8914E52DF343"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269603 - in head: etc/mtree lib/libnv lib/libnv/tests tools/regression/lib/libnv From: Garrett Cooper In-Reply-To: <53e12558.5d33.563f584f@svn.freebsd.org> Date: Tue, 5 Aug 2014 15:06:06 -0700 Message-Id: References: <53e12558.5d33.563f584f@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 22:06:11 -0000 --Apple-Mail=_EA719593-3018-48BB-A66B-8914E52DF343 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 5, 2014, at 11:41 AM, Garrett Cooper wrote: > Author: ngie > Date: Tue Aug 5 18:41:27 2014 > New Revision: 269603 > URL: http://svnweb.freebsd.org/changeset/base/269603 >=20 > Log: > Integrate lib/libnv into the build/kyua >=20 > Rename all of the TAP test applications from to _test > to match the convention described in the TestSuite wiki page >=20 > Phabric: D538 > Approved by: jmmv (mentor) > Sponsored by: EMC / Isilon Storage Division I forgot to mention=85 MFC after: 2 weeks --Apple-Mail=_EA719593-3018-48BB-A66B-8914E52DF343 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJT4VVOAAoJEMZr5QU6S73e1PQH/1pOw0jjHq7045OMeV3j9YFY ARKb0ldLjvv5UNNCMJ9V4L200+4QMEudCaXIRw2IjWFyAek2mxBNtxIvKi1Ou7Jm IIdGnjN0ur4lOJiNVOD0u+A8k+H2EG/cBzk9hveGRQqSJsO8DnTW3DdelG3l2dDm eEXLsgXarLBApnlFOyGLzQ+uN1ALlcbkvlHRovHha8vqJlLUPuNG60ICGWVY0jOI B1GznKY94VYHPsU6+F4+qZU5NAMYT88YdbEIvH92FFk0EXvDPIGYfkpyDwexWtIh u4A0u3f3Z2HABP8HgE5URbapULRsXdKpEtYkZbNJltuSo/ib9mwFaNIixmr26ds= =vtVU -----END PGP SIGNATURE----- --Apple-Mail=_EA719593-3018-48BB-A66B-8914E52DF343-- From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 22:38:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2C11C40 for ; Tue, 5 Aug 2014 22:38:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9205320B9 for ; Tue, 5 Aug 2014 22:38:49 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 5480 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 22:38:49 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 22:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269609 - head/sys/gnu/dts/include/dt-bindings/clock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e15cf9.5480.580cc7d9@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 22:38:49 -0000 Author: ian Date: Tue Aug 5 22:38:49 2014 New Revision: 269609 URL: http://svnweb.freebsd.org/changeset/base/269609 Log: Revert r269528; this was not the right way to bring these changes in. Deleted: head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h Modified: head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h Modified: head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h Tue Aug 5 19:43:44 2014 (r269608) +++ head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h Tue Aug 5 22:38:49 2014 (r269609) @@ -145,7 +145,6 @@ #define IMX6SL_CLK_USDHC4 132 #define IMX6SL_CLK_PLL4_AUDIO_DIV 133 #define IMX6SL_CLK_SPBA 134 -#define IMX6SL_CLK_ENET 135 -#define IMX6SL_CLK_END 136 +#define IMX6SL_CLK_END 135 #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:32:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F5CC724 for ; Tue, 5 Aug 2014 23:32:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D26A26D7 for ; Tue, 5 Aug 2014 23:32:54 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 5b5c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:32:53 +0000 From: John Baldwin Date: Tue, 5 Aug 2014 23:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269611 - head/sys/dev/hpt27xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e169a5.5b5c.574add41@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:32:54 -0000 Author: jhb Date: Tue Aug 5 23:32:53 2014 New Revision: 269611 URL: http://svnweb.freebsd.org/changeset/base/269611 Log: Remove compat shims for FreeBSD versions older than 8.0. Reviewed by: Steve Chang Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hpt27xx/os_bsd.h Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Tue Aug 5 23:16:31 2014 (r269610) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Tue Aug 5 23:32:53 2014 (r269611) @@ -78,57 +78,9 @@ void os_pci_writel (void *osext, HPT_U8 pci_write_config(((PHBA)osext)->pcidev, offset, value, 4); } -#if __FreeBSD_version < 500043 /* PCI space access */ HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) { - HPT_U8 v; - pcicfgregs pciref; - - pciref.bus = bus; - pciref.slot = dev; - pciref.func = func; - - v = pci_cfgread(&pciref, reg, 1); - return v; -} -HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) -{ - HPT_U32 v; - pcicfgregs pciref; - - pciref.bus = bus; - pciref.slot = dev; - pciref.func = func; - - v = pci_cfgread(&pciref, reg, 4); - return v; -} -void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) -{ - pcicfgregs pciref; - - pciref.hose = -1; - pciref.bus = bus; - pciref.slot = dev; - pciref.func = func; - - pci_cfgwrite(&pciref, reg, v, 1); -} -void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) -{ - pcicfgregs pciref; - - pciref.hose = -1; - pciref.bus = bus; - pciref.slot = dev; - pciref.func = func; - - pci_cfgwrite(&pciref, reg, v, 4); -}/* PCI space access */ -#else -HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) -{ return (HPT_U8)pci_cfgregread(bus, dev, func, reg, 1); } HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) @@ -143,7 +95,6 @@ void pcicfg_write_dword(HPT_U8 bus, HPT_ { pci_cfgregwrite(bus, dev, func, reg, v, 4); }/* PCI space access */ -#endif void *os_map_pci_bar( void *osext, Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Aug 5 23:16:31 2014 (r269610) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Aug 5 23:32:53 2014 (r269611) @@ -80,9 +80,7 @@ static int hpt_attach(device_t dev) him = hpt_match(dev); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; -#if __FreeBSD_version >=440000 pci_enable_busmaster(dev); -#endif pci_id.vid = pci_get_vendor(dev); pci_id.did = pci_get_device(dev); @@ -788,12 +786,10 @@ static void hpt_action(struct cam_sim *s strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); -#if (__FreeBSD_version >= 800000) cpi->transport = XPORT_SPI; cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; -#endif cpi->ccb_h.status = CAM_REQ_CMP; break; } @@ -969,19 +965,7 @@ static struct cdevsw hpt_cdevsw = { .d_close = hpt_close, .d_ioctl = hpt_ioctl, .d_name = driver_name, -#if __FreeBSD_version>=503000 .d_version = D_VERSION, -#endif -#if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, -#endif -#if __FreeBSD_version<600034 -#if __FreeBSD_version>501000 - .d_maj = MAJOR_AUTO, -#else - .d_maj = HPT_DEV_MAJOR, -#endif -#endif }; static struct intr_config_hook hpt_ich; @@ -1018,9 +1002,7 @@ static void hpt_final_init(void *dummy) /* initializing hardware */ ldm_for_each_vbus(vbus, vbus_ext) { /* make timer available here */ -#if (__FreeBSD_version >= 500000) mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); -#endif callout_init_mtx(&vbus_ext->timer, &vbus_ext->lock, 0); if (hpt_init_vbus(vbus_ext)) { os_printk("fail to initialize hardware"); @@ -1043,10 +1025,8 @@ static void hpt_final_init(void *dummy) os_max_sg_descriptors, /* nsegments */ 0x10000, /* maxsegsize */ BUS_DMA_WAITOK, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ &vbus_ext->lock, /* lockfuncarg */ -#endif &vbus_ext->io_dmat /* tag */)) { return ; @@ -1074,13 +1054,8 @@ static void hpt_final_init(void *dummy) return ; } -#if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, vbus_ext, unit_number, &vbus_ext->lock, os_max_queue_comm, /*tagged*/8, devq); -#else - vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); -#endif unit_number++; if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); @@ -1089,11 +1064,7 @@ static void hpt_final_init(void *dummy) } hpt_lock_vbus(vbus_ext); -#if __FreeBSD_version > 700044 if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) { -#else - if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) { -#endif hpt_unlock_vbus(vbus_ext); os_printk("xpt_bus_register failed"); cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE); @@ -1131,11 +1102,7 @@ static void hpt_final_init(void *dummy) } if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, -#if __FreeBSD_version > 700025 NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#else - hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#endif { os_printk("can't set up interrupt"); return ; @@ -1160,7 +1127,7 @@ static void hpt_final_init(void *dummy) S_IRUSR | S_IWUSR, "%s", driver_name); } -#if defined(KLD_MODULE) && (__FreeBSD_version >= 503000) +#if defined(KLD_MODULE) typedef struct driverlink *driverlink_t; struct driverlink { @@ -1252,29 +1219,17 @@ __DRIVER_MODULE(TARGETNAME, pci, hpt_pci __MODULE_VERSION(TARGETNAME, 1); __MODULE_DEPEND(TARGETNAME, cam, 1, 1, 1); -#if __FreeBSD_version>503000 -typedef struct cdev * ioctl_dev_t; -#else -typedef dev_t ioctl_dev_t; -#endif - -#if __FreeBSD_version >= 500000 -typedef struct thread * ioctl_thread_t; -#else -typedef struct proc * ioctl_thread_t; -#endif - -static int hpt_open(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_open(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_close(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_close(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_ioctl(ioctl_dev_t dev, u_long cmd, caddr_t data, int fflag, ioctl_thread_t td) +static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; Modified: head/sys/dev/hpt27xx/os_bsd.h ============================================================================== --- head/sys/dev/hpt27xx/os_bsd.h Tue Aug 5 23:16:31 2014 (r269610) +++ head/sys/dev/hpt27xx/os_bsd.h Tue Aug 5 23:32:53 2014 (r269611) @@ -38,12 +38,8 @@ #include #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include /*to support DELAY function under 4.x BSD versions*/ -#endif #include #include @@ -51,11 +47,9 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include #include -#endif #include #include @@ -63,9 +57,7 @@ #include #include -#if __FreeBSD_version >= 500043 #include -#endif #include #include #include @@ -73,17 +65,8 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#endif - -#if (__FreeBSD_version <= 500043) -#include -#endif #include #include @@ -95,10 +78,6 @@ #include #include -#if (__FreeBSD_version < 500043) -#include -#endif - typedef struct _INQUIRYDATA { u_char DeviceType : 5; @@ -188,11 +167,7 @@ typedef struct _vbus_ext { struct cam_sim *sim; /* sim for this vbus */ struct cam_path *path; /* peripheral, path, tgt, lun with this vbus */ -#if (__FreeBSD_version >= 500000) struct mtx lock; /* general purpose lock */ -#else - int hpt_splx; -#endif bus_dma_tag_t io_dmat; /* I/O buffer DMA tag */ POS_CMDEXT cmdext_list; @@ -209,20 +184,9 @@ typedef struct _vbus_ext { } VBUS_EXT, *PVBUS_EXT; -#if __FreeBSD_version >= 500000 #define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock) #define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock) #define hpt_assert_vbus_locked(vbus_ext) mtx_assert(&(vbus_ext)->lock, MA_OWNED) -#else -static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext) -{ - vbus_ext->hpt_splx = splcam(); -} -static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext) -{ - splx(vbus_ext->hpt_splx); -} -#endif #define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */ @@ -231,35 +195,9 @@ static __inline void hpt_unlock_vbus(PVB #define HPT_SCAN_BUS _IO('H', 1) -#if __FreeBSD_version >= 501000 -#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi_giant,(task)); -#else #define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi,(task)); -#endif -#if __FreeBSD_version >= 500000 static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) { return msleep(ident, &vbus_ext->lock, priority, wmesg, timo); } -#else -static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) -{ - int retval = 0; - - asleep(ident, priority, wmesg, timo); - hpt_unlock_vbus(vbus_ext); - retval = await(priority, timo); - hpt_lock_vbus(vbus_ext); - - return retval; -} -#endif - -#if __FreeBSD_version < 501000 -#define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e -#endif - -#define HPT_DEV_MAJOR 200 From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:35:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B678F87C for ; Tue, 5 Aug 2014 23:35:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95EAB26EA for ; Tue, 5 Aug 2014 23:35:19 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 5b77 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:35:19 +0000 From: John Baldwin Date: Tue, 5 Aug 2014 23:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269612 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16a37.5b77.57894f1c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:35:19 -0000 Author: jhb Date: Tue Aug 5 23:35:19 2014 New Revision: 269612 URL: http://svnweb.freebsd.org/changeset/base/269612 Log: Various fixes to hptiop(4): - Use callout(9) instead of timeout(9). - Use the existing hba lock as the CAM sim lock instead of Giant. - Mark interrupt handler MPSAFE. - Reorder detach and destroy the hba lock in detach. Reviewed by: Steve Chang Modified: head/sys/dev/hptiop/hptiop.c head/sys/dev/hptiop/hptiop.h Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Tue Aug 5 23:32:53 2014 (r269611) +++ head/sys/dev/hptiop/hptiop.c Tue Aug 5 23:35:19 2014 (r269612) @@ -643,7 +643,7 @@ static void hptiop_request_callback_mvfr ccb = (union ccb *)srb->ccb; - untimeout(hptiop_reset_adapter, hba, srb->timeout_ch); + callout_stop(&srb->timeout); if (ccb->ccb_h.flags & CAM_CDB_POINTER) cdb = ccb->csio.cdb_io.cdb_ptr; @@ -2013,12 +2013,13 @@ static int hptiop_attach(device_t dev) } hba->sim = cam_sim_alloc(hptiop_action, hptiop_poll, driver_name, - hba, unit, &Giant, hba->max_requests - 1, 1, devq); + hba, unit, &hba->lock, hba->max_requests - 1, 1, devq); if (!hba->sim) { device_printf(dev, "cam_sim_alloc failed\n"); cam_simq_free(devq); goto srb_dmamap_unload; } + hptiop_lock_adapter(hba); if (xpt_bus_register(hba->sim, dev, 0) != CAM_SUCCESS) { device_printf(dev, "xpt_bus_register failed\n"); @@ -2031,6 +2032,7 @@ static int hptiop_attach(device_t dev) device_printf(dev, "xpt_create_path failed\n"); goto deregister_xpt_bus; } + hptiop_unlock_adapter(hba); bzero(&set_config, sizeof(set_config)); set_config.iop_id = unit; @@ -2056,7 +2058,7 @@ static int hptiop_attach(device_t dev) goto free_hba_path; } - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, + if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, NULL, hptiop_pci_intr, hba, &hba->irq_handle)) { device_printf(dev, "allocate intr function failed!\n"); @@ -2086,6 +2088,7 @@ teartown_irq_resource: free_irq_resource: bus_release_resource(dev, SYS_RES_IRQ, 0, hba->irq_res); + hptiop_lock_adapter(hba); free_hba_path: xpt_free_path(hba->path); @@ -2094,6 +2097,7 @@ deregister_xpt_bus: free_cam_sim: cam_sim_free(hba->sim, /*free devq*/ TRUE); + hptiop_unlock_adapter(hba); srb_dmamap_unload: if (hba->uncached_ptr) @@ -2145,9 +2149,10 @@ static int hptiop_detach(device_t dev) if (hptiop_send_sync_msg(hba, IOPMU_INBOUND_MSG0_STOP_BACKGROUND_TASK, 60000)) goto out; + hptiop_unlock_adapter(hba); hptiop_release_resource(hba); - error = 0; + return (0); out: hptiop_unlock_adapter(hba); return error; @@ -2182,7 +2187,10 @@ static void hptiop_pci_intr(void *arg) static void hptiop_poll(struct cam_sim *sim) { - hptiop_pci_intr(cam_sim_softc(sim)); + struct hpt_iop_hba *hba; + + hba = cam_sim_softc(sim); + hba->ops->iop_intr(hba); } static void hptiop_async(void * callback_arg, u_int32_t code, @@ -2289,21 +2297,20 @@ static void hptiop_action(struct cam_sim switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: - hptiop_lock_adapter(hba); if (ccb->ccb_h.target_lun != 0 || ccb->ccb_h.target_id >= hba->max_devices || (ccb->ccb_h.flags & CAM_CDB_PHYS)) { ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); - goto scsi_done; + return; } if ((srb = hptiop_get_srb(hba)) == NULL) { device_printf(hba->pcidev, "srb allocated failed"); ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); - goto scsi_done; + return; } srb->ccb = ccb; @@ -2322,19 +2329,15 @@ static void hptiop_action(struct cam_sim ccb->ccb_h.status = CAM_REQ_CMP_ERR; hptiop_free_srb(hba, srb); xpt_done(ccb); - goto scsi_done; + return; } -scsi_done: - hptiop_unlock_adapter(hba); return; case XPT_RESET_BUS: device_printf(hba->pcidev, "reset adapter"); - hptiop_lock_adapter(hba); hba->msg_done = 0; hptiop_reset_adapter(hba); - hptiop_unlock_adapter(hba); break; case XPT_GET_TRAN_SETTINGS: @@ -2629,7 +2632,7 @@ static void hptiop_post_req_mvfrey(struc BUS_SPACE_RD4_MVFREY2(inbound_write_ptr); if (req->header.type == IOP_REQUEST_TYPE_SCSI_COMMAND) { - srb->timeout_ch = timeout(hptiop_reset_adapter, hba, 20*hz); + callout_reset(&srb->timeout, 20 * hz, hptiop_reset_adapter, hba); } } @@ -2741,7 +2744,7 @@ static void hptiop_map_srb(void *arg, bu tmp_srb->phy_addr = phy_addr; } - callout_handle_init(&tmp_srb->timeout_ch); + callout_init_mtx(&tmp_srb->timeout, &hba->lock, 0); hptiop_free_srb(hba, tmp_srb); hba->srb[i] = tmp_srb; phy_addr += HPT_SRB_MAX_SIZE; @@ -2785,6 +2788,10 @@ static int hptiop_os_query_remove_devic static void hptiop_release_resource(struct hpt_iop_hba *hba) { int i; + + if (hba->ioctl_dev) + destroy_dev(hba->ioctl_dev); + if (hba->path) { struct ccb_setasync ccb; @@ -2797,9 +2804,14 @@ static void hptiop_release_resource(stru xpt_free_path(hba->path); } + if (hba->irq_handle) + bus_teardown_intr(hba->pcidev, hba->irq_res, hba->irq_handle); + if (hba->sim) { + hptiop_lock_adapter(hba); xpt_bus_deregister(cam_sim_path(hba->sim)); cam_sim_free(hba->sim, TRUE); + hptiop_unlock_adapter(hba); } if (hba->ctlcfg_dmat) { @@ -2813,6 +2825,7 @@ static void hptiop_release_resource(stru struct hpt_iop_srb *srb = hba->srb[i]; if (srb->dma_map) bus_dmamap_destroy(hba->io_dmat, srb->dma_map); + callout_drain(&srb->timeout); } if (hba->srb_dmat) { @@ -2827,9 +2840,6 @@ static void hptiop_release_resource(stru if (hba->parent_dmat) bus_dma_tag_destroy(hba->parent_dmat); - if (hba->irq_handle) - bus_teardown_intr(hba->pcidev, hba->irq_res, hba->irq_handle); - if (hba->irq_res) bus_release_resource(hba->pcidev, SYS_RES_IRQ, 0, hba->irq_res); @@ -2840,6 +2850,5 @@ static void hptiop_release_resource(stru if (hba->bar2_res) bus_release_resource(hba->pcidev, SYS_RES_MEMORY, hba->bar2_rid, hba->bar2_res); - if (hba->ioctl_dev) - destroy_dev(hba->ioctl_dev); + mtx_destroy(&hba->lock); } Modified: head/sys/dev/hptiop/hptiop.h ============================================================================== --- head/sys/dev/hptiop/hptiop.h Tue Aug 5 23:32:53 2014 (r269611) +++ head/sys/dev/hptiop/hptiop.h Tue Aug 5 23:35:19 2014 (r269612) @@ -460,7 +460,7 @@ struct hpt_iop_srb { u_int64_t phy_addr; u_int32_t srb_flag; int index; - struct callout_handle timeout_ch; + struct callout timeout; }; #define hptiop_lock_adapter(hba) mtx_lock(&(hba)->lock) From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:39:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C7719EC for ; Tue, 5 Aug 2014 23:39:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0AA2711 for ; Tue, 5 Aug 2014 23:39:36 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 5b98 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:39:35 +0000 From: John Baldwin Date: Tue, 5 Aug 2014 23:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269613 - head/sys/dev/hptnr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16b38.5b98.1bb028c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:39:36 -0000 Author: jhb Date: Tue Aug 5 23:39:35 2014 New Revision: 269613 URL: http://svnweb.freebsd.org/changeset/base/269613 Log: Various fixes to hptnr(4): - Use the existing vbus locks instead of Giant for the CAM sim lock. - Use callout(9) instead of timeout(9). - Mark the interrupt handler MPSAFE. - Don't attempt to pass data in the softc from probe() to attach(). - Remove compat shims for FreeBSD versions older than 8.0. Reviewed by: Steve Chang Modified: head/sys/dev/hptnr/hptnr_os_bsd.c head/sys/dev/hptnr/hptnr_osm_bsd.c head/sys/dev/hptnr/os_bsd.h Modified: head/sys/dev/hptnr/hptnr_os_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_os_bsd.c Tue Aug 5 23:35:19 2014 (r269612) +++ head/sys/dev/hptnr/hptnr_os_bsd.c Tue Aug 5 23:39:35 2014 (r269613) @@ -86,25 +86,10 @@ BUS_ADDRESS get_dmapool_phy_addr(void *o return (BUS_ADDRESS)vtophys(dmapool_virt_addr); } -#if __FreeBSD_version < 500043 -HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) -{ - HPT_U32 v; - pcicfgregs pciref; - - pciref.bus = bus; - pciref.slot = dev; - pciref.func = func; - - v = pci_cfgread(&pciref, reg, 4); - return v; -}/* PCI space access */ -#else HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) { return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4);; }/* PCI space access */ -#endif void *os_map_pci_bar( void *osext, @@ -249,9 +234,9 @@ void os_request_timer(void * osext, HPT PVBUS_EXT vbus_ext = osext; HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - - untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); - vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); + + callout_reset(&vbus_ext->timer, interval * hz / 1000000, + os_timer_for_ldm, vbus_ext); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- head/sys/dev/hptnr/hptnr_osm_bsd.c Tue Aug 5 23:35:19 2014 (r269612) +++ head/sys/dev/hptnr/hptnr_osm_bsd.c Tue Aug 5 23:39:35 2014 (r269613) @@ -31,12 +31,11 @@ #include #include -static int hpt_probe(device_t dev) +static HIM *hpt_match(device_t dev) { PCI_ID pci_id; HIM *him; int i; - PHBA hba; for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { @@ -44,36 +43,46 @@ static int hpt_probe(device_t dev) him->get_controller_count(&pci_id,0,0); if ((pci_get_vendor(dev) == pci_id.vid) && (pci_get_device(dev) == pci_id.did)){ - KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", - pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) - )); - device_set_desc(dev, him->name); - hba = (PHBA)device_get_softc(dev); - memset(hba, 0, sizeof(HBA)); - hba->ext_type = EXT_TYPE_HBA; - hba->ldm_adapter.him = him; - return 0; + return (him); } } } + return (NULL); +} + +static int hpt_probe(device_t dev) +{ + HIM *him; + + him = hpt_match(dev); + if (him != NULL) { + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int hpt_attach(device_t dev) { PHBA hba = (PHBA)device_get_softc(dev); - HIM *him = hba->ldm_adapter.him; + HIM *him; PCI_ID pci_id; HPT_UINT size; PVBUS vbus; PVBUS_EXT vbus_ext; KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); - -#if __FreeBSD_version >=440000 + + him = hpt_match(dev); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; + pci_enable_busmaster(dev); -#endif pci_id.vid = pci_get_vendor(dev); pci_id.did = pci_get_device(dev); @@ -82,8 +91,6 @@ static int hpt_attach(device_t dev) size = him->get_adapter_size(&pci_id); hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); - if (!hba->ldm_adapter.him_handle) - return ENXIO; hba->pcidev = dev; hba->pciaddr.tree = 0; @@ -93,7 +100,7 @@ static int hpt_attach(device_t dev) if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; + return ENXIO; } os_printk("adapter at PCI %d:%d:%d, IRQ %d", @@ -101,12 +108,8 @@ static int hpt_attach(device_t dev) if (!ldm_register_adapter(&hba->ldm_adapter)) { size = ldm_get_vbus_size(); - vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); - if (!vbus_ext) { - free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; - } - memset(vbus_ext, 0, sizeof(VBUS_EXT)); + vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK | + M_ZERO); vbus_ext->ext_type = EXT_TYPE_VBUS; ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); ldm_register_adapter(&hba->ldm_adapter); @@ -287,7 +290,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus KdPrint(("flusing dev %p", vd)); - hpt_lock_vbus(vbus_ext); + hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) count = MAX(vd->u.array.transform->source->cmds_per_request, @@ -298,7 +301,6 @@ static int hpt_flush_vdev(PVBUS_EXT vbus pCmd = ldm_alloc_cmds(vd->vbus, count); if (!pCmd) { - hpt_unlock_vbus(vbus_ext); return -1; } @@ -324,8 +326,6 @@ static int hpt_flush_vdev(PVBUS_EXT vbus ldm_free_cmds(pCmd); - hpt_unlock_vbus(vbus_ext); - return result; } @@ -340,6 +340,7 @@ static void hpt_shutdown_vbus(PVBUS_EXT /* stop all ctl tasks and disable the worker taskqueue */ hpt_stop_tasks(vbus_ext); + hpt_lock_vbus(vbus_ext); vbus_ext->worker.ta_context = 0; /* flush devices */ @@ -352,7 +353,6 @@ static void hpt_shutdown_vbus(PVBUS_EXT } } - hpt_lock_vbus(vbus_ext); ldm_shutdown(vbus); hpt_unlock_vbus(vbus_ext); @@ -368,6 +368,8 @@ static void hpt_shutdown_vbus(PVBUS_EXT free(hba->ldm_adapter.him_handle, M_DEVBUF); } + callout_drain(&vbus_ext->timer); + mtx_destroy(&vbus_ext->lock); free(vbus_ext, M_DEVBUF); KdPrint(("hpt_shutdown_vbus done")); } @@ -431,8 +433,8 @@ static void os_cmddone(PCOMMAND pCmd) union ccb *ccb = ext->ccb; KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result)); - - untimeout(hpt_timeout, pCmd, ext->timeout_ch); + + callout_stop(&ext->timeout); switch(pCmd->Result) { case RETURN_SUCCESS: @@ -511,7 +513,7 @@ static void hpt_io_dmamap_callback(void } } - ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT); + callout_reset(&ext->timeout, HPT_OSM_TIMEOUT, hpt_timeout, pCmd); ldm_queue_cmd(pCmd); } @@ -728,18 +730,15 @@ static void hpt_action(struct cam_sim *s KdPrint(("hpt_action(fn=%d, id=%d)", ccb->ccb_h.func_code, ccb->ccb_h.target_id)); + hpt_assert_vbus_locked(vbus_ext); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: - hpt_lock_vbus(vbus_ext); hpt_scsi_io(vbus_ext, ccb); - hpt_unlock_vbus(vbus_ext); return; case XPT_RESET_BUS: - hpt_lock_vbus(vbus_ext); ldm_reset_vbus((PVBUS)vbus_ext->vbus); - hpt_unlock_vbus(vbus_ext); break; case XPT_GET_TRAN_SETTINGS: @@ -773,12 +772,10 @@ static void hpt_action(struct cam_sim *s strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); -#if (__FreeBSD_version >= 800000) cpi->transport = XPORT_SPI; cpi->transport_version = 2; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; -#endif cpi->ccb_h.status = CAM_REQ_CMP; break; } @@ -802,7 +799,9 @@ static void hpt_pci_intr(void *arg) static void hpt_poll(struct cam_sim *sim) { - hpt_pci_intr(cam_sim_softc(sim)); + PVBUS_EXT vbus_ext = cam_sim_softc(sim); + hpt_assert_vbus_locked(vbus_ext); + ldm_intr((PVBUS)vbus_ext->vbus); } static void hpt_async(void * callback_arg, u_int32_t code, struct cam_path * path, void * arg) @@ -951,19 +950,7 @@ static struct cdevsw hpt_cdevsw = { .d_close = hpt_close, .d_ioctl = hpt_ioctl, .d_name = driver_name, -#if __FreeBSD_version>=503000 .d_version = D_VERSION, -#endif -#if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, -#endif -#if __FreeBSD_version<600034 -#if __FreeBSD_version>501000 - .d_maj = MAJOR_AUTO, -#else - .d_maj = HPT_DEV_MAJOR, -#endif -#endif }; static struct intr_config_hook hpt_ich; @@ -1000,7 +987,8 @@ static void hpt_final_init(void *dummy) /* initializing hardware */ ldm_for_each_vbus(vbus, vbus_ext) { /* make timer available here */ - callout_handle_init(&vbus_ext->timer); + mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); + callout_init_mtx(&vbus_ext->timer, &vbus_ext->lock, 0); if (hpt_init_vbus(vbus_ext)) { os_printk("fail to initialize hardware"); break; /* FIXME */ @@ -1012,9 +1000,6 @@ static void hpt_final_init(void *dummy) struct cam_devq *devq; struct ccb_setasync ccb; -#if (__FreeBSD_version >= 500000) - mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); -#endif if (bus_dma_tag_create(NULL,/* parent */ 4, /* alignment */ BUS_SPACE_MAXADDR_32BIT+1, /* boundary */ @@ -1025,10 +1010,8 @@ static void hpt_final_init(void *dummy) os_max_sg_descriptors, /* nsegments */ 0x10000, /* maxsegsize */ BUS_DMA_WAITOK, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ &vbus_ext->lock, /* lockfuncarg */ -#endif &vbus_ext->io_dmat /* tag */)) { return ; @@ -1048,7 +1031,7 @@ static void hpt_final_init(void *dummy) os_printk("Can't create dma map(%d)", i); return ; } - callout_handle_init(&ext->timeout_ch); + callout_init_mtx(&ext->timeout, &vbus_ext->lock, 0); } if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) { @@ -1056,25 +1039,19 @@ static void hpt_final_init(void *dummy) return ; } -#if __FreeBSD_version > 700025 - vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, unit_number, &Giant, os_max_queue_comm, /*tagged*/8, devq); -#else + hpt_lock_vbus(vbus_ext); vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); -#endif + vbus_ext, unit_number, &vbus_ext->lock, + os_max_queue_comm, /*tagged*/8, devq); unit_number++; if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); cam_simq_free(devq); + hpt_unlock_vbus(vbus_ext); return ; } -#if __FreeBSD_version > 700044 if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) { -#else - if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) { -#endif os_printk("xpt_bus_register failed"); cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE); vbus_ext->sim = NULL; @@ -1088,9 +1065,11 @@ static void hpt_final_init(void *dummy) os_printk("xpt_create_path failed"); xpt_bus_deregister(cam_sim_path(vbus_ext->sim)); cam_sim_free(vbus_ext->sim, /*free_devq*/TRUE); + hpt_unlock_vbus(vbus_ext); vbus_ext->sim = NULL; return ; } + hpt_unlock_vbus(vbus_ext); xpt_setup_ccb(&ccb.ccb_h, vbus_ext->path, /*priority*/5); ccb.ccb_h.func_code = XPT_SASYNC_CB; @@ -1108,12 +1087,8 @@ static void hpt_final_init(void *dummy) return ; } - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, -#if __FreeBSD_version > 700025 + if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#else - hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#endif { os_printk("can't set up interrupt"); return ; @@ -1138,7 +1113,7 @@ static void hpt_final_init(void *dummy) S_IRUSR | S_IWUSR, "%s", driver_name); } -#if defined(KLD_MODULE) && (__FreeBSD_version >= 503000) +#if defined(KLD_MODULE) typedef struct driverlink *driverlink_t; struct driverlink { @@ -1230,29 +1205,17 @@ __DRIVER_MODULE(TARGETNAME, pci, hpt_pci __MODULE_VERSION(TARGETNAME, 1); __MODULE_DEPEND(TARGETNAME, cam, 1, 1, 1); -#if __FreeBSD_version>503000 -typedef struct cdev * ioctl_dev_t; -#else -typedef dev_t ioctl_dev_t; -#endif - -#if __FreeBSD_version >= 500000 -typedef struct thread * ioctl_thread_t; -#else -typedef struct proc * ioctl_thread_t; -#endif - -static int hpt_open(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_open(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_close(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_close(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_ioctl(ioctl_dev_t dev, u_long cmd, caddr_t data, int fflag, ioctl_thread_t td) +static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; @@ -1291,16 +1254,8 @@ static int hpt_ioctl(ioctl_dev_t dev, u_ goto invalid; } -#if (__FreeBSD_version >= 500000) - mtx_lock(&Giant); -#endif - hpt_do_ioctl(&ioctl_args); -#if (__FreeBSD_version >= 500000) - mtx_unlock(&Giant); -#endif - if (ioctl_args.result==HPT_IOCTL_RESULT_OK) { if (piop->nOutBufferSize) { if (copyout(ioctl_args.lpOutBuffer, @@ -1341,8 +1296,6 @@ static int hpt_rescan_bus(void) PVBUS vbus; PVBUS_EXT vbus_ext; - mtx_lock(&Giant); - ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) { @@ -1356,6 +1309,5 @@ static int hpt_rescan_bus(void) } xpt_rescan(ccb); } - mtx_unlock(&Giant); return(0); } Modified: head/sys/dev/hptnr/os_bsd.h ============================================================================== --- head/sys/dev/hptnr/os_bsd.h Tue Aug 5 23:35:19 2014 (r269612) +++ head/sys/dev/hptnr/os_bsd.h Tue Aug 5 23:39:35 2014 (r269613) @@ -40,12 +40,8 @@ #include #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include /*to support DELAY function under 4.x BSD versions*/ -#endif #include #include @@ -53,11 +49,9 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include #include -#endif #include #include @@ -65,9 +59,7 @@ #include #include -#if __FreeBSD_version >= 500043 #include -#endif #include #include #include @@ -75,17 +67,8 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#endif - -#if (__FreeBSD_version <= 500043) -#include -#endif #include #include @@ -97,10 +80,6 @@ #include #include -#if (__FreeBSD_version < 500043) -#include -#endif - typedef struct _INQUIRYDATA { u_char DeviceType : 5; @@ -176,7 +155,7 @@ typedef struct _os_cmdext { struct _os_cmdext *next; union ccb *ccb; bus_dmamap_t dma_map; - struct callout_handle timeout_ch; + struct callout timeout; SG psg[os_max_sg_descriptors]; } OS_CMDEXT, *POS_CMDEXT; @@ -190,11 +169,7 @@ typedef struct _vbus_ext { struct cam_sim *sim; /* sim for this vbus */ struct cam_path *path; /* peripheral, path, tgt, lun with this vbus */ -#if (__FreeBSD_version >= 500000) struct mtx lock; /* general purpose lock */ -#else - int hpt_splx; -#endif bus_dma_tag_t io_dmat; /* I/O buffer DMA tag */ POS_CMDEXT cmdext_list; @@ -202,7 +177,7 @@ typedef struct _vbus_ext { OSM_TASK *tasks; struct task worker; - struct callout_handle timer; + struct callout timer; eventhandler_tag shutdown_eh; @@ -211,19 +186,9 @@ typedef struct _vbus_ext { } VBUS_EXT, *PVBUS_EXT; -#if __FreeBSD_version >= 500000 #define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock) #define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock) -#else -static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext) -{ - vbus_ext->hpt_splx = splcam(); -} -static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext) -{ - splx(vbus_ext->hpt_splx); -} -#endif +#define hpt_assert_vbus_locked(vbus_ext) mtx_assert(&(vbus_ext)->lock, MA_OWNED) #define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */ @@ -232,36 +197,9 @@ static __inline void hpt_unlock_vbus(PVB #define HPT_SCAN_BUS _IO('H', 1) -#if __FreeBSD_version >= 501000 -#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi_giant,(task)); -#else #define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi,(task)); -#endif -#if __FreeBSD_version >= 500000 static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) { return msleep(ident, &vbus_ext->lock, priority, wmesg, timo); } -#else -static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) -{ - int retval = 0; - - asleep(ident, priority, wmesg, timo); - hpt_unlock_vbus(vbus_ext); - retval = await(priority, timo); - hpt_lock_vbus(vbus_ext); - - return retval; -} -#endif - -#if __FreeBSD_version < 501000 -#define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e -#endif - -#define HPT_DEV_MAJOR 200 - From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:41:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3C8FB52 for ; Tue, 5 Aug 2014 23:41:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84C2227B6 for ; Tue, 5 Aug 2014 23:41:40 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 5eeb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:41:40 +0000 From: Marcel Moolenaar Date: Tue, 5 Aug 2014 23:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269614 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16bb4.5eeb.2ac18d4c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:41:40 -0000 Author: marcel Date: Tue Aug 5 23:41:40 2014 New Revision: 269614 URL: http://svnweb.freebsd.org/changeset/base/269614 Log: In file_loadraw() print the name of the file as well as its size so that we know what file is being loaded and how big the file is once complete. This has ELF modules and disk images emit the same output. Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Aug 5 23:39:35 2014 (r269613) +++ head/sys/boot/common/module.c Tue Aug 5 23:41:40 2014 (r269614) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" @@ -387,6 +388,8 @@ file_loadraw(char *name, char *type) if (archsw.arch_loadaddr != NULL) loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); + printf("%s ", name); + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -401,7 +404,9 @@ file_loadraw(char *name, char *type) } laddr += got; } - + + printf("size=%#jx\n", (uintmax_t)(laddr - loadaddr)); + /* Looks OK so far; create & populate control structure */ fp = file_alloc(); fp->f_name = strdup(name); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:47:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A97F8CF2 for ; Tue, 5 Aug 2014 23:47:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91ECA27EC for ; Tue, 5 Aug 2014 23:47:27 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 5f06 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:47:27 +0000 From: John Baldwin Date: Tue, 5 Aug 2014 23:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269615 - head/sys/dev/hptrr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16d0f.5f06.48812b5e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:47:27 -0000 Author: jhb Date: Tue Aug 5 23:47:26 2014 New Revision: 269615 URL: http://svnweb.freebsd.org/changeset/base/269615 Log: Various fixes to hptrr(4): - Use the existing vbus locks instead of Giant for the CAM sim lock. - Use callout(9) instead of timeout(9). - Mark the interrupt handler MPSAFE. - Don't attempt to pass data in the softc from probe() to attach(). - Remove compat shims for FreeBSD versions older than 8.0. Reviewed by: Steve Chang Modified: head/sys/dev/hptrr/hptrr_os_bsd.c head/sys/dev/hptrr/hptrr_osm_bsd.c head/sys/dev/hptrr/os_bsd.h Modified: head/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_os_bsd.c Tue Aug 5 23:41:40 2014 (r269614) +++ head/sys/dev/hptrr/hptrr_os_bsd.c Tue Aug 5 23:47:26 2014 (r269615) @@ -220,9 +220,9 @@ void os_request_timer(void * osext, HPT PVBUS_EXT vbus_ext = osext; HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - - untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); - vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); + + callout_reset(&vbus_ext->timer, interval * hz / 1000000, + os_timer_for_ldm, vbus_ext); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Tue Aug 5 23:41:40 2014 (r269614) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Tue Aug 5 23:47:26 2014 (r269615) @@ -39,32 +39,38 @@ __FBSDID("$FreeBSD$"); static int attach_generic = 0; TUNABLE_INT("hw.hptrr.attach_generic", &attach_generic); -static int hpt_probe(device_t dev) +static HIM *hpt_match(device_t dev) { PCI_ID pci_id; - HIM *him; int i; - PHBA hba; + HIM *him; /* Some of supported chips are used not only by HPT. */ if (pci_get_vendor(dev) != 0x1103 && !attach_generic) - return (ENXIO); + return (NULL); for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { if ((pci_get_vendor(dev) == pci_id.vid) && (pci_get_device(dev) == pci_id.did)){ - KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", - pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) - )); - device_set_desc(dev, him->name); - hba = (PHBA)device_get_softc(dev); - memset(hba, 0, sizeof(HBA)); - hba->ext_type = EXT_TYPE_HBA; - hba->ldm_adapter.him = him; - return (BUS_PROBE_DEFAULT); + return (him); } } } + return (NULL); +} + +static int hpt_probe(device_t dev) +{ + HIM *him; + + him = hpt_match(dev); + if (him != NULL) { + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + return (BUS_PROBE_DEFAULT); + } return (ENXIO); } @@ -72,17 +78,19 @@ static int hpt_probe(device_t dev) static int hpt_attach(device_t dev) { PHBA hba = (PHBA)device_get_softc(dev); - HIM *him = hba->ldm_adapter.him; + HIM *him; PCI_ID pci_id; HPT_UINT size; PVBUS vbus; PVBUS_EXT vbus_ext; KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); - -#if __FreeBSD_version >=440000 + + him = hpt_match(dev); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; + pci_enable_busmaster(dev); -#endif pci_id.vid = pci_get_vendor(dev); pci_id.did = pci_get_device(dev); @@ -90,8 +98,6 @@ static int hpt_attach(device_t dev) size = him->get_adapter_size(&pci_id); hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); - if (!hba->ldm_adapter.him_handle) - return ENXIO; hba->pcidev = dev; hba->pciaddr.tree = 0; @@ -101,7 +107,7 @@ static int hpt_attach(device_t dev) if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; + return ENXIO; } os_printk("adapter at PCI %d:%d:%d, IRQ %d", @@ -109,12 +115,8 @@ static int hpt_attach(device_t dev) if (!ldm_register_adapter(&hba->ldm_adapter)) { size = ldm_get_vbus_size(); - vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); - if (!vbus_ext) { - free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; - } - memset(vbus_ext, 0, sizeof(VBUS_EXT)); + vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK | + M_ZERO); vbus_ext->ext_type = EXT_TYPE_VBUS; ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); ldm_register_adapter(&hba->ldm_adapter); @@ -295,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus KdPrint(("flusing dev %p", vd)); - hpt_lock_vbus(vbus_ext); + hpt_assert_vbus_locked(vbus_ext); if (mIsArray(vd->type) && vd->u.array.transform) count = MAX(vd->u.array.transform->source->cmds_per_request, @@ -306,7 +308,6 @@ static int hpt_flush_vdev(PVBUS_EXT vbus pCmd = ldm_alloc_cmds(vd->vbus, count); if (!pCmd) { - hpt_unlock_vbus(vbus_ext); return -1; } @@ -332,8 +333,6 @@ static int hpt_flush_vdev(PVBUS_EXT vbus ldm_free_cmds(pCmd); - hpt_unlock_vbus(vbus_ext); - return result; } @@ -348,6 +347,7 @@ static void hpt_shutdown_vbus(PVBUS_EXT /* stop all ctl tasks and disable the worker taskqueue */ hpt_stop_tasks(vbus_ext); + hpt_lock_vbus(vbus_ext); vbus_ext->worker.ta_context = 0; /* flush devices */ @@ -360,7 +360,6 @@ static void hpt_shutdown_vbus(PVBUS_EXT } } - hpt_lock_vbus(vbus_ext); ldm_shutdown(vbus); hpt_unlock_vbus(vbus_ext); @@ -376,6 +375,8 @@ static void hpt_shutdown_vbus(PVBUS_EXT free(hba->ldm_adapter.him_handle, M_DEVBUF); } + callout_drain(&vbus_ext->timer); + mtx_destroy(&vbus_ext->lock); free(vbus_ext, M_DEVBUF); KdPrint(("hpt_shutdown_vbus done")); } @@ -439,8 +440,8 @@ static void os_cmddone(PCOMMAND pCmd) union ccb *ccb = ext->ccb; KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result)); - - untimeout(hpt_timeout, pCmd, ext->timeout_ch); + + callout_stop(&ext->timeout); switch(pCmd->Result) { case RETURN_SUCCESS: @@ -528,7 +529,7 @@ static void hpt_io_dmamap_callback(void BUS_DMASYNC_PREWRITE); } } - ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT); + callout_reset(&ext->timeout, HPT_OSM_TIMEOUT, hpt_timeout, pCmd); ldm_queue_cmd(pCmd); } @@ -745,18 +746,15 @@ static void hpt_action(struct cam_sim *s KdPrint(("hpt_action(fn=%d, id=%d)", ccb->ccb_h.func_code, ccb->ccb_h.target_id)); + hpt_assert_vbus_locked(vbus_ext); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: - hpt_lock_vbus(vbus_ext); hpt_scsi_io(vbus_ext, ccb); - hpt_unlock_vbus(vbus_ext); return; case XPT_RESET_BUS: - hpt_lock_vbus(vbus_ext); ldm_reset_vbus((PVBUS)vbus_ext->vbus); - hpt_unlock_vbus(vbus_ext); break; case XPT_GET_TRAN_SETTINGS: @@ -765,14 +763,7 @@ static void hpt_action(struct cam_sim *s break; case XPT_CALC_GEOMETRY: -#if __FreeBSD_version >= 500000 cam_calc_geometry(&ccb->ccg, 1); -#else - ccb->ccg.heads = 255; - ccb->ccg.secs_per_track = 63; - ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); - ccb->ccb_h.status = CAM_REQ_CMP; -#endif break; case XPT_PATH_INQ: @@ -821,7 +812,9 @@ static void hpt_pci_intr(void *arg) static void hpt_poll(struct cam_sim *sim) { - hpt_pci_intr(cam_sim_softc(sim)); + PVBUS_EXT vbus_ext = cam_sim_softc(sim); + hpt_assert_vbus_locked(vbus_ext); + ldm_intr((PVBUS)vbus_ext->vbus); } static void hpt_async(void * callback_arg, u_int32_t code, struct cam_path * path, void * arg) @@ -970,19 +963,7 @@ static struct cdevsw hpt_cdevsw = { .d_close = hpt_close, .d_ioctl = hpt_ioctl, .d_name = driver_name, -#if __FreeBSD_version>=503000 .d_version = D_VERSION, -#endif -#if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, -#endif -#if __FreeBSD_version<600034 -#if __FreeBSD_version>501000 - .d_maj = MAJOR_AUTO, -#else - .d_maj = HPT_DEV_MAJOR, -#endif -#endif }; static struct intr_config_hook hpt_ich; @@ -1019,7 +1000,8 @@ static void hpt_final_init(void *dummy) /* initializing hardware */ ldm_for_each_vbus(vbus, vbus_ext) { /* make timer available here */ - callout_handle_init(&vbus_ext->timer); + mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); + callout_init_mtx(&vbus_ext->timer, &vbus_ext->lock, 0); if (hpt_init_vbus(vbus_ext)) { os_printk("fail to initialize hardware"); break; /* FIXME */ @@ -1031,9 +1013,6 @@ static void hpt_final_init(void *dummy) struct cam_devq *devq; struct ccb_setasync ccb; -#if (__FreeBSD_version >= 500000) - mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); -#endif if (bus_dma_tag_create(NULL,/* parent */ 4, /* alignment */ BUS_SPACE_MAXADDR_32BIT+1, /* boundary */ @@ -1044,10 +1023,8 @@ static void hpt_final_init(void *dummy) os_max_sg_descriptors, /* nsegments */ 0x10000, /* maxsegsize */ BUS_DMA_WAITOK, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ &vbus_ext->lock, /* lockfuncarg */ -#endif &vbus_ext->io_dmat /* tag */)) { return ; @@ -1067,7 +1044,7 @@ static void hpt_final_init(void *dummy) os_printk("Can't create dma map(%d)", i); return ; } - callout_handle_init(&ext->timeout_ch); + callout_init_mtx(&ext->timeout, &vbus_ext->lock, 0); } if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) { @@ -1075,13 +1052,9 @@ static void hpt_final_init(void *dummy) return ; } -#if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, &Giant, os_max_queue_comm, /*tagged*/8, devq); -#else - vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, os_max_queue_comm, /*tagged*/8, devq); -#endif + vbus_ext, 0, &vbus_ext->lock, os_max_queue_comm, + /*tagged*/8, devq); if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); @@ -1089,13 +1062,11 @@ static void hpt_final_init(void *dummy) return ; } -#if __FreeBSD_version > 700044 + hpt_lock_vbus(vbus_ext); if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) { -#else - if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) { -#endif os_printk("xpt_bus_register failed"); cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE); + hpt_unlock_vbus(vbus_ext); vbus_ext->sim = NULL; return ; } @@ -1107,9 +1078,11 @@ static void hpt_final_init(void *dummy) os_printk("xpt_create_path failed"); xpt_bus_deregister(cam_sim_path(vbus_ext->sim)); cam_sim_free(vbus_ext->sim, /*free_devq*/TRUE); + hpt_unlock_vbus(vbus_ext); vbus_ext->sim = NULL; return ; } + hpt_unlock_vbus(vbus_ext); xpt_setup_ccb(&ccb.ccb_h, vbus_ext->path, /*priority*/5); ccb.ccb_h.func_code = XPT_SASYNC_CB; @@ -1127,12 +1100,8 @@ static void hpt_final_init(void *dummy) return ; } - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, -#if __FreeBSD_version > 700025 + if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#else - hpt_pci_intr, vbus_ext, &hba->irq_handle)) -#endif { os_printk("can't set up interrupt"); return ; @@ -1156,7 +1125,7 @@ static void hpt_final_init(void *dummy) S_IRUSR | S_IWUSR, "%s", driver_name); } -#if defined(KLD_MODULE) && (__FreeBSD_version >= 503000) +#if defined(KLD_MODULE) typedef struct driverlink *driverlink_t; struct driverlink { @@ -1248,29 +1217,17 @@ __DRIVER_MODULE(TARGETNAME, pci, hpt_pci __MODULE_VERSION(TARGETNAME, 1); __MODULE_DEPEND(TARGETNAME, cam, 1, 1, 1); -#if __FreeBSD_version>503000 -typedef struct cdev * ioctl_dev_t; -#else -typedef dev_t ioctl_dev_t; -#endif - -#if __FreeBSD_version >= 500000 -typedef struct thread * ioctl_thread_t; -#else -typedef struct proc * ioctl_thread_t; -#endif - -static int hpt_open(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_open(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_close(ioctl_dev_t dev, int flags, int devtype, ioctl_thread_t td) +static int hpt_close(struct cdev *dev, int flags, int devtype, struct thread *td) { return 0; } -static int hpt_ioctl(ioctl_dev_t dev, u_long cmd, caddr_t data, int fflag, ioctl_thread_t td) +static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; @@ -1309,16 +1266,8 @@ static int hpt_ioctl(ioctl_dev_t dev, u_ goto invalid; } -#if (__FreeBSD_version >= 500000) - mtx_lock(&Giant); -#endif - hpt_do_ioctl(&ioctl_args); -#if (__FreeBSD_version >= 500000) - mtx_unlock(&Giant); -#endif - if (ioctl_args.result==HPT_IOCTL_RESULT_OK) { if (piop->nOutBufferSize) { if (copyout(ioctl_args.lpOutBuffer, @@ -1359,10 +1308,6 @@ static int hpt_rescan_bus(void) PVBUS vbus; PVBUS_EXT vbus_ext; -#if (__FreeBSD_version >= 500000) - mtx_lock(&Giant); -#endif - ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); @@ -1375,9 +1320,5 @@ static int hpt_rescan_bus(void) xpt_rescan(ccb); } -#if (__FreeBSD_version >= 500000) - mtx_unlock(&Giant); -#endif - return(0); } Modified: head/sys/dev/hptrr/os_bsd.h ============================================================================== --- head/sys/dev/hptrr/os_bsd.h Tue Aug 5 23:41:40 2014 (r269614) +++ head/sys/dev/hptrr/os_bsd.h Tue Aug 5 23:47:26 2014 (r269615) @@ -42,12 +42,8 @@ #include #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include /*to support DELAY function under 4.x BSD versions*/ -#endif #include #include @@ -55,11 +51,9 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include #include -#endif #include #include @@ -74,17 +68,8 @@ #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#endif - -#if (__FreeBSD_version <= 500043) -#include -#endif #include #include @@ -95,9 +80,6 @@ #include #include -#if (__FreeBSD_version < 500043) -#include -#endif typedef struct _INQUIRYDATA { @@ -174,7 +156,7 @@ typedef struct _os_cmdext { struct _os_cmdext *next; union ccb *ccb; bus_dmamap_t dma_map; - struct callout_handle timeout_ch; + struct callout timeout; SG psg[os_max_sg_descriptors]; } OS_CMDEXT, *POS_CMDEXT; @@ -188,11 +170,7 @@ typedef struct _vbus_ext { struct cam_sim *sim; /* sim for this vbus */ struct cam_path *path; /* peripheral, path, tgt, lun with this vbus */ -#if (__FreeBSD_version >= 500000) struct mtx lock; /* general purpose lock */ -#else - int hpt_splx; -#endif bus_dma_tag_t io_dmat; /* I/O buffer DMA tag */ POS_CMDEXT cmdext_list; @@ -200,7 +178,7 @@ typedef struct _vbus_ext { OSM_TASK *tasks; struct task worker; - struct callout_handle timer; + struct callout timer; eventhandler_tag shutdown_eh; @@ -209,19 +187,9 @@ typedef struct _vbus_ext { } VBUS_EXT, *PVBUS_EXT; -#if __FreeBSD_version >= 500000 #define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock) #define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock) -#else -static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext) -{ - vbus_ext->hpt_splx = splcam(); -} -static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext) -{ - splx(vbus_ext->hpt_splx); -} -#endif +#define hpt_assert_vbus_locked(vbus_ext) mtx_assert(&(vbus_ext)->lock, MA_OWNED) #define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */ @@ -230,35 +198,9 @@ static __inline void hpt_unlock_vbus(PVB #define HPT_SCAN_BUS _IO('H', 1) -#if __FreeBSD_version >= 501000 -#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi_giant,(task)); -#else #define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi,(task)); -#endif -#if __FreeBSD_version >= 500000 static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) { return msleep(ident, &vbus_ext->lock, priority, wmesg, timo); } -#else -static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo) -{ - int retval = 0; - - asleep(ident, priority, wmesg, timo); - hpt_unlock_vbus(vbus_ext); - retval = await(priority, timo); - hpt_lock_vbus(vbus_ext); - - return retval; -} -#endif - -#if __FreeBSD_version < 501000 -#define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e -#endif - -#define HPT_DEV_MAJOR 200 From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:55:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E375DE91 for ; Tue, 5 Aug 2014 23:55:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAE362898 for ; Tue, 5 Aug 2014 23:55:23 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 535b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:55:23 +0000 From: Marcel Moolenaar Date: Tue, 5 Aug 2014 23:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269616 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16eeb.535b.389e3ae4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:55:24 -0000 Author: marcel Date: Tue Aug 5 23:55:23 2014 New Revision: 269616 URL: http://svnweb.freebsd.org/changeset/base/269616 Log: In command_lsmod() prevent overrunning lbuf due to long path names. Call pager_output() separately for the module name. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Aug 5 23:47:26 2014 (r269615) +++ head/sys/boot/common/module.c Tue Aug 5 23:55:23 2014 (r269616) @@ -237,8 +237,10 @@ command_lsmod(int argc, char *argv[]) pager_open(); for (fp = preloaded_files; fp; fp = fp->f_next) { - sprintf(lbuf, " %p: %s (%s, 0x%lx)\n", - (void *) fp->f_addr, fp->f_name, fp->f_type, (long) fp->f_size); + sprintf(lbuf, " %p: ", (void *) fp->f_addr); + pager_output(lbuf); + pager_output(fp->f_name); + sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); pager_output(lbuf); if (fp->f_args != NULL) { pager_output(" args: "); From owner-svn-src-head@FreeBSD.ORG Tue Aug 5 23:58:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 768A3FEB for ; Tue, 5 Aug 2014 23:58:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A93928AD for ; Tue, 5 Aug 2014 23:58:50 +0000 (UTC) Received: from jhb (uid 793) (envelope-from jhb@FreeBSD.org) id 5382 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 23:58:49 +0000 From: John Baldwin Date: Tue, 5 Aug 2014 23:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269617 - head/sys/dev/hptmv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e16fb9.5382.2579e38f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 23:58:50 -0000 Author: jhb Date: Tue Aug 5 23:58:49 2014 New Revision: 269617 URL: http://svnweb.freebsd.org/changeset/base/269617 Log: Various fixes to hptmv(4): - Replace the global driver lock with a per-instance device lock. - Use the per-instance device lock instead of Giant for the CAM sim lock. - Add global locks to protect the adapter list and DPC queues. - Use wakeup() and mtx_sleep() to wait for certain events like the controller going idle rather than polling via timeouts passed to tsleep(). - Use callout(9) instead of timeout(9). - Mark the interrupt handler MPSAFE. - Remove compat shims for FreeBSD versions older than 8.0. Reviewed by: Steve Chang Modified: head/sys/dev/hptmv/entry.c head/sys/dev/hptmv/global.h head/sys/dev/hptmv/hptproc.c head/sys/dev/hptmv/ioctl.c head/sys/dev/hptmv/mv.c head/sys/dev/hptmv/osbsd.h Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Tue Aug 5 23:55:23 2014 (r269616) +++ head/sys/dev/hptmv/entry.c Tue Aug 5 23:58:49 2014 (r269617) @@ -40,20 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 500000) #include #include -#endif +#include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#include -#include -#endif #ifndef __KERNEL__ #define __KERNEL__ @@ -119,6 +111,7 @@ static void HPTLIBAPI fOsCommandDone(_VB static void ccb_done(union ccb *ccb); static void hpt_queue_ccb(union ccb **ccb_Q, union ccb *ccb); static void hpt_free_ccb(union ccb **ccb_Q, union ccb *ccb); +static void hpt_intr_locked(IAL_ADAPTER_T *pAdapter); static void hptmv_free_edma_queues(IAL_ADAPTER_T *pAdapter); static void hptmv_free_channel(IAL_ADAPTER_T *pAdapter, MV_U8 channelNum); static void handleEdmaError(_VBUS_ARG PCommand pCmd); @@ -143,6 +136,8 @@ static MV_BOOLEAN hptmv_event_notify(MV_ #define ccb_ccb_ptr spriv_ptr0 #define ccb_adapter ccb_h.spriv_ptr1 +static struct sx hptmv_list_lock; +SX_SYSINIT(hptmv_list_lock, &hptmv_list_lock, "hptmv list"); IAL_ADAPTER_T *gIal_Adapter = 0; IAL_ADAPTER_T *pCurAdapter = 0; static MV_SATA_CHANNEL gMvSataChannels[MAX_VBUS][MV_SATA_CHANNELS_NUM]; @@ -159,48 +154,11 @@ UCHAR DPC_Request_Nums = 0; static ST_HPT_DPC DpcQueue[MAX_DPC]; static int DpcQueue_First=0; static int DpcQueue_Last = 0; +static struct mtx DpcQueue_Lock; +MTX_SYSINIT(hpmtv_dpc_lock, &DpcQueue_Lock, "hptmv dpc", MTX_DEF); char DRIVER_VERSION[] = "v1.16"; -#if (__FreeBSD_version >= 500000) -static struct mtx driver_lock; -intrmask_t lock_driver() -{ - - intrmask_t spl = 0; - mtx_lock(&driver_lock); - return spl; -} -void unlock_driver(intrmask_t spl) -{ - mtx_unlock(&driver_lock); -} -#else -static int driver_locked = 0; -intrmask_t lock_driver() -{ - intrmask_t spl = splcam(); -loop: - while (driver_locked) - tsleep(&driver_locked, PRIBIO, "hptlck", hz); - atomic_add_int(&driver_locked, 1); - if (driver_locked>1) { - atomic_subtract_int(&driver_locked, 1); - goto loop; - } - return spl; -} - -void unlock_driver(intrmask_t spl) -{ - atomic_subtract_int(&driver_locked, 1); - if (driver_locked==0) { - wakeup(&driver_locked); - } - splx(spl); -} -#endif - /******************************************************************************* * Name: hptmv_free_channel * @@ -790,7 +748,8 @@ hptmv_handle_event(void * data, int flag IAL_ADAPTER_T *pAdapter = (IAL_ADAPTER_T *)data; MV_SATA_ADAPTER *pMvSataAdapter = &pAdapter->mvSataAdapter; MV_U8 channelIndex; - + + mtx_assert(&pAdapter->lock, MA_OWNED); /* mvOsSemTake(&pMvSataAdapter->semaphore); */ for (channelIndex = 0; channelIndex < MV_SATA_CHANNELS_NUM; channelIndex++) { @@ -898,7 +857,7 @@ hptmv_event_notify(MV_SATA_ADAPTER *pMvS KdPrint(("RR18xx [%d,%d]: device connected event received\n", pMvSataAdapter->adapterId, channel)); /* Delete previous timers (if multiple drives connected in the same time */ - pAdapter->event_timer_connect = timeout(hptmv_handle_event_connect, pAdapter, 10*hz); + callout_reset(&pAdapter->event_timer_connect, 10 * hz, hptmv_handle_event_connect, pAdapter); } else if (param1 == EVENT_DISCONNECT) { @@ -907,7 +866,7 @@ hptmv_event_notify(MV_SATA_ADAPTER *pMvS pMvSataAdapter->adapterId, channel)); device_change(pAdapter, channel, FALSE); /* Delete previous timers (if multiple drives disconnected in the same time */ - /*pAdapter->event_timer_disconnect = timeout(hptmv_handle_event_disconnect, pAdapter, 10*hz); */ + /*callout_reset(&pAdapter->event_timer_disconnect, 10 * hz, hptmv_handle_event_disconnect, pAdapter); */ /*It is not necessary to wait, handle it directly*/ hptmv_handle_event_disconnect(pAdapter); } @@ -1286,18 +1245,6 @@ dmamap_put(PBUS_DMAMAP p) p->pAdapter->pbus_dmamap_list = p; } -/*Since mtx not provide the initialize when declare, so we Final init here to initialize the global mtx*/ -#if __FreeBSD_version >= 500000 -#define override_kernel_driver() - -static void hpt_init(void *dummy) -{ - override_kernel_driver(); - mtx_init(&driver_lock, "hptsleeplock", NULL, MTX_DEF); -} -SYSINIT(hptinit, SI_SUB_CONFIGURE, SI_ORDER_FIRST, hpt_init, NULL); -#endif - static int num_adapters = 0; static int init_adapter(IAL_ADAPTER_T *pAdapter) @@ -1308,8 +1255,11 @@ init_adapter(IAL_ADAPTER_T *pAdapter) PVDevice pVDev; - intrmask_t oldspl = lock_driver(); + mtx_init(&pAdapter->lock, "hptsleeplock", NULL, MTX_DEF); + callout_init_mtx(&pAdapter->event_timer_connect, &pAdapter->lock, 0); + callout_init_mtx(&pAdapter->event_timer_disconnect, &pAdapter->lock, 0); + sx_xlock(&hptmv_list_lock); pAdapter->next = 0; if(gIal_Adapter == 0){ @@ -1320,6 +1270,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) pCurAdapter->next = pAdapter; pCurAdapter = pAdapter; } + sx_xunlock(&hptmv_list_lock); pAdapter->outstandingCommands = 0; @@ -1337,10 +1288,8 @@ init_adapter(IAL_ADAPTER_T *pAdapter) MAX_SG_DESCRIPTORS, /* nsegments */ 0x10000, /* maxsegsize */ BUS_DMA_WAITOK, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ - &driver_lock, /* lockfuncarg */ -#endif + &pAdapter->lock, /* lockfuncarg */ &pAdapter->io_dma_parent /* tag */)) { return ENXIO; @@ -1350,7 +1299,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) if (hptmv_allocate_edma_queues(pAdapter)) { MV_ERROR("RR18xx: Failed to allocate memory for EDMA queues\n"); - unlock_driver(oldspl); return ENOMEM; } @@ -1363,7 +1311,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx: Failed to remap memory space\n"); hptmv_free_edma_queues(pAdapter); - unlock_driver(oldspl); return ENXIO; } else @@ -1393,7 +1340,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) unregister: bus_release_resource(pAdapter->hpt_dev, SYS_RES_MEMORY, rid, pAdapter->mem_res); hptmv_free_edma_queues(pAdapter); - unlock_driver(oldspl); return ENXIO; } pAdapter->ver_601 = pMvSataAdapter->pcbVersion; @@ -1438,7 +1384,7 @@ unregister: free(pAdapter->pbus_dmamap, M_DEVBUF); goto unregister; } - callout_handle_init(&pmap->timeout_ch); + callout_init_mtx(&pmap->timeout, &pAdapter->lock, 0); } /* setup PRD Tables */ KdPrint(("Allocate PRD Tables\n")); @@ -1537,7 +1483,6 @@ unregister: #endif mvSataUnmaskAdapterInterrupt(pMvSataAdapter); - unlock_driver(oldspl); return 0; } @@ -2036,20 +1981,7 @@ hpt_attach(device_t dev) struct cam_devq *devq; struct cam_sim *hpt_vsim; - printf("%s Version %s \n", DRIVER_NAME, DRIVER_VERSION); - - if (!pAdapter) - { - pAdapter = (IAL_ADAPTER_T *)malloc(sizeof (IAL_ADAPTER_T), M_DEVBUF, M_NOWAIT); -#if __FreeBSD_version > 410000 - device_set_softc(dev, (void *)pAdapter); -#else - device_set_driver(dev, (driver_t *)pAdapter); -#endif - } - - if (!pAdapter) return (ENOMEM); - bzero(pAdapter, sizeof(IAL_ADAPTER_T)); + device_printf(dev, "%s Version %s \n", DRIVER_NAME, DRIVER_VERSION); pAdapter->hpt_dev = dev; @@ -2064,13 +1996,9 @@ hpt_attach(device_t dev) return(ENXIO); } -#if __FreeBSD_version <700000 - if (bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, - hpt_intr, pAdapter, &pAdapter->hpt_intr)) -#else - if (bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, INTR_TYPE_CAM, + if (bus_setup_intr(pAdapter->hpt_dev, pAdapter->hpt_irq, + INTR_TYPE_CAM | INTR_MPSAFE, NULL, hpt_intr, pAdapter, &pAdapter->hpt_intr)) -#endif { hpt_printk(("can't set up interrupt\n")); free(pAdapter, M_DEVBUF); @@ -2100,25 +2028,19 @@ hpt_attach(device_t dev) /* * Construct our SIM entry */ -#if __FreeBSD_version <700000 - hpt_vsim = cam_sim_alloc(hpt_action, hpt_poll, __str(PROC_DIR_NAME), - pAdapter, device_get_unit(pAdapter->hpt_dev), 1, 8, devq); -#else hpt_vsim = cam_sim_alloc(hpt_action, hpt_poll, __str(PROC_DIR_NAME), - pAdapter, device_get_unit(pAdapter->hpt_dev), &Giant, 1, 8, devq); -#endif + pAdapter, device_get_unit(pAdapter->hpt_dev), + &pAdapter->lock, 1, 8, devq); if (hpt_vsim == NULL) { cam_simq_free(devq); return ENOMEM; } -#if __FreeBSD_version <700000 - if (xpt_bus_register(hpt_vsim, 0) != CAM_SUCCESS) -#else + mtx_lock(&pAdapter->lock); if (xpt_bus_register(hpt_vsim, dev, 0) != CAM_SUCCESS) -#endif { cam_sim_free(hpt_vsim, /*free devq*/ TRUE); + mtx_unlock(&pAdapter->lock); hpt_vsim = NULL; return ENXIO; } @@ -2129,9 +2051,11 @@ hpt_attach(device_t dev) { xpt_bus_deregister(cam_sim_path(hpt_vsim)); cam_sim_free(hpt_vsim, /*free_devq*/TRUE); + mtx_unlock(&pAdapter->lock); hpt_vsim = NULL; return ENXIO; } + mtx_unlock(&pAdapter->lock); xpt_setup_ccb(&(ccb->ccb_h), pAdapter->path, /*priority*/5); ccb->ccb_h.func_code = XPT_SASYNC_CB; @@ -2164,7 +2088,11 @@ hpt_detach(device_t dev) static void hpt_poll(struct cam_sim *sim) { - hpt_intr((void *)cam_sim_softc(sim)); + IAL_ADAPTER_T *pAdapter; + + pAdapter = cam_sim_softc(sim); + + hpt_intr_locked((void *)cam_sim_softc(sim)); } /**************************************************************** @@ -2174,9 +2102,19 @@ hpt_poll(struct cam_sim *sim) static void hpt_intr(void *arg) { - IAL_ADAPTER_T *pAdapter = (IAL_ADAPTER_T *)arg; - intrmask_t oldspl = lock_driver(); - + IAL_ADAPTER_T *pAdapter; + + pAdapter = arg; + mtx_lock(&pAdapter->lock); + hpt_intr_locked(pAdapter); + mtx_unlock(&pAdapter->lock); +} + +static void +hpt_intr_locked(IAL_ADAPTER_T *pAdapter) +{ + + mtx_assert(&pAdapter->lock, MA_OWNED); /* KdPrintI(("----- Entering Isr() -----\n")); */ if (mvSataInterruptServiceRoutine(&pAdapter->mvSataAdapter) == MV_TRUE) { @@ -2185,7 +2123,6 @@ hpt_intr(void *arg) } /* KdPrintI(("----- Leaving Isr() -----\n")); */ - unlock_driver(oldspl); } /********************************************************** @@ -2228,11 +2165,11 @@ hpt_shutdown(device_t dev) IAL_ADAPTER_T *pAdapter; pAdapter = device_get_softc(dev); - if (pAdapter == NULL) - return (EINVAL); EVENTHANDLER_DEREGISTER(shutdown_final, pAdapter->eh); + mtx_lock(&pAdapter->lock); FlushAdapter(pAdapter); + mtx_unlock(&pAdapter->lock); /* give the flush some time to happen, *otherwise "shutdown -p now" will make file system corrupted */ DELAY(1000 * 1000 * 5); @@ -2288,6 +2225,7 @@ ccb_done(union ccb *ccb) { if(DPC_Request_Nums == 0) Check_Idle_Call(pAdapter); + wakeup(pAdapter); } } @@ -2301,11 +2239,11 @@ ccb_done(union ccb *ccb) void hpt_action(struct cam_sim *sim, union ccb *ccb) { - intrmask_t oldspl; IAL_ADAPTER_T * pAdapter = (IAL_ADAPTER_T *) cam_sim_softc(sim); PBUS_DMAMAP pmap; _VBUS_INST(&pAdapter->VBus) + mtx_assert(&pAdapter->lock, MA_OWNED); CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("hpt_action\n")); KdPrint(("hpt_action(%lx,%lx{%x})\n", (u_long)sim, (u_long)ccb, ccb->ccb_h.func_code)); @@ -2327,7 +2265,6 @@ hpt_action(struct cam_sim *sim, union cc return; } - oldspl = lock_driver(); if (pAdapter->outstandingCommands==0 && DPC_Request_Nums==0) Check_Idle_Call(pAdapter); @@ -2340,7 +2277,6 @@ hpt_action(struct cam_sim *sim, union cc hpt_queue_ccb(&pAdapter->pending_Q, ccb); else OsSendCommand(_VBUS_P ccb); - unlock_driver(oldspl); /* KdPrint(("leave scsiio\n")); */ break; @@ -2348,9 +2284,7 @@ hpt_action(struct cam_sim *sim, union cc case XPT_RESET_BUS: KdPrint(("reset bus\n")); - oldspl = lock_driver(); fResetVBus(_VBUS_P0); - unlock_driver(oldspl); xpt_done(ccb); break; @@ -2374,29 +2308,7 @@ hpt_action(struct cam_sim *sim, union cc break; case XPT_CALC_GEOMETRY: -#if __FreeBSD_version >= 500000 cam_calc_geometry(&ccb->ccg, 1); -#else - { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - - ccg = &ccb->ccg; - size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size); - - if (size_mb > 1024 ) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; - } -#endif xpt_done(ccb); break; @@ -2482,20 +2394,20 @@ hpt_free_ccb(union ccb **ccb_Q, union cc ***************************************************************************/ static void hpt_worker_thread(void) { - intrmask_t oldspl; for(;;) { + mtx_lock(&DpcQueue_Lock); while (DpcQueue_First!=DpcQueue_Last) { ST_HPT_DPC p; - oldspl = lock_driver(); p = DpcQueue[DpcQueue_First]; DpcQueue_First++; DpcQueue_First %= MAX_DPC; DPC_Request_Nums++; - unlock_driver(oldspl); + mtx_unlock(&DpcQueue_Lock); p.dpc(p.pAdapter, p.arg, p.flags); - oldspl = lock_driver(); + mtx_lock(&p.pAdapter->lock); + mtx_lock(&DpcQueue_Lock); DPC_Request_Nums--; /* since we may have prevented Check_Idle_Call, do it here */ if (DPC_Request_Nums==0) { @@ -2505,28 +2417,22 @@ static void hpt_worker_thread(void) CheckPendingCall(_VBUS_P0); } } - unlock_driver(oldspl); + mtx_unlock(&p.pAdapter->lock); + mtx_unlock(&DpcQueue_Lock); /*Schedule out*/ -#if (__FreeBSD_version < 500000) - YIELD_THREAD; -#else -#if (__FreeBSD_version > 700033) - pause("sched", 1); -#else - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "sched", 1); -#endif -#endif if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) { /* abort rebuilding process. */ IAL_ADAPTER_T *pAdapter; PVDevice pArray; PVBus _vbus_p; int i; + + sx_slock(&hptmv_list_lock); pAdapter = gIal_Adapter; while(pAdapter != 0){ - + mtx_lock(&pAdapter->lock); _vbus_p = &pAdapter->VBus; for (i=0;iu.array.rf_abort_rebuild = 1; } } + mtx_unlock(&pAdapter->lock); pAdapter = pAdapter->next; } + sx_sunlock(&hptmv_list_lock); } + mtx_lock(&DpcQueue_Lock); } + mtx_unlock(&DpcQueue_Lock); /*Remove this debug option*/ /* #ifdef DEBUG if (SIGISMEMBER(curproc->p_siglist, SIGSTOP)) -#if (__FreeBSD_version > 700033) pause("hptrdy", 2*hz); -#else - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); -#endif #endif */ - #if (__FreeBSD_version >= 800002) kproc_suspend_check(curproc); - #elif (__FreeBSD_version >= 500043) - kthread_suspend_check(curproc); - #else - kproc_suspend_loop(curproc); - #endif -#if (__FreeBSD_version > 700033) - pause("hptrdy", 2*hz); /* wait for something to do */ -#else - tsleep((caddr_t)hpt_worker_thread, PPAUSE, "hptrdy", 2*hz); /* wait for something to do */ -#endif + pause("-", 2*hz); /* wait for something to do */ } } @@ -2586,6 +2482,7 @@ launch_worker_thread(void) kproc_start(&hpt_kp); + sx_slock(&hptmv_list_lock); for (pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next) { _VBUS_INST(&pAdapTemp->VBus) @@ -2601,17 +2498,13 @@ launch_worker_thread(void) (UCHAR)((pVDev->u.array.CriticalMembers || pVDev->VDeviceType == VD_RAID_1)? DUPLICATE : REBUILD_PARITY)); } } + sx_sunlock(&hptmv_list_lock); /* * hpt_worker_thread needs to be suspended after shutdown sync, when fs sync finished. */ -#if (__FreeBSD_version < 500043) - EVENTHANDLER_REGISTER(shutdown_post_sync, shutdown_kproc, hptdaemonproc, - SHUTDOWN_PRI_LAST); -#else EVENTHANDLER_REGISTER(shutdown_post_sync, kproc_shutdown, hptdaemonproc, SHUTDOWN_PRI_LAST); -#endif } /* *SYSINIT(hptwt, SI_SUB_KTHREAD_IDLE, SI_ORDER_FIRST, launch_worker_thread, NULL); @@ -2721,10 +2614,12 @@ SetInquiryData(PINQUIRYDATA inquiryData, static void hpt_timeout(void *arg) { - _VBUS_INST(&((PBUS_DMAMAP)((union ccb *)arg)->ccb_adapter)->pAdapter->VBus) - intrmask_t oldspl = lock_driver(); + PBUS_DMAMAP pmap = (PBUS_DMAMAP)((union ccb *)arg)->ccb_adapter; + IAL_ADAPTER_T *pAdapter = pmap->pAdapter; + _VBUS_INST(&pAdapter->VBus) + + mtx_assert(&pAdapter->lock, MA_OWNED); fResetVBus(_VBUS_P0); - unlock_driver(oldspl); } static void @@ -2766,7 +2661,7 @@ hpt_io_dmamap_callback(void *arg, bus_dm } } - pmap->timeout_ch = timeout(hpt_timeout, (caddr_t)ccb, 20*hz); + callout_reset(&pmap->timeout, 20 * hz, hpt_timeout, ccb); pVDev->pfnSendCommand(_VBUS_P pCmd); CheckPendingCall(_VBUS_P0); } @@ -2964,6 +2859,8 @@ OsSendCommand(_VBUS_ARG union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP_ERR; dmamap_put(pmap); pAdapter->outstandingCommands--; + if (pAdapter->outstandingCommands == 0) + wakeup(pAdapter); xpt_done(ccb); } goto Command_Complished; @@ -2987,8 +2884,8 @@ fOsCommandDone(_VBUS_ARG PCommand pCmd) IAL_ADAPTER_T *pAdapter = pmap->pAdapter; KdPrint(("fOsCommandDone(pcmd=%p, result=%d)\n", pCmd, pCmd->Result)); - - untimeout(hpt_timeout, (caddr_t)ccb, pmap->timeout_ch); + + callout_stop(&pmap->timeout); switch(pCmd->Result) { case RETURN_SUCCESS: @@ -3032,9 +2929,11 @@ hpt_queue_dpc(HPT_DPC dpc, IAL_ADAPTER_T { int p; + mtx_lock(&DpcQueue_Lock); p = (DpcQueue_Last + 1) % MAX_DPC; if (p==DpcQueue_First) { KdPrint(("DPC Queue full!\n")); + mtx_unlock(&DpcQueue_Lock); return -1; } @@ -3043,6 +2942,7 @@ hpt_queue_dpc(HPT_DPC dpc, IAL_ADAPTER_T DpcQueue[DpcQueue_Last].arg = arg; DpcQueue[DpcQueue_Last].flags = flags; DpcQueue_Last = p; + mtx_unlock(&DpcQueue_Lock); return 0; } Modified: head/sys/dev/hptmv/global.h ============================================================================== --- head/sys/dev/hptmv/global.h Tue Aug 5 23:55:23 2014 (r269616) +++ head/sys/dev/hptmv/global.h Tue Aug 5 23:58:49 2014 (r269617) @@ -132,11 +132,6 @@ typedef struct _VDevice_Ext #define LongDiv(x, y) (x / (UINT)(y)) #define LongRem(x, y) (x % (UINT)(y)) #define LongMul(x, y) (x * y) -/* Minimum and maximum macros */ -#if (__FreeBSD_version < 501000) -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif /************************************************************************* * C library @@ -151,9 +146,6 @@ unsigned HPTLIBAPI os_strlen(const char #define memcpy os_memcpy #define memset os_memset #define strlen os_strlen -#elif (__FreeBSD_version <= 410000) -#define memcpy(d, s, len) bcopy((s),(d),(len)) -#define memset(d, s, len) bzero((d),(len)) #endif #define ZeroMemory(a, b) memset((char *)a, 0, b) #define MemoryCopy(a,b,c) memcpy((char *)(a), (char *)(b), (UINT)(c)) Modified: head/sys/dev/hptmv/hptproc.c ============================================================================== --- head/sys/dev/hptmv/hptproc.c Tue Aug 5 23:55:23 2014 (r269616) +++ head/sys/dev/hptmv/hptproc.c Tue Aug 5 23:58:49 2014 (r269617) @@ -65,8 +65,8 @@ hpt_set_asc_info(IAL_ADAPTER_T *pAdapter PVDevice pSubArray, pVDev; UINT i, iarray, ichan; struct cam_periph *periph = NULL; - intrmask_t oldspl; + mtx_lock(&pAdapter->lock); #ifdef SUPPORT_ARRAY if (length>=8 && strncmp(buffer, "rebuild ", 8)==0) { @@ -74,7 +74,6 @@ hpt_set_asc_info(IAL_ADAPTER_T *pAdapter length-=8; if (length>=5 && strncmp(buffer, "start", 5)==0) { - oldspl = lock_driver(); for(i = 0; i < MAX_ARRAY_PER_VBUS; i++) if ((pArray=ArrayTables(i))->u.array.dArStamp==0) continue; @@ -83,12 +82,11 @@ hpt_set_asc_info(IAL_ADAPTER_T *pAdapter hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, pArray, (UCHAR)((pArray->u.array.CriticalMembers || pArray->VDeviceType == VD_RAID_1)? DUPLICATE : REBUILD_PARITY)); } - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); return orig_length; } else if (length>=4 && strncmp(buffer, "stop", 4)==0) { - oldspl = lock_driver(); for(i = 0; i < MAX_ARRAY_PER_VBUS; i++) if ((pArray=ArrayTables(i))->u.array.dArStamp==0) continue; @@ -96,7 +94,7 @@ hpt_set_asc_info(IAL_ADAPTER_T *pAdapter if (pArray->u.array.rf_rebuilding) pArray->u.array.rf_abort_rebuild = 1; } - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); return orig_length; } else if (length>=3 && buffer[1]==','&& buffer[0]>='1'&& buffer[2]>='1') @@ -107,17 +105,24 @@ hpt_set_asc_info(IAL_ADAPTER_T *pAdapter if(iarray >= MAX_VDEVICE_PER_VBUS || ichan >= MV_SATA_CHANNELS_NUM) return -EINVAL; pArray = _vbus_p->pVDevice[iarray]; - if (!pArray || (pArray->vf_online == 0)) return -EINVAL; + if (!pArray || (pArray->vf_online == 0)) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } for (i=0;ilock); return -EINVAL; rebuild: pVDev = &pAdapter->VDevices[ichan]; - if(!pVDev->u.disk.df_on_line || pVDev->pParent) return -EINVAL; + if(!pVDev->u.disk.df_on_line || pVDev->pParent) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } /* Not allow to use a mounted disk ??? test*/ for(i = 0; i < MAX_VDEVICE_PER_VBUS; i++) @@ -127,6 +132,7 @@ rebuild: if (periph != NULL && periph->refcount >= 1) { hpt_printk(("Can not use disk used by OS!\n")); + mtx_unlock(&pAdapter->lock); return -EINVAL; } /* the Mounted Disk isn't delete */ @@ -139,15 +145,13 @@ rebuild: { pSubArray = pArray; loop: - oldspl = lock_driver(); if(hpt_add_disk_to_array(_VBUS_P VDEV_TO_ID(pSubArray), VDEV_TO_ID(pVDev)) == -1) { - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); return -EINVAL; } pSubArray->u.array.rf_auto_rebuild = 0; pSubArray->u.array.rf_abort_rebuild = 0; hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, pSubArray, DUPLICATE); - unlock_driver(oldspl); break; } case VD_RAID_0: @@ -159,8 +163,10 @@ loop: goto loop; } default: + mtx_unlock(&pAdapter->lock); return -EINVAL; } + mtx_unlock(&pAdapter->lock); return orig_length; } } @@ -175,24 +181,31 @@ loop: if (length>=1 && *buffer>='1') { iarray = *buffer-'1'; - if(iarray >= MAX_VDEVICE_PER_VBUS) return -EINVAL; + if(iarray >= MAX_VDEVICE_PER_VBUS) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } pArray = _vbus_p->pVDevice[iarray]; - if (!pArray || (pArray->vf_online == 0)) return -EINVAL; + if (!pArray || (pArray->vf_online == 0)) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } - if(pArray->VDeviceType != VD_RAID_1 && pArray->VDeviceType != VD_RAID_5) + if(pArray->VDeviceType != VD_RAID_1 && pArray->VDeviceType != VD_RAID_5) { + mtx_unlock(&pAdapter->lock); return -EINVAL; + } if (!(pArray->u.array.rf_need_rebuild || pArray->u.array.rf_rebuilding || pArray->u.array.rf_verifying || pArray->u.array.rf_initializing)) { - oldspl = lock_driver(); pArray->u.array.RebuildSectors = 0; hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, pArray, VERIFY); - unlock_driver(oldspl); } + mtx_unlock(&pAdapter->lock); return orig_length; } } @@ -203,16 +216,21 @@ loop: if (length>=1 && *buffer>='1') { iarray = *buffer-'1'; - if(iarray >= MAX_VDEVICE_PER_VBUS) return -EINVAL; + if(iarray >= MAX_VDEVICE_PER_VBUS) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } pArray = _vbus_p->pVDevice[iarray]; - if (!pArray || (pArray->vf_online == 0)) return -EINVAL; + if (!pArray || (pArray->vf_online == 0)) { + mtx_unlock(&pAdapter->lock); + return -EINVAL; + } if(pArray->u.array.rf_verifying) { - oldspl = lock_driver(); pArray->u.array.rf_abort_rebuild = 1; - unlock_driver(oldspl); } + mtx_unlock(&pAdapter->lock); return orig_length; } } @@ -226,6 +244,7 @@ loop: _vbus_(r5.enable_write_back) = *buffer-'0'; if (_vbus_(r5.enable_write_back)) hpt_printk(("RAID5 write back enabled")); + mtx_unlock(&pAdapter->lock); return orig_length; } } @@ -239,6 +258,7 @@ loop: length-=9; if (length>=1 && *buffer>='0' && *buffer<='3') { hpt_dbg_level = *buffer-'0'; + mtx_unlock(&pAdapter->lock); return orig_length; } } @@ -246,6 +266,7 @@ loop: /* TO DO */ } #endif + mtx_unlock(&pAdapter->lock); return -EINVAL; } @@ -486,12 +507,12 @@ hpt_get_info(IAL_ADAPTER_T *pAdapter, HP PVDevice pVDev; #ifndef FOR_DEMO + mtx_lock(&pAdapter->lock); if (pAdapter->beeping) { - intrmask_t oldspl = lock_driver(); pAdapter->beeping = 0; BeepOff(pAdapter->mvSataAdapter.adapterIoBaseAddress); - unlock_driver(oldspl); } + mtx_unlock(&pAdapter->lock); #endif hpt_copy_info(pinfo, "Controller #%d:\n\n", pAdapter->mvSataAdapter.adapterId); @@ -610,16 +631,16 @@ out: #define xhptregister_node(name) hptregister_node(name) -#if (__FreeBSD_version < 500043) +#if __FreeBSD_version >= 1100024 #define hptregister_node(name) \ - SYSCTL_NODE(, OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node") \ + SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ SYSCTL_OID(_ ## name, OID_AUTO, status, CTLTYPE_STRING|CTLFLAG_RW, \ NULL, 0, hpt_status, "A", "Get/Set " #name " state") -#else +#else #define hptregister_node(name) \ - SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ + SYSCTL_NODE(, OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ SYSCTL_OID(_ ## name, OID_AUTO, status, CTLTYPE_STRING|CTLFLAG_RW, \ - NULL, 0, hpt_status, "A", "Get/Set " #name " state"); + NULL, 0, hpt_status, "A", "Get/Set " #name " state") #endif xhptregister_node(PROC_DIR_NAME); Modified: head/sys/dev/hptmv/ioctl.c ============================================================================== --- head/sys/dev/hptmv/ioctl.c Tue Aug 5 23:55:23 2014 (r269616) +++ head/sys/dev/hptmv/ioctl.c Tue Aug 5 23:58:49 2014 (r269617) @@ -33,13 +33,6 @@ #include #include -#if (__FreeBSD_version < 500000) -#include -#include -#include -#include -#endif - #ifndef __KERNEL__ #define __KERNEL__ #endif @@ -66,7 +59,7 @@ static int event_queue_head=0, event_que static int hpt_get_event(PHPT_EVENT pEvent); static int hpt_set_array_state(DEVICEID idArray, DWORD state); -static intrmask_t lock_driver_idle(IAL_ADAPTER_T *pAdapter); +static void lock_driver_idle(IAL_ADAPTER_T *pAdapter); static void HPTLIBAPI thread_io_done(_VBUS_ARG PCommand pCmd); static int HPTLIBAPI R1ControlSgl(_VBUS_ARG PCommand pCmd, FPSCAT_GATH pSgTable, int logical); @@ -158,6 +151,7 @@ ioctl_ReportEvent(UCHAR event, PVOID par get_disk_location(&((PVDevice)param)->u.disk, &controller, &channel); hpt_printk(("Device removed: controller %d channel %d\n", controller, channel)); } + wakeup(param); } static int @@ -195,30 +189,17 @@ hpt_delete_array(_VBUS_ARG DEVICEID id, /* just to prevent driver from sending more commands */ static void HPTLIBAPI nothing(_VBUS_ARG void *notused){} -intrmask_t +void lock_driver_idle(IAL_ADAPTER_T *pAdapter) { - intrmask_t oldspl; _VBUS_INST(&pAdapter->VBus) - oldspl = lock_driver(); + mtx_lock(&pAdapter->lock); while (pAdapter->outstandingCommands) { KdPrint(("outstandingCommands is %d, wait..\n", pAdapter->outstandingCommands)); if (!mWaitingForIdle(_VBUS_P0)) CallWhenIdle(_VBUS_P nothing, 0); - unlock_driver(oldspl); -/*Schedule out*/ -#if (__FreeBSD_version < 500000) - YIELD_THREAD; -#else -#if (__FreeBSD_version > 700033) - pause("switch", 1); -#else - tsleep(lock_driver_idle, PPAUSE, "switch", 1); -#endif -#endif - oldspl = lock_driver(); + mtx_sleep(pAdapter, &pAdapter->lock, 0, "hptidle", 0); } CheckIdleCall(_VBUS_P0); - return oldspl; } int Kernel_DeviceIoControl(_VBUS_ARG @@ -329,9 +310,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG default: { PVDevice pVDev; -#ifdef SUPPORT_ARRAY - intrmask_t oldspl; -#endif + switch(dwIoControlCode) { /* read-only ioctl functions can be called directly. */ case HPT_IOCTL_GET_VERSION: @@ -382,13 +361,13 @@ int Kernel_DeviceIoControl(_VBUS_ARG * create_array, and other functions can't be executed while channel is * perform I/O commands. Wait until driver is idle. */ - oldspl = lock_driver_idle(pAdapter); + lock_driver_idle(pAdapter); if (hpt_default_ioctl(_VBUS_P dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned) == -1) { - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); return -1; } - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); } else return -1; @@ -401,7 +380,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG case HPT_IOCTL_CREATE_ARRAY: { pAdapter=(IAL_ADAPTER_T *)(ID_TO_VDEV(*(DEVICEID *)lpOutBuffer))->pVBus->OsExt; - oldspl = lock_driver(); + mtx_lock(&pAdapter->lock); if(((PCREATE_ARRAY_PARAMS)lpInBuffer)->CreateFlags & CAF_CREATE_AND_DUPLICATE) { (ID_TO_VDEV(*(DEVICEID *)lpOutBuffer))->u.array.rf_auto_rebuild = 0; @@ -415,7 +394,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG { hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, ID_TO_VDEV(*(DEVICEID *)lpOutBuffer), REBUILD_PARITY); } - unlock_driver(oldspl); + mtx_unlock(&pAdapter->lock); break; } @@ -423,7 +402,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG case HPT_IOCTL_CREATE_ARRAY_V2: { pAdapter=(IAL_ADAPTER_T *)(ID_TO_VDEV(*(DEVICEID *)lpOutBuffer))->pVBus->OsExt; - oldspl = lock_driver(); + mtx_lock(&pAdapter->lock); if(((PCREATE_ARRAY_PARAMS_V2)lpInBuffer)->CreateFlags & CAF_CREATE_AND_DUPLICATE) { (ID_TO_VDEV(*(DEVICEID *)lpOutBuffer))->u.array.rf_auto_rebuild = 0; hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, ID_TO_VDEV(*(DEVICEID *)lpOutBuffer), DUPLICATE); @@ -432,7 +411,7 @@ int Kernel_DeviceIoControl(_VBUS_ARG } else if(((PCREATE_ARRAY_PARAMS_V2)lpInBuffer)->CreateFlags & CAF_CREATE_R5_BUILD_PARITY) { hpt_queue_dpc((HPT_DPC)hpt_rebuild_data_block, pAdapter, ID_TO_VDEV(*(DEVICEID *)lpOutBuffer), REBUILD_PARITY); } - unlock_driver(oldspl); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 00:06:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0308F2F0 for ; Wed, 6 Aug 2014 00:06:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC78F29AA for ; Wed, 6 Aug 2014 00:06:25 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 5720 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 00:06:25 +0000 From: Marcel Moolenaar Date: Wed, 6 Aug 2014 00:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269618 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e17181.5720.320caf0c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 00:06:26 -0000 Author: marcel Date: Wed Aug 6 00:06:25 2014 New Revision: 269618 URL: http://svnweb.freebsd.org/changeset/base/269618 Log: Rename command_unload() to unload() and re-implement command_unload() in terms of unload() This allows unloading all files by the loader itself. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/common/bootstrap.h head/sys/boot/common/module.c Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Tue Aug 5 23:58:49 2014 (r269617) +++ head/sys/boot/common/bootstrap.h Wed Aug 6 00:06:25 2014 (r269618) @@ -229,6 +229,7 @@ extern struct preloaded_file *preloaded_ int mod_load(char *name, struct mod_depend *verinfo, int argc, char *argv[]); int mod_loadkld(const char *name, int argc, char *argv[]); +void unload(void); struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(char *name, char *type); Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Aug 5 23:58:49 2014 (r269617) +++ head/sys/boot/common/module.c Wed Aug 6 00:06:25 2014 (r269618) @@ -192,13 +192,11 @@ command_load_geli(int argc, char *argv[] return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR); } -COMMAND_SET(unload, "unload", "unload all modules", command_unload); - -static int -command_unload(int argc, char *argv[]) +void +unload(void) { - struct preloaded_file *fp; - + struct preloaded_file *fp; + while (preloaded_files != NULL) { fp = preloaded_files; preloaded_files = preloaded_files->f_next; @@ -206,6 +204,14 @@ command_unload(int argc, char *argv[]) } loadaddr = 0; unsetenv("kernelname"); +} + +COMMAND_SET(unload, "unload", "unload all modules", command_unload); + +static int +command_unload(int argc, char *argv[]) +{ + unload(); return(CMD_OK); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 00:35:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A7DEA46 for ; Wed, 6 Aug 2014 00:35:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07E342F61 for ; Wed, 6 Aug 2014 00:35:50 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 5125 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 00:35:48 +0000 From: Nathan Whitehorn Date: Wed, 6 Aug 2014 00:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269620 - in head/sys: dev/fb dev/vt/hw/efifb dev/vt/hw/fb dev/vt/hw/ofwfb powerpc/ps3 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e17864.5125.6941a0e1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 00:35:50 -0000 Author: nwhitehorn Date: Wed Aug 6 00:35:48 2014 New Revision: 269620 URL: http://svnweb.freebsd.org/changeset/base/269620 Log: Retire various intertwined bits of fbd(4) and vt_fb, in particular the pixel modification indirection. No actual drivers use it and those that might (e.g. creatorfb) use custom implementations of vd_bitbltchr(). Modified: head/sys/dev/fb/fbd.c head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/fb/vt_fb.h head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/powerpc/ps3/ps3_syscons.c head/sys/sys/fbio.h Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/fb/fbd.c Wed Aug 6 00:35:48 2014 (r269620) @@ -165,6 +165,10 @@ fb_mmap(struct cdev *dev, vm_ooffset_t o struct fb_info *info; info = dev->si_drv1; + + if ((info->fb_flags & FB_FLAG_NOMMAP) || info->fb_pbase == 0) + return (ENODEV); + if (offset < info->fb_size) { *paddr = info->fb_pbase + offset; return (0); @@ -172,103 +176,6 @@ fb_mmap(struct cdev *dev, vm_ooffset_t o return (EINVAL); } - -static void -vt_fb_mem_wr1(struct fb_info *sc, uint32_t o, uint8_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - *(uint8_t *)(sc->fb_vbase + o) = v; -} - -static void -vt_fb_mem_wr2(struct fb_info *sc, uint32_t o, uint16_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - *(uint16_t *)(sc->fb_vbase + o) = v; -} - -static void -vt_fb_mem_wr4(struct fb_info *sc, uint32_t o, uint32_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - *(uint32_t *)(sc->fb_vbase + o) = v; -} - -static void -vt_fb_mem_copy(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, - uint32_t size) -{ - - memmove((void *)(sc->fb_vbase + offset_to), (void *)(sc->fb_vbase + - offset_from), size); -} - -static void -vt_fb_indir_wr1(struct fb_info *sc, uint32_t o, uint8_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - sc->fb_write(sc->fb_priv, o, &v, 1); -} - -static void -vt_fb_indir_wr2(struct fb_info *sc, uint32_t o, uint16_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - sc->fb_write(sc->fb_priv, o, &v, 2); -} - -static void -vt_fb_indir_wr4(struct fb_info *sc, uint32_t o, uint32_t v) -{ - - KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); - sc->fb_write(sc->fb_priv, o, &v, 4); -} - -static void -vt_fb_indir_copy(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, - uint32_t size) -{ - - sc->copy(sc->fb_priv, offset_to, offset_from, size); -} - -int -fb_probe(struct fb_info *info) -{ - - if (info->fb_size == 0) - return (ENXIO); - - if (info->fb_write != NULL) { - if (info->fb_read == NULL) { - return (EINVAL); - } - info->fb_flags |= FB_FLAG_NOMMAP; - info->wr1 = &vt_fb_indir_wr1; - info->wr2 = &vt_fb_indir_wr2; - info->wr4 = &vt_fb_indir_wr4; - info->copy = &vt_fb_indir_copy; - } else if (info->fb_vbase != 0) { - if (info->fb_pbase == 0) { - info->fb_flags |= FB_FLAG_NOMMAP; - } - info->wr1 = &vt_fb_mem_wr1; - info->wr2 = &vt_fb_mem_wr2; - info->wr4 = &vt_fb_mem_wr4; - info->copy = &vt_fb_mem_copy; - } else - return (ENXIO); - - return (0); -} - - static int fb_init(struct fb_list_entry *entry, int unit) { @@ -329,10 +236,6 @@ fbd_register(struct fb_info* info) return (0); } - err = fb_probe(info); - if (err) - return (err); - entry = malloc(sizeof(struct fb_list_entry), M_DEVBUF, M_WAITOK|M_ZERO); entry->fb_info = info; @@ -342,8 +245,10 @@ fbd_register(struct fb_info* info) if (err) return (err); - if (first) - vt_fb_attach(info); + if (first) { + if (vt_fb_attach(info) == CN_DEAD) + return (ENXIO); + } return (0); } Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/vt/hw/efifb/efifb.c Wed Aug 6 00:35:48 2014 (r269620) @@ -154,12 +154,8 @@ vt_efifb_init(struct vt_device *vd) info->fb_width = MIN(info->fb_width, VT_FB_DEFAULT_WIDTH); info->fb_height = MIN(info->fb_height, VT_FB_DEFAULT_HEIGHT); - fb_probe(info); vt_fb_init(vd); - /* Clear the screen. */ - vt_fb_blank(vd, TC_BLACK); - return (CN_INTERNAL); } Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Wed Aug 6 00:35:48 2014 (r269620) @@ -296,7 +296,6 @@ vt_efb_init(struct vt_device *vd) #else vt_efb_initialize(info); #endif - fb_probe(info); vt_fb_init(vd); return (CN_INTERNAL); Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/vt/hw/fb/vt_fb.c Wed Aug 6 00:35:48 2014 (r269620) @@ -61,6 +61,30 @@ static struct vt_driver vt_fb_driver = { VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); +static void +vt_fb_mem_wr1(struct fb_info *sc, uint32_t o, uint8_t v) +{ + + KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); + *(uint8_t *)(sc->fb_vbase + o) = v; +} + +static void +vt_fb_mem_wr2(struct fb_info *sc, uint32_t o, uint16_t v) +{ + + KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); + *(uint16_t *)(sc->fb_vbase + o) = v; +} + +static void +vt_fb_mem_wr4(struct fb_info *sc, uint32_t o, uint32_t v) +{ + + KASSERT((o < sc->fb_size), ("Offset %#08x out of fb size", o)); + *(uint32_t *)(sc->fb_vbase + o) = v; +} + int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) { @@ -134,20 +158,22 @@ vt_fb_setpixel(struct vt_device *vd, int c = info->fb_cmap[color]; o = info->fb_stride * y + x * FBTYPE_GET_BYTESPP(info); + KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); + switch (FBTYPE_GET_BYTESPP(info)) { case 1: - info->wr1(info, o, c); + vt_fb_mem_wr1(info, o, c); break; case 2: - info->wr2(info, o, c); + vt_fb_mem_wr2(info, o, c); break; case 3: - info->wr1(info, o, (c >> 16) & 0xff); - info->wr1(info, o + 1, (c >> 8) & 0xff); - info->wr1(info, o + 2, c & 0xff); + vt_fb_mem_wr1(info, o, (c >> 16) & 0xff); + vt_fb_mem_wr1(info, o + 1, (c >> 8) & 0xff); + vt_fb_mem_wr1(info, o + 2, c & 0xff); break; case 4: - info->wr4(info, o, c); + vt_fb_mem_wr4(info, o, c); break; default: /* panic? */ @@ -183,32 +209,34 @@ vt_fb_blank(struct vt_device *vd, term_c info = vd->vd_softc; c = info->fb_cmap[color]; + KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); + switch (FBTYPE_GET_BYTESPP(info)) { case 1: for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o++) - info->wr1(info, h*info->fb_stride + o, c); + vt_fb_mem_wr1(info, h*info->fb_stride + o, c); break; case 2: for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 2) - info->wr2(info, h*info->fb_stride + o, c); + vt_fb_mem_wr2(info, h*info->fb_stride + o, c); break; case 3: for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 3) { - info->wr1(info, h*info->fb_stride + o, + vt_fb_mem_wr1(info, h*info->fb_stride + o, (c >> 16) & 0xff); - info->wr1(info, h*info->fb_stride + o + 1, + vt_fb_mem_wr1(info, h*info->fb_stride + o + 1, (c >> 8) & 0xff); - info->wr1(info, h*info->fb_stride + o + 2, + vt_fb_mem_wr1(info, h*info->fb_stride + o + 2, c & 0xff); } break; case 4: for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 4) - info->wr4(info, h*info->fb_stride + o, c); + vt_fb_mem_wr4(info, h*info->fb_stride + o, c); break; default: /* panic? */ @@ -241,6 +269,8 @@ vt_fb_bitbltchr(struct vt_device *vd, co info->fb_height)) return; + KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); + line = (info->fb_stride * top) + (left * bpp); for (l = 0; l < height; l++) { ch = src; @@ -254,19 +284,19 @@ vt_fb_bitbltchr(struct vt_device *vd, co switch(bpp) { case 1: - info->wr1(info, o, cc); + vt_fb_mem_wr1(info, o, cc); break; case 2: - info->wr2(info, o, cc); + vt_fb_mem_wr2(info, o, cc); break; case 3: /* Packed mode, so unaligned. Byte access. */ - info->wr1(info, o, (cc >> 16) & 0xff); - info->wr1(info, o + 1, (cc >> 8) & 0xff); - info->wr1(info, o + 2, cc & 0xff); + vt_fb_mem_wr1(info, o, (cc >> 16) & 0xff); + vt_fb_mem_wr1(info, o + 1, (cc >> 8) & 0xff); + vt_fb_mem_wr1(info, o + 2, cc & 0xff); break; case 4: - info->wr4(info, o, cc); + vt_fb_mem_wr4(info, o, cc); break; default: /* panic? */ @@ -303,6 +333,8 @@ vt_fb_maskbitbltchr(struct vt_device *vd info->fb_height)) return; + KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); + line = (info->fb_stride * top) + (left * bpp); for (l = 0; l < height; l++) { ch = src; @@ -325,19 +357,19 @@ vt_fb_maskbitbltchr(struct vt_device *vd switch(bpp) { case 1: - info->wr1(info, o, cc); + vt_fb_mem_wr1(info, o, cc); break; case 2: - info->wr2(info, o, cc); + vt_fb_mem_wr2(info, o, cc); break; case 3: /* Packed mode, so unaligned. Byte access. */ - info->wr1(info, o, (cc >> 16) & 0xff); - info->wr1(info, o + 1, (cc >> 8) & 0xff); - info->wr1(info, o + 2, cc & 0xff); + vt_fb_mem_wr1(info, o, (cc >> 16) & 0xff); + vt_fb_mem_wr1(info, o + 1, (cc >> 8) & 0xff); + vt_fb_mem_wr1(info, o + 2, cc & 0xff); break; case 4: - info->wr4(info, o, cc); + vt_fb_mem_wr4(info, o, cc); break; default: /* panic? */ @@ -393,6 +425,12 @@ vt_fb_init(struct vt_device *vd) vd->vd_height = info->fb_height; vd->vd_width = info->fb_width; + if (info->fb_size == 0) + return (CN_DEAD); + + if (info->fb_pbase == 0) + info->fb_flags |= FB_FLAG_NOMMAP; + if (info->fb_cmsize <= 0) { err = vt_fb_init_cmap(info->fb_cmap, FBTYPE_GET_BPP(info)); if (err) Modified: head/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.h Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/vt/hw/fb/vt_fb.h Wed Aug 6 00:35:48 2014 (r269620) @@ -36,8 +36,6 @@ int vt_fb_attach(struct fb_info *info); void vt_fb_resume(void); void vt_fb_suspend(void); -int fb_probe(struct fb_info *info); - vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitbltchr_t vt_fb_bitbltchr; Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Aug 6 00:35:48 2014 (r269620) @@ -399,7 +399,6 @@ ofwfb_init(struct vt_device *vd) sc->fb.fb_pbase = fb_phys; ofwfb_initialize(vd); - fb_probe(&sc->fb); vt_fb_init(vd); return (CN_INTERNAL); Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/powerpc/ps3/ps3_syscons.c Wed Aug 6 00:35:48 2014 (r269620) @@ -188,12 +188,8 @@ ps3fb_init(struct vt_device *vd) lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); - fb_probe(&sc->fb_info); - sc->fb_info.fb_flags &= ~FB_FLAG_NOMMAP; /* Set wrongly by fb_probe */ vt_fb_init(vd); - - /* Clear the screen. */ - vt_fb_blank(vd, TC_BLACK); + sc->fb_info.fb_flags &= ~FB_FLAG_NOMMAP; /* Set wrongly by vt_fb_init */ return (CN_INTERNAL); } Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Wed Aug 6 00:35:32 2014 (r269619) +++ head/sys/sys/fbio.h Wed Aug 6 00:35:48 2014 (r269620) @@ -115,19 +115,6 @@ struct fb_info; typedef int fb_enter_t(void *priv); typedef int fb_leave_t(void *priv); -typedef int fb_write_t(void *priv, int offset, void *data, int size); -typedef int fb_read_t(void *priv, int offset, void *data, int size); - -/* XXX: should use priv instead of fb_info too. */ -typedef void fb_copy_t(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, - uint32_t size); -typedef void fb_wr1_t(struct fb_info *sc, uint32_t offset, uint8_t value); -typedef void fb_wr2_t(struct fb_info *sc, uint32_t offset, uint16_t value); -typedef void fb_wr4_t(struct fb_info *sc, uint32_t offset, uint32_t value); - -typedef int fb_ioctl_t(struct cdev *, u_long, caddr_t, int, struct thread *); -typedef int fb_mmap_t(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr); struct fb_info { /* Raw copy of fbtype. Do not change. */ @@ -138,16 +125,8 @@ struct fb_info { int fb_cmsize; /* size of color map (entries) */ int fb_size; /* total size in bytes */ - /* Methods. */ - fb_write_t *fb_write; /* if NULL, direct mem write. */ - fb_read_t *fb_read; /* if NULL, direct mem read. */ - struct cdev *fb_cdev; - fb_wr1_t *wr1; - fb_wr2_t *wr2; - fb_wr4_t *wr4; - fb_copy_t *copy; fb_enter_t *enter; fb_leave_t *leave; From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 00:36:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF08AB8E for ; Wed, 6 Aug 2014 00:36:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD7E72F6A for ; Wed, 6 Aug 2014 00:36:04 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 5149 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 00:36:04 +0000 From: Marcel Moolenaar Date: Wed, 6 Aug 2014 00:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269621 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e17874.5149.1878e978@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 00:36:04 -0000 Author: marcel Date: Wed Aug 6 00:36:04 2014 New Revision: 269621 URL: http://svnweb.freebsd.org/changeset/base/269621 Log: Optionally include the install command as found on Juniper products like EX and SRX. The install command uses pkgfs to extract a kernel, zero or more modules and a root file system from the specified package and boots the kernel. The name of the kernel, the list of modules and the name of the root file system can be specified by putting a file called "metatags in the package. The package to use is given by an URL. The schemes supported are tftp and file. For the file scheme, the disk is currently hardcoded but that should really look for the package on all devices and partititions. Obtained from: Juniper Networks, Inc. Added: head/sys/boot/common/install.c (contents, props changed) Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Wed Aug 6 00:35:48 2014 (r269620) +++ head/sys/boot/common/Makefile.inc Wed Aug 6 00:36:04 2014 (r269621) @@ -72,4 +72,9 @@ MAN+= ../forth/version.4th.8 CFLAGS+= -DBOOT_PROMPT_123 .endif +.if defined(LOADER_INSTALL_SUPPORT) +SRCS+= install.c +CFLAGS+=-I${.CURDIR}/../../../../lib/libstand +.endif + MAN+= loader.8 Added: head/sys/boot/common/install.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/common/install.c Wed Aug 6 00:36:04 2014 (r269621) @@ -0,0 +1,339 @@ +/*- + * Copyright (c) 2008-2014, Juniper Networks, Inc. + * 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 WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "bootstrap.h" + +extern struct in_addr rootip; +extern struct in_addr servip; + +extern int pkgfs_init(const char *, struct fs_ops *); +extern void pkgfs_cleanup(void); + +COMMAND_SET(install, "install", "install software package", command_install); + +static char *inst_kernel; +static char **inst_modules; +static char *inst_rootfs; + +static int +setpath(char **what, char *val) +{ + char *path; + size_t len; + int rel; + + len = strlen(val) + 1; + rel = (val[0] != '/') ? 1 : 0; + path = malloc(len + rel); + if (path == NULL) + return (ENOMEM); + path[0] = '/'; + strcpy(path + rel, val); + + *what = path; + return (0); +} + +static int +setmultipath(char ***what, char *val) +{ + char *s, *v; + int count, error, idx; + + count = 0; + v = val; + do { + count++; + s = strchr(v, ','); + v = (s == NULL) ? NULL : s + 1; + } while (v != NULL); + + *what = calloc(count + 1, sizeof(char *)); + if (*what == NULL) + return (ENOMEM); + + for (idx = 0; idx < count; idx++) { + s = strchr(val, ','); + if (s != NULL) + *s++ = '\0'; + error = setpath(*what + idx, val); + if (error) + return (error); + val = s; + } + + return (0); +} + +static int +read_metatags(int fd) +{ + char buf[1024]; + char *p, *tag, *val; + ssize_t fsize; + int error; + + fsize = read(fd, buf, sizeof(buf)); + if (fsize == -1) + return (errno); + + /* + * Assume that if we read a whole buffer worth of data, we + * haven't read the entire file. In other words, the buffer + * size must always be larger than the file size. That way + * we can append a '\0' and use standard string operations. + * Return an error if this is not possible. + */ + if (fsize == sizeof(buf)) + return (ENOMEM); + + buf[fsize] = '\0'; + error = 0; + tag = buf; + while (!error && *tag != '\0') { + val = strchr(tag, '='); + if (val == NULL) { + error = EINVAL; + break; + } + *val++ = '\0'; + p = strchr(val, '\n'); + if (p == NULL) { + error = EINVAL; + break; + } + *p++ = '\0'; + + if (strcmp(tag, "KERNEL") == 0) + error = setpath(&inst_kernel, val); + else if (strcmp(tag, "MODULES") == 0) + error = setmultipath(&inst_modules, val); + else if (strcmp(tag, "ROOTFS") == 0) + error = setpath(&inst_rootfs, val); + + tag = p; + } + + return (error); +} + +static void +cleanup(void) +{ + u_int i; + + if (inst_kernel != NULL) { + free(inst_kernel); + inst_kernel = NULL; + } + if (inst_modules != NULL) { + i = 0; + while (inst_modules[i] != NULL) + free(inst_modules[i++]); + free(inst_modules); + inst_modules = NULL; + } + if (inst_rootfs != NULL) { + free(inst_rootfs); + inst_rootfs = NULL; + } + pkgfs_cleanup(); +} + +/* + * usage: install URL + * where: URL = (tftp|file)://[host]/ + */ +static int +install(char *pkgname) +{ + static char buf[256]; + struct fs_ops *proto; + struct preloaded_file *fp; + char *s, *currdev; + const char *devname; + int error, fd, i, local; + + s = strstr(pkgname, "://"); + if (s == NULL) + goto invalid_url; + + i = s - pkgname; + if (i == 4 && !strncasecmp(pkgname, "tftp", i)) { + devname = "net0"; + proto = &tftp_fsops; + local = 0; + } else if (i == 4 && !strncasecmp(pkgname, "file", i)) { + currdev = getenv("currdev"); + if (currdev != NULL && strcmp(currdev, "pxe0:") == 0) { + devname = "pxe0"; + proto = NULL; + } else { + devname = "disk1"; + proto = &dosfs_fsops; + } + local = 1; + } else + goto invalid_url; + + s += 3; + if (*s == '\0') + goto invalid_url; + + if (*s != '/' ) { + if (local) + goto invalid_url; + + pkgname = strchr(s, '/'); + if (pkgname == NULL) + goto invalid_url; + + *pkgname = '\0'; + servip.s_addr = inet_addr(s); + if (servip.s_addr == htonl(INADDR_NONE)) + goto invalid_url; + + setenv("serverip", inet_ntoa(servip), 1); + + *pkgname = '/'; + } else + pkgname = s; + + if (strlen(devname) + strlen(pkgname) + 2 > sizeof(buf)) { + command_errmsg = "package name too long"; + return (CMD_ERROR); + } + sprintf(buf, "%s:%s", devname, pkgname); + setenv("install_package", buf, 1); + + error = pkgfs_init(buf, proto); + if (error) { + command_errmsg = "cannot open package"; + goto fail; + } + + /* + * Point of no return: unload anything that may have been + * loaded and prune the environment from harmful variables. + */ + unload(); + unsetenv("vfs.root.mountfrom"); + + /* + * read the metatags file. + */ + fd = open("/metatags", O_RDONLY); + if (fd != -1) { + error = read_metatags(fd); + close(fd); + if (error) { + command_errmsg = "cannot load metatags"; + goto fail; + } + } + + s = (inst_kernel == NULL) ? "/kernel" : inst_kernel; + error = mod_loadkld(s, 0, NULL); + if (error) { + command_errmsg = "cannot load kernel from package"; + goto fail; + } + + i = 0; + while (inst_modules != NULL && inst_modules[i] != NULL) { + error = mod_loadkld(inst_modules[i], 0, NULL); + if (error) { + command_errmsg = "cannot load module(s) from package"; + goto fail; + } + i++; + } + + s = (inst_rootfs == NULL) ? "/install.iso" : inst_rootfs; + if (file_loadraw("mfs_root", s) == NULL) { + error = errno; + command_errmsg = "cannot load root file system"; + goto fail; + } + + cleanup(); + + fp = file_findfile(NULL, NULL); + if (fp != NULL) + file_formats[fp->f_loader]->l_exec(fp); + error = CMD_ERROR; + command_errmsg = "unable to start installation"; + + fail: + sprintf(buf, "%s (error %d)", command_errmsg, error); + cleanup(); + unload(); + exclusive_file_system = NULL; + command_errmsg = buf; /* buf is static. */ + return (CMD_ERROR); + + invalid_url: + command_errmsg = "invalid URL"; + return (CMD_ERROR); +} + +static int +command_install(int argc, char *argv[]) +{ + int argidx; + + unsetenv("install_format"); + + argidx = 1; + while (1) { + if (argc == argidx) { + command_errmsg = + "usage: install [--format] "; + return (CMD_ERROR); + } + if (!strcmp(argv[argidx], "--format")) { + setenv("install_format", "yes", 1); + argidx++; + continue; + } + break; + } + + return (install(argv[argidx])); +} From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 08:54:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71FB3571 for ; Wed, 6 Aug 2014 08:54:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F63C2754 for ; Wed, 6 Aug 2014 08:54:32 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 5559 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 08:54:31 +0000 From: Alexander Motin Date: Wed, 6 Aug 2014 08:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269622 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e1ed47.5559.2321a83f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 08:54:32 -0000 Author: mav Date: Wed Aug 6 08:54:31 2014 New Revision: 269622 URL: http://svnweb.freebsd.org/changeset/base/269622 Log: Fix several issues and inconsistencies in UNMAP capabilities reporting. This makes Windows 2012 to start using UNMAP on our disks. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Aug 6 00:36:04 2014 (r269621) +++ head/sys/cam/ctl/ctl.c Wed Aug 6 08:54:31 2014 (r269622) @@ -320,10 +320,10 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), - * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0) and - * Logical Block Provisioning (0xB2) + * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0), + * Block Device Characteristics (0xB1) and Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 7 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 8 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -383,6 +383,7 @@ static int ctl_inquiry_evpd_scsi_ports(s int alloc_len); static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); @@ -7252,7 +7253,7 @@ ctl_read_capacity_16(struct ctl_scsiio * data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) - data->lalba_lbp[0] |= SRC16_LBPME; + data->lalba_lbp[0] |= SRC16_LBPME | SRC16_LBPRZ; ctsio->scsi_status = SCSI_STATUS_OK; @@ -9809,8 +9810,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc pages->page_list[4] = SVPD_SCSI_TPC; /* Block limits */ pages->page_list[5] = SVPD_BLOCK_LIMITS; + /* Block Device Characteristics */ + pages->page_list[6] = SVPD_BDC; /* Logical Block Provisioning */ - pages->page_list[6] = SVPD_LBP; + pages->page_list[7] = SVPD_LBP; ctsio->scsi_status = SCSI_STATUS_OK; @@ -10166,6 +10169,12 @@ ctl_inquiry_evpd_block_limits(struct ctl if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + if (lun->be_lun->pblockexp != 0) { + scsi_ulto4b((1 << lun->be_lun->pblockexp), + bl_ptr->opt_unmap_grain); + scsi_ulto4b(0x80000000 | lun->be_lun->pblockoff, + bl_ptr->unmap_grain_align); + } } } scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); @@ -10179,6 +10188,54 @@ ctl_inquiry_evpd_block_limits(struct ctl } static int +ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_block_device_characteristics *bdc_ptr; + struct ctl_lun *lun; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + ctsio->kern_data_ptr = malloc(sizeof(*bdc_ptr), M_CTL, M_WAITOK | M_ZERO); + bdc_ptr = (struct scsi_vpd_block_device_characteristics *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (sizeof(*bdc_ptr) < alloc_len) { + ctsio->residual = alloc_len - sizeof(*bdc_ptr); + ctsio->kern_data_len = sizeof(*bdc_ptr); + ctsio->kern_total_len = sizeof(*bdc_ptr); + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + bdc_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + bdc_ptr->page_code = SVPD_BDC; + scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length); + scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate); + bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len) { struct scsi_vpd_logical_block_prov *lbp_ptr; @@ -10215,8 +10272,12 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; lbp_ptr->page_code = SVPD_LBP; - if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) - lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10; + scsi_ulto2b(sizeof(*lbp_ptr) - 4, lbp_ptr->page_length); + if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | + SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; + lbp_ptr->prov_type = SVPD_LBP_RESOURCE; + } ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -10259,6 +10320,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi case SVPD_BLOCK_LIMITS: retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); break; + case SVPD_BDC: + retval = ctl_inquiry_evpd_bdc(ctsio, alloc_len); + break; case SVPD_LBP: retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len); break; Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Aug 6 00:36:04 2014 (r269621) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Aug 6 08:54:31 2014 (r269622) @@ -1039,8 +1039,8 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b softc = be_lun->softc; lbalen = ARGS(beio->io); - if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP) || - (lbalen->flags & SWS_UNMAP && be_lun->unmap == NULL)) { + if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP | SWS_ANCHOR) || + (lbalen->flags & (SWS_UNMAP | SWS_ANCHOR) && be_lun->unmap == NULL)) { ctl_free_beio(beio); ctl_set_invalid_field(&io->scsiio, /*sks_valid*/ 1, @@ -1076,7 +1076,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b break; } - if (lbalen->flags & SWS_UNMAP) { + if (lbalen->flags & (SWS_UNMAP | SWS_ANCHOR)) { beio->io_offset = lbalen->lba * be_lun->blocksize; beio->io_len = (uint64_t)lbalen->len * be_lun->blocksize; beio->bio_cmd = BIO_DELETE; @@ -1146,7 +1146,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct softc = be_lun->softc; ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; - if (ptrlen->flags != 0 || be_lun->unmap == NULL) { + if ((ptrlen->flags & ~SU_ANCHOR) != 0 || be_lun->unmap == NULL) { ctl_free_beio(beio); ctl_set_invalid_field(&io->scsiio, /*sks_valid*/ 0, Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 6 00:36:04 2014 (r269621) +++ head/sys/cam/ctl/ctl_cmd_table.c Wed Aug 6 08:54:31 2014 (r269622) @@ -785,12 +785,12 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 10, {0x0a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, + 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, /* 42 READ SUB-CHANNEL / UNMAP */ {ctl_unmap, CTL_SERIDX_UNMAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE, - 10, {0, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, + 10, {1, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, /* 43 READ TOC/PMA/ATIP */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -1085,7 +1085,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 16, {0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 94 */ Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Aug 6 00:36:04 2014 (r269621) +++ head/sys/cam/scsi/scsi_all.h Wed Aug 6 08:54:31 2014 (r269622) @@ -2315,6 +2315,27 @@ struct scsi_vpd_block_characteristics }; /* + * Block Device Characteristics VPD Page + */ +struct scsi_vpd_block_device_characteristics +{ + uint8_t device; + uint8_t page_code; +#define SVPD_BDC 0xB1 + uint8_t page_length[2]; + uint8_t medium_rotation_rate[2]; +#define SVPD_NOT_REPORTED 0x0000 +#define SVPD_NON_ROTATING 0x0001 + uint8_t product_type; + uint8_t wab_wac_ff; + uint8_t flags; +#define SVPD_VBULS 0x01 +#define SVPD_FUAB 0x02 +#define SVPD_HAW_ZBC 0x10 + uint8_t reserved[55]; +}; + +/* * Logical Block Provisioning VPD Page based on * T10/1799-D Revision 31 */ From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 08:58:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8FDA6FD for ; Wed, 6 Aug 2014 08:58:32 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84D462785 for ; Wed, 6 Aug 2014 08:58:32 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by gateway1.nyi.internal (Postfix) with ESMTP id 5E47B2282A for ; Wed, 6 Aug 2014 04:50:15 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 06 Aug 2014 04:50:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=U8i+Nep5g+qrsmwRcpX4QospWV4=; b=XSNIaIlSK6MZpmq1xaWH29ZqxUqt tr5crUS3JhZvzDw3bt65baVjDT5tm9nU1TF73qlawl4ofm6EG6nmHY3g7+EDmUKp DYc6TUhvrvyyEszXoZL3z4P0oZTn863XjQvd1l++q47IHAAor1llmpRmqygsrc9D X1O9P/q24a+dZCc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=U8i+Nep5g+qrsmwRcpX4Qo spWV4=; b=pu29g/xQuEdcXzNpP8H+7xLORe29tpWyjnGMyBqWvzHkqW2ElDNtct Ze8YK41BecM/oV6ar16ONuXkzvgWCAEMrK7oTnkqHFV3hb4mYOXsGroBxsNiXlfz XBgBVgFp0eRTJ0kdHceH03Wj0gh+/Qov/zPkAjDKJqi/1Ws5qzql4= X-Sasl-enc: t2UtqjA7fnOqvhwwWUXeruKQ67myDbt7dYgeTsiMv8+j 1407315014 Received: from [192.168.5.197] (unknown [217.40.0.61]) by mail.messagingengine.com (Postfix) with ESMTPA id B90D66801AD; Wed, 6 Aug 2014 04:50:10 -0400 (EDT) Message-ID: <53E1EC40.8090804@fastmail.net> Date: Wed, 06 Aug 2014 09:50:08 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r269621 - head/sys/boot/common References: <53e17874.5149.1878e978@svn.freebsd.org> In-Reply-To: <53e17874.5149.1878e978@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 08:58:32 -0000 On 06/08/2014 01:36, Marcel Moolenaar wrote: > Log: > Optionally include the install command as found on Juniper products > like EX and SRX. The install command uses pkgfs to extract a kernel, > zero or more modules and a root file system from the specified package > and boots the kernel. The name of the kernel, the list of modules and > the name of the root file system can be specified by putting a > file called "metatags in the package. Nice. This is going to be really useful for people building appliances, both as a low-level recovery mechanism, and/or upgrade mechanism. From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 14:38:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E286CCD5 for ; Wed, 6 Aug 2014 14:38:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8E6624C0 for ; Wed, 6 Aug 2014 14:38:09 +0000 (UTC) Received: from skreuzer (uid 1195) (envelope-from skreuzer@FreeBSD.org) id 5608 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 14:38:09 +0000 From: Steven Kreuzer Date: Wed, 6 Aug 2014 14:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269627 - head/sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e23dd1.5608.2f200c41@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 14:38:10 -0000 Author: skreuzer (doc,ports committer) Date: Wed Aug 6 14:38:09 2014 New Revision: 269627 URL: http://svnweb.freebsd.org/changeset/base/269627 Log: Mention tmpfs(5) PR: 192389 Submitted by: yaneurabeya@gmail.com Approved by: hrs (mentor) Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Wed Aug 6 14:20:01 2014 (r269626) +++ head/sbin/mount/mount.8 Wed Aug 6 14:38:09 2014 (r269627) @@ -551,6 +551,7 @@ support for a particular file system mig .Xr mount_smbfs 8 , .Xr mount_udf 8 , .Xr mount_unionfs 8 , +.Xr tmpfs 5 , .Xr umount 8 , .Xr zfs 8 , .Xr zpool 8 From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 17:02:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D16CBD18 for ; Wed, 6 Aug 2014 17:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E2027E3 for ; Wed, 6 Aug 2014 17:02:19 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 506b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 17:02:19 +0000 From: Alexander Motin Date: Wed, 6 Aug 2014 17:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269631 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e25f9b.506b.2fc5af04@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 17:02:19 -0000 Author: mav Date: Wed Aug 6 17:02:19 2014 New Revision: 269631 URL: http://svnweb.freebsd.org/changeset/base/269631 Log: Reduce reported additional INQUIRY data length. sizeof(struct scsi_inquiry_data) of 256 bytes combined with off-by-one error in the changed code gave total INQUIRY data length above 255 bytes, that was maximal INQUIRY length in SPC-2. While SPC-3 increased the maximal length to 64K, at least sg3_utils are still confused by that. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Aug 6 16:44:31 2014 (r269630) +++ head/sys/cam/ctl/ctl.c Wed Aug 6 17:02:19 2014 (r269631) @@ -10462,7 +10462,9 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio */ inq_ptr->response_format = SID_HiSup | 2; - inq_ptr->additional_length = sizeof(*inq_ptr) - 4; + inq_ptr->additional_length = + offsetof(struct scsi_inquiry_data, vendor_specific1) - + (offsetof(struct scsi_inquiry_data, additional_length) + 1); CTL_DEBUG_PRINT(("additional_length = %d\n", inq_ptr->additional_length)); From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 17:46:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D4DCBF5 for ; Wed, 6 Aug 2014 17:46:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 635AF2D50 for ; Wed, 6 Aug 2014 17:46:00 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5f11 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 17:46:00 +0000 From: Roger Pau Monné Date: Wed, 6 Aug 2014 17:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269634 - in head/sys/dev/drm2: i915 ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e269d8.5f11.5b973b7c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 17:46:00 -0000 Author: royger Date: Wed Aug 6 17:45:59 2014 New Revision: 269634 URL: http://svnweb.freebsd.org/changeset/base/269634 Log: drm: fix usage of vm_phys_fictitious_to_vm_page vm_phys_fictitious_to_vm_page should not be called directly, even when operating on a range that has been registered using vm_phys_fictitious_reg_range. PHYS_TO_VM_PAGE should be used instead because on arches that use VM_PHYSSEG_DENSE the page might come directly from vm_page_array. Reported by: nwhitehorn Tested by: nwhitehorn, David Mackay Sponsored by: Citrix Systems R&D Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Aug 6 17:40:11 2014 (r269633) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Aug 6 17:45:59 2014 (r269634) @@ -1428,8 +1428,10 @@ retry: obj->fault_mappable = true; VM_OBJECT_WLOCK(vm_obj); - m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + - offset); + m = PHYS_TO_VM_PAGE(dev->agp->base + obj->gtt_offset + offset); + KASSERT((m->flags & PG_FICTITIOUS) != 0, + ("physical address %#jx not fictitious", + (uintmax_t)(dev->agp->base + obj->gtt_offset + offset))); if (m == NULL) { VM_OBJECT_WUNLOCK(vm_obj); cause = 60; Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Aug 6 17:40:11 2014 (r269633) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Aug 6 17:45:59 2014 (r269634) @@ -216,8 +216,12 @@ reserve: } if (bo->mem.bus.is_iomem) { - m = vm_phys_fictitious_to_vm_page(bo->mem.bus.base + - bo->mem.bus.offset + offset); + m = PHYS_TO_VM_PAGE(bo->mem.bus.base + bo->mem.bus.offset + + offset); + KASSERT((m->flags & PG_FICTITIOUS) != 0, + ("physical address %#jx not fictitious", + (uintmax_t)(bo->mem.bus.base + bo->mem.bus.offset + + offset))); pmap_page_set_memattr(m, ttm_io_prot(bo->mem.placement)); } else { ttm = bo->ttm; From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 18:13:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 262EF2B8 for ; Wed, 6 Aug 2014 18:13:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F10CD2139 for ; Wed, 6 Aug 2014 18:13:09 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 5a5d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 18:13:09 +0000 From: Nathan Whitehorn Date: Wed, 6 Aug 2014 18:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269636 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e27035.5a5d.5e609498@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 18:13:10 -0000 Author: nwhitehorn Date: Wed Aug 6 18:13:09 2014 New Revision: 269636 URL: http://svnweb.freebsd.org/changeset/base/269636 Log: Set fb_pbase properly on PowerPC in the case where we have to guess at the right register bank for the framebuffer. Disable the assigned-addresses path on SPARC since it is just a hack for IBM PPC systems and was neither relevant for nor worked on SPARC anyway. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Aug 6 18:09:46 2014 (r269635) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Aug 6 18:13:09 2014 (r269636) @@ -337,6 +337,8 @@ ofwfb_init(struct vt_device *vd) #else #error Unsupported platform! #endif + + sc->fb.fb_pbase = fb_phys; } else { /* * Some IBM systems don't have an address property. Try to @@ -386,17 +388,13 @@ ofwfb_init(struct vt_device *vd) #if defined(__powerpc__) OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase); - #elif defined(__sparc64__) - OF_decode_addr(node, fb_phys, &space, &phys); - sc->sc_memt = &ofwfb_memt[0]; - sc->fb.fb_vbase = sparc64_fake_bustag(space, phys, sc->sc_memt); + sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */ #else /* No ability to interpret assigned-addresses otherwise */ return (CN_DEAD); #endif } - sc->fb.fb_pbase = fb_phys; ofwfb_initialize(vd); vt_fb_init(vd); From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 18:59:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D935FC19 for ; Wed, 6 Aug 2014 18:59:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA422644 for ; Wed, 6 Aug 2014 18:59:39 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 58ee by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 18:59:39 +0000 From: Adrian Chadd Date: Wed, 6 Aug 2014 18:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269638 - head/tools/tools/ath/athdecode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e27b1b.58ee.439e7b54@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 18:59:39 -0000 Author: adrian Date: Wed Aug 6 18:59:39 2014 New Revision: 269638 URL: http://svnweb.freebsd.org/changeset/base/269638 Log: Fix athdecode to actually work. * Add AR9287 and AR9331 chipset support - it just uses the AR5416 support for now so some of the register mappings are wrong, but it works well enough. * don't call exit() from opmark(). Modified: head/tools/tools/ath/athdecode/main.c Modified: head/tools/tools/ath/athdecode/main.c ============================================================================== --- head/tools/tools/ath/athdecode/main.c Wed Aug 6 18:15:33 2014 (r269637) +++ head/tools/tools/ath/athdecode/main.c Wed Aug 6 18:59:39 2014 (r269638) @@ -192,7 +192,7 @@ opmark(FILE *fd, int i, const struct ath fprintf(fd, "mark #%u value %u/0x%x", r->reg, r->val, r->val); break; } - exit(0); + return (NULL); } #include "ah_devid.h" @@ -260,6 +260,9 @@ opdevice(const struct athregrec *r) case AR9280_DEVID_PCI: case AR9280_DEVID_PCIE: case AR9285_DEVID_PCIE: + case AR9287_DEVID_PCI: + case AR9287_DEVID_PCIE: + case AR9300_DEVID_AR9330: state.chipnum = 5416; state.revs.ah_macVersion = 13; state.revs.ah_macRev = 8; From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:04:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08D27DB7 for ; Wed, 6 Aug 2014 19:04:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB0BC2701 for ; Wed, 6 Aug 2014 19:04:06 +0000 (UTC) Received: from gjb (uid 1237) (envelope-from gjb@FreeBSD.org) id 5c51 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:04:05 +0000 From: Glen Barber Date: Wed, 6 Aug 2014 19:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269639 - in head/release: . arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e27c25.5c51.37e0e59@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 19:04:07 -0000 Author: gjb Date: Wed Aug 6 19:04:05 2014 New Revision: 269639 URL: http://svnweb.freebsd.org/changeset/base/269639 Log: Merge the following from ^/projects/release-noxdev: r269549, r269551, r269552, r269553, r269554, r269555, r269558, r269559, r269560, r269561, r269628, r269629, r269630, r269635, r269637: r269549: Create a new project branch, release-noxdev, for a sandbox workspace outside of head/ to update the release bits for arm builds since the deprecation of the XDEV and XDEV_ARCH make(1) variables. r269551: Define load_chroot_env() and load_target_env() prototypes. r269552: Call load_chroot_env() and load_target_env() where they can be mutually conflicting with regard to TARGET, TARGET_ARCH, XDEV, and XDEV_ARCH. r269553: Add shebang line to arm/*.conf files since these should be considered to be executable (albeit not on their own) shell scripts. r269554: Redefine load_chroot_env() and load_target_env() in the arm/*.conf files, and reindent. r269555: Simplify where load_chroot_env() and load_target_env() are called. r269558: Provide example in release.conf.sample for overriding the load_chroot_env() and load_target_env() prototypes. r269559: Remove a gratuitous newline. r269560: Unset potentially conflicting variables in load_chroot_env() and load_target_env(). r269561: Make global variables global, and accessible outside of the functions within which they were once defined. r269628: Remove XDEV/XDEV_ARCH evaluation if EMBEDDEDBUILD is set. r269629: In arm/release.sh, switch TARGET/TARGET_ARCH back to the original XDEV/XDEV_ARCH make(1) variables. In theory, this should have been a no-op, but the TARGET and TARGET_ARCH are now unset in load_target_env() to avoid collision with the chroot userland. r269630: Export variables in the arm/*.conf files because they need to be passed through release.sh to arm/release.sh. Set MK_TESTS=no for the xdev target. r269635: As part of the XDEV/XDEV_ARCH deprecation, the 'xdev-links' target was intentionally no longer invoked automatically. Invoke the xdev-links target after xdev, which creates, for example, /usr/bin/armv6-freebsd-cc symlink to /usr/armv6-freebsd/usr/bin/cc. r269637: Set TARGET and TARGET_ARCH to the XDEV and XDEV_ARCH counterparts for the xdev and xdev-links make(1) targets. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/WANDBOARD-QUAD.conf head/release/arm/ZEDBOARD.conf head/release/arm/release.sh head/release/release.conf.sample head/release/release.sh Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/BEAGLEBONE.conf Wed Aug 6 19:04:05 2014 (r269639) @@ -1,30 +1,37 @@ +#!/bin/sh # # $FreeBSD$ # +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 + # Build chroot configuration -TARGET="amd64" -TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" -NODOC=yes +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} # Build target configuration -# Since this file is sourced by a script that runs another -# script, these must be exported. -set -a -WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" -EMBEDDEDBUILD=1 -EMBEDDEDPORTS="lang/python textproc/gsed" -XDEV="arm" -XDEV_ARCH="armv6" -XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" -KERNEL="BEAGLEBONE" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" -set +a - +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export EMBEDDEDPORTS="lang/python textproc/gsed" + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="BEAGLEBONE" + export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETBRANCH="trunk" +} Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/PANDABOARD.conf Wed Aug 6 19:04:05 2014 (r269639) @@ -1,30 +1,37 @@ +#!/bin/sh # # $FreeBSD$ # +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="lang/python textproc/gsed" + # Build chroot configuration -TARGET="amd64" -TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" -NODOC=yes +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} # Build target configuration -# Since this file is sourced by a script that runs another -# script, these must be exported. -set -a -WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" -EMBEDDEDBUILD=1 -EMBEDDEDPORTS="lang/python textproc/gsed" -XDEV="arm" -XDEV_ARCH="armv6" -XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" -KERNEL="PANDABOARD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" -set +a - +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="PANDABOARD" + export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETBRANCH="trunk" +} Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/RPI-B.conf Wed Aug 6 19:04:05 2014 (r269639) @@ -1,32 +1,40 @@ +#!/bin/sh # # $FreeBSD$ # +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="lang/python textproc/gsed" + # Build chroot configuration -TARGET="amd64" -TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" -NODOC=yes +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} # Build target configuration -# Since this file is sourced by a script that runs another -# script, these must be exported. -set -a -WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" -EMBEDDEDBUILD=1 -EMBEDDEDPORTS="lang/python textproc/gsed" -XDEV="arm" -XDEV_ARCH="armv6" -XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" -KERNEL="RPI-B" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" -UBOOTSRC="https://github.com/gonzoua/u-boot-pi" -UBOOTBRANCH="trunk" -UBOOTDIR="/tmp/crochet/u-boot-rpi" -set +a +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="RPI-B" + export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETBRANCH="trunk" + export UBOOTSRC="https://github.com/gonzoua/u-boot-pi" + export UBOOTBRANCH="trunk" + export UBOOTDIR="/tmp/crochet/u-boot-rpi" +} Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/WANDBOARD-QUAD.conf Wed Aug 6 19:04:05 2014 (r269639) @@ -1,30 +1,37 @@ +#!/bin/sh # # $FreeBSD$ # +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 +export EMBEDDEDPORTS="lang/python textproc/gsed" + # Build chroot configuration -TARGET="amd64" -TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" -NODOC=yes +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} # Build target configuration -# Since this file is sourced by a script that runs another -# script, these must be exported. -set -a -WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" -EMBEDDEDBUILD=1 -EMBEDDEDPORTS="lang/python textproc/gsed" -XDEV="arm" -XDEV_ARCH="armv6" -XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" -KERNEL="WANDBOARD-QUAD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" -set +a - +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="WANDBOARD-QUAD" + export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETBRANCH="trunk" +} Modified: head/release/arm/ZEDBOARD.conf ============================================================================== --- head/release/arm/ZEDBOARD.conf Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/ZEDBOARD.conf Wed Aug 6 19:04:05 2014 (r269639) @@ -1,29 +1,36 @@ +#!/bin/sh # # $FreeBSD$ # +# Global variables. +export SVNROOT="svn://svn.FreeBSD.org/" +export SRCBRANCH="base/head@rHEAD" +export DOCBRANCH="doc/head@rHEAD" +export PORTBRANCH="ports/head@rHEAD" +export NODOC=yes +export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +export export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +export CHROOTDIR="/scratch" +export EMBEDDEDBUILD=1 + # Build chroot configuration -TARGET="amd64" -TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org/" -SRCBRANCH="base/head@rHEAD" -DOCBRANCH="doc/head@rHEAD" -PORTBRANCH="ports/head@rHEAD" -NODOC=yes +load_chroot_env() { + # Avoid collision with TARGET and XDEV. + unset XDEV XDEV_ARCH KERNEL + export TARGET="amd64" + export TARGET_ARCH="amd64" +} # Build target configuration -# Since this file is sourced by a script that runs another -# script, these must be exported. -set -a -WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" -CHROOTDIR="/scratch" -EMBEDDEDBUILD=1 -XDEV="arm" -XDEV_ARCH="armv6" -XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" -KERNEL="ZEDBOARD" -CROCHETSRC="https://github.com/kientzle/crochet-freebsd" -CROCHETBRANCH="trunk" -set +a - +load_target_env() { + # Avoid collision with TARGET and XDEV. + unset TARGET TARGET_ARCH + export XDEV="arm" + export XDEV_ARCH="armv6" + export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" + export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no" + export KERNEL="ZEDBOARD" + export CROCHETSRC="https://github.com/kientzle/crochet-freebsd" + export CROCHETBRANCH="trunk" +} Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/arm/release.sh Wed Aug 6 19:04:05 2014 (r269639) @@ -94,9 +94,17 @@ install_uboot() { main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - ${XDEV_FLAGS} TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ + ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ + TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev + # Install the cross-build symlinks to /usr/bin to make crochet + # happy. + eval chroot ${CHROOTDIR} make -C /usr/src \ + ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ + TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ + ${WORLD_FLAGS} xdev-links + # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints # is created. eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/release.conf.sample Wed Aug 6 19:04:05 2014 (r269639) @@ -3,6 +3,11 @@ # $FreeBSD$ # +# Redefine environment variables here to override prototypes +# defined in release.sh. +load_chroot_env() { } +load_target_env() { } + ## Set the directory within which the release will be built. CHROOTDIR="/scratch" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Aug 6 18:59:39 2014 (r269638) +++ head/release/release.sh Wed Aug 6 19:04:05 2014 (r269639) @@ -39,6 +39,10 @@ PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" export PATH +# Prototypes that can be redefined per-chroot or per-target. +load_chroot_env() { } +load_target_env() { } + # The directory within which the release will be built. CHROOTDIR="/scratch" RELENGDIR="$(realpath $(dirname $(basename ${0})))" @@ -124,10 +128,6 @@ DOCBRANCH="${SVNROOT}${DOCBRANCH}" PORTBRANCH="${SVNROOT}${PORTBRANCH}" if [ -n "${EMBEDDEDBUILD}" ]; then - if [ -z "${XDEV}" ] || [ -z "${XDEV_ARCH}" ]; then - echo "ERROR: XDEV and XDEV_ARCH must be set in ${RELEASECONF}." - exit 1 - fi WITH_DVD= WITH_COMPRESSED_IMAGES= NODOC=yes @@ -161,6 +161,7 @@ if [ -n "${TARGET}" ] && [ -n "${TARGET_ else ARCH_FLAGS= fi +load_chroot_env CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" CHROOT_IMAKEFLAGS="${CONF_FILES}" @@ -229,6 +230,7 @@ if [ -n "${EMBEDDEDBUILD}" ]; then # release/, copy it to the /tmp/external directory within the chroot. # This allows building embedded releases without relying on updated # scripts and/or configurations to exist in the branch being built. + load_target_env if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ @@ -261,6 +263,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then fi fi +load_target_env eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:06:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5470F20 for ; Wed, 6 Aug 2014 19:06:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2D9271C for ; Wed, 6 Aug 2014 19:06:38 +0000 (UTC) Received: from gjb (uid 1237) (envelope-from gjb@FreeBSD.org) id 5c70 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:06:38 +0000 From: Glen Barber Date: Wed, 6 Aug 2014 19:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269640 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e27cbe.5c70.71a6548@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 19:06:39 -0000 Author: gjb Date: Wed Aug 6 19:06:38 2014 New Revision: 269640 URL: http://svnweb.freebsd.org/changeset/base/269640 Log: Comment load_chroot_env() and load_target_env() in the release/release.conf.sample file. The uncommented version snuck in during testing. Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Wed Aug 6 19:04:05 2014 (r269639) +++ head/release/release.conf.sample Wed Aug 6 19:06:38 2014 (r269640) @@ -3,10 +3,10 @@ # $FreeBSD$ # -# Redefine environment variables here to override prototypes -# defined in release.sh. -load_chroot_env() { } -load_target_env() { } +## Redefine environment variables here to override prototypes +## defined in release.sh. +#load_chroot_env() { } +#load_target_env() { } ## Set the directory within which the release will be built. CHROOTDIR="/scratch" From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:30:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 673415F6 for ; Wed, 6 Aug 2014 19:30:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CFDA29F8 for ; Wed, 6 Aug 2014 19:30:36 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 57b7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:30:36 +0000 From: Konstantin Belousov Date: Wed, 6 Aug 2014 19:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269642 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2825c.57b7.623bed17@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 19:30:36 -0000 Author: kib Date: Wed Aug 6 19:30:35 2014 New Revision: 269642 URL: http://svnweb.freebsd.org/changeset/base/269642 Log: Add wrappers to assert that vm object is unlocked and for try upgrade. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.h Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Wed Aug 6 19:09:21 2014 (r269641) +++ head/sys/vm/vm_object.h Wed Aug 6 19:30:35 2014 (r269642) @@ -225,6 +225,8 @@ extern struct vm_object kmem_object_stor rw_assert(&(object)->lock, RA_RLOCKED) #define VM_OBJECT_ASSERT_WLOCKED(object) \ rw_assert(&(object)->lock, RA_WLOCKED) +#define VM_OBJECT_ASSERT_UNLOCKED(object) \ + rw_assert(&(object)->lock, RA_UNLOCKED) #define VM_OBJECT_LOCK_DOWNGRADE(object) \ rw_downgrade(&(object)->lock) #define VM_OBJECT_RLOCK(object) \ @@ -237,6 +239,8 @@ extern struct vm_object kmem_object_stor rw_try_rlock(&(object)->lock) #define VM_OBJECT_TRYWLOCK(object) \ rw_try_wlock(&(object)->lock) +#define VM_OBJECT_TRYUPGRADE(object) \ + rw_try_upgrade(&(object)->lock) #define VM_OBJECT_WLOCK(object) \ rw_wlock(&(object)->lock) #define VM_OBJECT_WUNLOCK(object) \ From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:34:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E4947AF for ; Wed, 6 Aug 2014 19:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241F82A26 for ; Wed, 6 Aug 2014 19:34:04 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 57cb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:34:04 +0000 From: Konstantin Belousov Date: Wed, 6 Aug 2014 19:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269643 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2832c.57cb.3d6fef35@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 19:34:04 -0000 Author: kib Date: Wed Aug 6 19:34:03 2014 New Revision: 269643 URL: http://svnweb.freebsd.org/changeset/base/269643 Log: The vm_pager_page_unswapped() pager op is only implemented for the swap pager. Swap pager uses a private mutex to protect swap metadata, and does not rely on the vm object lock to ensure integrity of it. Weaken the requirement for the vm object lock by only asserting locked object in vm_pager_page_unswapped(), instead of locked exclusively. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_pager.h Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Wed Aug 6 19:30:35 2014 (r269642) +++ head/sys/vm/vm_pager.h Wed Aug 6 19:34:03 2014 (r269643) @@ -187,7 +187,7 @@ static __inline void vm_pager_page_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); if (pagertab[m->object->type]->pgo_pageunswapped) (*pagertab[m->object->type]->pgo_pageunswapped)(m); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 19:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD25CA19 for ; Wed, 6 Aug 2014 19:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904C22A99 for ; Wed, 6 Aug 2014 19:38:04 +0000 (UTC) Received: from np (uid 1205) (envelope-from np@FreeBSD.org) id 57e5 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 19:38:04 +0000 From: Navdeep Parhar Date: Wed, 6 Aug 2014 19:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269644 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2841c.57e5.7d9ee4dd@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 19:38:05 -0000 Author: np Date: Wed Aug 6 19:38:03 2014 New Revision: 269644 URL: http://svnweb.freebsd.org/changeset/base/269644 Log: cxgbe(4): Let caller specify whether it's ok to sleep in t4_sched_config and t4_sched_params. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/common/common.h Wed Aug 6 19:38:03 2014 (r269644) @@ -614,8 +614,10 @@ int t4_sge_ctxt_rd_bd(struct adapter *ad int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); -int t4_sched_config(struct adapter *adapter, int type, int minmaxen); +int t4_sched_config(struct adapter *adapter, int type, int minmaxen, + int sleep_ok); int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, - int minrate, int maxrate, int weight, int pktsize); + int minrate, int maxrate, int weight, int pktsize, + int sleep_ok); #endif /* __CHELSIO_COMMON_H */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Aug 6 19:38:03 2014 (r269644) @@ -5717,7 +5717,8 @@ int __devinit t4_port_init(struct port_i return 0; } -int t4_sched_config(struct adapter *adapter, int type, int minmaxen) +int t4_sched_config(struct adapter *adapter, int type, int minmaxen, + int sleep_ok) { struct fw_sched_cmd cmd; @@ -5732,12 +5733,13 @@ int t4_sched_config(struct adapter *adap cmd.u.config.minmaxen = minmaxen; return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), - NULL, 1); + NULL, sleep_ok); } int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, - int minrate, int maxrate, int weight, int pktsize) + int minrate, int maxrate, int weight, int pktsize, + int sleep_ok) { struct fw_sched_cmd cmd; @@ -5761,5 +5763,5 @@ int t4_sched_params(struct adapter *adap cmd.u.params.pktsize = cpu_to_be16(pktsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), - NULL, 1); + NULL, sleep_ok); } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Aug 6 19:34:03 2014 (r269643) +++ head/sys/dev/cxgbe/t4_main.c Wed Aug 6 19:38:03 2014 (r269644) @@ -7617,7 +7617,7 @@ set_sched_class(struct adapter *sc, stru } /* And pass the request to the firmware ...*/ - rc = -t4_sched_config(sc, fw_type, p->u.config.minmax); + rc = -t4_sched_config(sc, fw_type, p->u.config.minmax, 1); goto done; } @@ -7715,7 +7715,7 @@ set_sched_class(struct adapter *sc, stru rc = -t4_sched_params(sc, fw_type, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->u.params.channel, p->u.params.cl, p->u.params.minrate, p->u.params.maxrate, - p->u.params.weight, p->u.params.pktsize); + p->u.params.weight, p->u.params.pktsize, 1); goto done; } From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 21:16:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B736C748 for ; Wed, 6 Aug 2014 21:16:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB4E2827 for ; Wed, 6 Aug 2014 21:16:15 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 5be4 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 21:16:15 +0000 From: John-Mark Gurney Date: Wed, 6 Aug 2014 21:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269645 - head/sys/arm/xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e29b1f.5be4.42283c1c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 21:16:15 -0000 Author: jmg Date: Wed Aug 6 21:16:15 2014 New Revision: 269645 URL: http://svnweb.freebsd.org/changeset/base/269645 Log: put these under bootverbose, they are only needed for debugging, not useful for the normal user durning normal runtime... Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Wed Aug 6 19:38:03 2014 (r269644) +++ head/sys/arm/xscale/ixp425/if_npe.c Wed Aug 6 21:16:15 2014 (r269645) @@ -681,7 +681,8 @@ npe_activate(device_t dev) /* MAC */ if (!override_addr(dev, "mac", &macbase)) macbase = npeconfig[sc->sc_npeid].macbase; - device_printf(sc->sc_dev, "MAC at 0x%x\n", macbase); + if (bootverbose) + device_printf(sc->sc_dev, "MAC at 0x%x\n", macbase); if (bus_space_map(sc->sc_iot, macbase, IXP425_REG_SIZE, 0, &sc->sc_ioh)) { device_printf(dev, "cannot map mac registers 0x%x:0x%x\n", macbase, IXP425_REG_SIZE); @@ -693,7 +694,8 @@ npe_activate(device_t dev) phy = npeconfig[sc->sc_npeid].phy; if (!override_addr(dev, "mii", &miibase)) miibase = npeconfig[sc->sc_npeid].miibase; - device_printf(sc->sc_dev, "MII at 0x%x\n", miibase); + if (bootverbose) + device_printf(sc->sc_dev, "MII at 0x%x\n", miibase); if (miibase != macbase) { /* * PHY is mapped through a different MAC, setup an From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 21:27:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89DA3C72 for ; Wed, 6 Aug 2014 21:27:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6012F29AC for ; Wed, 6 Aug 2014 21:27:16 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 5f39 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 21:27:16 +0000 From: Ian Lepore Date: Wed, 6 Aug 2014 21:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269646 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e29db4.5f39.275b0c5a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 21:27:16 -0000 Author: ian Date: Wed Aug 6 21:27:15 2014 New Revision: 269646 URL: http://svnweb.freebsd.org/changeset/base/269646 Log: Use a SYSINIT to init the array of interrupt names on arm. This was called from initarm() in arm/machdep.c, but many legacy arm platforms have their own private initarm(), so a SYSINIT fixes everyone. Reported by: jmg Modified: head/sys/arm/arm/intr.c head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Wed Aug 6 21:16:15 2014 (r269645) +++ head/sys/arm/arm/intr.c Wed Aug 6 21:27:15 2014 (r269646) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,8 +76,8 @@ size_t sintrnames = sizeof(intrnames); * assumptions of vmstat(8) and the kdb "show intrcnt" command, the two * consumers of this data. */ -void -arm_intrnames_init(void) +static void +intr_init(void *unused) { int i; @@ -86,6 +87,8 @@ arm_intrnames_init(void) } } +SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); + void arm_setup_irqhandler(const char *name, driver_filter_t *filt, void (*hand)(void*), void *arg, int irq, int flags, void **cookiep) Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Aug 6 21:16:15 2014 (r269645) +++ head/sys/arm/arm/machdep.c Wed Aug 6 21:27:15 2014 (r269646) @@ -1278,7 +1278,6 @@ initarm(struct arm_boot_params *abp) init_proc0(kernelstack.pv_va); - arm_intrnames_init(); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 22:17:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7D6439B for ; Wed, 6 Aug 2014 22:17:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E122160 for ; Wed, 6 Aug 2014 22:17:33 +0000 (UTC) Received: from bapt (uid 1235) (envelope-from bapt@FreeBSD.org) id 53a9 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 22:17:26 +0000 From: Baptiste Daroussin Date: Wed, 6 Aug 2014 22:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269648 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gdbtui gnu/usr.bin/gdb/kgdb kerberos5/lib/libkrb5 kerberos5/libexec/digest-service kerberos5/libexec/kcm lib/lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2a976.53a9.7276309d@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 22:17:33 -0000 Author: bapt Date: Wed Aug 6 22:17:26 2014 New Revision: 269648 URL: http://svnweb.freebsd.org/changeset/base/269648 Log: Rework privatelib/internallib Make sure everything linking to a privatelib and/or an internallib does it directly from the OBJDIR rather than DESTDIR. Add src.libnames.mk so bsd.libnames.mk is not polluted by libraries not existsing in final installation Introduce the LD* variable which is what ld(1) is expecting (via LDADD) to link to internal/privatelib Directly link to the .so in case of private library to avoid having to complexify LDFLAGS. Phabric: https://phabric.freebsd.org/D553 Reviewed by: imp, emaste Added: head/share/mk/src.libnames.mk (contents, props changed) Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/gdbtui/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile head/kerberos5/lib/libkrb5/Makefile head/kerberos5/libexec/digest-service/Makefile head/kerberos5/libexec/kcm/Makefile head/lib/libpam/modules/pam_ssh/Makefile head/libexec/atf/atf-check/Makefile head/libexec/atf/atf-sh/Makefile head/secure/lib/libssh/Makefile head/secure/libexec/sftp-server/Makefile head/secure/libexec/ssh-keysign/Makefile head/secure/libexec/ssh-pkcs11-helper/Makefile head/secure/usr.bin/scp/Makefile head/secure/usr.bin/sftp/Makefile head/secure/usr.bin/ssh-add/Makefile head/secure/usr.bin/ssh-agent/Makefile head/secure/usr.bin/ssh-keygen/Makefile head/secure/usr.bin/ssh-keyscan/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile head/share/mk/atf.test.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.libnames.mk head/usr.bin/drill/Makefile head/usr.bin/host/Makefile head/usr.sbin/pkg/Makefile head/usr.sbin/unbound/anchor/Makefile head/usr.sbin/unbound/checkconf/Makefile head/usr.sbin/unbound/control/Makefile head/usr.sbin/unbound/daemon/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Aug 6 22:15:01 2014 (r269647) +++ head/ObsoleteFiles.inc Wed Aug 6 22:17:26 2014 (r269648) @@ -38,6 +38,31 @@ # xargs -n1 | sort | uniq -d; # done +# 20140807: Remove private lib files that should not be installed. +OLD_FILES+=usr/lib/private/libatf-c.a +OLD_FILES+=usr/lib/private/libatf-c.so +OLD_FILES+=usr/lib/private/libatf-c_p.a +OLD_FILES+=usr/lib/private/libatf-c++.a +OLD_FILES+=usr/lib/private/libatf-c++.so +OLD_FILES+=usr/lib/private/libatf-c++_p.a +OLD_FILES+=usr/lib/private/libheimipcc.a +OLD_FILES+=usr/lib/private/libheimipcc.so +OLD_FILES+=usr/lib/private/libheimipcc_p.a +OLD_FILES+=usr/lib/private/libheimipcs.a +OLD_FILES+=usr/lib/private/libheimipcs.so +OLD_FILES+=usr/lib/private/libheimipcs_p.a +OLD_FILES+=usr/lib/private/libldns.a +OLD_FILES+=usr/lib/private/libldns.so +OLD_FILES+=usr/lib/private/libldns_p.a +OLD_FILES+=usr/lib/private/libssh.a +OLD_FILES+=usr/lib/private/libssh.so +OLD_FILES+=usr/lib/private/libssh.p.a +OLD_FILES+=usr/lib/private/libunbound.a +OLD_FILES+=usr/lib/private/libunbound.so +OLD_FILES+=usr/lib/private/libunbound_p.a +OLD_FILES+=usr/lib/private/libucl.a +OLD_FILES+=usr/lib/private/libucl.so +OLD_FILES+=usr/lib/private/libucl_p.a # 20140803: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/pmap_change_wiring.9.gz # 20140728: libsbuf restored to old version. Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Wed Aug 6 22:15:01 2014 (r269647) +++ head/gnu/usr.bin/gdb/Makefile.inc Wed Aug 6 22:17:26 2014 (r269648) @@ -16,7 +16,6 @@ OBJ_ROOT= ${.OBJDIR}/../.. OBJ_BU= ${OBJ_ROOT}/binutils OBJ_GDB= ${OBJ_ROOT}/gdb OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/readline -LIBREADLINE= ${OBJ_ROOT}/../lib/libreadline/readline/libreadline.a # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/gnu/usr.bin/gdb/gdb/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,7 +12,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcapw -lgnuregex +LDADD= ${GDBLIBS} ${BULIBS} -lm ${LDREADLINE} -ltermcapw -lgnuregex NO_PIE= yes Modified: head/gnu/usr.bin/gdb/gdbtui/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbtui/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/gnu/usr.bin/gdb/gdbtui/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -13,7 +13,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcapw -lgnuregex +LDADD= ${GDBLIBS} ${BULIBS} -lm ${LDREADLINE} -ltermcapw -lgnuregex NO_PIE= yes Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -10,7 +10,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} \ ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LIBREADLINE} -ltermcapw \ +LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LDREADLINE} -ltermcapw \ -lgnuregex .if defined(GDB_CROSS_DEBUGGER) Modified: head/kerberos5/lib/libkrb5/Makefile ============================================================================== --- head/kerberos5/lib/libkrb5/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/kerberos5/lib/libkrb5/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -3,7 +3,7 @@ LIB= krb5 LDFLAGS= -Wl,--no-undefined VERSION_MAP= ${KRB5DIR}/lib/krb5/version-script.map -LDADD= -lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken -lwind -lheimbase -lheimipcc +LDADD= -lasn1 -lcom_err -lcrypt -lcrypto -lhx509 -lroken -lwind -lheimbase ${LDHEIMIPCC} DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} ${LIBHX509} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC} USEPRIVATELIB= heimipcc Modified: head/kerberos5/libexec/digest-service/Makefile ============================================================================== --- head/kerberos5/libexec/digest-service/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/kerberos5/libexec/digest-service/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -10,7 +10,7 @@ CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/roken DPADD= ${LIBHDB} ${LIBKDC} ${LIBHEIMIPCS} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} \ ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} -LDADD= -lhdb -lkdc -lheimipcs -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \ +LDADD= -lhdb -lkdc ${LDHEIMIPCS} -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \ ${LIBVERS} -lheimntlm USEPRIVATELIB= heimipcs Modified: head/kerberos5/libexec/kcm/Makefile ============================================================================== --- head/kerberos5/libexec/kcm/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/kerberos5/libexec/kcm/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -21,7 +21,7 @@ CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DI -I${KRB5DIR}/kcm -I${KRB5DIR}/lib/ipc ${LDAPCFLAGS} DPADD= ${LIBHDB} ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBHEIMNTLM} \ ${LIBHEIMIPCS} ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} ${LDAPDPADD} -LDADD= -lhdb -lkrb5 -lroken -lasn1 -lheimntlm -lheimipcs \ +LDADD= -lhdb -lkrb5 -lroken -lasn1 -lheimntlm ${LDHEIMIPCS} \ -lcrypto -lcrypt ${LIBVERS} ${LDAPLDADD} USEPRIVATELIB= heimipcs LDFLAGS=${LDAPLDFLAGS} Modified: head/lib/libpam/modules/pam_ssh/Makefile ============================================================================== --- head/lib/libpam/modules/pam_ssh/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/lib/libpam/modules/pam_ssh/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -14,7 +14,7 @@ WARNS?= 3 CFLAGS+= -I${SSHDIR} -include ssh_namespace.h DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} -LDADD= -lssh -lcrypto -lcrypt +LDADD= ${LDSSH} -lcrypto -lcrypt USEPRIVATELIB= ssh .include Modified: head/libexec/atf/atf-check/Makefile ============================================================================== --- head/libexec/atf/atf-check/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/libexec/atf/atf-check/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -37,10 +37,8 @@ MAN= atf-check.1 CFLAGS+= -I${ATF} -LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c++ -LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c DPADD+= ${LIBATF_CXX} ${LIBATF_C} -LDADD+= -latf-c++ -latf-c +LDADD+= ${LDATF_CXX} ${LDATF_C} USEPRIVATELIB= atf-c++ atf-c .if ${MK_TESTS} != "no" Modified: head/libexec/atf/atf-sh/Makefile ============================================================================== --- head/libexec/atf/atf-sh/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/libexec/atf/atf-sh/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -39,7 +39,7 @@ CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -I${ATF} DPADD+= ${LIBATF_C} ${LIBATF_CXX} -LDADD+= -latf-c++ -latf-c +LDADD+= ${LDATF_C} ${LDATF_CXX} USEPRIVATELIB= atf-c++ atf-c FILESGROUPS= SUBR Modified: head/secure/lib/libssh/Makefile ============================================================================== --- head/secure/lib/libssh/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/lib/libssh/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -35,7 +35,7 @@ LDNSDIR= ${.CURDIR}/../../../contrib/ldn CFLAGS+= -DHAVE_LDNS=1 -I${LDNSDIR} SRCS+= getrrsetbyname-ldns.c DPADD+= ${LIBLDNS} -LDADD+= -lldns +LDADD+= ${LDLDNS} USEPRIVATELIB+= ldns .endif Modified: head/secure/libexec/sftp-server/Makefile ============================================================================== --- head/secure/libexec/sftp-server/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/libexec/sftp-server/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -13,7 +13,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/libexec/ssh-keysign/Makefile ============================================================================== --- head/secure/libexec/ssh-keysign/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/libexec/ssh-keysign/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -9,7 +9,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa BINMODE=4555 DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/libexec/ssh-pkcs11-helper/Makefile ============================================================================== --- head/secure/libexec/ssh-pkcs11-helper/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/libexec/ssh-pkcs11-helper/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -13,7 +13,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/scp/Makefile ============================================================================== --- head/secure/usr.bin/scp/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/scp/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,7 +12,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/sftp/Makefile ============================================================================== --- head/secure/usr.bin/sftp/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/sftp/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,7 +12,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} ${LIBEDIT} ${LIBNCURSESW} -LDADD= -lssh -ledit -lncursesw +LDADD= ${LDSSH} -ledit -lncursesw USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/ssh-add/Makefile ============================================================================== --- head/secure/usr.bin/ssh-add/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/ssh-add/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,7 +12,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/ssh-agent/Makefile ============================================================================== --- head/secure/usr.bin/ssh-agent/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/ssh-agent/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,7 +12,7 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/ssh-keygen/Makefile ============================================================================== --- head/secure/usr.bin/ssh-keygen/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/ssh-keygen/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -12,13 +12,13 @@ SRCS+= roaming_dummy.c .endif DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" CFLAGS+= -DHAVE_LDNS=1 DPADD+= ${LIBLDNS} -LDADD+= -lldns +LDADD+= ${LDLDNS} USEPRIVATELIB+= ldns .endif Modified: head/secure/usr.bin/ssh-keyscan/Makefile ============================================================================== --- head/secure/usr.bin/ssh-keyscan/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/ssh-keyscan/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -7,7 +7,7 @@ SRCS= ssh-keyscan.c roaming_dummy.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h DPADD= ${LIBSSH} -LDADD= -lssh +LDADD= ${LDSSH} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.bin/ssh/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -16,13 +16,13 @@ SRCS= ssh.c readconf.c clientloop.c ssht SRCS+= gss-genr.c DPADD= ${LIBSSH} ${LIBUTIL} -LDADD= -lssh -lutil +LDADD= ${LDSSH} -lutil USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" CFLAGS+= -DHAVE_LDNS=1 DPADD+= ${LIBLDNS} -LDADD+= -lldns +LDADD+= ${LIBLDNSADD} USEPRIVATELIB+= ldns .endif Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/secure/usr.sbin/sshd/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -26,7 +26,7 @@ MAN= sshd.8 sshd_config.5 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h DPADD= ${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM} -LDADD= -lssh -lutil -lwrap ${MINUSLPAM} +LDADD= ${LDSSH} -lutil -lwrap ${MINUSLPAM} USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" @@ -47,7 +47,7 @@ CFLAGS+= -include krb5_config.h DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} \ ${LIBCOM_ERR} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC} LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lhx509 -lasn1 \ - -lcom_err -lroken -lwind -lheimbase -lheimipcc + -lcom_err -lroken -lwind -lheimbase ${LDHEIMIPCC} .endif .if ${MK_OPENSSH_NONE_CIPHER} != "no" Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Wed Aug 6 22:15:01 2014 (r269647) +++ head/share/mk/atf.test.mk Wed Aug 6 22:17:26 2014 (r269648) @@ -71,7 +71,7 @@ BINDIR.${_T}= ${TESTSDIR} MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.c DPADD.${_T}+= ${LIBATF_C} -LDADD.${_T}+= -latf-c +LDADD.${_T}+= ${LDATF_C} USEPRIVATELIB+= atf-c TEST_INTERFACE.${_T}= atf .endfor @@ -85,7 +85,7 @@ BINDIR.${_T}= ${TESTSDIR} MAN.${_T}?= # empty SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} -LDADD.${_T}+= -latf-c++ -latf-c +LDADD.${_T}+= ${LDATF_CXX} ${LDATF_C} USEPRIVATELIB+= atf-c++ TEST_INTERFACE.${_T}= atf .endfor Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Aug 6 22:15:01 2014 (r269647) +++ head/share/mk/bsd.lib.mk Wed Aug 6 22:17:26 2014 (r269648) @@ -155,7 +155,7 @@ LDFLAGS+= -Wl,--version-script=${VERSION .endif .if defined(USEPRIVATELIB) -LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR} +LDFLAGS+= -rpath ${LIBPRIVATEDIR} .endif .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) @@ -306,11 +306,11 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${i realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: -.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" +.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" && !defined(PRIVATELIB) ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${_LIBDIR} .endif -.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) +.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) && !defined(PRIVATELIB) ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${_LIBDIR} .endif @@ -326,7 +326,7 @@ _libinstall: ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} .endif -.if defined(SHLIB_LINK) +.if defined(SHLIB_LINK) && !defined(PRIVATELIB) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory # prefix where shared objects will be installed by the install target. @@ -367,7 +367,7 @@ _libinstall: .endif # SHLIB_LDSCRIPT .endif # SHLIB_LINK .endif # SHIB_NAME -.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" +.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" && !defined(PRIVATELIB) ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR} .endif Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Wed Aug 6 22:15:01 2014 (r269647) +++ head/share/mk/bsd.libnames.mk Wed Aug 6 22:17:26 2014 (r269648) @@ -8,13 +8,13 @@ .error bsd.libnames.mk cannot be included directly. .endif +.sinclude + LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a -LIBATF_C?= ${DESTDIR}${LIBPRIVATEDIR}/libatf-c.a -LIBATF_CXX?= ${DESTDIR}${LIBPRIVATEDIR}/libatf-c++.a LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a @@ -58,8 +58,6 @@ LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssap LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a -LIBHEIMIPCC?= ${DESTDIR}${LIBPRIVATEDIR}/libheimipcc.a -LIBHEIMIPCS?= ${DESTDIR}${LIBPRIVATEDIR}/libheimipcs.a LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a @@ -74,7 +72,6 @@ LIBKICONV?= ${DESTDIR}${LIBDIR}/libkicon LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a LIBL?= ${DESTDIR}${LIBDIR}/libl.a -LIBLDNS?= ${DESTDIR}${LIBPRIVATEDIR}/libldns.a LIBLN?= "don't use LIBLN, use LIBL" LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR}/libm.a @@ -134,7 +131,6 @@ LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a -LIBSSH?= ${DESTDIR}${LIBPRIVATEDIR}/libssh.a LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a @@ -142,11 +138,9 @@ LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacp LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" -LIBUCL?= ${DESTDIR}${LIBPRIVATEDIR}/libucl.a LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -LIBUNBOUND?= ${DESTDIR}${LIBPRIVATEDIR}/libunbound.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a Added: head/share/mk/src.libnames.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/src.libnames.mk Wed Aug 6 22:17:26 2014 (r269648) @@ -0,0 +1,46 @@ +# $FreeBSD$ +# +# The include file define library names suitable +# for INTERNALLIB and PRIVATELIB definition + +.if !target(____) +.error src.libnames.mk cannot be included directly. +.endif + +ROOTOBJDIR= ${.OBJDIR:S/${.CURDIR}//}${.MAKE.MAKEFILES:M*/src.libnames.mk:H:H:H} + +LIBATF_CDIR= ${ROOTOBJDIR}/lib/atf/libatf-c +LDATF_C?= ${LIBATF_CDIR}/libatf-c.so +LIBATF_C?= ${LIBATF_CDIR}/libatf-c.a + +LIBATF_CXXDIR= ${ROOTOBJDIR}/lib/atf/libatf-c++ +LDATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.so +LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a + +LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc +LDHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.so +LIBHEIMIPCC?= ${LIBHEIMIPCCDIR}/libheimipcc.a + +LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs +LDHEIMIPCS?= ${LIBHEIMIPCSDIR}/libheimipcs.so +LIBHEIMIPCS?= ${LIBHEIMIPCSDIR}/libheimipcs.a + +LIBLDNSDIR= ${ROOTOBJDIR}/lib/libldns +LDLDNS?= ${LIBLDNSDIR}/libldns.so +LIBLDNS?= ${LIBLDNSDIR}/libldns.a + +LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh +LDSSH?= ${LIBSSHDIR}/libssh.so +LIBSSH?= ${LIBSSHDIR}/libssh.a + +LIBUNBOUNDDIR= ${ROOTOBJDIR}/lib/libunbound +LDUNBOUND?= ${LIBUNBOUNDDIR}/libunbound.so +LIBUNBOUND?= ${LIBUNBOUNDDIR}/libunbound.a + +LIBUCLDIR= ${ROOTOBJDIR}/lib/libucl +LDUCL?= ${LIBUCLDIR}/libucl.so +LIBUCL?= ${LIBUCLDIR}/libucl.a + +LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline +LDREADLINE?= ${LIBREADLINEDIR}/libreadline.a +LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a Modified: head/usr.bin/drill/Makefile ============================================================================== --- head/usr.bin/drill/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.bin/drill/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -13,7 +13,7 @@ NO_WERROR= true MAN= drill.1 DPADD+= ${LIBLDNS} ${LIBCRYPTO} -LDADD+= -lldns -lcrypto +LDADD+= ${LDLDNS} -lcrypto USEPRIVATELIB= ldns .include Modified: head/usr.bin/host/Makefile ============================================================================== --- head/usr.bin/host/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.bin/host/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -15,7 +15,7 @@ host.1: ldns-host.1 CFLAGS+= -I${LDNSDIR} DPADD+= ${LIBLDNS} ${LIBCRYPTO} -LDADD+= -lldns -lcrypto +LDADD+= ${LDLDNS} -lcrypto USEPRIVATELIB= ldns .include Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.sbin/pkg/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -8,7 +8,7 @@ CFLAGS+=-I${.CURDIR}/../../contrib/libuc .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} ${LIBM} -LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm +LDADD= -larchive -lelf -lfetch ${LDUCL} -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include Modified: head/usr.sbin/unbound/anchor/Makefile ============================================================================== --- head/usr.sbin/unbound/anchor/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.sbin/unbound/anchor/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -11,7 +11,7 @@ PROG= unbound-anchor SRCS= unbound-anchor.c CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib DPADD= ${LIBUNBOUND} ${LIBLDNS} ${LIBUTIL} ${LIBBSDXML} ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD} -LDADD= -lunbound -lldns -lutil -lbsdxml -lssl -lcrypto -lpthread +LDADD= ${LDUNBOUND} ${LDLDNS} -lutil -lbsdxml -lssl -lcrypto -lpthread USEPRIVATELIB= ldns MAN= unbound-anchor.8 Modified: head/usr.sbin/unbound/checkconf/Makefile ============================================================================== --- head/usr.sbin/unbound/checkconf/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.sbin/unbound/checkconf/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -10,7 +10,7 @@ PROG= unbound-checkconf SRCS= unbound-checkconf.c worker_cb.c CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} DPADD= ${LIBUNBOUND} ${LIBLDNS} ${LIBUTIL} ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD} -LDADD= -lunbound -lldns -lutil -lssl -lcrypto -lpthread +LDADD= ${LDUNBOUND} ${LDLDNS} -lutil -lssl -lcrypto -lpthread USEPRIVATELIB= ldns MAN= unbound-checkconf.8 Modified: head/usr.sbin/unbound/control/Makefile ============================================================================== --- head/usr.sbin/unbound/control/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.sbin/unbound/control/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -11,7 +11,7 @@ SCRIPTS= unbound-control-setup.sh SRCS= unbound-control.c worker_cb.c CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} DPADD= ${LIBUNBOUND} ${LIBLDNS} ${LIBUTIL} ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD} -LDADD= -lunbound -lldns -lutil -lssl -lcrypto -lpthread +LDADD= ${LDUNBOUND} ${LDLDNS} -lutil -lssl -lcrypto -lpthread USEPRIVATELIB= ldns MAN= unbound-control.8 Modified: head/usr.sbin/unbound/daemon/Makefile ============================================================================== --- head/usr.sbin/unbound/daemon/Makefile Wed Aug 6 22:15:01 2014 (r269647) +++ head/usr.sbin/unbound/daemon/Makefile Wed Aug 6 22:17:26 2014 (r269648) @@ -10,7 +10,7 @@ PROG= unbound SRCS= acl_list.c cachedump.c daemon.c remote.c stats.c unbound.c worker.c CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} DPADD= ${LIBUNBOUND} ${LIBLDNS} ${LIBUTIL} ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD} -LDADD= -lunbound -lldns -lutil -lssl -lcrypto -lpthread +LDADD= ${LDUNBOUND} ${LDLDNS} -lutil -lssl -lcrypto -lpthread USEPRIVATELIB= ldns MAN= unbound.8 unbound.conf.5 From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 22:46:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9F20C64 for ; Wed, 6 Aug 2014 22:46:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02CA2589 for ; Wed, 6 Aug 2014 22:46:16 +0000 (UTC) Received: from bapt (uid 1235) (envelope-from bapt@FreeBSD.org) id 5e44 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 22:46:15 +0000 From: Baptiste Daroussin Date: Wed, 6 Aug 2014 22:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269649 - in head: lib lib/libohash share/mk usr.bin/m4 usr.bin/m4/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2b038.5e44.59dbd637@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 22:46:16 -0000 Author: bapt Date: Wed Aug 6 22:46:15 2014 New Revision: 269649 URL: http://svnweb.freebsd.org/changeset/base/269649 Log: Make libohash a proper internallib instead of hidding it in m4 mandoc development seems to be also using ohash so prepare to share the code when needed Added: head/lib/libohash/ - copied from r269624, head/usr.bin/m4/lib/ head/lib/libohash/Makefile (contents, props changed) Deleted: head/usr.bin/m4/lib/ Modified: head/lib/Makefile head/share/mk/src.libnames.mk head/usr.bin/m4/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Aug 6 22:17:26 2014 (r269648) +++ head/lib/Makefile Wed Aug 6 22:46:15 2014 (r269649) @@ -69,6 +69,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libnetgraph} \ ${_libngatm} \ libnv \ + libohash \ libopie \ libpam \ libpcap \ Added: head/lib/libohash/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libohash/Makefile Wed Aug 6 22:46:15 2014 (r269649) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= ohash +SRCS= ohash.c +INTERNALLIB= + +WARNS= 3 + +.include Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Aug 6 22:17:26 2014 (r269648) +++ head/share/mk/src.libnames.mk Wed Aug 6 22:46:15 2014 (r269649) @@ -44,3 +44,7 @@ LIBUCL?= ${LIBUCLDIR}/libucl.a LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LDREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a + +LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash +LDOHASH?= ${LIBOHASHDIR}/libohash.a +LIBOHASH?= ${LIBOHASHDIR}/libohash.a Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Wed Aug 6 22:17:26 2014 (r269648) +++ head/usr.bin/m4/Makefile Wed Aug 6 22:46:15 2014 (r269649) @@ -7,16 +7,13 @@ .include PROG= m4 -CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib -DPADD= ${LIBY} ${LIBL} ${LIBM} -LDADD= -ly -ll -lm +CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/../../lib/libohash +DPADD= ${LIBY} ${LIBL} ${LIBM} ${LIBOHASH} +LDADD= -ly -ll -lm ${LDOHASH} NO_WMISSING_VARIABLE_DECLARATIONS= SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l -.PATH: ${.CURDIR}/lib -SRCS+= ohash.c -WARNS= 3 tokenizer.o: parser.h From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 23:06:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8332030A for ; Wed, 6 Aug 2014 23:06:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 545552760 for ; Wed, 6 Aug 2014 23:06:10 +0000 (UTC) Received: from bapt (uid 1235) (envelope-from bapt@FreeBSD.org) id 5643 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 23:06:10 +0000 From: Baptiste Daroussin Date: Wed, 6 Aug 2014 23:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269650 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2b4e2.5643.78e7243a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 23:06:10 -0000 Author: bapt Date: Wed Aug 6 23:06:09 2014 New Revision: 269650 URL: http://svnweb.freebsd.org/changeset/base/269650 Log: Add more private obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Aug 6 22:46:15 2014 (r269649) +++ head/ObsoleteFiles.inc Wed Aug 6 23:06:09 2014 (r269650) @@ -45,6 +45,9 @@ OLD_FILES+=usr/lib/private/libatf-c_p.a OLD_FILES+=usr/lib/private/libatf-c++.a OLD_FILES+=usr/lib/private/libatf-c++.so OLD_FILES+=usr/lib/private/libatf-c++_p.a +OLD_FILES+=usr/lib/private/libbsdstat.a +OLD_FILES+=usr/lib/private/libbsdstat.so +OLD_FILES+=usr/lib/private/libbsdstat_p.a OLD_FILES+=usr/lib/private/libheimipcc.a OLD_FILES+=usr/lib/private/libheimipcc.so OLD_FILES+=usr/lib/private/libheimipcc_p.a From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 01:51:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D560B8CE for ; Thu, 7 Aug 2014 01:51:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B45E12AB2 for ; Thu, 7 Aug 2014 01:51:01 +0000 (UTC) Received: from thompsa (uid 1062) (envelope-from thompsa@FreeBSD.org) id 5f6d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 01:51:01 +0000 From: Andrew Thompson Date: Thu, 7 Aug 2014 01:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269653 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e2db85.5f6d.26685940@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 01:51:01 -0000 Author: thompsa Date: Thu Aug 7 01:51:01 2014 New Revision: 269653 URL: http://svnweb.freebsd.org/changeset/base/269653 Log: Give a brief message as to what error was encountered to help the user along. Reviewed by: nwhitehorn MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/scripts/auto head/usr.sbin/bsdinstall/scripts/jail Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Thu Aug 7 00:32:23 2014 (r269652) +++ head/usr.sbin/bsdinstall/scripts/auto Thu Aug 7 01:51:01 2014 (r269653) @@ -35,11 +35,15 @@ BSDCFG_SHARE="/usr/share/bsdconfig" ############################################################ FUNCTIONS error() { + local msg + if [ -n "$1" ]; then + msg="$1\n\n" + fi test -n "$DISTDIR_IS_UNIONFS" && umount -f $BSDINSTALL_DISTDIR test -f $PATH_FSTAB && bsdinstall umount dialog --backtitle "FreeBSD Installer" --title "Abort" \ --no-label "Exit" --yes-label "Restart" --yesno \ - "An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 + "${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 if [ $? -ne 0 ]; then exit 1 else @@ -58,7 +62,7 @@ trap true SIGINT # This section is optio bsdinstall keymap trap error SIGINT # Catch cntrl-C here -bsdinstall hostname || error +bsdinstall hostname || error "Set hostname failed" export DISTRIBUTIONS="base.txz kernel.txz" if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then @@ -95,7 +99,7 @@ if [ -n "$FETCH_DISTRIBUTIONS" ]; then BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) MIRROR_BUTTON=$? exec 3>&- - test $MIRROR_BUTTON -eq 0 || error + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" export BSDINSTALL_DISTSITE fi @@ -125,8 +129,8 @@ exec 3>&- case "$PARTMODE" in "Guided") # Guided - bsdinstall autopart || error - bsdinstall mount || error + bsdinstall autopart || error "Partitioning error" + bsdinstall mount || error "Failed to mount filesystem" ;; "Shell") # Shell clear @@ -136,18 +140,18 @@ case "$PARTMODE" in "Manual") # Manual if f_isset debugFile; then # Give partedit the path to our logfile so it can append - BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error + BSDINSTALL_LOG="${debugFile#+}" bsdinstall partedit || error "Partitioning error" else - bsdinstall partedit || error + bsdinstall partedit || error "Partitioning error" fi - bsdinstall mount || error + bsdinstall mount || error "Failed to mount filesystem" ;; "ZFS") # ZFS - bsdinstall zfsboot || error - bsdinstall mount || error + bsdinstall zfsboot || error "ZFS setup failed" + bsdinstall mount || error "Failed to mount filesystem" ;; *) - error + error "Unknown partitioning mode" ;; esac @@ -156,7 +160,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then # Download to a directory in the new system as scratch space BSDINSTALL_FETCHDEST="$BSDINSTALL_CHROOT/usr/freebsd-dist" - mkdir -p "$BSDINSTALL_FETCHDEST" || error + mkdir -p "$BSDINSTALL_FETCHDEST" || error "Could not create directory $BSDINSTALL_FETCHDEST" export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS" # Try to use any existing distfiles @@ -169,13 +173,13 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then fi export FTP_PASSIVE_MODE=YES - bsdinstall distfetch || error + bsdinstall distfetch || error "Failed to fetch distribution" export DISTRIBUTIONS="$ALL_DISTRIBUTIONS" fi -bsdinstall checksum || error -bsdinstall distextract || error -bsdinstall rootpass || error +bsdinstall checksum || error "Distribution checksum failed" +bsdinstall distextract || error "Distribution extract failed" +bsdinstall rootpass || error "Could not set root password" trap true SIGINT # This section is optional if [ "$NETCONFIG_DONE" != yes ]; then @@ -239,7 +243,7 @@ finalconfig() { finalconfig trap error SIGINT # SIGINT is bad again -bsdinstall config || error +bsdinstall config || error "Failed to save config" if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then [ "$BSDINSTALL_FETCHDEST" != "$BSDINSTALL_DISTDIR" ] && \ Modified: head/usr.sbin/bsdinstall/scripts/jail ============================================================================== --- head/usr.sbin/bsdinstall/scripts/jail Thu Aug 7 00:32:23 2014 (r269652) +++ head/usr.sbin/bsdinstall/scripts/jail Thu Aug 7 01:51:01 2014 (r269653) @@ -38,9 +38,13 @@ f_dprintf "Began Installation at %s" "$( export BSDINSTALL_CHROOT=$1 error() { + local msg + if [ -n "$1" ]; then + msg="$1\n\n" + fi dialog --backtitle "FreeBSD Installer" --title "Abort" \ --no-label "Exit" --yes-label "Restart" --yesno \ - "An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 + "${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 if [ $? -ne 0 ]; then exit else @@ -51,7 +55,7 @@ error() { rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC -mkdir -p $1 || error +mkdir -p $1 || error "mkdir failed for $1" test ! -d $BSDINSTALL_DISTDIR && mkdir -p $BSDINSTALL_DISTDIR @@ -60,9 +64,9 @@ if [ ! -f $BSDINSTALL_DISTDIR/MANIFEST - BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) MIRROR_BUTTON=$? exec 3>&- - test $MIRROR_BUTTON -eq 0 || error + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" export BSDINSTALL_DISTSITE - fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error + fetch -o $BSDINSTALL_DISTDIR/MANIFEST $BSDINSTALL_DISTSITE/MANIFEST || error "Could not download $BSDINSTALL_DISTSITE/MANIFEST" fi export DISTRIBUTIONS="base.txz" @@ -94,17 +98,17 @@ if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$B BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3` MIRROR_BUTTON=$? exec 3>&- - test $MIRROR_BUTTON -eq 0 || error + test $MIRROR_BUTTON -eq 0 || error "No mirror selected" export BSDINSTALL_DISTSITE fi if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then - bsdinstall distfetch || error + bsdinstall distfetch || error "Failed to fetch distribution" fi -bsdinstall checksum || error -bsdinstall distextract || error -bsdinstall rootpass || error +bsdinstall checksum || error "Distribution checksum failed" +bsdinstall distextract || error "Distribution extract failed" +bsdinstall rootpass || error "Could not set root password" trap true SIGINT # This section is optional bsdinstall services @@ -114,7 +118,7 @@ dialog --backtitle "FreeBSD Installer" - bsdinstall adduser trap error SIGINT # SIGINT is bad again -bsdinstall config || error +bsdinstall config || error "Failed to save config" cp /etc/resolv.conf $1/etc cp /etc/localtime $1/etc From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 05:47:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EDD9BEB for ; Thu, 7 Aug 2014 05:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7E72418 for ; Thu, 7 Aug 2014 05:47:54 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 5581 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 05:47:53 +0000 From: Konstantin Belousov Date: Thu, 7 Aug 2014 05:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269656 - in head: bin/ps sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e31309.5581.568424c9@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 05:47:54 -0000 Author: kib Date: Thu Aug 7 05:47:53 2014 New Revision: 269656 URL: http://svnweb.freebsd.org/changeset/base/269656 Log: Correct the problems with the ptrace(2) making the debuggee an orphan. One problem is inferior(9) looping due to the process tree becoming a graph instead of tree if the parent is traced by child. Another issue is due to the use of p_oppid to restore the original parent/child relationship, because real parent could already exited and its pid reused (noted by mjg). Add the function proc_realparent(9), which calculates the parent for given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head element of the p_orphan list and than stepping back to its container to find the parent process. If the parent has already exited, the init(8) is returned. Move the P_ORPHAN and the new helper flag from the p_flag* to new p_treeflag field of struct proc, which is protected by proctree lock instead of proc lock, since the orphans relationship is managed under the proctree_lock already. The remaining uses of p_oppid in ptrace(PT_DETACH) and process reapping are replaced by proc_realparent(9). Phabric: D417 Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/bin/ps/ps.1 head/sys/kern/kern_exit.c head/sys/kern/kern_proc.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Aug 7 03:50:30 2014 (r269655) +++ head/bin/ps/ps.1 Thu Aug 7 05:47:53 2014 (r269656) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd June 6, 2014 +.Dd August 7, 2014 .Dt PS 1 .Os .Sh NAME @@ -332,7 +332,6 @@ the include file .It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000" Ta "Threads should suspend at user boundary" .It Dv "P_HWPMC" Ta No "0x800000" Ta "Process is using HWPMCs" .It Dv "P_JAILED" Ta No "0x1000000" Ta "Process is in jail" -.It Dv "P_ORPHAN" Ta No "0x2000000" Ta "Orphaned by original parent, reparented to debugger" .It Dv "P_INEXEC" Ta No "0x4000000" Ta "Process is in execve()" .It Dv "P_STATCHILD" Ta No "0x8000000" Ta "Child process stopped or exited" .It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory" Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Aug 7 03:50:30 2014 (r269655) +++ head/sys/kern/kern_exit.c Thu Aug 7 05:47:53 2014 (r269656) @@ -97,16 +97,44 @@ SDT_PROBE_DEFINE1(proc, kernel, , exit, /* Hook for NFS teardown procedure. */ void (*nlminfo_release_p)(struct proc *p); +struct proc * +proc_realparent(struct proc *child) +{ + struct proc *p, *parent; + + sx_assert(&proctree_lock, SX_LOCKED); + if ((child->p_treeflag & P_TREE_ORPHANED) == 0) { + return (child->p_pptr->p_pid == child->p_oppid ? + child->p_pptr : initproc); + } + for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { + /* Cannot use LIST_PREV(), since the list head is not known. */ + p = __containerof(p->p_orphan.le_prev, struct proc, + p_orphan.le_next); + KASSERT((p->p_treeflag & P_TREE_ORPHANED) != 0, + ("missing P_ORPHAN %p", p)); + } + parent = __containerof(p->p_orphan.le_prev, struct proc, + p_orphans.lh_first); + return (parent); +} + static void clear_orphan(struct proc *p) { + struct proc *p1; - PROC_LOCK_ASSERT(p, MA_OWNED); - - if (p->p_flag & P_ORPHAN) { - LIST_REMOVE(p, p_orphan); - p->p_flag &= ~P_ORPHAN; + sx_assert(&proctree_lock, SA_XLOCKED); + if ((p->p_treeflag & P_TREE_ORPHANED) == 0) + return; + if ((p->p_treeflag & P_TREE_FIRST_ORPHAN) != 0) { + p1 = LIST_NEXT(p, p_orphan); + if (p1 != NULL) + p1->p_treeflag |= P_TREE_FIRST_ORPHAN; + p->p_treeflag &= ~P_TREE_FIRST_ORPHAN; } + LIST_REMOVE(p, p_orphan); + p->p_treeflag &= ~P_TREE_ORPHANED; } /* @@ -772,7 +800,9 @@ proc_reap(struct thread *td, struct proc * If we got the child via a ptrace 'attach', we need to give it back * to the old parent. */ - if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) { + if (p->p_oppid != 0) { + t = proc_realparent(p); + PROC_LOCK(t); PROC_LOCK(p); proc_reparent(p, t); p->p_oppid = 0; @@ -1243,8 +1273,15 @@ proc_reparent(struct proc *child, struct clear_orphan(child); if (child->p_flag & P_TRACED) { - LIST_INSERT_HEAD(&child->p_pptr->p_orphans, child, p_orphan); - child->p_flag |= P_ORPHAN; + if (LIST_EMPTY(&child->p_pptr->p_orphans)) { + child->p_treeflag |= P_TREE_FIRST_ORPHAN; + LIST_INSERT_HEAD(&child->p_pptr->p_orphans, child, + p_orphan); + } else { + LIST_INSERT_AFTER(child, + LIST_FIRST(&child->p_pptr->p_orphans), p_orphan); + } + child->p_treeflag |= P_TREE_ORPHANED; } child->p_pptr = parent; Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Aug 7 03:50:30 2014 (r269655) +++ head/sys/kern/kern_proc.c Thu Aug 7 05:47:53 2014 (r269656) @@ -263,14 +263,15 @@ proc_fini(void *mem, int size) * Is p an inferior of the current process? */ int -inferior(p) - register struct proc *p; +inferior(struct proc *p) { sx_assert(&proctree_lock, SX_LOCKED); - for (; p != curproc; p = p->p_pptr) + PROC_LOCK_ASSERT(p, MA_OWNED); + for (; p != curproc; p = proc_realparent(p)) { if (p->p_pid == 0) return (0); + } return (1); } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Aug 7 03:50:30 2014 (r269655) +++ head/sys/kern/sys_process.c Thu Aug 7 05:47:53 2014 (r269656) @@ -917,19 +917,11 @@ kern_ptrace(struct thread *td, int req, case PT_DETACH: /* reset process parent */ if (p->p_oppid != p->p_pptr->p_pid) { - struct proc *pp; - PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); PROC_UNLOCK(p->p_pptr); - PROC_UNLOCK(p); - pp = pfind(p->p_oppid); - if (pp == NULL) - pp = initproc; - else - PROC_UNLOCK(pp); - PROC_LOCK(p); + pp = proc_realparent(p); proc_reparent(p, pp); if (pp == initproc) p->p_sigparent = SIGCHLD; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Aug 7 03:50:30 2014 (r269655) +++ head/sys/sys/proc.h Thu Aug 7 05:47:53 2014 (r269656) @@ -549,6 +549,7 @@ struct proc { int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ + u_int p_treeflag; /* (e) P_TREE flags */ /* End area that is zeroed on creation. */ #define p_endzero p_magic @@ -632,7 +633,7 @@ struct proc { #define P_SINGLE_BOUNDARY 0x400000 /* Threads should suspend at user boundary. */ #define P_HWPMC 0x800000 /* Process is using HWPMCs */ #define P_JAILED 0x1000000 /* Process is in jail. */ -#define P_ORPHAN 0x2000000 /* Orphaned. */ +#define P_UNUSED1 0x2000000 #define P_INEXEC 0x4000000 /* Process is in execve(). */ #define P_STATCHILD 0x8000000 /* Child process stopped or exited. */ #define P_INMEM 0x10000000 /* Loaded into memory. */ @@ -647,6 +648,11 @@ struct proc { /* These flags are kept in p_flag2. */ #define P2_INHERIT_PROTECTED 0x00000001 /* New children get P_PROTECTED. */ +/* Flags protected by proctree_lock, kept in p_treeflags. */ +#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ +#define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan + list */ + /* * These were process status values (p_stat), now they are only used in * legacy conversion code. @@ -887,6 +893,7 @@ int proc_getenvv(struct thread *td, stru void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); +struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); struct pstats *pstats_alloc(void); From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 08:09:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id E833FF13; Thu, 7 Aug 2014 08:09:04 +0000 (UTC) Date: Thu, 7 Aug 2014 08:09:04 +0000 From: Alexey Dokuchaev To: Nathan Whitehorn Subject: Re: svn commit: r269601 - in head/sys: conf dev/fb Message-ID: <20140807080904.GA59911@FreeBSD.org> References: <53e12048.529c.76a204bd@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53e12048.529c.76a204bd@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 08:09:05 -0000 On Tue, Aug 05, 2014 at 06:19:52PM +0000, Nathan Whitehorn wrote: > New Revision: 269601 > URL: http://svnweb.freebsd.org/changeset/base/269601 > > Log: > Add a simple unaccelerated vt(4) framebuffer driver for Sun framebuffers > handled by creator(4) (Sun Creator 3D, Elite 3D, etc.). This provides > vt(4) consoles on all devices currently supported by syscons on sparc64. > The driver should also be easily adaptable to support newer Sun framebuffers > such as the XVR-500 and higher. Now this is totally awesome. Thank you for your work! ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 09:38:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB2F5D2C for ; Thu, 7 Aug 2014 09:38:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80B202D00 for ; Thu, 7 Aug 2014 09:38:27 +0000 (UTC) Received: from bapt (uid 1235) (envelope-from bapt@FreeBSD.org) id 57b3 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 09:38:27 +0000 From: Baptiste Daroussin Date: Thu, 7 Aug 2014 09:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269660 - head/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e34913.57b3.49fb1b0f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 09:38:27 -0000 Author: bapt Date: Thu Aug 7 09:38:27 2014 New Revision: 269660 URL: http://svnweb.freebsd.org/changeset/base/269660 Log: Lower warnings again to 3 the right thing would be to fix the warnings which will be done by discussing with upstream I want the m4 code to stay as close as possible to upstream. Modified: head/usr.bin/m4/Makefile Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Thu Aug 7 08:09:43 2014 (r269659) +++ head/usr.bin/m4/Makefile Thu Aug 7 09:38:27 2014 (r269660) @@ -15,6 +15,8 @@ NO_WMISSING_VARIABLE_DECLARATIONS= SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l +WARNS= 3 + tokenizer.o: parser.h CLEANFILES+= parser.c parser.h tokenizer.o From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 10:23:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18BF580E for ; Thu, 7 Aug 2014 10:23:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E31242294 for ; Thu, 7 Aug 2014 10:23:50 +0000 (UTC) Received: from ae (uid 1226) (envelope-from ae@FreeBSD.org) id 5aa8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 10:23:50 +0000 From: Andrey V. Elsukov Date: Thu, 7 Aug 2014 10:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269661 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e353b6.5aa8.4ee2421b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 10:23:51 -0000 Author: ae Date: Thu Aug 7 10:23:50 2014 New Revision: 269661 URL: http://svnweb.freebsd.org/changeset/base/269661 Log: Use cpuset_setithread() to apply cpu mask to taskq threads. Sponsored by: Yandex LLC Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu Aug 7 09:38:27 2014 (r269660) +++ head/sys/kern/subr_taskqueue.c Thu Aug 7 10:23:50 2014 (r269661) @@ -538,7 +538,7 @@ _taskqueue_start_threads(struct taskqueu continue; td = tq->tq_threads[i]; if (mask) { - error = cpuset_setthread(td->td_tid, mask); + error = cpuset_setithread(td->td_tid, mask); /* * Failing to pin is rarely an actual fatal error; * it'll just affect performance. From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 11:44:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C44EA3E for ; Thu, 7 Aug 2014 11:44:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 731D62B5C for ; Thu, 7 Aug 2014 11:44:30 +0000 (UTC) Received: from roberto (uid 615) (envelope-from roberto@FreeBSD.org) id 5845 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 11:44:30 +0000 From: Ollivier Robert Date: Thu, 7 Aug 2014 11:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269662 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3669e.5845.3a38a5f4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 11:44:30 -0000 Author: roberto Date: Thu Aug 7 11:44:30 2014 New Revision: 269662 URL: http://svnweb.freebsd.org/changeset/base/269662 Log: 10 has a new flex (2.5.37) and the config.h for unbound has been updated to take this into account. Alas it breaks source upgrade from any version of 9 because flex is not built as a bootstrap-tools (it would be for older versions). That means "libunbound/configlexer.c" is built with the old flex but using config.h for the new one. Build is thus broken going from 9.* to 10. Make flex a bootstrap-tools entry if host is less than 1000033 to take into account the flex update in 10. Tested on both 9.2-RC3 and 9.3 by myself and dim@. Running buildworld in head but as both 10 and 11 has the new flex, it will not matter. Reviewed by: imp Approved by: des, imp MFC after: 1 week Phabric: D554 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 7 10:23:50 2014 (r269661) +++ head/Makefile.inc1 Thu Aug 7 11:44:30 2014 (r269662) @@ -1207,10 +1207,6 @@ _vtfontcvt= usr.bin/vtfontcvt _sed= usr.bin/sed .endif -.if ${BOOTSTRAPPING} < 900006 -_lex= usr.bin/lex -.endif - .if ${BOOTSTRAPPING} < 1000002 _m4= usr.bin/m4 .endif @@ -1233,6 +1229,10 @@ _nmtree= lib/libnetbsd \ _cat= bin/cat .endif +.if ${BOOTSTRAPPING} < 1000033 +_lex= usr.bin/lex +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 12:47:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23CC9DFF for ; Thu, 7 Aug 2014 12:47:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8046240C for ; Thu, 7 Aug 2014 12:47:25 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 5d70 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 12:47:25 +0000 From: Hans Petter Selasky Date: Thu, 7 Aug 2014 12:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269664 - head/sys/dev/usb/gadget X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3755d.5d70.7ff8a911@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 12:47:26 -0000 Author: hselasky Date: Thu Aug 7 12:47:25 2014 New Revision: 269664 URL: http://svnweb.freebsd.org/changeset/base/269664 Log: Make sure the USB audio level residue is non-zero. Modified: head/sys/dev/usb/gadget/g_audio.c Modified: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- head/sys/dev/usb/gadget/g_audio.c Thu Aug 7 12:19:42 2014 (r269663) +++ head/sys/dev/usb/gadget/g_audio.c Thu Aug 7 12:47:25 2014 (r269664) @@ -580,7 +580,7 @@ g_audio_handle_request(device_t dev, (req->bRequest == 0x84 /* get residue */ )) { if (offset == 0) { - USETW(sc->sc_volume_limit, 0); + USETW(sc->sc_volume_limit, 1); *plen = 2; *pptr = &sc->sc_volume_limit; } else { @@ -591,6 +591,7 @@ g_audio_handle_request(device_t dev, (req->bRequest == 0x81 /* get value */ )) { if (offset == 0) { + USETW(sc->sc_volume_setting, 0x2000); *plen = sizeof(sc->sc_volume_setting); *pptr = &sc->sc_volume_setting; } else { From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 13:46:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8A34FC0; Thu, 7 Aug 2014 13:46:25 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED422A82; Thu, 7 Aug 2014 13:46:25 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s77DkEug062993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Aug 2014 16:46:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s77DkEug062993 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s77DkEd8062992; Thu, 7 Aug 2014 16:46:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Aug 2014 16:46:14 +0300 From: Konstantin Belousov To: "Alexander V. Chernikov" Subject: Re: svn commit: r267716 - in head/sys: kern sys Message-ID: <20140807134614.GU93733@kib.kiev.ua> References: <201406221132.s5MBWNWj097084@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NUEmSKXm1rGj4SU8" Content-Disposition: inline In-Reply-To: <201406221132.s5MBWNWj097084@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 13:46:25 -0000 --NUEmSKXm1rGj4SU8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 22, 2014 at 11:32:23AM +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sun Jun 22 11:32:23 2014 > New Revision: 267716 > URL: http://svnweb.freebsd.org/changeset/base/267716 >=20 > Log: > Permit changing cpu mask for cpu set 1 in presence of drivers > binding their threads to particular CPU. > =20 > Changing ithread cpu mask is now performed by special cpuset_setithread= (). > It creates additional cpuset root group on first bind invocation. > =20 > No objection: jhb > Tested by: hiren > MFC after: 2 weeks > Sponsored by: Yandex LLC >=20 > Modified: > head/sys/kern/kern_cpuset.c > head/sys/kern/kern_intr.c > head/sys/sys/cpuset.h >=20 > Modified: head/sys/kern/kern_cpuset.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_cpuset.c Sun Jun 22 10:00:33 2014 (r267715) > +++ head/sys/kern/kern_cpuset.c Sun Jun 22 11:32:23 2014 (r267716) > @@ -106,7 +106,7 @@ static uma_zone_t cpuset_zone; > static struct mtx cpuset_lock; > static struct setlist cpuset_ids; > static struct unrhdr *cpuset_unr; > -static struct cpuset *cpuset_zero; > +static struct cpuset *cpuset_zero, *cpuset_default; > =20 > /* Return the size of cpuset_t at the kernel level */ > SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD, > @@ -716,6 +716,89 @@ out: > } > =20 > /* > + * Apply new cpumask to the ithread. > + */ > +int > +cpuset_setithread(lwpid_t id, u_char cpu) > +{ > + struct cpuset *nset, *rset; > + struct cpuset *parent, *old_set; > + struct thread *td; > + struct proc *p; > + cpusetid_t cs_id; > + cpuset_t mask; > + int error; > + > + nset =3D uma_zalloc(cpuset_zone, M_WAITOK); > + rset =3D uma_zalloc(cpuset_zone, M_WAITOK); > + > + CPU_ZERO(&mask); > + if (cpu =3D=3D NOCPU) > + CPU_COPY(cpuset_root, &mask); > + else > + CPU_SET(cpu, &mask); > + > + error =3D cpuset_which(CPU_WHICH_TID, id, &p, &td, &old_set); > + if (((cs_id =3D alloc_unr(cpuset_unr)) =3D=3D CPUSET_INVALID) || error = !=3D 0) Why calling alloc_unr() at all if error !=3D 0 ? > + goto out; > + > + thread_lock(td); > + old_set =3D td->td_cpuset; > + > + if (cpu =3D=3D NOCPU) { > + /* > + * roll back to default set. We're not using cpuset_shadow() > + * here because we can fail CPU_SUBSET() check. This can happen > + * if default set does not contain all CPUs. > + */ > + error =3D _cpuset_create(nset, cpuset_default, &mask, > + CPUSET_INVALID); Why should _cpuset_create() be called under the thread_lock() taken ? > + > + goto applyset; > + } > + > + if (old_set->cs_id =3D=3D 1 || (old_set->cs_id =3D=3D CPUSET_INVALID && > + old_set->cs_parent->cs_id =3D=3D 1)) { > + /* Default mask, we need to use new root set */ > + error =3D _cpuset_create(rset, cpuset_zero, > + &cpuset_zero->cs_mask, cs_id); And this one, does the call need thread_lock ? > + if (error !=3D 0) { Wouldn't this leak thread_lock() ? > + PROC_UNLOCK(p); > + goto out; > + } > + rset->cs_flags |=3D CPU_SET_ROOT; > + parent =3D rset; > + rset =3D NULL; > + cs_id =3D CPUSET_INVALID; > + } else { > + /* Assume existing set was already allocated by previous call */ > + parent =3D td->td_cpuset; > + old_set =3D NULL; > + } > + > + error =3D cpuset_shadow(parent, nset, &mask); > +applyset: > + if (error =3D=3D 0) { > + td->td_cpuset =3D nset; > + sched_affinity(td); > + nset =3D NULL; > + } > + thread_unlock(td); > + PROC_UNLOCK(p); > + if (old_set !=3D NULL) > + cpuset_rel(old_set); > +out: > + if (nset !=3D NULL) > + uma_zfree(cpuset_zone, nset); > + if (rset !=3D NULL) > + uma_zfree(cpuset_zone, rset); > + if (cs_id !=3D CPUSET_INVALID) > + free_unr(cpuset_unr, cs_id); > + return (error); > +} > + > + > +/* > * Creates the cpuset for thread0. We make two sets: > *=20 > * 0 - The root set which should represent all valid processors in the > @@ -735,6 +818,7 @@ cpuset_thread0(void) > cpuset_zone =3D uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL, > NULL, NULL, UMA_ALIGN_PTR, 0); > mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE); > + > /* > * Create the root system set for the whole machine. Doesn't use > * cpuset_create() due to NULL parent. > @@ -747,12 +831,15 @@ cpuset_thread0(void) > set->cs_flags =3D CPU_SET_ROOT; > cpuset_zero =3D set; > cpuset_root =3D &set->cs_mask; > + > /* > * Now derive a default, modifiable set from that to give out. > */ > set =3D uma_zalloc(cpuset_zone, M_WAITOK); > error =3D _cpuset_create(set, cpuset_zero, &cpuset_zero->cs_mask, 1); > KASSERT(error =3D=3D 0, ("Error creating default set: %d\n", error)); > + cpuset_default =3D set; > + > /* > * Initialize the unit allocator. 0 and 1 are allocated above. > */ >=20 > Modified: head/sys/kern/kern_intr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_intr.c Sun Jun 22 10:00:33 2014 (r267715) > +++ head/sys/kern/kern_intr.c Sun Jun 22 11:32:23 2014 (r267716) > @@ -295,7 +295,6 @@ intr_event_create(struct intr_event **ev > int > intr_event_bind(struct intr_event *ie, u_char cpu) > { > - cpuset_t mask; > lwpid_t id; > int error; > =20 > @@ -316,14 +315,9 @@ intr_event_bind(struct intr_event *ie, u > */ > mtx_lock(&ie->ie_lock); > if (ie->ie_thread !=3D NULL) { > - CPU_ZERO(&mask); > - if (cpu =3D=3D NOCPU) > - CPU_COPY(cpuset_root, &mask); > - else > - CPU_SET(cpu, &mask); > id =3D ie->ie_thread->it_thread->td_tid; > mtx_unlock(&ie->ie_lock); > - error =3D cpuset_setthread(id, &mask); > + error =3D cpuset_setithread(id, cpu); > if (error) > return (error); > } else > @@ -332,14 +326,10 @@ intr_event_bind(struct intr_event *ie, u > if (error) { > mtx_lock(&ie->ie_lock); > if (ie->ie_thread !=3D NULL) { > - CPU_ZERO(&mask); > - if (ie->ie_cpu =3D=3D NOCPU) > - CPU_COPY(cpuset_root, &mask); > - else > - CPU_SET(ie->ie_cpu, &mask); > + cpu =3D ie->ie_cpu; > id =3D ie->ie_thread->it_thread->td_tid; > mtx_unlock(&ie->ie_lock); > - (void)cpuset_setthread(id, &mask); > + (void)cpuset_setithread(id, cpu); > } else > mtx_unlock(&ie->ie_lock); > return (error); >=20 > Modified: head/sys/sys/cpuset.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/cpuset.h Sun Jun 22 10:00:33 2014 (r267715) > +++ head/sys/sys/cpuset.h Sun Jun 22 11:32:23 2014 (r267716) > @@ -118,6 +118,7 @@ struct cpuset *cpuset_thread0(void); > struct cpuset *cpuset_ref(struct cpuset *); > void cpuset_rel(struct cpuset *); > int cpuset_setthread(lwpid_t id, cpuset_t *); > +int cpuset_setithread(lwpid_t id, u_char cpu); > int cpuset_create_root(struct prison *, struct cpuset **); > int cpuset_setproc_update_set(struct proc *, struct cpuset *); > char *cpusetobj_strprint(char *, const cpuset_t *); --NUEmSKXm1rGj4SU8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT44MlAAoJEJDCuSvBvK1B6OMP/0BIF0NkCM4ElxwcjG/w2vXG WIa+d8DuuVugZ+ej1zazjw6gs3uvuZ0ImrO5sF5m6+3Z21oFTwuv7b+quSW/r63O Rl843Zjn9UwVD4WGX97seNWPnnr6xxCMk+Uc8dmlLmyAUC9GVetMh5C/Aw+roXb7 pZKK7dEu/MGv37yXMDxCINO1LC5gq7a+05OONdoTQYa8C736UwLr94MZi7garKeL Cu5kcYJFfVD9gipiurC/1EK7Xjt58g0r2d4D+pdZvUe2G+wW3tV+yPHzqhTn9+fQ 0VlXHRFE92FFcrnecX3ejSpCMokqSpjWwNoglS8fe1Y5MhZD/7fOwA6D5wzmx5YA IdL0EJ3/3+QUmdlszl00wmqD+s6ivQb/4Ttdxk+WzWH7amQZCv+KzPzRmCKvpwjC zAghlyxZXOaUZ4ipOMnu/F5MCOPoEVu8pGeZuP812wJFjWXQmb00JVGyvm0qFf21 2mWzImB0OccNiC6dD/c8X2G/o6Q2J11/m+68mHMpX7JxfZCx8XulRB/kSukTzMMx LKE4ZdU0RPwsD1vouAY9fxwZePqb2toDM48H3M/1HtERx/Kniek9caY0FgQRsgEO MBLIGHiAkPaNk6mAaIoIT4+zcNra0MWa8q9lXo1RBk87qT9qN9q4DnTJEcg6nKcR 8mm9H5+vjC82IbommJm/ =KWGR -----END PGP SIGNATURE----- --NUEmSKXm1rGj4SU8-- From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 14:14:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A02B1B4B; Thu, 7 Aug 2014 14:14:13 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95B442F8A; Thu, 7 Aug 2014 14:14:12 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id gf5so3545143lab.37 for ; Thu, 07 Aug 2014 07:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=eOcBhDvuzGpyJOUR8ZovUHCtV4BOJ0fJeZILcMMexAU=; b=m46Lc6cTVqJ5ZWFUbWKKRzy70c7ZHP5EmwpFEHOPuz09FKNYDI5Z0X1wyT4qpYCUV8 WOhc6zmN2rpvZnrMR+9WMtj/1hcouiKwULfkF3MW6h2/FoZcoVDbblZZKW5DcP9LK4w9 c0XLsSL7WF7CigOf0nudLyvvq1fgarrBLk3jRs59LwK6SP49L8AztXohAIkITaPe+CQK gfR2FVKV0X0XRs0WSFmNTHE8N1V0SfDJbmGdjEM7QuBzBWhZc8Y3FrgxyqCUi8M7+kML f3+MCfky1F0wCQangQXuxzOnC39J8fccFWGRLYW4WzyMzWiw7ITaYmUeuA3XgQLCZGVW AlMw== X-Received: by 10.152.205.35 with SMTP id ld3mr16655562lac.48.1407420850421; Thu, 07 Aug 2014 07:14:10 -0700 (PDT) Received: from orwell.gmail.com (a91-154-115-217.elisa-laajakaista.fi. [91.154.115.217]) by mx.google.com with ESMTPSA id j2sm10457laf.15.2014.08.07.07.14.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Aug 2014 07:14:09 -0700 (PDT) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: Andrey V. Elsukov Subject: Re: svn commit: r269661 - head/sys/kern References: <53e353b6.5aa8.4ee2421b@svn.freebsd.org> Date: Thu, 07 Aug 2014 17:14:02 +0300 In-Reply-To: <53e353b6.5aa8.4ee2421b@svn.freebsd.org> (Andrey V. Elsukov's message of "Thu, 7 Aug 2014 10:23:50 +0000 (UTC)") Message-ID: <86r40s1j6d.fsf@FreeBSD.org> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 14:14:13 -0000 Andrey V. Elsukov writes: > Author: ae > Date: Thu Aug 7 10:23:50 2014 > New Revision: 269661 > URL: http://svnweb.freebsd.org/changeset/base/269661 > > Log: > Use cpuset_setithread() to apply cpu mask to taskq threads. > > Sponsored by: Yandex LLC This broke the build here: /usr/src/sys/kern/subr_taskqueue.c:541:42: error: incompatible pointer to integer conversion passing 'cpuset_t *' (aka 'struct _cpuset *') to parameter of type 'u_char' (aka 'unsigned char') [-Werror,-Wint-conversion] error = cpuset_setithread(td->td_tid, mask); ^~~~ /usr/src/sys/sys/cpuset.h:121:42: note: passing argument to parameter 'cpu' here int cpuset_setithread(lwpid_t id, u_char cpu); ^ From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 14:26:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDE791CC for ; Thu, 7 Aug 2014 14:26:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4F6120AF for ; Thu, 7 Aug 2014 14:26:44 +0000 (UTC) Received: from jmmv (uid 1331) (envelope-from jmmv@FreeBSD.org) id 52a0 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 14:26:44 +0000 From: Julio Merino Date: Thu, 7 Aug 2014 14:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269665 - head/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e38ca4.52a0.5778d22b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 14:26:44 -0000 Author: jmmv Date: Thu Aug 7 14:26:44 2014 New Revision: 269665 URL: http://svnweb.freebsd.org/changeset/base/269665 Log: Avoid name shadowing to fix build under powerpc64. Error was: cc1: warnings being treated as errors .../usr.bin/m4/misc.c: In function 'm4errx': .../usr.bin/m4/misc.c:268: warning: declaration of 'eval' shadows a global declaration .../usr.bin/m4/extern.h:40: warning: shadowed declaration is here Modified: head/usr.bin/m4/misc.c Modified: head/usr.bin/m4/misc.c ============================================================================== --- head/usr.bin/m4/misc.c Thu Aug 7 12:47:25 2014 (r269664) +++ head/usr.bin/m4/misc.c Thu Aug 7 14:26:44 2014 (r269665) @@ -265,7 +265,7 @@ killdiv(void) extern char *__progname; void -m4errx(int eval, const char *fmt, ...) +m4errx(int exitstatus, const char *fmt, ...) { fprintf(stderr, "%s: ", __progname); fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); @@ -277,7 +277,7 @@ m4errx(int eval, const char *fmt, ...) va_end(ap); } fprintf(stderr, "\n"); - exit(eval); + exit(exitstatus); } /* From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 14:32:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32BD460C for ; Thu, 7 Aug 2014 14:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08CC32195 for ; Thu, 7 Aug 2014 14:32:29 +0000 (UTC) Received: from ae (uid 1226) (envelope-from ae@FreeBSD.org) id 5667 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 14:32:29 +0000 From: Andrey V. Elsukov Date: Thu, 7 Aug 2014 14:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269666 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e38dfd.5667.16c957f4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 14:32:29 -0000 Author: ae Date: Thu Aug 7 14:32:28 2014 New Revision: 269666 URL: http://svnweb.freebsd.org/changeset/base/269666 Log: Temporary revert r269661, it looks like the patch isn't complete. Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Thu Aug 7 14:26:44 2014 (r269665) +++ head/sys/kern/subr_taskqueue.c Thu Aug 7 14:32:28 2014 (r269666) @@ -538,7 +538,7 @@ _taskqueue_start_threads(struct taskqueu continue; td = tq->tq_threads[i]; if (mask) { - error = cpuset_setithread(td->td_tid, mask); + error = cpuset_setthread(td->td_tid, mask); /* * Failing to pin is rarely an actual fatal error; * it'll just affect performance. From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 16:48:28 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD90EAB8; Thu, 7 Aug 2014 16:48:28 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF9A26B4; Thu, 7 Aug 2014 16:48:28 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s77GmI98043796; Thu, 7 Aug 2014 09:48:22 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201408071648.s77GmI98043796@gw.catspoiler.org> Date: Thu, 7 Aug 2014 09:48:18 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r269656 - in head: bin/ps sys/kern sys/sys To: kib@FreeBSD.org In-Reply-To: <53e31309.5581.568424c9@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 16:48:29 -0000 On 7 Aug, Konstantin Belousov wrote: > Author: kib > Date: Thu Aug 7 05:47:53 2014 > New Revision: 269656 > URL: http://svnweb.freebsd.org/changeset/base/269656 > > Log: > Correct the problems with the ptrace(2) making the debuggee an orphan. > One problem is inferior(9) looping due to the process tree becoming a > graph instead of tree if the parent is traced by child. Another issue > is due to the use of p_oppid to restore the original parent/child > relationship, because real parent could already exited and its pid > reused (noted by mjg). > > Add the function proc_realparent(9), which calculates the parent for > given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head > element of the p_orphan list and than stepping back to its container > to find the parent process. If the parent has already exited, the > init(8) is returned. > > Move the P_ORPHAN and the new helper flag from the p_flag* to new > p_treeflag field of struct proc, which is protected by proctree lock > instead of proc lock, since the orphans relationship is managed under > the proctree_lock already. > > The remaining uses of p_oppid in ptrace(PT_DETACH) and process > reapping are replaced by proc_realparent(9). Changing the parent process has always seemed like a hack to me. It seems like the debugger should register itself as an additional parent. From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 16:49:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33116C70 for ; Thu, 7 Aug 2014 16:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 081E726D1 for ; Thu, 7 Aug 2014 16:49:51 +0000 (UTC) Received: from bz (uid 1027) (envelope-from bz@FreeBSD.org) id 2b48 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 16:49:50 +0000 From: Bjoern A. Zeeb Date: Thu, 7 Aug 2014 16:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269669 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3ae2e.2b48.41ea6a03@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 16:49:51 -0000 Author: bz Date: Thu Aug 7 16:49:50 2014 New Revision: 269669 URL: http://svnweb.freebsd.org/changeset/base/269669 Log: Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variant and export the kern_ version needed by an upcoming linuxolator change. MFC after: 3 days Sponsored by: DARPA,AFRL Modified: head/sys/kern/kern_time.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Thu Aug 7 16:40:24 2014 (r269668) +++ head/sys/kern/kern_time.c Thu Aug 7 16:49:50 2014 (r269669) @@ -1361,13 +1361,20 @@ struct timer_getoverrun_args { int sys_ktimer_getoverrun(struct thread *td, struct ktimer_getoverrun_args *uap) { + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +kern_ktimer_getoverrun(struct thread *td, int timer_id) +{ struct proc *p = td->td_proc; struct itimer *it; int error ; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || + (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Aug 7 16:40:24 2014 (r269668) +++ head/sys/sys/syscallsubr.h Thu Aug 7 16:49:50 2014 (r269669) @@ -239,6 +239,7 @@ int kern_ktimer_settime(struct thread *t struct itimerspec *val, struct itimerspec *oval); int kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val); +int kern_ktimer_getoverrun(struct thread *td, int timer_id); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 16:53:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6C143F1 for ; Thu, 7 Aug 2014 16:53:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9F627BF for ; Thu, 7 Aug 2014 16:53:07 +0000 (UTC) Received: from mckusick (uid 740) (envelope-from mckusick@FreeBSD.org) id 242f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 16:53:07 +0000 From: Kirk McKusick Date: Thu, 7 Aug 2014 16:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269674 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3aef3.242f.1f52e61b@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 16:53:07 -0000 Author: mckusick Date: Thu Aug 7 16:53:07 2014 New Revision: 269674 URL: http://svnweb.freebsd.org/changeset/base/269674 Log: The SUJ journal is only prepared to handle full-size block numbers, so we have to adjust freeblk records to reflect the change to a full-size block. For example, suppose we have a block made up of fragments 8-15 and want to free its last two fragments. We are given a request that says: FREEBLK ino=5, blkno=14, lbn=0, frags=2, oldfrags=0 where frags are the number of fragments to free and oldfrags are the number of fragments to keep. To block align it, we have to change it to have a valid full-size blkno, so it becomes: FREEBLK ino=5, blkno=8, lbn=0, frags=2, oldfrags=6 Submitted by: Mikihito Takehara Tested by: Mikihito Takehara Reviewed by: Jeff Roberson MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Aug 7 16:52:59 2014 (r269673) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Aug 7 16:53:07 2014 (r269674) @@ -931,6 +931,7 @@ static inline struct jsegdep *inoref_jse static struct jmvref *newjmvref(struct inode *, ino_t, off_t, off_t); static struct jfreeblk *newjfreeblk(struct freeblks *, ufs_lbn_t, ufs2_daddr_t, int); +static void adjust_newfreework(struct freeblks *, int); static struct jtrunc *newjtrunc(struct freeblks *, off_t, int); static void move_newblock_dep(struct jaddref *, struct inodedep *); static void cancel_jfreeblk(struct freeblks *, ufs2_daddr_t); @@ -4163,6 +4164,33 @@ newjfreeblk(freeblks, lbn, blkno, frags) } /* + * The journal is only prepared to handle full-size block numbers, so we + * have to adjust the record to reflect the change to a full-size block. + * For example, suppose we have a block made up of fragments 8-15 and + * want to free its last two fragments. We are given a request that says: + * FREEBLK ino=5, blkno=14, lbn=0, frags=2, oldfrags=0 + * where frags are the number of fragments to free and oldfrags are the + * number of fragments to keep. To block align it, we have to change it to + * have a valid full-size blkno, so it becomes: + * FREEBLK ino=5, blkno=8, lbn=0, frags=2, oldfrags=6 + */ +static void +adjust_newfreework(freeblks, frag_offset) + struct freeblks *freeblks; + int frag_offset; +{ + struct jfreeblk *jfreeblk; + + KASSERT((LIST_FIRST(&freeblks->fb_jblkdephd) != NULL && + LIST_FIRST(&freeblks->fb_jblkdephd)->jb_list.wk_type == D_JFREEBLK), + ("adjust_newfreework: Missing freeblks dependency")); + + jfreeblk = WK_JFREEBLK(LIST_FIRST(&freeblks->fb_jblkdephd)); + jfreeblk->jf_blkno -= frag_offset; + jfreeblk->jf_frags += frag_offset; +} + +/* * Allocate a new jtrunc to track a partial truncation. */ static struct jtrunc * @@ -6529,6 +6557,9 @@ softdep_journal_freeblocks(ip, cred, len blkno += numfrags(ip->i_fs, frags); newfreework(ump, freeblks, NULL, lastlbn, blkno, oldfrags, 0, needj); + if (needj) + adjust_newfreework(freeblks, + numfrags(ip->i_fs, frags)); } else if (blkno == 0) allocblock = 1; } From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 17:00:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2289B64 for ; Thu, 7 Aug 2014 17:00:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E8B2848 for ; Thu, 7 Aug 2014 17:00:50 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 25ff by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 17:00:50 +0000 From: Roger Pau Monné Date: Thu, 7 Aug 2014 17:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269675 - head/sys/x86/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3b0c2.25ff.29ca9019@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 17:00:50 -0000 Author: royger Date: Thu Aug 7 17:00:50 2014 New Revision: 269675 URL: http://svnweb.freebsd.org/changeset/base/269675 Log: atpic: make sure atpic_init is called after IO APIC initialization After r269510 the IO APIC and ATPIC initialization is done at the same order, which means atpic_init can be called before the IO APIC has been initalized. In that case the ATPIC will take over the interrupt sources, preventing the IO APIC from registering them. Reported by: David Wolfskill Tested by: David Wolfskill , Trond Endrestøl Sponsored by: Citrix Systems R&D Modified: head/sys/x86/isa/atpic.c Modified: head/sys/x86/isa/atpic.c ============================================================================== --- head/sys/x86/isa/atpic.c Thu Aug 7 16:53:07 2014 (r269674) +++ head/sys/x86/isa/atpic.c Thu Aug 7 17:00:50 2014 (r269675) @@ -524,7 +524,7 @@ atpic_init(void *dummy __unused) intr_register_source(&ai->at_intsrc); } } -SYSINIT(atpic_init, SI_SUB_INTR, SI_ORDER_SECOND + 1, atpic_init, NULL); +SYSINIT(atpic_init, SI_SUB_INTR, SI_ORDER_FOURTH, atpic_init, NULL); void atpic_handle_intr(u_int vector, struct trapframe *frame) From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 18:45:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0C6D3F2 for ; Thu, 7 Aug 2014 18:45:38 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C4C325F6 for ; Thu, 7 Aug 2014 18:45:38 +0000 (UTC) Received: from bdrewery (uid 1298) (envelope-from bdrewery@freebsd.org) id ee4 by freefall.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 18:45:38 +0000 Received: (qmail 71650 invoked from network); 7 Aug 2014 13:45:34 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 7 Aug 2014 13:45:34 -0500 Message-ID: <53E3C93B.2080106@FreeBSD.org> Date: Thu, 07 Aug 2014 13:45:15 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r269656 - in head: bin/ps sys/kern sys/sys References: <53e31309.5581.568424c9@svn.freebsd.org> In-Reply-To: <53e31309.5581.568424c9@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i4ohngj1rj2iTrm50SgI3m9N7OHHuhRXt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 18:45:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --i4ohngj1rj2iTrm50SgI3m9N7OHHuhRXt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/7/2014 12:47 AM, Konstantin Belousov wrote: > Author: kib > Date: Thu Aug 7 05:47:53 2014 > New Revision: 269656 > URL: http://svnweb.freebsd.org/changeset/base/269656 >=20 > Log: > Correct the problems with the ptrace(2) making the debuggee an orphan= =2E > One problem is inferior(9) looping due to the process tree becoming a= > graph instead of tree if the parent is traced by child. Another issue= > is due to the use of p_oppid to restore the original parent/child > relationship, because real parent could already exited and its pid > reused (noted by mjg). > =20 > Add the function proc_realparent(9), which calculates the parent for > given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the hea= d > element of the p_orphan list and than stepping back to its container > to find the parent process. If the parent has already exited, the > init(8) is returned. > =20 > Move the P_ORPHAN and the new helper flag from the p_flag* to new > p_treeflag field of struct proc, which is protected by proctree lock > instead of proc lock, since the orphans relationship is managed under= > the proctree_lock already. > =20 > The remaining uses of p_oppid in ptrace(PT_DETACH) and process > reapping are replaced by proc_realparent(9). > =20 > Phabric: D417 > Reviewed by: jhb > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks Thanks! --=20 Regards, Bryan Drewery --i4ohngj1rj2iTrm50SgI3m9N7OHHuhRXt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJT48lDAAoJEDXXcbtuRpfPgUYIALComLW73DQKNpkmTfOMv4nk Lo5xUFb0QooMiKaFEfQghMZzjM44uuWH59BIVivdyW79khRhByAhKdJIP6XLaZ4N Blp9FhDpjJIG5gjr/U0tMB1m+D6vIRjZXfyl72DE9Y9PAY9mk0kHQIG4P/0VuVC8 oN1qiIU12GSMCh4d4OW4KWPJjLbwJgZokyY0FeKfW20koxVnxrBpzreOHCzUz72A RO/2QnxC1/x8p/kImEGQpS3uNsgkjqTLzi8OeBp8QB8tyGo5SL2o/Ev/XlE3NOZR lwWIMi+oPJ2aX7y4k4dE7UYYFxqfrlN5wKqW63Yyfv8/HKqpc/4MGI5K6dZgWoE= =TR77 -----END PGP SIGNATURE----- --i4ohngj1rj2iTrm50SgI3m9N7OHHuhRXt-- From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 18:56:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9566741 for ; Thu, 7 Aug 2014 18:56:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F07726EB for ; Thu, 7 Aug 2014 18:56:18 +0000 (UTC) Received: from jkim (uid 1068) (envelope-from jkim@FreeBSD.org) id 2fc7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 18:56:10 +0000 From: Jung-uk Kim Date: Thu, 7 Aug 2014 18:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269682 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/cms crypt... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3cbca.2fc7.2c4ae3a1@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 18:56:18 -0000 Author: jkim Date: Thu Aug 7 18:56:10 2014 New Revision: 269682 URL: http://svnweb.freebsd.org/changeset/base/269682 Log: Merge OpenSSL 1.0.1i. Added: head/crypto/openssl/doc/ssl/SSL_CTX_set_tlsext_ticket_key_cb.pod - copied unchanged from r269670, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_tlsext_ticket_key_cb.pod head/crypto/openssl/ssl/ssl_utst.c - copied unchanged from r269670, vendor-crypto/openssl/dist/ssl/ssl_utst.c head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 (contents, props changed) Deleted: head/crypto/openssl/crypto/pkcs7/bio_ber.c head/crypto/openssl/crypto/pkcs7/dec.c head/crypto/openssl/crypto/pkcs7/des.pem head/crypto/openssl/crypto/pkcs7/doc head/crypto/openssl/crypto/pkcs7/enc.c head/crypto/openssl/crypto/pkcs7/es1.pem head/crypto/openssl/crypto/pkcs7/example.c head/crypto/openssl/crypto/pkcs7/example.h head/crypto/openssl/crypto/pkcs7/info.pem head/crypto/openssl/crypto/pkcs7/infokey.pem head/crypto/openssl/crypto/pkcs7/p7/ head/crypto/openssl/crypto/pkcs7/server.pem head/crypto/openssl/crypto/pkcs7/sign.c head/crypto/openssl/crypto/pkcs7/t/ head/crypto/openssl/crypto/pkcs7/verify.c Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/FAQ head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ciphers.c head/crypto/openssl/apps/crl2p7.c head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/progs.h head/crypto/openssl/apps/progs.pl head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/crypto/asn1/a_object.c head/crypto/openssl/crypto/asn1/a_utctm.c head/crypto/openssl/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/asn1_lib.c head/crypto/openssl/crypto/asn1/asn_mime.c head/crypto/openssl/crypto/asn1/asn_pack.c head/crypto/openssl/crypto/asn1/bio_asn1.c head/crypto/openssl/crypto/asn1/charmap.pl head/crypto/openssl/crypto/asn1/evp_asn1.c head/crypto/openssl/crypto/asn1/t_x509.c head/crypto/openssl/crypto/asn1/tasn_enc.c head/crypto/openssl/crypto/asn1/x_crl.c head/crypto/openssl/crypto/bio/bio_lib.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_sqr.c head/crypto/openssl/crypto/cms/cms_pwri.c head/crypto/openssl/crypto/conf/conf_def.c head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ecp_smpl.c head/crypto/openssl/crypto/ec/ectest.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/evp_pbe.c head/crypto/openssl/crypto/idea/ideatest.c head/crypto/openssl/crypto/objects/obj_dat.c head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/obj_dat.pl head/crypto/openssl/crypto/ocsp/ocsp_ht.c head/crypto/openssl/crypto/ocsp/ocsp_lib.c head/crypto/openssl/crypto/opensslconf.h head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/pem/pvkfmt.c head/crypto/openssl/crypto/pkcs7/Makefile head/crypto/openssl/crypto/rand/md_rand.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rsa/rsa_eay.c head/crypto/openssl/crypto/srp/srp_lib.c head/crypto/openssl/crypto/ui/ui_lib.c head/crypto/openssl/doc/apps/asn1parse.pod head/crypto/openssl/doc/apps/ca.pod head/crypto/openssl/doc/apps/ciphers.pod head/crypto/openssl/doc/apps/cms.pod head/crypto/openssl/doc/apps/crl.pod head/crypto/openssl/doc/apps/dhparam.pod head/crypto/openssl/doc/apps/dsa.pod head/crypto/openssl/doc/apps/ecparam.pod head/crypto/openssl/doc/apps/gendsa.pod head/crypto/openssl/doc/apps/genrsa.pod head/crypto/openssl/doc/apps/rsa.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/verify.pod head/crypto/openssl/doc/apps/x509.pod head/crypto/openssl/doc/apps/x509v3_config.pod head/crypto/openssl/doc/crypto/ASN1_generate_nconf.pod head/crypto/openssl/doc/crypto/BIO_f_base64.pod head/crypto/openssl/doc/crypto/BIO_push.pod head/crypto/openssl/doc/crypto/ERR_get_error.pod head/crypto/openssl/doc/crypto/EVP_DigestInit.pod head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod head/crypto/openssl/doc/crypto/EVP_SignInit.pod head/crypto/openssl/doc/crypto/RSA_set_method.pod head/crypto/openssl/doc/crypto/RSA_sign.pod head/crypto/openssl/doc/crypto/des.pod head/crypto/openssl/doc/crypto/err.pod head/crypto/openssl/doc/crypto/pem.pod head/crypto/openssl/doc/crypto/ui.pod head/crypto/openssl/doc/fingerprints.txt head/crypto/openssl/doc/ssl/SSL_CIPHER_get_name.pod head/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod head/crypto/openssl/doc/ssl/SSL_CTX_add_session.pod head/crypto/openssl/doc/ssl/SSL_CTX_new.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_cipher_list.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_client_CA_list.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_client_cert_cb.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod head/crypto/openssl/doc/ssl/SSL_get_version.pod head/crypto/openssl/doc/ssl/d2i_SSL_SESSION.pod head/crypto/openssl/ssl/Makefile head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_clnt.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/heartbeat_test.c head/crypto/openssl/ssl/s23_lib.c head/crypto/openssl/ssl/s23_srvr.c head/crypto/openssl/ssl/s2_lib.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_stat.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls_srp.c head/crypto/openssl/util/mk1mf.pl head/crypto/openssl/util/mkdef.pl head/crypto/openssl/util/mkerr.pl head/crypto/openssl/util/ssleay.num head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/CHANGES Thu Aug 7 18:56:10 2014 (r269682) @@ -2,6 +2,92 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1h and 1.0.1i [6 Aug 2014] + + *) Fix SRP buffer overrun vulnerability. Invalid parameters passed to the + SRP code can be overrun an internal buffer. Add sanity check that + g, A, B < N to SRP code. + + Thanks to Sean Devlin and Watson Ladd of Cryptography Services, NCC + Group for discovering this issue. + (CVE-2014-3512) + [Steve Henson] + + *) A flaw in the OpenSSL SSL/TLS server code causes the server to negotiate + TLS 1.0 instead of higher protocol versions when the ClientHello message + is badly fragmented. This allows a man-in-the-middle attacker to force a + downgrade to TLS 1.0 even if both the server and the client support a + higher protocol version, by modifying the client's TLS records. + + Thanks to David Benjamin and Adam Langley (Google) for discovering and + researching this issue. + (CVE-2014-3511) + [David Benjamin] + + *) OpenSSL DTLS clients enabling anonymous (EC)DH ciphersuites are subject + to a denial of service attack. A malicious server can crash the client + with a null pointer dereference (read) by specifying an anonymous (EC)DH + ciphersuite and sending carefully crafted handshake messages. + + Thanks to Felix Gröbert (Google) for discovering and researching this + issue. + (CVE-2014-3510) + [Emilia Käsper] + + *) By sending carefully crafted DTLS packets an attacker could cause openssl + to leak memory. This can be exploited through a Denial of Service attack. + Thanks to Adam Langley for discovering and researching this issue. + (CVE-2014-3507) + [Adam Langley] + + *) An attacker can force openssl to consume large amounts of memory whilst + processing DTLS handshake messages. This can be exploited through a + Denial of Service attack. + Thanks to Adam Langley for discovering and researching this issue. + (CVE-2014-3506) + [Adam Langley] + + *) An attacker can force an error condition which causes openssl to crash + whilst processing DTLS packets due to memory being freed twice. This + can be exploited through a Denial of Service attack. + Thanks to Adam Langley and Wan-Teh Chang for discovering and researching + this issue. + (CVE-2014-3505) + [Adam Langley] + + *) If a multithreaded client connects to a malicious server using a resumed + session and the server sends an ec point format extension it could write + up to 255 bytes to freed memory. + + Thanks to Gabor Tyukasz (LogMeIn Inc) for discovering and researching this + issue. + (CVE-2014-3509) + [Gabor Tyukasz] + + *) A malicious server can crash an OpenSSL client with a null pointer + dereference (read) by specifying an SRP ciphersuite even though it was not + properly negotiated with the client. This can be exploited through a + Denial of Service attack. + + Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for + discovering and researching this issue. + (CVE-2014-5139) + [Steve Henson] + + *) A flaw in OBJ_obj2txt may cause pretty printing functions such as + X509_name_oneline, X509_name_print_ex et al. to leak some information + from the stack. Applications may be affected if they echo pretty printing + output to the attacker. + + Thanks to Ivan Fratric (Google) for discovering this issue. + (CVE-2014-3508) + [Emilia Käsper, and Steve Henson] + + *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.) + for corner cases. (Certain input points at infinity could lead to + bogus results, with non-infinity inputs mapped to infinity too.) + [Bodo Moeller] + Changes between 1.0.1g and 1.0.1h [5 Jun 2014] *) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/Configure Thu Aug 7 18:56:10 2014 (r269682) @@ -720,6 +720,7 @@ my %disabled = ( # "what" => "co "sctp" => "default", "shared" => "default", "store" => "experimental", + "unit-test" => "default", "zlib" => "default", "zlib-dynamic" => "default" ); @@ -727,7 +728,7 @@ my @experimental = (); # This is what $depflags will look like with the above defaults # (we need this to see if we should advise the user to run "make depend"): -my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE"; +my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST"; # Explicit "no-..." options will be collected in %disabled along with the defaults. # To remove something from %disabled, use "enable-foo" (unless it's experimental). Modified: head/crypto/openssl/FAQ ============================================================================== --- head/crypto/openssl/FAQ Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/FAQ Thu Aug 7 18:56:10 2014 (r269682) @@ -113,11 +113,6 @@ that came with the version of OpenSSL yo documentation is included in each OpenSSL distribution under the docs directory. -For information on parts of libcrypto that are not yet documented, you -might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's -predecessor, at . Much -of this still applies to OpenSSL. - There is some documentation about certificate extensions and PKCS#12 in doc/openssl.txt Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/Makefile Thu Aug 7 18:56:10 2014 (r269682) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1h +VERSION=1.0.1i MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 @@ -13,7 +13,7 @@ SHLIB_MAJOR=1 SHLIB_MINOR=0.0 SHLIB_EXT= PLATFORM=dist -OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-store no-zlib no-zlib-dynamic static-engine +OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-store no-unit-test no-zlib no-zlib-dynamic static-engine CONFIGURE_ARGS=dist SHLIB_TARGET= @@ -61,7 +61,7 @@ OPENSSLDIR=/usr/local/ssl CC= cc CFLAG= -O -DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE +DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST PEX_LIBS= EX_LIBS= EXE_EXT= Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/NEWS Thu Aug 7 18:56:10 2014 (r269682) @@ -5,10 +5,23 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1h and OpenSSL 1.0.1i [6 Aug 2014] + + o Fix for CVE-2014-3512 + o Fix for CVE-2014-3511 + o Fix for CVE-2014-3510 + o Fix for CVE-2014-3507 + o Fix for CVE-2014-3506 + o Fix for CVE-2014-3505 + o Fix for CVE-2014-3509 + o Fix for CVE-2014-5139 + o Fix for CVE-2014-3508 + Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014] o Fix for CVE-2014-0224 o Fix for CVE-2014-0221 + o Fix for CVE-2014-0198 o Fix for CVE-2014-0195 o Fix for CVE-2014-3470 o Fix for CVE-2010-5298 Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/README Thu Aug 7 18:56:10 2014 (r269682) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1h 5 Jun 2014 + OpenSSL 1.0.1i 6 Aug 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/apps.c Thu Aug 7 18:56:10 2014 (r269682) @@ -390,6 +390,8 @@ int chopup_args(ARGS *arg, char *buf, in { arg->count=20; arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count); + if (arg->data == NULL) + return 0; } for (i=0; icount; i++) arg->data[i]=NULL; @@ -1542,6 +1544,8 @@ char *make_config_name() len=strlen(t)+strlen(OPENSSL_CONF)+2; p=OPENSSL_malloc(len); + if (p == NULL) + return NULL; BUF_strlcpy(p,t,len); #ifndef OPENSSL_SYS_VMS BUF_strlcat(p,"/",len); Modified: head/crypto/openssl/apps/ca.c ============================================================================== --- head/crypto/openssl/apps/ca.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/ca.c Thu Aug 7 18:56:10 2014 (r269682) @@ -1620,12 +1620,14 @@ static int certify(X509 **xret, char *in { ok=0; BIO_printf(bio_err,"Signature verification problems....\n"); + ERR_print_errors(bio_err); goto err; } if (i == 0) { ok=0; BIO_printf(bio_err,"Signature did not match the certificate request\n"); + ERR_print_errors(bio_err); goto err; } else @@ -2777,6 +2779,9 @@ char *make_revocation_str(int rev_type, revtm = X509_gmtime_adj(NULL, 0); + if (!revtm) + return NULL; + i = revtm->length + 1; if (reason) i += strlen(reason) + 1; Modified: head/crypto/openssl/apps/ciphers.c ============================================================================== --- head/crypto/openssl/apps/ciphers.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/ciphers.c Thu Aug 7 18:56:10 2014 (r269682) @@ -96,13 +96,7 @@ int MAIN(int argc, char **argv) char buf[512]; BIO *STDout=NULL; -#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) meth=SSLv23_server_method(); -#elif !defined(OPENSSL_NO_SSL3) - meth=SSLv3_server_method(); -#elif !defined(OPENSSL_NO_SSL2) - meth=SSLv2_server_method(); -#endif apps_startup(); Modified: head/crypto/openssl/apps/crl2p7.c ============================================================================== --- head/crypto/openssl/apps/crl2p7.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/crl2p7.c Thu Aug 7 18:56:10 2014 (r269682) @@ -141,7 +141,13 @@ int MAIN(int argc, char **argv) { if (--argc < 1) goto bad; if(!certflst) certflst = sk_OPENSSL_STRING_new_null(); - sk_OPENSSL_STRING_push(certflst,*(++argv)); + if (!certflst) + goto end; + if (!sk_OPENSSL_STRING_push(certflst,*(++argv))) + { + sk_OPENSSL_STRING_free(certflst); + goto end; + } } else { Modified: head/crypto/openssl/apps/enc.c ============================================================================== --- head/crypto/openssl/apps/enc.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/enc.c Thu Aug 7 18:56:10 2014 (r269682) @@ -67,7 +67,9 @@ #include #include #include +#ifndef OPENSSL_NO_COMP #include +#endif #include int set_hex(char *in,unsigned char *out,int size); @@ -337,6 +339,12 @@ bad: goto end; } + if (cipher && (EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)) + { + BIO_printf(bio_err, "Ciphers in XTS mode are not supported by the enc utility\n"); + goto end; + } + if (md && (dgst=EVP_get_digestbyname(md)) == NULL) { BIO_printf(bio_err,"%s is an unsupported message digest type\n",md); Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/ocsp.c Thu Aug 7 18:56:10 2014 (r269682) @@ -1419,7 +1419,7 @@ OCSP_RESPONSE *process_responder(BIO *er } resp = query_responder(err, cbio, path, headers, req, req_timeout); if (!resp) - BIO_printf(bio_err, "Error querying OCSP responsder\n"); + BIO_printf(bio_err, "Error querying OCSP responder\n"); end: if (cbio) BIO_free_all(cbio); Modified: head/crypto/openssl/apps/progs.h ============================================================================== --- head/crypto/openssl/apps/progs.h Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/progs.h Thu Aug 7 18:56:10 2014 (r269682) @@ -107,16 +107,16 @@ FUNCTION functions[] = { {FUNC_TYPE_GENERAL,"gendsa",gendsa_main}, #endif {FUNC_TYPE_GENERAL,"genpkey",genpkey_main}, -#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) +#if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL,"s_server",s_server_main}, #endif -#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) +#if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL,"s_client",s_client_main}, #endif #ifndef OPENSSL_NO_SPEED {FUNC_TYPE_GENERAL,"speed",speed_main}, #endif -#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) +#if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL,"s_time",s_time_main}, #endif {FUNC_TYPE_GENERAL,"version",version_main}, @@ -126,7 +126,7 @@ FUNCTION functions[] = { #endif {FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main}, {FUNC_TYPE_GENERAL,"sess_id",sess_id_main}, -#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3)) +#if !defined(OPENSSL_NO_SOCK) {FUNC_TYPE_GENERAL,"ciphers",ciphers_main}, #endif {FUNC_TYPE_GENERAL,"nseq",nseq_main}, Modified: head/crypto/openssl/apps/progs.pl ============================================================================== --- head/crypto/openssl/apps/progs.pl Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/progs.pl Thu Aug 7 18:56:10 2014 (r269682) @@ -32,7 +32,7 @@ foreach (@ARGV) push(@files,$_); $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) - { print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_SSL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; } + { print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; } elsif ( ($_ =~ /^speed$/)) { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; } elsif ( ($_ =~ /^engine$/)) Modified: head/crypto/openssl/apps/s_client.c ============================================================================== --- head/crypto/openssl/apps/s_client.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/s_client.c Thu Aug 7 18:56:10 2014 (r269682) @@ -290,6 +290,7 @@ static void sc_usage(void) BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL_HOST_NAME,PORT_STR); BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n"); + BIO_printf(bio_err," -verify_return_error - return verification errors\n"); BIO_printf(bio_err," -cert arg - certificate file to use, PEM format assumed\n"); BIO_printf(bio_err," -certform arg - certificate format (PEM or DER) PEM default\n"); BIO_printf(bio_err," -key arg - Private key file to use, in cert file if\n"); @@ -300,6 +301,7 @@ static void sc_usage(void) BIO_printf(bio_err," -CAfile arg - PEM format file of CA's\n"); BIO_printf(bio_err," -reconnect - Drop and re-make the connection with the same Session-ID\n"); BIO_printf(bio_err," -pause - sleep(1) after each read(2) and write(2) system call\n"); + BIO_printf(bio_err," -prexit - print session information even on connection failure\n"); BIO_printf(bio_err," -showcerts - show all certificates in the chain\n"); BIO_printf(bio_err," -debug - extra output\n"); #ifdef WATT32 Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/apps/s_server.c Thu Aug 7 18:56:10 2014 (r269682) @@ -463,6 +463,7 @@ static void sv_usage(void) BIO_printf(bio_err," -context arg - set session ID context\n"); BIO_printf(bio_err," -verify arg - turn on peer certificate verification\n"); BIO_printf(bio_err," -Verify arg - turn on peer certificate verification, must have a cert.\n"); + BIO_printf(bio_err," -verify_return_error - return verification errors\n"); BIO_printf(bio_err," -cert arg - certificate file to use\n"); BIO_printf(bio_err," (default is %s)\n",TEST_CERT); BIO_printf(bio_err," -crl_check - check the peer certificate has not been revoked by its CA.\n" \ @@ -534,6 +535,7 @@ static void sv_usage(void) BIO_printf(bio_err," -no_ecdhe - Disable ephemeral ECDH\n"); #endif BIO_printf(bio_err," -bugs - Turn on SSL bug compatibility\n"); + BIO_printf(bio_err," -hack - workaround for early Netscape code\n"); BIO_printf(bio_err," -www - Respond to a 'GET /' with a status page\n"); BIO_printf(bio_err," -WWW - Respond to a 'GET / HTTP/1.0' with file ./\n"); BIO_printf(bio_err," -HTTP - Respond to a 'GET / HTTP/1.0' with file ./\n"); @@ -562,6 +564,10 @@ static void sv_usage(void) #endif BIO_printf(bio_err," -keymatexport label - Export keying material using label\n"); BIO_printf(bio_err," -keymatexportlen len - Export len bytes of keying material (default 20)\n"); + BIO_printf(bio_err," -status - respond to certificate status requests\n"); + BIO_printf(bio_err," -status_verbose - enable status request verbose printout\n"); + BIO_printf(bio_err," -status_timeout n - status request responder timeout\n"); + BIO_printf(bio_err," -status_url URL - status request fallback URL\n"); } static int local_argc=0; @@ -739,7 +745,7 @@ static int MS_CALLBACK ssl_servername_cb if (servername) { - if (strcmp(servername,p->servername)) + if (strcasecmp(servername,p->servername)) return p->extension_error; if (ctx2) { @@ -1356,6 +1362,14 @@ bad: sv_usage(); goto end; } +#ifndef OPENSSL_NO_DTLS1 + if (www && socket_type == SOCK_DGRAM) + { + BIO_printf(bio_err, + "Can't use -HTTP, -www or -WWW with DTLS\n"); + goto end; + } +#endif #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) if (jpake_secret) Modified: head/crypto/openssl/crypto/asn1/a_object.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_object.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/a_object.c Thu Aug 7 18:56:10 2014 (r269682) @@ -283,17 +283,29 @@ err: ASN1err(ASN1_F_D2I_ASN1_OBJECT,i); return(NULL); } + ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long len) { ASN1_OBJECT *ret=NULL; const unsigned char *p; unsigned char *data; - int i; - /* Sanity check OID encoding: can't have leading 0x80 in - * subidentifiers, see: X.690 8.19.2 + int i, length; + + /* Sanity check OID encoding. + * Need at least one content octet. + * MSB must be clear in the last octet. + * can't have leading 0x80 in subidentifiers, see: X.690 8.19.2 */ - for (i = 0, p = *pp; i < len; i++, p++) + if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || + p[len - 1] & 0x80) + { + ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + /* Now 0 < len <= INT_MAX, so the cast is safe. */ + length = (int)len; + for (i = 0; i < length; i++, p++) { if (*p == 0x80 && (!i || !(p[-1] & 0x80))) { @@ -316,23 +328,23 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT data = (unsigned char *)ret->data; ret->data = NULL; /* once detached we can change it */ - if ((data == NULL) || (ret->length < len)) + if ((data == NULL) || (ret->length < length)) { ret->length=0; if (data != NULL) OPENSSL_free(data); - data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1); + data=(unsigned char *)OPENSSL_malloc(length); if (data == NULL) { i=ERR_R_MALLOC_FAILURE; goto err; } ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; } - memcpy(data,p,(int)len); + memcpy(data,p,length); /* reattach data to object, after which it remains const */ ret->data =data; - ret->length=(int)len; + ret->length=length; ret->sn=NULL; ret->ln=NULL; /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ - p+=len; + p+=length; if (a != NULL) (*a)=ret; *pp=p; Modified: head/crypto/openssl/crypto/asn1/a_utctm.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_utctm.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/a_utctm.c Thu Aug 7 18:56:10 2014 (r269682) @@ -196,24 +196,29 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCT struct tm *ts; struct tm data; size_t len = 20; + int free_s = 0; if (s == NULL) + { + free_s = 1; s=M_ASN1_UTCTIME_new(); + } if (s == NULL) - return(NULL); + goto err; + ts=OPENSSL_gmtime(&t, &data); if (ts == NULL) - return(NULL); + goto err; if (offset_day || offset_sec) { if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)) - return NULL; + goto err; } if((ts->tm_year < 50) || (ts->tm_year >= 150)) - return NULL; + goto err; p=(char *)s->data; if ((p == NULL) || ((size_t)s->length < len)) @@ -222,7 +227,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCT if (p == NULL) { ASN1err(ASN1_F_ASN1_UTCTIME_ADJ,ERR_R_MALLOC_FAILURE); - return(NULL); + goto err; } if (s->data != NULL) OPENSSL_free(s->data); @@ -237,6 +242,10 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCT ebcdic2ascii(s->data, s->data, s->length); #endif return(s); + err: + if (free_s && s) + M_ASN1_UTCTIME_free(s); + return NULL; } @@ -261,6 +270,11 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_U t -= offset*60; /* FIXME: may overflow in extreme cases */ tm = OPENSSL_gmtime(&t, &data); + /* NB: -1, 0, 1 already valid return values so use -2 to + * indicate error. + */ + if (tm == NULL) + return -2; #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 year = g2(s->data); Modified: head/crypto/openssl/crypto/asn1/ameth_lib.c ============================================================================== --- head/crypto/openssl/crypto/asn1/ameth_lib.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/ameth_lib.c Thu Aug 7 18:56:10 2014 (r269682) @@ -258,7 +258,12 @@ int EVP_PKEY_asn1_add_alias(int to, int if (!ameth) return 0; ameth->pkey_base_id = to; - return EVP_PKEY_asn1_add0(ameth); + if (!EVP_PKEY_asn1_add0(ameth)) + { + EVP_PKEY_asn1_free(ameth); + return 0; + } + return 1; } int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags, Modified: head/crypto/openssl/crypto/asn1/asn1_lib.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1_lib.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/asn1_lib.c Thu Aug 7 18:56:10 2014 (r269682) @@ -131,6 +131,9 @@ int ASN1_get_object(const unsigned char *pclass=xclass; if (!asn1_get_length(&p,&inf,plength,(int)max)) goto err; + if (inf && !(ret & V_ASN1_CONSTRUCTED)) + goto err; + #if 0 fprintf(stderr,"p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", (int)p,*plength,omax,(int)*pp,(int)(p+ *plength), Modified: head/crypto/openssl/crypto/asn1/asn_mime.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn_mime.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/asn_mime.c Thu Aug 7 18:56:10 2014 (r269682) @@ -667,6 +667,8 @@ static STACK_OF(MIME_HEADER) *mime_parse int len, state, save_state = 0; headers = sk_MIME_HEADER_new(mime_hdr_cmp); + if (!headers) + return NULL; while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) { /* If whitespace at line start then continuation line */ if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME; Modified: head/crypto/openssl/crypto/asn1/asn_pack.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn_pack.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/asn_pack.c Thu Aug 7 18:56:10 2014 (r269682) @@ -134,15 +134,23 @@ ASN1_STRING *ASN1_pack_string(void *obj, if (!(octmp->length = i2d(obj, NULL))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); - return NULL; + goto err; } if (!(p = OPENSSL_malloc (octmp->length))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } octmp->data = p; i2d (obj, &p); return octmp; + err: + if (!oct || !*oct) + { + ASN1_STRING_free(octmp); + if (oct) + *oct = NULL; + } + return NULL; } #endif Modified: head/crypto/openssl/crypto/asn1/bio_asn1.c ============================================================================== --- head/crypto/openssl/crypto/asn1/bio_asn1.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/bio_asn1.c Thu Aug 7 18:56:10 2014 (r269682) @@ -154,7 +154,10 @@ static int asn1_bio_new(BIO *b) if (!ctx) return 0; if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE)) + { + OPENSSL_free(ctx); return 0; + } b->init = 1; b->ptr = (char *)ctx; b->flags = 0; Modified: head/crypto/openssl/crypto/asn1/charmap.pl ============================================================================== --- head/crypto/openssl/crypto/asn1/charmap.pl Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/charmap.pl Thu Aug 7 18:56:10 2014 (r269682) @@ -1,5 +1,8 @@ #!/usr/local/bin/perl -w +# Written by Dr Stephen N Henson (steve@openssl.org). +# Licensed under the terms of the OpenSSL license. + use strict; my ($i, @arr); Modified: head/crypto/openssl/crypto/asn1/evp_asn1.c ============================================================================== --- head/crypto/openssl/crypto/asn1/evp_asn1.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/evp_asn1.c Thu Aug 7 18:56:10 2014 (r269682) @@ -66,7 +66,11 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE ASN1_STRING *os; if ((os=M_ASN1_OCTET_STRING_new()) == NULL) return(0); - if (!M_ASN1_OCTET_STRING_set(os,data,len)) return(0); + if (!M_ASN1_OCTET_STRING_set(os,data,len)) + { + M_ASN1_OCTET_STRING_free(os); + return 0; + } ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os); return(1); } Modified: head/crypto/openssl/crypto/asn1/t_x509.c ============================================================================== --- head/crypto/openssl/crypto/asn1/t_x509.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/t_x509.c Thu Aug 7 18:56:10 2014 (r269682) @@ -475,6 +475,8 @@ int X509_NAME_print(BIO *bp, X509_NAME * l=80-2-obase; b=X509_NAME_oneline(name,NULL,0); + if (!b) + return 0; if (!*b) { OPENSSL_free(b); Modified: head/crypto/openssl/crypto/asn1/tasn_enc.c ============================================================================== --- head/crypto/openssl/crypto/asn1/tasn_enc.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/tasn_enc.c Thu Aug 7 18:56:10 2014 (r269682) @@ -453,9 +453,14 @@ static int asn1_set_seq_out(STACK_OF(ASN { derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst)); + if (!derlst) + return 0; tmpdat = OPENSSL_malloc(skcontlen); - if (!derlst || !tmpdat) + if (!tmpdat) + { + OPENSSL_free(derlst); return 0; + } } } /* If not sorting just output each item */ Modified: head/crypto/openssl/crypto/asn1/x_crl.c ============================================================================== --- head/crypto/openssl/crypto/asn1/x_crl.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/asn1/x_crl.c Thu Aug 7 18:56:10 2014 (r269682) @@ -270,6 +270,7 @@ static int crl_cb(int operation, ASN1_VA { /* We handle IDP and deltas */ if ((nid == NID_issuing_distribution_point) + || (nid == NID_authority_key_identifier) || (nid == NID_delta_crl)) break;; crl->flags |= EXFLAG_CRITICAL; Modified: head/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- head/crypto/openssl/crypto/bio/bio_lib.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/bio/bio_lib.c Thu Aug 7 18:56:10 2014 (r269682) @@ -132,8 +132,8 @@ int BIO_free(BIO *a) CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); - if ((a->method == NULL) || (a->method->destroy == NULL)) return(1); - a->method->destroy(a); + if ((a->method != NULL) && (a->method->destroy != NULL)) + a->method->destroy(a); OPENSSL_free(a); return(1); } Modified: head/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_exp.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/bn/bn_exp.c Thu Aug 7 18:56:10 2014 (r269682) @@ -680,7 +680,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr /* Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as * 512-bit RSA is hardly relevant, we omit it to spare size... */ - if (window==5) + if (window==5 && top>1) { void bn_mul_mont_gather5(BN_ULONG *rp,const BN_ULONG *ap, const void *table,const BN_ULONG *np, Modified: head/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_lib.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/bn/bn_lib.c Thu Aug 7 18:56:10 2014 (r269682) @@ -320,6 +320,15 @@ static BN_ULONG *bn_expand_internal(cons BNerr(BN_F_BN_EXPAND_INTERNAL,ERR_R_MALLOC_FAILURE); return(NULL); } +#ifdef PURIFY + /* Valgrind complains in BN_consttime_swap because we process the whole + * array even if it's not initialised yet. This doesn't matter in that + * function - what's important is constant time operation (we're not + * actually going to use the data) + */ + memset(a, 0, sizeof(BN_ULONG)*words); +#endif + #if 1 B=b->d; /* Check if the previous number needs to be copied */ Modified: head/crypto/openssl/crypto/bn/bn_sqr.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_sqr.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/bn/bn_sqr.c Thu Aug 7 18:56:10 2014 (r269682) @@ -77,6 +77,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, B if (al <= 0) { r->top=0; + r->neg = 0; return 1; } Modified: head/crypto/openssl/crypto/cms/cms_pwri.c ============================================================================== --- head/crypto/openssl/crypto/cms/cms_pwri.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/cms/cms_pwri.c Thu Aug 7 18:56:10 2014 (r269682) @@ -93,9 +93,10 @@ CMS_RecipientInfo *CMS_add0_recipient_pa X509_ALGOR *encalg = NULL; unsigned char iv[EVP_MAX_IV_LENGTH]; int ivlen; + env = cms_get0_enveloped(cms); if (!env) - goto err; + return NULL; if (wrap_nid <= 0) wrap_nid = NID_id_alg_PWRI_KEK; Modified: head/crypto/openssl/crypto/conf/conf_def.c ============================================================================== --- head/crypto/openssl/crypto/conf/conf_def.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/conf/conf_def.c Thu Aug 7 18:56:10 2014 (r269682) @@ -321,7 +321,7 @@ again: p=eat_ws(conf, end); if (*p != ']') { - if (*p != '\0') + if (*p != '\0' && ss != p) { ss=p; goto again; Modified: head/crypto/openssl/crypto/ec/ec_lib.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_lib.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/ec/ec_lib.c Thu Aug 7 18:56:10 2014 (r269682) @@ -942,7 +942,7 @@ int EC_POINT_dbl(const EC_GROUP *group, int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { - if (group->meth->dbl == 0) + if (group->meth->invert == 0) { ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; Modified: head/crypto/openssl/crypto/ec/ecp_smpl.c ============================================================================== --- head/crypto/openssl/crypto/ec/ecp_smpl.c Thu Aug 7 18:37:15 2014 (r269681) +++ head/crypto/openssl/crypto/ec/ecp_smpl.c Thu Aug 7 18:56:10 2014 (r269682) @@ -1181,9 +1181,8 @@ int ec_GFp_simple_make_affine(const EC_G int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx) { BN_CTX *new_ctx = NULL; - BIGNUM *tmp0, *tmp1; - size_t pow2 = 0; - BIGNUM **heap = NULL; + BIGNUM *tmp, *tmp_Z; + BIGNUM **prod_Z = NULL; size_t i; int ret = 0; @@ -1198,124 +1197,104 @@ int ec_GFp_simple_points_make_affine(con } BN_CTX_start(ctx); - tmp0 = BN_CTX_get(ctx); - tmp1 = BN_CTX_get(ctx); - if (tmp0 == NULL || tmp1 == NULL) goto err; - - /* Before converting the individual points, compute inverses of all Z values. - * Modular inversion is rather slow, but luckily we can do with a single - * explicit inversion, plus about 3 multiplications per input value. - */ - - pow2 = 1; - while (num > pow2) - pow2 <<= 1; - /* Now pow2 is the smallest power of 2 satifsying pow2 >= num. - * We need twice that. */ - pow2 <<= 1; - - heap = OPENSSL_malloc(pow2 * sizeof heap[0]); - if (heap == NULL) goto err; - - /* The array is used as a binary tree, exactly as in heapsort: - * - * heap[1] - * heap[2] heap[3] - * heap[4] heap[5] heap[6] heap[7] - * heap[8]heap[9] heap[10]heap[11] heap[12]heap[13] heap[14] heap[15] - * - * We put the Z's in the last line; - * then we set each other node to the product of its two child-nodes (where - * empty or 0 entries are treated as ones); - * then we invert heap[1]; - * then we invert each other node by replacing it by the product of its - * parent (after inversion) and its sibling (before inversion). - */ - heap[0] = NULL; - for (i = pow2/2 - 1; i > 0; i--) - heap[i] = NULL; + tmp = BN_CTX_get(ctx); + tmp_Z = BN_CTX_get(ctx); + if (tmp == NULL || tmp_Z == NULL) goto err; + + prod_Z = OPENSSL_malloc(num * sizeof prod_Z[0]); + if (prod_Z == NULL) goto err; for (i = 0; i < num; i++) - heap[pow2/2 + i] = &points[i]->Z; - for (i = pow2/2 + num; i < pow2; i++) - heap[i] = NULL; - - /* set each node to the product of its children */ - for (i = pow2/2 - 1; i > 0; i--) - { - heap[i] = BN_new(); - if (heap[i] == NULL) goto err; - - if (heap[2*i] != NULL) + { + prod_Z[i] = BN_new(); + if (prod_Z[i] == NULL) goto err; + } + + /* Set each prod_Z[i] to the product of points[0]->Z .. points[i]->Z, + * skipping any zero-valued inputs (pretend that they're 1). */ + + if (!BN_is_zero(&points[0]->Z)) + { + if (!BN_copy(prod_Z[0], &points[0]->Z)) goto err; + } + else + { + if (group->meth->field_set_to_one != 0) { - if ((heap[2*i + 1] == NULL) || BN_is_zero(heap[2*i + 1])) - { - if (!BN_copy(heap[i], heap[2*i])) goto err; - } - else - { - if (BN_is_zero(heap[2*i])) - { - if (!BN_copy(heap[i], heap[2*i + 1])) goto err; - } - else - { - if (!group->meth->field_mul(group, heap[i], - heap[2*i], heap[2*i + 1], ctx)) goto err; - } - } + if (!group->meth->field_set_to_one(group, prod_Z[0], ctx)) goto err; + } + else + { + if (!BN_one(prod_Z[0])) goto err; } } - /* invert heap[1] */ - if (!BN_is_zero(heap[1])) + for (i = 1; i < num; i++) { - if (!BN_mod_inverse(heap[1], heap[1], &group->field, ctx)) + if (!BN_is_zero(&points[i]->Z)) { - ECerr(EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE, ERR_R_BN_LIB); - goto err; + if (!group->meth->field_mul(group, prod_Z[i], prod_Z[i - 1], &points[i]->Z, ctx)) goto err; } + else + { + if (!BN_copy(prod_Z[i], prod_Z[i - 1])) goto err; + } + } + + /* Now use a single explicit inversion to replace every + * non-zero points[i]->Z by its inverse. */ + + if (!BN_mod_inverse(tmp, prod_Z[num - 1], &group->field, ctx)) + { + ECerr(EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE, ERR_R_BN_LIB); + goto err; } if (group->meth->field_encode != 0) { - /* in the Montgomery case, we just turned R*H (representing H) + /* In the Montgomery case, we just turned R*H (representing H) * into 1/(R*H), but we need R*(1/H) (representing 1/H); - * i.e. we have need to multiply by the Montgomery factor twice */ - if (!group->meth->field_encode(group, heap[1], heap[1], ctx)) goto err; - if (!group->meth->field_encode(group, heap[1], heap[1], ctx)) goto err; + * i.e. we need to multiply by the Montgomery factor twice. */ + if (!group->meth->field_encode(group, tmp, tmp, ctx)) goto err; + if (!group->meth->field_encode(group, tmp, tmp, ctx)) goto err; } - /* set other heap[i]'s to their inverses */ - for (i = 2; i < pow2/2 + num; i += 2) + for (i = num - 1; i > 0; --i) { - /* i is even */ - if ((heap[i + 1] != NULL) && !BN_is_zero(heap[i + 1])) - { - if (!group->meth->field_mul(group, tmp0, heap[i/2], heap[i + 1], ctx)) goto err; - if (!group->meth->field_mul(group, tmp1, heap[i/2], heap[i], ctx)) goto err; - if (!BN_copy(heap[i], tmp0)) goto err; - if (!BN_copy(heap[i + 1], tmp1)) goto err; - } - else + /* Loop invariant: tmp is the product of the inverses of + * points[0]->Z .. points[i]->Z (zero-valued inputs skipped). */ + if (!BN_is_zero(&points[i]->Z)) { - if (!BN_copy(heap[i], heap[i/2])) goto err; + /* Set tmp_Z to the inverse of points[i]->Z (as product + * of Z inverses 0 .. i, Z values 0 .. i - 1). */ + if (!group->meth->field_mul(group, tmp_Z, prod_Z[i - 1], tmp, ctx)) goto err; + /* Update tmp to satisfy the loop invariant for i - 1. */ + if (!group->meth->field_mul(group, tmp, tmp, &points[i]->Z, ctx)) goto err; + /* Replace points[i]->Z by its inverse. */ + if (!BN_copy(&points[i]->Z, tmp_Z)) goto err; } } - /* we have replaced all non-zero Z's by their inverses, now fix up all the points */ + if (!BN_is_zero(&points[0]->Z)) + { + /* Replace points[0]->Z by its inverse. */ + if (!BN_copy(&points[0]->Z, tmp)) goto err; + } + + /* Finally, fix up the X and Y coordinates for all points. */ + for (i = 0; i < num; i++) { EC_POINT *p = points[i]; - + if (!BN_is_zero(&p->Z)) { /* turn (X, Y, 1/Z) into (X/Z^2, Y/Z^3, 1) */ - if (!group->meth->field_sqr(group, tmp1, &p->Z, ctx)) goto err; - if (!group->meth->field_mul(group, &p->X, &p->X, tmp1, ctx)) goto err; + if (!group->meth->field_sqr(group, tmp, &p->Z, ctx)) goto err; + if (!group->meth->field_mul(group, &p->X, &p->X, tmp, ctx)) goto err; + + if (!group->meth->field_mul(group, tmp, tmp, &p->Z, ctx)) goto err; + if (!group->meth->field_mul(group, &p->Y, &p->Y, tmp, ctx)) goto err; - if (!group->meth->field_mul(group, tmp1, tmp1, &p->Z, ctx)) goto err; - if (!group->meth->field_mul(group, &p->Y, &p->Y, tmp1, ctx)) goto err; - if (group->meth->field_set_to_one != 0) { if (!group->meth->field_set_to_one(group, &p->Z, ctx)) goto err; @@ -1329,20 +1308,19 @@ int ec_GFp_simple_points_make_affine(con } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:00:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7407B2DD for ; Thu, 7 Aug 2014 21:00:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554C12631 for ; Thu, 7 Aug 2014 21:00:18 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 2359 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:00:16 +0000 From: Nathan Whitehorn Date: Thu, 7 Aug 2014 21:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269685 - in head/sys: dev/fb dev/vt dev/vt/hw/efifb dev/vt/hw/fb dev/vt/hw/ofwfb dev/vt/hw/vga powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3e8e0.2359.16c134a3@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:00:18 -0000 Author: nwhitehorn Date: Thu Aug 7 21:00:16 2014 New Revision: 269685 URL: http://svnweb.freebsd.org/changeset/base/269685 Log: Retire vd_maskbitbltchr. The same functionality can be obtained by testing for mask != NULL in vd_bitbltchr, which all implementations of vd_bitbltchr() were doing anyway. Modified: head/sys/dev/fb/creator_vt.c head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/fb/vt_fb.h head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/dev/vt/hw/vga/vt_vga.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/dev/fb/creator_vt.c ============================================================================== --- head/sys/dev/fb/creator_vt.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/fb/creator_vt.c Thu Aug 7 21:00:16 2014 (r269685) @@ -53,7 +53,6 @@ static const struct vt_driver vt_creator .vd_init = creatorfb_init, .vd_blank = creatorfb_blank, .vd_bitbltchr = creatorfb_bitbltchr, - .vd_maskbitbltchr = creatorfb_bitbltchr, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, .vd_priority = VD_PRIORITY_SPECIFIC Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/hw/efifb/efifb.c Thu Aug 7 21:00:16 2014 (r269685) @@ -61,7 +61,6 @@ static struct vt_driver vt_efifb_driver .vd_init = vt_efifb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, - .vd_maskbitbltchr = vt_fb_maskbitbltchr, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Aug 7 21:00:16 2014 (r269685) @@ -50,7 +50,6 @@ static struct vt_driver vt_fb_driver = { .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, - .vd_maskbitbltchr = vt_fb_maskbitbltchr, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, @@ -253,70 +252,6 @@ vt_fb_bitbltchr(struct vt_device *vd, co uint32_t fgc, bgc, cc, o; int c, l, bpp; u_long line; - uint8_t b; - const uint8_t *ch; - - info = vd->vd_softc; - bpp = FBTYPE_GET_BYTESPP(info); - fgc = info->fb_cmap[fg]; - bgc = info->fb_cmap[bg]; - b = 0; - if (bpl == 0) - bpl = (width + 7) >> 3; /* Bytes per sorce line. */ - - /* Don't try to put off screen pixels */ - if (((left + width) > info->fb_width) || ((top + height) > - info->fb_height)) - return; - - KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); - - line = (info->fb_stride * top) + (left * bpp); - for (l = 0; l < height; l++) { - ch = src; - for (c = 0; c < width; c++) { - if (c % 8 == 0) - b = *ch++; - else - b <<= 1; - o = line + (c * bpp); - cc = b & 0x80 ? fgc : bgc; - - switch(bpp) { - case 1: - vt_fb_mem_wr1(info, o, cc); - break; - case 2: - vt_fb_mem_wr2(info, o, cc); - break; - case 3: - /* Packed mode, so unaligned. Byte access. */ - vt_fb_mem_wr1(info, o, (cc >> 16) & 0xff); - vt_fb_mem_wr1(info, o + 1, (cc >> 8) & 0xff); - vt_fb_mem_wr1(info, o + 2, cc & 0xff); - break; - case 4: - vt_fb_mem_wr4(info, o, cc); - break; - default: - /* panic? */ - break; - } - } - line += info->fb_stride; - src += bpl; - } -} - -void -vt_fb_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, - int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, - unsigned int height, term_color_t fg, term_color_t bg) -{ - struct fb_info *info; - uint32_t fgc, bgc, cc, o; - int c, l, bpp; - u_long line; uint8_t b, m; const uint8_t *ch; Modified: head/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.h Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/hw/fb/vt_fb.h Thu Aug 7 21:00:16 2014 (r269685) @@ -39,7 +39,6 @@ void vt_fb_suspend(void); vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitbltchr_t vt_fb_bitbltchr; -vd_maskbitbltchr_t vt_fb_maskbitbltchr; vd_postswitch_t vt_fb_postswitch; vd_fb_ioctl_t vt_fb_ioctl; vd_fb_mmap_t vt_fb_mmap; Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Thu Aug 7 21:00:16 2014 (r269685) @@ -66,7 +66,6 @@ static const struct vt_driver vt_ofwfb_d .vd_init = ofwfb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = ofwfb_bitbltchr, - .vd_maskbitbltchr = ofwfb_bitbltchr, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, .vd_priority = VD_PRIORITY_GENERIC+1, Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/hw/vga/vt_vga.c Thu Aug 7 21:00:16 2014 (r269685) @@ -75,7 +75,6 @@ static vd_probe_t vga_probe; static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; -static vd_maskbitbltchr_t vga_maskbitbltchr; static vd_drawrect_t vga_drawrect; static vd_setpixel_t vga_setpixel; static vd_putchar_t vga_putchar; @@ -87,7 +86,6 @@ static const struct vt_driver vt_vga_dri .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, - .vd_maskbitbltchr = vga_bitbltchr, .vd_drawrect = vga_drawrect, .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/vt.h Thu Aug 7 21:00:16 2014 (r269685) @@ -290,9 +290,6 @@ typedef void vd_blank_t(struct vt_device typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); -typedef void vd_maskbitbltchr_t(struct vt_device *vd, const uint8_t *src, - const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, - unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); typedef void vd_putchar_t(struct vt_device *vd, term_char_t, vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg); typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); @@ -311,7 +308,6 @@ struct vt_driver { /* Drawing. */ vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; - vd_maskbitbltchr_t *vd_maskbitbltchr; vd_drawrect_t *vd_drawrect; vd_setpixel_t *vd_setpixel; Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/dev/vt/vt_core.c Thu Aug 7 21:00:16 2014 (r269685) @@ -887,7 +887,7 @@ vt_flush(struct vt_device *vd) if ((vd->vd_my + m->h) > (size.tp_row * vf->vf_height)) h = (size.tp_row * vf->vf_height) - vd->vd_my - 1; - vd->vd_driver->vd_maskbitbltchr(vd, m->map, m->mask, bpl, + vd->vd_driver->vd_bitbltchr(vd, m->map, m->mask, bpl, vd->vd_offset.tp_row + vd->vd_my, vd->vd_offset.tp_col + vd->vd_mx, w, h, TC_WHITE, TC_BLACK); @@ -2103,8 +2103,6 @@ vt_allocate(struct vt_driver *drv, void } vd = main_vd; VT_LOCK(vd); - if (drv->vd_maskbitbltchr == NULL) - drv->vd_maskbitbltchr = drv->vd_bitbltchr; if (vd->vd_flags & VDF_ASYNC) { /* Stop vt_flush periodic task. */ Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Thu Aug 7 20:05:50 2014 (r269684) +++ head/sys/powerpc/ps3/ps3_syscons.c Thu Aug 7 21:00:16 2014 (r269685) @@ -77,7 +77,6 @@ static struct vt_driver vt_ps3fb_driver .vd_init = ps3fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, - .vd_maskbitbltchr = vt_fb_maskbitbltchr, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:37:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7AD7F7F for ; Thu, 7 Aug 2014 21:37:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC6FD2A0D for ; Thu, 7 Aug 2014 21:37:03 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2e4b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:37:03 +0000 From: Ian Lepore Date: Thu, 7 Aug 2014 21:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269688 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3f17f.2e4b.79076202@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:37:03 -0000 Author: ian Date: Thu Aug 7 21:37:03 2014 New Revision: 269688 URL: http://svnweb.freebsd.org/changeset/base/269688 Log: m4 now requires libohash, ensure it gets built when bootstrapping. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 7 21:06:34 2014 (r269687) +++ head/Makefile.inc1 Thu Aug 7 21:37:03 2014 (r269688) @@ -1208,7 +1208,8 @@ _sed= usr.bin/sed .endif .if ${BOOTSTRAPPING} < 1000002 -_m4= usr.bin/m4 +_m4= lib/libohash \ + usr.bin/m4 .endif .if ${BOOTSTRAPPING} < 1000013 From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:56:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DAD1907 for ; Thu, 7 Aug 2014 21:56:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 021332C86 for ; Thu, 7 Aug 2014 21:56:33 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2904 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:56:32 +0000 From: Warner Losh Date: Thu, 7 Aug 2014 21:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269690 - head/sys/dev/esp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3f610.2904.4c46763e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:56:33 -0000 Author: imp Date: Thu Aug 7 21:56:32 2014 New Revision: 269690 URL: http://svnweb.freebsd.org/changeset/base/269690 Log: target is unsigned, so don't compare it < 0 for range test. Modified: head/sys/dev/esp/ncr53c9x.c Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Thu Aug 7 21:37:31 2014 (r269689) +++ head/sys/dev/esp/ncr53c9x.c Thu Aug 7 21:56:32 2014 (r269690) @@ -1082,8 +1082,7 @@ ncr53c9x_action(struct cam_sim *sim, uni case XPT_RESET_DEV: case XPT_SCSI_IO: - if (ccb->ccb_h.target_id < 0 || - ccb->ccb_h.target_id >= sc->sc_ntarg) { + if (ccb->ccb_h.target_id >= sc->sc_ntarg) { ccb->ccb_h.status = CAM_PATH_INVALID; goto done; } From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:56:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8ECEA4B for ; Thu, 7 Aug 2014 21:56:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90DB02C8C for ; Thu, 7 Aug 2014 21:56:37 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 291d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:56:37 +0000 From: Warner Losh Date: Thu, 7 Aug 2014 21:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269691 - head/sys/geom/cache X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3f615.291d.15c80fca@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:56:37 -0000 Author: imp Date: Thu Aug 7 21:56:37 2014 New Revision: 269691 URL: http://svnweb.freebsd.org/changeset/base/269691 Log: Unsigned values can never be less than 0. Modified: head/sys/geom/cache/g_cache.c Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Thu Aug 7 21:56:32 2014 (r269690) +++ head/sys/geom/cache/g_cache.c Thu Aug 7 21:56:37 2014 (r269691) @@ -73,7 +73,7 @@ sysctl_handle_pct(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) return (error); - if (val < 0 || val > 100) + if (val > 100) return (EINVAL); if ((arg1 == &g_cache_used_lo && val > g_cache_used_hi) || (arg1 == &g_cache_used_hi && g_cache_used_lo > val)) From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:56:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E2B5B87 for ; Thu, 7 Aug 2014 21:56:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74FAB2C90 for ; Thu, 7 Aug 2014 21:56:42 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2936 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:56:42 +0000 From: Warner Losh Date: Thu, 7 Aug 2014 21:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269692 - head/sys/geom/journal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3f61a.2936.6db30e60@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:56:42 -0000 Author: imp Date: Thu Aug 7 21:56:42 2014 New Revision: 269692 URL: http://svnweb.freebsd.org/changeset/base/269692 Log: cswitch is unsigned, so don't compare it < 0. Any negative numbers will look huge and be caught by > 100. Modified: head/sys/geom/journal/g_journal.c Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Thu Aug 7 21:56:37 2014 (r269691) +++ head/sys/geom/journal/g_journal.c Thu Aug 7 21:56:42 2014 (r269692) @@ -172,7 +172,7 @@ g_journal_cache_switch_sysctl(SYSCTL_HAN error = sysctl_handle_int(oidp, &cswitch, 0, req); if (error != 0 || req->newptr == NULL) return (error); - if (cswitch < 0 || cswitch > 100) + if (cswitch > 100) return (EINVAL); g_journal_cache_switch = cswitch; g_journal_cache_low = (g_journal_cache_limit / 100) * cswitch; From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 21:56:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B7BDCA8 for ; Thu, 7 Aug 2014 21:56:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 232FD2C94 for ; Thu, 7 Aug 2014 21:56:47 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 294f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 21:56:47 +0000 From: Warner Losh Date: Thu, 7 Aug 2014 21:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269693 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3f61f.294f.783dc2e4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:56:47 -0000 Author: imp Date: Thu Aug 7 21:56:46 2014 New Revision: 269693 URL: http://svnweb.freebsd.org/changeset/base/269693 Log: Cast queue length because q_len isn't really an enum in the same sense that clang wants it to be (a value that can only have values inside the enum range), but rather an unsigned count of bytes. Modified: head/sys/dev/oce/oce_mbox.c Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Thu Aug 7 21:56:42 2014 (r269692) +++ head/sys/dev/oce/oce_mbox.c Thu Aug 7 21:56:46 2014 (r269693) @@ -1876,7 +1876,7 @@ oce_mbox_cq_create(struct oce_cq *cq, ui ctx->v2.armed = 0; ctx->v2.eq_id = cq->eq->eq_id; if (ctx->v2.count == 3) { - if (cq->cq_cfg.q_len > (4*1024)-1) + if ((u_int)cq->cq_cfg.q_len > (4*1024)-1) ctx->v2.cqe_count = (4*1024)-1; else ctx->v2.cqe_count = cq->cq_cfg.q_len; From owner-svn-src-head@FreeBSD.ORG Thu Aug 7 22:14:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E183A259 for ; Thu, 7 Aug 2014 22:14:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7E212EE1 for ; Thu, 7 Aug 2014 22:14:37 +0000 (UTC) Received: from pfg (uid 1275) (envelope-from pfg@FreeBSD.org) id 2ff8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 22:14:37 +0000 From: Pedro F. Giffuni Date: Thu, 7 Aug 2014 22:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269695 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e3fa4d.2ff8.4272aad6@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 22:14:38 -0000 Author: pfg Date: Thu Aug 7 22:14:37 2014 New Revision: 269695 URL: http://svnweb.freebsd.org/changeset/base/269695 Log: Const-ify character string Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days Modified: head/lib/libc/net/linkaddr.c Modified: head/lib/libc/net/linkaddr.c ============================================================================== --- head/lib/libc/net/linkaddr.c Thu Aug 7 22:08:43 2014 (r269694) +++ head/lib/libc/net/linkaddr.c Thu Aug 7 22:14:37 2014 (r269695) @@ -118,7 +118,7 @@ link_addr(addr, sdl) return; } -static char hexlist[] = "0123456789abcdef"; +static const char hexlist[] = "0123456789abcdef"; char * link_ntoa(sdl) From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 01:21:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DC027F1 for ; Fri, 8 Aug 2014 01:21:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 537552233 for ; Fri, 8 Aug 2014 01:21:53 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2f09 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 01:21:53 +0000 From: Ian Lepore Date: Fri, 8 Aug 2014 01:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269697 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e42631.2f09.4832895f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 01:21:53 -0000 Author: ian Date: Fri Aug 8 01:21:52 2014 New Revision: 269697 URL: http://svnweb.freebsd.org/changeset/base/269697 Log: Add the dts include directory to the -I list when doing arm builds. Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Fri Aug 8 00:58:24 2014 (r269696) +++ head/sys/conf/Makefile.arm Fri Aug 8 01:21:52 2014 (r269697) @@ -30,7 +30,7 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt +INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M} SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M} From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 01:23:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DA1A94A for ; Fri, 8 Aug 2014 01:23:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E779A2249 for ; Fri, 8 Aug 2014 01:23:43 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 2f1c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 01:23:43 +0000 From: Ian Lepore Date: Fri, 8 Aug 2014 01:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269698 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4269f.2f1c.4f83a077@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 01:23:44 -0000 Author: ian Date: Fri Aug 8 01:23:43 2014 New Revision: 269698 URL: http://svnweb.freebsd.org/changeset/base/269698 Log: Add a missing clock register definition. Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Fri Aug 8 01:21:52 2014 (r269697) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Fri Aug 8 01:23:43 2014 (r269698) @@ -36,6 +36,7 @@ #define CCM_CLPCR_LPM_STOP 0x02 #define CCM_CGPR 0x064 #define CCM_CGPR_INT_MEM_CLK_LPM (1 << 17) +#define CCM_CCGR0 0x068 #define CCM_CCGR1 0x06C #define CCM_CCGR2 0x070 #define CCM_CCGR3 0x074 From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 01:57:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C78DE12C for ; Fri, 8 Aug 2014 01:57:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B332425D5 for ; Fri, 8 Aug 2014 01:57:19 +0000 (UTC) Received: from kevlo (uid 772) (envelope-from kevlo@FreeBSD.org) id 2d2c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 01:57:15 +0000 From: Kevin Lo Date: Fri, 8 Aug 2014 01:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269699 - in head/sys: net netinet netinet6 netipsec netpfil/pf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e42e7c.2d2c.122bcb35@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 01:57:19 -0000 Author: kevlo Date: Fri Aug 8 01:57:15 2014 New Revision: 269699 URL: http://svnweb.freebsd.org/changeset/base/269699 Log: Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have only one protocol switch structure that is shared between ipv4 and ipv6. Phabric: D476 Reviewed by: jhb Modified: head/sys/net/if_stf.c head/sys/net/if_stf.h head/sys/netinet/igmp.c head/sys/netinet/igmp_var.h head/sys/netinet/in_gif.c head/sys/netinet/in_gif.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_carp.h head/sys/netinet/ip_divert.c head/sys/netinet/ip_encap.c head/sys/netinet/ip_encap.h head/sys/netinet/ip_gre.c head/sys/netinet/ip_gre.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_var.h head/sys/netinet/pim_var.h head/sys/netinet/raw_ip.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_var.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_var.h head/sys/netinet6/ip6protosw.h head/sys/netinet6/raw_ip6.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/xform.h head/sys/netipsec/xform_ipip.c head/sys/netpfil/pf/if_pfsync.c head/sys/sys/protosw.h Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/net/if_stf.c Fri Aug 8 01:57:15 2014 (r269699) @@ -678,23 +678,23 @@ stf_checkaddr6(sc, in6, inifp) return 0; } -void -in_stf_input(m, off) - struct mbuf *m; - int off; +int +in_stf_input(struct mbuf **mp, int *offp, int proto) { - int proto; struct stf_softc *sc; struct ip *ip; struct ip6_hdr *ip6; + struct mbuf *m; u_int8_t otos, itos; struct ifnet *ifp; + int off; - proto = mtod(m, struct ip *)->ip_p; + m = *mp; + off = *offp; if (proto != IPPROTO_IPV6) { m_freem(m); - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); @@ -703,7 +703,7 @@ in_stf_input(m, off) if (sc == NULL || (STF2IFP(sc)->if_flags & IFF_UP) == 0) { m_freem(m); - return; + return (IPPROTO_DONE); } ifp = STF2IFP(sc); @@ -719,7 +719,7 @@ in_stf_input(m, off) if (stf_checkaddr4(sc, &ip->ip_dst, NULL) < 0 || stf_checkaddr4(sc, &ip->ip_src, m->m_pkthdr.rcvif) < 0) { m_freem(m); - return; + return (IPPROTO_DONE); } otos = ip->ip_tos; @@ -728,7 +728,7 @@ in_stf_input(m, off) if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) - return; + return (IPPROTO_DONE); } ip6 = mtod(m, struct ip6_hdr *); @@ -739,7 +739,7 @@ in_stf_input(m, off) if (stf_checkaddr6(sc, &ip6->ip6_dst, NULL) < 0 || stf_checkaddr6(sc, &ip6->ip6_src, m->m_pkthdr.rcvif) < 0) { m_freem(m); - return; + return (IPPROTO_DONE); } itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; @@ -774,6 +774,7 @@ in_stf_input(m, off) ifp->if_ibytes += m->m_pkthdr.len; M_SETFIB(m, ifp->if_fib); netisr_dispatch(NETISR_IPV6, m); + return (IPPROTO_DONE); } /* ARGSUSED */ Modified: head/sys/net/if_stf.h ============================================================================== --- head/sys/net/if_stf.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/net/if_stf.h Fri Aug 8 01:57:15 2014 (r269699) @@ -33,6 +33,6 @@ #ifndef _NET_IF_STF_H_ #define _NET_IF_STF_H_ -void in_stf_input(struct mbuf *, int); +int in_stf_input(struct mbuf **, int *, int); #endif /* _NET_IF_STF_H_ */ Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/igmp.c Fri Aug 8 01:57:15 2014 (r269699) @@ -1424,26 +1424,29 @@ out_locked: return (0); } -void -igmp_input(struct mbuf *m, int off) +int +igmp_input(struct mbuf **mp, int *offp, int proto) { int iphlen; struct ifnet *ifp; struct igmp *igmp; struct ip *ip; + struct mbuf *m; int igmplen; int minlen; int queryver; CTR3(KTR_IGMPV3, "%s: called w/mbuf (%p,%d)", __func__, m, off); + m = *mp; ifp = m->m_pkthdr.rcvif; + *mp = NULL; IGMPSTAT_INC(igps_rcv_total); ip = mtod(m, struct ip *); - iphlen = off; - igmplen = ntohs(ip->ip_len) - off; + iphlen = *offp; + igmplen = ntohs(ip->ip_len) - iphlen; /* * Validate lengths. @@ -1451,7 +1454,7 @@ igmp_input(struct mbuf *m, int off) if (igmplen < IGMP_MINLEN) { IGMPSTAT_INC(igps_rcv_tooshort); m_freem(m); - return; + return (IPPROTO_DONE); } /* @@ -1466,7 +1469,7 @@ igmp_input(struct mbuf *m, int off) if ((m->m_flags & M_EXT || m->m_len < minlen) && (m = m_pullup(m, minlen)) == 0) { IGMPSTAT_INC(igps_rcv_tooshort); - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); @@ -1479,7 +1482,7 @@ igmp_input(struct mbuf *m, int off) if (in_cksum(m, igmplen)) { IGMPSTAT_INC(igps_rcv_badsum); m_freem(m); - return; + return (IPPROTO_DONE); } m->m_data -= iphlen; m->m_len += iphlen; @@ -1492,7 +1495,7 @@ igmp_input(struct mbuf *m, int off) if (igmp->igmp_type != IGMP_DVMRP && ip->ip_ttl != 1) { IGMPSTAT_INC(igps_rcv_badttl); m_freem(m); - return; + return (IPPROTO_DONE); } switch (igmp->igmp_type) { @@ -1507,7 +1510,7 @@ igmp_input(struct mbuf *m, int off) } else { IGMPSTAT_INC(igps_rcv_tooshort); m_freem(m); - return; + return (IPPROTO_DONE); } switch (queryver) { @@ -1517,7 +1520,7 @@ igmp_input(struct mbuf *m, int off) break; if (igmp_input_v1_query(ifp, ip, igmp) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } break; @@ -1527,7 +1530,7 @@ igmp_input(struct mbuf *m, int off) break; if (igmp_input_v2_query(ifp, ip, igmp) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } break; @@ -1546,7 +1549,7 @@ igmp_input(struct mbuf *m, int off) srclen = sizeof(struct in_addr) * nsrc; if (nsrc * sizeof(in_addr_t) > srclen) { IGMPSTAT_INC(igps_rcv_tooshort); - return; + return (IPPROTO_DONE); } /* * m_pullup() may modify m, so pullup in @@ -1558,13 +1561,13 @@ igmp_input(struct mbuf *m, int off) m->m_len < igmpv3len) && (m = m_pullup(m, igmpv3len)) == NULL) { IGMPSTAT_INC(igps_rcv_tooshort); - return; + return (IPPROTO_DONE); } igmpv3 = (struct igmpv3 *)(mtod(m, uint8_t *) + iphlen); if (igmp_input_v3_query(ifp, ip, igmpv3) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } } break; @@ -1576,7 +1579,7 @@ igmp_input(struct mbuf *m, int off) break; if (igmp_input_v1_report(ifp, ip, igmp) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } break; @@ -1587,7 +1590,7 @@ igmp_input(struct mbuf *m, int off) IGMPSTAT_INC(igps_rcv_nora); if (igmp_input_v2_report(ifp, ip, igmp) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } break; @@ -1608,7 +1611,8 @@ igmp_input(struct mbuf *m, int off) * Pass all valid IGMP packets up to any process(es) listening on a * raw IGMP socket. */ - rip_input(m, off); + *mp = m; + return (rip_input(mp, offp, proto)); } Modified: head/sys/netinet/igmp_var.h ============================================================================== --- head/sys/netinet/igmp_var.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/igmp_var.h Fri Aug 8 01:57:15 2014 (r269699) @@ -205,7 +205,7 @@ struct igmp_ifinfo * igmp_domifattach(struct ifnet *); void igmp_domifdetach(struct ifnet *); void igmp_ifdetach(struct ifnet *); -void igmp_input(struct mbuf *, int); +int igmp_input(struct mbuf **, int *, int); void igmp_slowtimo(void); SYSCTL_DECL(_net_inet_igmp); Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/in_gif.c Fri Aug 8 01:57:15 2014 (r269699) @@ -81,7 +81,7 @@ struct protosw in_gif_protosw = { .pr_protocol = 0/* IPPROTO_IPV[46] */, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = in_gif_input, - .pr_output = (pr_output_t*)rip_output, + .pr_output = (pr_output_t *)rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; @@ -270,31 +270,34 @@ in_gif_output(struct ifnet *ifp, int fam return (error); } -void -in_gif_input(struct mbuf *m, int off) +int +in_gif_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m; struct ifnet *gifp = NULL; struct gif_softc *sc; struct ip *ip; int af; + int off; u_int8_t otos; - int proto; + m = *mp; ip = mtod(m, struct ip *); - proto = ip->ip_p; + off = *offp; + *mp = NULL; sc = (struct gif_softc *)encap_getarg(m); if (sc == NULL) { m_freem(m); KMOD_IPSTAT_INC(ips_nogif); - return; + return (IPPROTO_DONE); } gifp = GIF2IFP(sc); if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) { m_freem(m); KMOD_IPSTAT_INC(ips_nogif); - return; + return (IPPROTO_DONE); } otos = ip->ip_tos; @@ -309,14 +312,14 @@ in_gif_input(struct mbuf *m, int off) if (m->m_len < sizeof(*ip)) { m = m_pullup(m, sizeof(*ip)); if (!m) - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); if (ip_ecn_egress((gifp->if_flags & IFF_LINK1) ? ECN_ALLOWED : ECN_NOCARE, &otos, &ip->ip_tos) == 0) { m_freem(m); - return; + return (IPPROTO_DONE); } break; } @@ -331,7 +334,7 @@ in_gif_input(struct mbuf *m, int off) if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) - return; + return (IPPROTO_DONE); } ip6 = mtod(m, struct ip6_hdr *); itos = oitos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; @@ -339,7 +342,7 @@ in_gif_input(struct mbuf *m, int off) ECN_ALLOWED : ECN_NOCARE, &otos, &itos) == 0) { m_freem(m); - return; + return (IPPROTO_DONE); } if (itos != oitos) { ip6->ip6_flow &= ~htonl(0xff << 20); @@ -355,10 +358,10 @@ in_gif_input(struct mbuf *m, int off) default: KMOD_IPSTAT_INC(ips_nogif); m_freem(m); - return; + return (IPPROTO_DONE); } gif_input(m, af, gifp); - return; + return (IPPROTO_DONE); } /* Modified: head/sys/netinet/in_gif.h ============================================================================== --- head/sys/netinet/in_gif.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/in_gif.h Fri Aug 8 01:57:15 2014 (r269699) @@ -36,7 +36,7 @@ #define GIF_TTL 30 struct gif_softc; -void in_gif_input(struct mbuf *, int); +int in_gif_input(struct mbuf **, int *, int); int in_gif_output(struct ifnet *, int, struct mbuf *); int gif_encapcheck4(const struct mbuf *, int, int, void *); int in_gif_attach(struct gif_softc *); Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_carp.c Fri Aug 8 01:57:15 2014 (r269699) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include -#include #include #include #include @@ -435,18 +434,22 @@ carp_hmac_verify(struct carp_softc *sc, * but it seems more efficient this way or not possible otherwise. */ #ifdef INET -void -carp_input(struct mbuf *m, int hlen) +int +carp_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m = *mp; struct ip *ip = mtod(m, struct ip *); struct carp_header *ch; int iplen, len; + iplen = *offp; + *mp = NULL; + CARPSTATS_INC(carps_ipackets); if (!V_carp_allow) { m_freem(m); - return; + return (IPPROTO_DONE); } /* verify that the IP TTL is 255. */ @@ -456,7 +459,7 @@ carp_input(struct mbuf *m, int hlen) ip->ip_ttl, m->m_pkthdr.rcvif->if_xname); m_freem(m); - return; + return (IPPROTO_DONE); } iplen = ip->ip_hl << 2; @@ -467,14 +470,14 @@ carp_input(struct mbuf *m, int hlen) "on %s\n", __func__, m->m_len - sizeof(struct ip), m->m_pkthdr.rcvif->if_xname); m_freem(m); - return; + return (IPPROTO_DONE); } if (iplen + sizeof(*ch) < m->m_len) { if ((m = m_pullup(m, iplen + sizeof(*ch))) == NULL) { CARPSTATS_INC(carps_hdrops); CARP_DEBUG("%s: pullup failed\n", __func__); - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); } @@ -491,12 +494,12 @@ carp_input(struct mbuf *m, int hlen) m->m_pkthdr.len, m->m_pkthdr.rcvif->if_xname); m_freem(m); - return; + return (IPPROTO_DONE); } if ((m = m_pullup(m, len)) == NULL) { CARPSTATS_INC(carps_hdrops); - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); ch = (struct carp_header *)((char *)ip + iplen); @@ -508,11 +511,12 @@ carp_input(struct mbuf *m, int hlen) CARP_DEBUG("%s: checksum failed on %s\n", __func__, m->m_pkthdr.rcvif->if_xname); m_freem(m); - return; + return (IPPROTO_DONE); } m->m_data -= iplen; carp_input_c(m, ch, AF_INET); + return (IPPROTO_DONE); } #endif @@ -2058,13 +2062,13 @@ static struct protosw in_carp_protosw = #ifdef INET6 extern struct domain inet6domain; -static struct ip6protosw in6_carp_protosw = { +static struct protosw in6_carp_protosw = { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_input, - .pr_output = rip6_output, + .pr_output = (pr_output_t *)rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs }; Modified: head/sys/netinet/ip_carp.h ============================================================================== --- head/sys/netinet/ip_carp.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_carp.h Fri Aug 8 01:57:15 2014 (r269699) @@ -140,7 +140,7 @@ int carp_ioctl(struct ifreq *, u_long, int carp_attach(struct ifaddr *, int); void carp_detach(struct ifaddr *); void carp_carpdev_state(struct ifnet *); -void carp_input (struct mbuf *, int); +int carp_input(struct mbuf **, int *, int); int carp6_input (struct mbuf **, int *, int); int carp_output (struct ifnet *, struct mbuf *, const struct sockaddr *); Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_divert.c Fri Aug 8 01:57:15 2014 (r269699) @@ -173,12 +173,14 @@ div_destroy(void) * IPPROTO_DIVERT is not in the real IP protocol number space; this * function should never be called. Just in case, drop any packets. */ -static void -div_input(struct mbuf *m, int off) +static int +div_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m = *mp; KMOD_IPSTAT_INC(ips_noproto); m_freem(m); + return (IPPROTO_DONE); } /* Modified: head/sys/netinet/ip_encap.c ============================================================================== --- head/sys/netinet/ip_encap.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_encap.c Fri Aug 8 01:57:15 2014 (r269699) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include -#include #endif #include @@ -115,18 +114,20 @@ encap_init(void) } #ifdef INET -void -encap4_input(struct mbuf *m, int off) +int +encap4_input(struct mbuf **mp, int *offp, int proto) { struct ip *ip; - int proto; + struct mbuf *m; struct sockaddr_in s, d; const struct protosw *psw; struct encaptab *ep, *match; - int prio, matchprio; + int matchprio, off, prio; + m = *mp; + off = *offp; ip = mtod(m, struct ip *); - proto = ip->ip_p; + *mp = NULL; bzero(&s, sizeof(s)); s.sin_family = AF_INET; @@ -188,14 +189,16 @@ encap4_input(struct mbuf *m, int off) psw = match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); - (*psw->pr_input)(m, off); + *mp = m; + (*psw->pr_input)(mp, offp, proto); } else m_freem(m); - return; + return (IPPROTO_DONE); } /* last resort: inject to raw socket */ - rip_input(m, off); + *mp = m; + return (rip_input(mp, offp, proto)); } #endif @@ -206,7 +209,7 @@ encap6_input(struct mbuf **mp, int *offp struct mbuf *m = *mp; struct ip6_hdr *ip6; struct sockaddr_in6 s, d; - const struct ip6protosw *psw; + const struct protosw *psw; struct encaptab *ep, *match; int prio, matchprio; @@ -252,7 +255,7 @@ encap6_input(struct mbuf **mp, int *offp if (match) { /* found a match */ - psw = (const struct ip6protosw *)match->psw; + psw = match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); return (*psw->pr_input)(mp, offp, proto); Modified: head/sys/netinet/ip_encap.h ============================================================================== --- head/sys/netinet/ip_encap.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_encap.h Fri Aug 8 01:57:15 2014 (r269699) @@ -49,7 +49,7 @@ struct encaptab { }; void encap_init(void); -void encap4_input(struct mbuf *, int); +int encap4_input(struct mbuf **, int *, int); int encap6_input(struct mbuf **, int *, int); const struct encaptab *encap_attach(int, int, const struct sockaddr *, const struct sockaddr *, const struct sockaddr *, Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_gre.c Fri Aug 8 01:57:15 2014 (r269699) @@ -92,12 +92,15 @@ static struct mbuf *gre_input2(struct mb * IPPROTO_GRE and a local destination address). * This really is simple */ -void -gre_input(struct mbuf *m, int off) +int +gre_input(struct mbuf **mp, int *offp, int proto) { - int proto; + struct mbuf *m; + int off; - proto = (mtod(m, struct ip *))->ip_p; + m = *mp; + off = *offp; + *mp = NULL; m = gre_input2(m, off, proto); @@ -105,8 +108,11 @@ gre_input(struct mbuf *m, int off) * If no matching tunnel that is up is found. We inject * the mbuf to raw ip socket to see if anyone picks it up. */ - if (m != NULL) - rip_input(m, off); + if (m != NULL) { + *mp = m; + rip_input(mp, offp, proto); + } + return (IPPROTO_DONE); } /* @@ -213,24 +219,26 @@ gre_input2(struct mbuf *m ,int hlen, u_c * between IP header and payload */ -void -gre_mobile_input(struct mbuf *m, int hlen) +int +gre_mobile_input(struct mbuf **mp, int *offp, int proto) { struct ip *ip; struct mobip_h *mip; + struct mbuf *m; struct gre_softc *sc; int msiz; + m = *mp; if ((sc = gre_lookup(m, IPPROTO_MOBILE)) == NULL) { /* No matching tunnel or tunnel is down. */ m_freem(m); - return; + return (IPPROTO_DONE); } if (m->m_len < sizeof(*mip)) { m = m_pullup(m, sizeof(*mip)); if (m == NULL) - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); mip = mtod(m, struct mobip_h *); @@ -247,7 +255,7 @@ gre_mobile_input(struct mbuf *m, int hle if (m->m_len < (ip->ip_hl << 2) + msiz) { m = m_pullup(m, (ip->ip_hl << 2) + msiz); if (m == NULL) - return; + return (IPPROTO_DONE); ip = mtod(m, struct ip *); mip = mtod(m, struct mobip_h *); } @@ -257,7 +265,7 @@ gre_mobile_input(struct mbuf *m, int hle if (gre_in_cksum((u_int16_t *)&mip->mh, msiz) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } bcopy((caddr_t)(ip) + (ip->ip_hl << 2) + msiz, (caddr_t)(ip) + @@ -282,12 +290,13 @@ gre_mobile_input(struct mbuf *m, int hle if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) { m_freem(m); - return; + return (IPPROTO_DONE); } m->m_pkthdr.rcvif = GRE2IFP(sc); netisr_queue(NETISR_IP, m); + return (IPPROTO_DONE); } /* Modified: head/sys/netinet/ip_gre.h ============================================================================== --- head/sys/netinet/ip_gre.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_gre.h Fri Aug 8 01:57:15 2014 (r269699) @@ -31,6 +31,6 @@ */ #ifdef _KERNEL -void gre_input(struct mbuf *, int); -void gre_mobile_input(struct mbuf *, int); +int gre_input(struct mbuf **, int *, int); +int gre_mobile_input(struct mbuf **, int *, int); #endif /* _KERNEL */ Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_icmp.c Fri Aug 8 01:57:15 2014 (r269699) @@ -358,19 +358,22 @@ freeit: /* * Process a received ICMP message. */ -void -icmp_input(struct mbuf *m, int off) +int +icmp_input(struct mbuf **mp, int *offp, int proto) { struct icmp *icp; struct in_ifaddr *ia; + struct mbuf *m = *mp; struct ip *ip = mtod(m, struct ip *); struct sockaddr_in icmpsrc, icmpdst, icmpgw; - int hlen = off; - int icmplen = ntohs(ip->ip_len) - off; + int hlen = *offp; + int icmplen = ntohs(ip->ip_len) - *offp; int i, code; void (*ctlfunc)(int, struct sockaddr *, void *); int fibnum; + *mp = NULL; + /* * Locate icmp structure in mbuf, and check * that not corrupted and of at least minimum length. @@ -390,7 +393,7 @@ icmp_input(struct mbuf *m, int off) i = hlen + min(icmplen, ICMP_ADVLENMIN); if (m->m_len < i && (m = m_pullup(m, i)) == NULL) { ICMPSTAT_INC(icps_tooshort); - return; + return (IPPROTO_DONE); } ip = mtod(m, struct ip *); m->m_len -= hlen; @@ -602,7 +605,7 @@ reflect: ICMPSTAT_INC(icps_reflect); ICMPSTAT_INC(icps_outhist[icp->icmp_type]); icmp_reflect(m); - return; + return (IPPROTO_DONE); case ICMP_REDIRECT: if (V_log_redirect) { @@ -679,11 +682,13 @@ reflect: } raw: - rip_input(m, off); - return; + *mp = m; + rip_input(mp, offp, proto); + return (IPPROTO_DONE); freeit: m_freem(m); + return (IPPROTO_DONE); } /* Modified: head/sys/netinet/ip_icmp.h ============================================================================== --- head/sys/netinet/ip_icmp.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_icmp.h Fri Aug 8 01:57:15 2014 (r269699) @@ -207,7 +207,7 @@ struct icmp { #ifdef _KERNEL void icmp_error(struct mbuf *, int, int, uint32_t, int); -void icmp_input(struct mbuf *, int); +int icmp_input(struct mbuf **, int *, int); int ip_next_mtu(int, int); #endif Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_input.c Fri Aug 8 01:57:15 2014 (r269699) @@ -726,7 +726,7 @@ ours: */ IPSTAT_INC(ips_delivered); - (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen); + (*inetsw[ip_protox[ip->ip_p]].pr_input)(&m, &hlen, ip->ip_p); return; bad: m_freem(m); @@ -1715,13 +1715,18 @@ ip_rsvp_done(void) return 0; } -void -rsvp_input(struct mbuf *m, int off) /* XXX must fixup manually */ +int +rsvp_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m; + + m = *mp; + *mp = NULL; if (rsvp_input_p) { /* call the real one if loaded */ - rsvp_input_p(m, off); - return; + *mp = m; + rsvp_input_p(mp, offp, proto); + return (IPPROTO_DONE); } /* Can still get packets with rsvp_on = 0 if there is a local member @@ -1731,13 +1736,15 @@ rsvp_input(struct mbuf *m, int off) /* X if (!V_rsvp_on) { m_freem(m); - return; + return (IPPROTO_DONE); } if (V_ip_rsvpd != NULL) { - rip_input(m, off); - return; + *mp = m; + rip_input(mp, offp, proto); + return (IPPROTO_DONE); } /* Drop the packet */ m_freem(m); + return (IPPROTO_DONE); } Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_mroute.c Fri Aug 8 01:57:15 2014 (r269699) @@ -247,7 +247,7 @@ static const struct protosw in_pim_proto .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim_input, - .pr_output = (pr_output_t*)rip_output, + .pr_output = (pr_output_t *)rip_output, .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }; @@ -1718,12 +1718,16 @@ X_ip_rsvp_force_done(struct socket *so _ } -static void -X_rsvp_input(struct mbuf *m, int off __unused) +static int +X_rsvp_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m; + m = *mp; + *mp = NULL; if (!V_rsvp_on) m_freem(m); + return (IPPROTO_DONE); } /* @@ -2556,15 +2560,19 @@ pim_encapcheck(const struct mbuf *m, int * (used by PIM-SM): the PIM header is stripped off, and the inner packet * is passed to if_simloop(). */ -void -pim_input(struct mbuf *m, int iphlen) +int +pim_input(struct mbuf **mp, int *offp, int proto) { + struct mbuf *m = *mp; struct ip *ip = mtod(m, struct ip *); struct pim *pim; + int iphlen = *offp; int minlen; int datalen = ntohs(ip->ip_len) - iphlen; int ip_tos; + *mp = NULL; + /* Keep statistics */ PIMSTAT_INC(pims_rcv_total_msgs); PIMSTAT_ADD(pims_rcv_total_bytes, datalen); @@ -2577,7 +2585,7 @@ pim_input(struct mbuf *m, int iphlen) CTR3(KTR_IPMF, "%s: short packet (%d) from %s", __func__, datalen, inet_ntoa(ip->ip_src)); m_freem(m); - return; + return (IPPROTO_DONE); } /* @@ -2595,7 +2603,7 @@ pim_input(struct mbuf *m, int iphlen) */ if (m->m_len < minlen && (m = m_pullup(m, minlen)) == 0) { CTR1(KTR_IPMF, "%s: m_pullup() failed", __func__); - return; + return (IPPROTO_DONE); } /* m_pullup() may have given us a new mbuf so reset ip. */ @@ -2620,7 +2628,7 @@ pim_input(struct mbuf *m, int iphlen) PIMSTAT_INC(pims_rcv_badsum); CTR1(KTR_IPMF, "%s: invalid checksum", __func__); m_freem(m); - return; + return (IPPROTO_DONE); } /* PIM version check */ @@ -2629,7 +2637,7 @@ pim_input(struct mbuf *m, int iphlen) CTR3(KTR_IPMF, "%s: bad version %d expect %d", __func__, (int)PIM_VT_V(pim->pim_vt), PIM_VERSION); m_freem(m); - return; + return (IPPROTO_DONE); } /* restore mbuf back to the outer IP */ @@ -2654,7 +2662,7 @@ pim_input(struct mbuf *m, int iphlen) CTR2(KTR_IPMF, "%s: register vif not set: %d", __func__, (int)V_reg_vif_num); m_freem(m); - return; + return (IPPROTO_DONE); } /* XXX need refcnt? */ vifp = V_viftable[V_reg_vif_num].v_ifp; @@ -2668,7 +2676,7 @@ pim_input(struct mbuf *m, int iphlen) PIMSTAT_INC(pims_rcv_badregisters); CTR1(KTR_IPMF, "%s: register packet size too small", __func__); m_freem(m); - return; + return (IPPROTO_DONE); } reghdr = (u_int32_t *)(pim + 1); @@ -2682,7 +2690,7 @@ pim_input(struct mbuf *m, int iphlen) PIMSTAT_INC(pims_rcv_badregisters); CTR1(KTR_IPMF, "%s: bad encap ip version", __func__); m_freem(m); - return; + return (IPPROTO_DONE); } /* verify the inner packet is destined to a mcast group */ @@ -2691,7 +2699,7 @@ pim_input(struct mbuf *m, int iphlen) CTR2(KTR_IPMF, "%s: bad encap ip dest %s", __func__, inet_ntoa(encap_ip->ip_dst)); m_freem(m); - return; + return (IPPROTO_DONE); } /* If a NULL_REGISTER, pass it to the daemon */ @@ -2730,7 +2738,7 @@ pim_input(struct mbuf *m, int iphlen) if (mcp == NULL) { CTR1(KTR_IPMF, "%s: m_copy() failed", __func__); m_freem(m); - return; + return (IPPROTO_DONE); } /* Keep statistics */ @@ -2766,9 +2774,10 @@ pim_input_to_daemon: * XXX: the outer IP header pkt size of a Register is not adjust to * reflect the fact that the inner multicast data is truncated. */ - rip_input(m, iphlen); + *mp = m; + rip_input(mp, offp, proto); - return; + return (IPPROTO_DONE); } static int Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/ip_var.h Fri Aug 8 01:57:15 2014 (r269699) @@ -234,15 +234,15 @@ void rip_init(void); #ifdef VIMAGE void rip_destroy(void); #endif -void rip_input(struct mbuf *, int); +int rip_input(struct mbuf **, int *, int); int rip_output(struct mbuf *, struct socket *, u_long); -void ipip_input(struct mbuf *, int); -void rsvp_input(struct mbuf *, int); +int ipip_input(struct mbuf **, int *, int); +int rsvp_input(struct mbuf **, int *, int); int ip_rsvp_init(struct socket *); int ip_rsvp_done(void); extern int (*ip_rsvp_vif)(struct socket *, struct sockopt *); extern void (*ip_rsvp_force_done)(struct socket *); -extern void (*rsvp_input_p)(struct mbuf *m, int off); +extern int (*rsvp_input_p)(struct mbuf **, int *, int); VNET_DECLARE(struct pfil_head, inet_pfil_hook); /* packet filter hooks */ #define V_inet_pfil_hook VNET(inet_pfil_hook) Modified: head/sys/netinet/pim_var.h ============================================================================== --- head/sys/netinet/pim_var.h Fri Aug 8 01:23:43 2014 (r269698) +++ head/sys/netinet/pim_var.h Fri Aug 8 01:57:15 2014 (r269699) @@ -72,7 +72,7 @@ struct pimstat { #ifdef _KERNEL -void pim_input(struct mbuf *, int); +int pim_input(struct mbuf **, int *, int); SYSCTL_DECL(_net_inet_pim); #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 03:49:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46953B33 for ; Fri, 8 Aug 2014 03:49:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3547F2249 for ; Fri, 8 Aug 2014 03:49:03 +0000 (UTC) Received: from neel (uid 1208) (envelope-from neel@FreeBSD.org) id 2b64 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 03:49:02 +0000 From: Neel Natu Date: Fri, 8 Aug 2014 03:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269700 - in head: sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e448ae.2b64.363ea56f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 03:49:03 -0000 Author: neel Date: Fri Aug 8 03:49:01 2014 New Revision: 269700 URL: http://svnweb.freebsd.org/changeset/base/269700 Log: Support PCI extended config space in bhyve. Add the ACPI MCFG table to advertise the extended config memory window. Introduce a new flag MEM_F_IMMUTABLE for memory ranges that cannot be deleted or moved in the guest's address space. The PCI extended config space is an example of an immutable memory range. Add emulation for the "movzw" instruction. This instruction is used by FreeBSD to read a 16-bit extended config space register. CR: https://phabric.freebsd.org/D505 Reviewed by: jhb, grehan Requested by: tychon Modified: head/sys/amd64/vmm/vmm_instruction_emul.c head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/mem.c head/usr.sbin/bhyve/mem.h head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri Aug 8 01:57:15 2014 (r269699) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri Aug 8 03:49:01 2014 (r269700) @@ -82,6 +82,10 @@ static const struct vie_op two_byte_opco .op_byte = 0xB6, .op_type = VIE_OP_TYPE_MOVZX, }, + [0xB7] = { + .op_byte = 0xB7, + .op_type = VIE_OP_TYPE_MOVZX, + }, [0xBE] = { .op_byte = 0xBE, .op_type = VIE_OP_TYPE_MOVSX, @@ -505,6 +509,25 @@ emulate_movx(void *vm, int vcpuid, uint6 /* write the result */ error = vie_update_register(vm, vcpuid, reg, val, size); break; + case 0xB7: + /* + * MOV and zero extend word from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F B7/r movzx r32, r/m16 + * REX.W + 0F B7/r movzx r64, r/m16 + */ + error = memread(vm, vcpuid, gpa, &val, 2, arg); + if (error) + return (error); + + reg = gpr_map[vie->reg]; + + /* zero-extend word */ + val = (uint16_t)val; + + error = vie_update_register(vm, vcpuid, reg, val, size); + break; case 0xBE: /* * MOV and sign extend byte from mem (ModRM:r/m) to Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Fri Aug 8 01:57:15 2014 (r269699) +++ head/usr.sbin/bhyve/acpi.c Fri Aug 8 03:49:01 2014 (r269700) @@ -40,12 +40,13 @@ * Layout * ------ * RSDP -> 0xf2400 (36 bytes fixed) - * RSDT -> 0xf2440 (36 bytes + 4*N table addrs, 2 used) - * XSDT -> 0xf2480 (36 bytes + 8*N table addrs, 2 used) + * RSDT -> 0xf2440 (36 bytes + 4*7 table addrs, 4 used) + * XSDT -> 0xf2480 (36 bytes + 8*7 table addrs, 4 used) * MADT -> 0xf2500 (depends on #CPUs) * FADT -> 0xf2600 (268 bytes) * HPET -> 0xf2740 (56 bytes) - * FACS -> 0xf2780 (64 bytes) + * MCFG -> 0xf2780 (60 bytes) + * FACS -> 0xf27C0 (64 bytes) * DSDT -> 0xf2800 (variable - can go up to 0x100000) */ @@ -80,7 +81,8 @@ __FBSDID("$FreeBSD$"); #define MADT_OFFSET 0x100 #define FADT_OFFSET 0x200 #define HPET_OFFSET 0x340 -#define FACS_OFFSET 0x380 +#define MCFG_OFFSET 0x380 +#define FACS_OFFSET 0x3C0 #define DSDT_OFFSET 0x400 #define BHYVE_ASL_TEMPLATE "bhyve.XXXXXXX" @@ -178,6 +180,8 @@ basl_fwrite_rsdt(FILE *fp) basl_acpi_base + FADT_OFFSET); EFPRINTF(fp, "[0004]\t\tACPI Table Address 2 : %08X\n", basl_acpi_base + HPET_OFFSET); + EFPRINTF(fp, "[0004]\t\tACPI Table Address 3 : %08X\n", + basl_acpi_base + MCFG_OFFSET); EFFLUSH(fp); @@ -216,6 +220,8 @@ basl_fwrite_xsdt(FILE *fp) basl_acpi_base + FADT_OFFSET); EFPRINTF(fp, "[0004]\t\tACPI Table Address 2 : 00000000%08X\n", basl_acpi_base + HPET_OFFSET); + EFPRINTF(fp, "[0004]\t\tACPI Table Address 3 : 00000000%08X\n", + basl_acpi_base + MCFG_OFFSET); EFFLUSH(fp); @@ -583,6 +589,39 @@ err_exit: } static int +basl_fwrite_mcfg(FILE *fp) +{ + int err = 0; + + EFPRINTF(fp, "/*\n"); + EFPRINTF(fp, " * bhyve MCFG template\n"); + EFPRINTF(fp, " */\n"); + EFPRINTF(fp, "[0004]\t\tSignature : \"MCFG\"\n"); + EFPRINTF(fp, "[0004]\t\tTable Length : 00000000\n"); + EFPRINTF(fp, "[0001]\t\tRevision : 01\n"); + EFPRINTF(fp, "[0001]\t\tChecksum : 00\n"); + EFPRINTF(fp, "[0006]\t\tOem ID : \"BHYVE \"\n"); + EFPRINTF(fp, "[0008]\t\tOem Table ID : \"BVMCFG \"\n"); + EFPRINTF(fp, "[0004]\t\tOem Revision : 00000001\n"); + + /* iasl will fill in the compiler ID/revision fields */ + EFPRINTF(fp, "[0004]\t\tAsl Compiler ID : \"xxxx\"\n"); + EFPRINTF(fp, "[0004]\t\tAsl Compiler Revision : 00000000\n"); + EFPRINTF(fp, "[0008]\t\tReserved : 0\n"); + EFPRINTF(fp, "\n"); + + EFPRINTF(fp, "[0008]\t\tBase Address : %016lX\n", pci_ecfg_base()); + EFPRINTF(fp, "[0002]\t\tSegment Group: 0000\n"); + EFPRINTF(fp, "[0001]\t\tStart Bus: 00\n"); + EFPRINTF(fp, "[0001]\t\tEnd Bus: FF\n"); + EFPRINTF(fp, "[0004]\t\tReserved : 0\n"); + EFFLUSH(fp); + return (0); +err_exit: + return (errno); +} + +static int basl_fwrite_facs(FILE *fp) { int err; @@ -921,6 +960,7 @@ static struct { { basl_fwrite_madt, MADT_OFFSET }, { basl_fwrite_fadt, FADT_OFFSET }, { basl_fwrite_hpet, HPET_OFFSET }, + { basl_fwrite_mcfg, MCFG_OFFSET }, { basl_fwrite_facs, FACS_OFFSET }, { basl_fwrite_dsdt, DSDT_OFFSET }, { NULL } Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Fri Aug 8 01:57:15 2014 (r269699) +++ head/usr.sbin/bhyve/mem.c Fri Aug 8 03:49:01 2014 (r269700) @@ -162,7 +162,7 @@ emulate_mem(struct vmctx *ctx, int vcpu, { struct mmio_rb_range *entry; - int err; + int err, immutable; pthread_rwlock_rdlock(&mmio_rwlock); /* @@ -186,9 +186,27 @@ emulate_mem(struct vmctx *ctx, int vcpu, } assert(entry != NULL); + + /* + * An 'immutable' memory range is guaranteed to be never removed + * so there is no need to hold 'mmio_rwlock' while calling the + * handler. + * + * XXX writes to the PCIR_COMMAND register can cause register_mem() + * to be called. If the guest is using PCI extended config space + * to modify the PCIR_COMMAND register then register_mem() can + * deadlock on 'mmio_rwlock'. However by registering the extended + * config space window as 'immutable' the deadlock can be avoided. + */ + immutable = (entry->mr_param.flags & MEM_F_IMMUTABLE); + if (immutable) + pthread_rwlock_unlock(&mmio_rwlock); + err = vmm_emulate_instruction(ctx, vcpu, paddr, vie, paging, mem_read, mem_write, &entry->mr_param); - pthread_rwlock_unlock(&mmio_rwlock); + + if (!immutable) + pthread_rwlock_unlock(&mmio_rwlock); return (err); } @@ -246,6 +264,7 @@ unregister_mem(struct mem_range *memp) mr = &entry->mr_param; assert(mr->name == memp->name); assert(mr->base == memp->base && mr->size == memp->size); + assert((mr->flags & MEM_F_IMMUTABLE) == 0); RB_REMOVE(mmio_rb_tree, &mmio_rb_root, entry); /* flush Per-vCPU cache */ Modified: head/usr.sbin/bhyve/mem.h ============================================================================== --- head/usr.sbin/bhyve/mem.h Fri Aug 8 01:57:15 2014 (r269699) +++ head/usr.sbin/bhyve/mem.h Fri Aug 8 03:49:01 2014 (r269700) @@ -48,6 +48,7 @@ struct mem_range { #define MEM_F_READ 0x1 #define MEM_F_WRITE 0x2 #define MEM_F_RW 0x3 +#define MEM_F_IMMUTABLE 0x4 /* mem_range cannot be unregistered */ void init_mem(void); int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie, Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Aug 8 01:57:15 2014 (r269699) +++ head/usr.sbin/bhyve/pci_emul.c Fri Aug 8 03:49:01 2014 (r269700) @@ -109,16 +109,20 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_IOBASE 0x2000 #define PCI_EMUL_IOLIMIT 0x10000 -#define PCI_EMUL_MEMLIMIT32 0xE0000000 /* 3.5GB */ +#define PCI_EMUL_ECFG_BASE 0xE0000000 /* 3.5GB */ +#define PCI_EMUL_ECFG_SIZE (MAXBUSES * 1024 * 1024) /* 1MB per bus */ +SYSRES_MEM(PCI_EMUL_ECFG_BASE, PCI_EMUL_ECFG_SIZE); + +#define PCI_EMUL_MEMLIMIT32 PCI_EMUL_ECFG_BASE #define PCI_EMUL_MEMBASE64 0xD000000000UL #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL static struct pci_devemu *pci_emul_finddev(char *name); -static void pci_lintr_route(struct pci_devinst *pi); -static void pci_lintr_update(struct pci_devinst *pi); - -static struct mem_range pci_mem_hole; +static void pci_lintr_route(struct pci_devinst *pi); +static void pci_lintr_update(struct pci_devinst *pi); +static void pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, + int func, int coff, int bytes, uint32_t *val); /* * I/O access @@ -1023,12 +1027,37 @@ pci_emul_fallback_handler(struct vmctx * return (0); } +static int +pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, + int bytes, uint64_t *val, void *arg1, long arg2) +{ + int bus, slot, func, coff, in; + + coff = addr & 0xfff; + func = (addr >> 12) & 0x7; + slot = (addr >> 15) & 0x1f; + bus = (addr >> 20) & 0xff; + in = (dir == MEM_F_READ); + if (in) + *val = ~0UL; + pci_cfgrw(ctx, vcpu, in, bus, slot, func, coff, bytes, (uint32_t *)val); + return (0); +} + +uint64_t +pci_ecfg_base(void) +{ + + return (PCI_EMUL_ECFG_BASE); +} + #define BUSIO_ROUNDUP 32 #define BUSMEM_ROUNDUP (1024 * 1024) int init_pci(struct vmctx *ctx) { + struct mem_range mr; struct pci_devemu *pde; struct businfo *bi; struct slotinfo *si; @@ -1112,22 +1141,34 @@ init_pci(struct vmctx *ctx) * The guest physical memory map looks like the following: * [0, lowmem) guest system memory * [lowmem, lowmem_limit) memory hole (may be absent) - * [lowmem_limit, 4GB) PCI hole (32-bit BAR allocation) + * [lowmem_limit, 0xE0000000) PCI hole (32-bit BAR allocation) + * [0xE0000000, 0xF0000000) PCI extended config window + * [0xF0000000, 4GB) LAPIC, IOAPIC, HPET, firmware * [4GB, 4GB + highmem) - * + */ + + /* * Accesses to memory addresses that are not allocated to system * memory or PCI devices return 0xff's. */ lowmem = vm_get_lowmem_size(ctx); + bzero(&mr, sizeof(struct mem_range)); + mr.name = "PCI hole"; + mr.flags = MEM_F_RW | MEM_F_IMMUTABLE; + mr.base = lowmem; + mr.size = (4ULL * 1024 * 1024 * 1024) - lowmem; + mr.handler = pci_emul_fallback_handler; + error = register_mem_fallback(&mr); + assert(error == 0); - memset(&pci_mem_hole, 0, sizeof(struct mem_range)); - pci_mem_hole.name = "PCI hole"; - pci_mem_hole.flags = MEM_F_RW; - pci_mem_hole.base = lowmem; - pci_mem_hole.size = (4ULL * 1024 * 1024 * 1024) - lowmem; - pci_mem_hole.handler = pci_emul_fallback_handler; - - error = register_mem_fallback(&pci_mem_hole); + /* PCI extended config space */ + bzero(&mr, sizeof(struct mem_range)); + mr.name = "PCI ECFG"; + mr.flags = MEM_F_RW | MEM_F_IMMUTABLE; + mr.base = PCI_EMUL_ECFG_BASE; + mr.size = PCI_EMUL_ECFG_SIZE; + mr.handler = pci_emul_ecfg_handler; + error = register_mem(&mr); assert(error == 0); return (0); @@ -1612,41 +1653,6 @@ pci_emul_hdrtype_fixup(int bus, int slot } } -static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff; - -static int -pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) -{ - uint32_t x; - - if (bytes != 4) { - if (in) - *eax = (bytes == 2) ? 0xffff : 0xff; - return (0); - } - - if (in) { - x = (cfgbus << 16) | - (cfgslot << 11) | - (cfgfunc << 8) | - cfgoff; - if (cfgenable) - x |= CONF1_ENABLE; - *eax = x; - } else { - x = *eax; - cfgenable = (x & CONF1_ENABLE) == CONF1_ENABLE; - cfgoff = x & PCI_REGMAX; - cfgfunc = (x >> 8) & PCI_FUNCMAX; - cfgslot = (x >> 11) & PCI_SLOTMAX; - cfgbus = (x >> 16) & PCI_BUSMAX; - } - - return (0); -} -INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr); - static uint32_t bits_changed(uint32_t old, uint32_t new, uint32_t mask) { @@ -1709,41 +1715,51 @@ pci_emul_cmdwrite(struct pci_devinst *pi pci_lintr_update(pi); } -static int -pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) +static void +pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func, + int coff, int bytes, uint32_t *eax) { struct businfo *bi; struct slotinfo *si; struct pci_devinst *pi; struct pci_devemu *pe; - int coff, idx, needcfg; + int idx, needcfg; uint64_t addr, bar, mask; - assert(bytes == 1 || bytes == 2 || bytes == 4); - - if ((bi = pci_businfo[cfgbus]) != NULL) { - si = &bi->slotinfo[cfgslot]; - pi = si->si_funcs[cfgfunc].fi_devi; + if ((bi = pci_businfo[bus]) != NULL) { + si = &bi->slotinfo[slot]; + pi = si->si_funcs[func].fi_devi; } else pi = NULL; - coff = cfgoff + (port - CONF1_DATA_PORT); - -#if 0 - printf("pcicfg-%s from 0x%0x of %d bytes (%d/%d/%d)\n\r", - in ? "read" : "write", coff, bytes, cfgbus, cfgslot, cfgfunc); -#endif - /* - * Just return if there is no device at this cfgslot:cfgfunc, - * if the guest is doing an un-aligned access, or if the config - * address word isn't enabled. + * Just return if there is no device at this slot:func or if the + * the guest is doing an un-aligned access. */ - if (!cfgenable || pi == NULL || (coff & (bytes - 1)) != 0) { + if (pi == NULL || (bytes != 1 && bytes != 2 && bytes != 4) || + (coff & (bytes - 1)) != 0) { if (in) *eax = 0xffffffff; - return (0); + return; + } + + /* + * Ignore all writes beyond the standard config space and return all + * ones on reads. + */ + if (coff >= PCI_REGMAX + 1) { + if (in) { + *eax = 0xffffffff; + /* + * Extended capabilities begin at offset 256 in config + * space. Absence of extended capabilities is signaled + * with all 0s in the extended capability header at + * offset 256. + */ + if (coff <= PCI_REGMAX + 4) + *eax = 0x00000000; + } + return; } pe = pi->pi_d; @@ -1754,8 +1770,8 @@ pci_emul_cfgdata(struct vmctx *ctx, int if (in) { /* Let the device emulation override the default handler */ if (pe->pe_cfgread != NULL) { - needcfg = pe->pe_cfgread(ctx, vcpu, pi, - coff, bytes, eax); + needcfg = pe->pe_cfgread(ctx, vcpu, pi, coff, bytes, + eax); } else { needcfg = 1; } @@ -1769,12 +1785,12 @@ pci_emul_cfgdata(struct vmctx *ctx, int *eax = pci_get_cfgdata32(pi, coff); } - pci_emul_hdrtype_fixup(cfgbus, cfgslot, coff, bytes, eax); + pci_emul_hdrtype_fixup(bus, slot, coff, bytes, eax); } else { /* Let the device emulation override the default handler */ if (pe->pe_cfgwrite != NULL && (*pe->pe_cfgwrite)(ctx, vcpu, pi, coff, bytes, *eax) == 0) - return (0); + return; /* * Special handling for write to BAR registers @@ -1785,7 +1801,7 @@ pci_emul_cfgdata(struct vmctx *ctx, int * 4-byte aligned. */ if (bytes != 4 || (coff & 0x3) != 0) - return (0); + return; idx = (coff - PCIR_BAR(0)) / 4; mask = ~(pi->pi_bar[idx].size - 1); switch (pi->pi_bar[idx].type) { @@ -1843,7 +1859,57 @@ pci_emul_cfgdata(struct vmctx *ctx, int CFGWRITE(pi, coff, *eax, bytes); } } +} + +static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff; + +static int +pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + uint32_t x; + if (bytes != 4) { + if (in) + *eax = (bytes == 2) ? 0xffff : 0xff; + return (0); + } + + if (in) { + x = (cfgbus << 16) | (cfgslot << 11) | (cfgfunc << 8) | cfgoff; + if (cfgenable) + x |= CONF1_ENABLE; + *eax = x; + } else { + x = *eax; + cfgenable = (x & CONF1_ENABLE) == CONF1_ENABLE; + cfgoff = x & PCI_REGMAX; + cfgfunc = (x >> 8) & PCI_FUNCMAX; + cfgslot = (x >> 11) & PCI_SLOTMAX; + cfgbus = (x >> 16) & PCI_BUSMAX; + } + + return (0); +} +INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr); + +static int +pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + int coff; + + assert(bytes == 1 || bytes == 2 || bytes == 4); + + coff = cfgoff + (port - CONF1_DATA_PORT); + if (cfgenable) { + pci_cfgrw(ctx, vcpu, in, cfgbus, cfgslot, cfgfunc, coff, bytes, + eax); + } else { + /* Ignore accesses to cfgdata if not enabled by cfgaddr */ + if (in) + *eax = 0xffffffff; + } return (0); } Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Fri Aug 8 01:57:15 2014 (r269699) +++ head/usr.sbin/bhyve/pci_emul.h Fri Aug 8 03:49:01 2014 (r269700) @@ -235,6 +235,7 @@ uint64_t pci_emul_msix_tread(struct pci_ int pci_count_lintr(int bus); void pci_walk_lintr(int bus, pci_lintr_cb cb, void *arg); void pci_write_dsdt(void); +uint64_t pci_ecfg_base(void); int pci_bus_configured(int bus); static __inline void From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 04:21:49 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03556114; Fri, 8 Aug 2014 04:21:49 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC82262E; Fri, 8 Aug 2014 04:21:48 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s784Lh3M062870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Aug 2014 07:21:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s784Lh3M062870 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s784Lh0C062869; Fri, 8 Aug 2014 07:21:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 8 Aug 2014 07:21:43 +0300 From: Konstantin Belousov To: Don Lewis Subject: Re: svn commit: r269656 - in head: bin/ps sys/kern sys/sys Message-ID: <20140808042143.GA93733@kib.kiev.ua> References: <53e31309.5581.568424c9@svn.freebsd.org> <201408071648.s77GmI98043796@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O/Q8kNx4kEBIW7e9" Content-Disposition: inline In-Reply-To: <201408071648.s77GmI98043796@gw.catspoiler.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 04:21:49 -0000 --O/Q8kNx4kEBIW7e9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 07, 2014 at 09:48:18AM -0700, Don Lewis wrote: > On 7 Aug, Konstantin Belousov wrote: > > Author: kib > > Date: Thu Aug 7 05:47:53 2014 > > New Revision: 269656 > > URL: http://svnweb.freebsd.org/changeset/base/269656 > >=20 > > Log: > > Correct the problems with the ptrace(2) making the debuggee an orphan. > > One problem is inferior(9) looping due to the process tree becoming a > > graph instead of tree if the parent is traced by child. Another issue > > is due to the use of p_oppid to restore the original parent/child > > relationship, because real parent could already exited and its pid > > reused (noted by mjg). > > =20 > > Add the function proc_realparent(9), which calculates the parent for > > given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head > > element of the p_orphan list and than stepping back to its container > > to find the parent process. If the parent has already exited, the > > init(8) is returned. > > =20 > > Move the P_ORPHAN and the new helper flag from the p_flag* to new > > p_treeflag field of struct proc, which is protected by proctree lock > > instead of proc lock, since the orphans relationship is managed under > > the proctree_lock already. > > =20 > > The remaining uses of p_oppid in ptrace(PT_DETACH) and process > > reapping are replaced by proc_realparent(9). >=20 > Changing the parent process has always seemed like a hack to me. It > seems like the debugger should register itself as an additional parent. And after that, the pass over the signal delivery and child handling code must be made to convert all of it to use that new parent, if available. The good consequence of using the orphans list is that no wholesale convertion is needed. Also, looking at the amount of code to handle and use orphan vs. amount of code which works with p_pptr, it is obvious which approach is less intrusive into the delicate code, where all corner cases are features. In other words, if somebody can provide the patch which 'transposes' the current approach it would be interesting to see, but I know from the first-hand experience that the work is large, very hard since all details must be done right at the first pass, and it would only change already correct code into something else. --O/Q8kNx4kEBIW7e9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT5FBWAAoJEJDCuSvBvK1B3WsP/2NzSHOo+H59oB1XM9/LIXPj i90L2MVrXpL0bGz4XEcoYxq9oh7pyCSBgSJjnh/F/i47gE+2CMITd6m4Qy8VuWtG TGqK0U2QT1xVr1u3S82Dkhi3PZ8QtuAeuwr6+ssOqfZmiCgzjeV3c0aiD9GgHav7 yVBZu85+blUiaQJ5oB088mmV0e5plTfpWuCo90+j+IFxL4diFKkEEu63lqGfSXlf oEgsoF1L6Fgfam7EPaATkhKmZLWWB15R64YDXbBPqH7yDUaxYEc8IdJsiGo4Dc6M yVoh3dceXNVv2wN5oQZCZaJOIWAYiiO5GkKJYgdSc8vVYqoyhrShdD3Yl/hgk4E2 dyQp7XLEcaKUZB3wYsIotsLpVEd9W3RDUoQBJgXYcjq8VKJfhQzGaEO1cX9QhyBP Wy2OVG3IpwvhZtRwxuttBoP+Et479qLXzd3LxvZZieLtWtXkxcyhLjW/M2Ya+oCs QgIURco/ZzT3qlvHAfb/fy5+C/8dRzFpa2m1yE4dxl117ImpB5VcwCFZzcCQ9DnB PbMg/F7IDh31LMa+39w87TlmpDDLHYfmDQTlxEA95rgQkXxDT1ByDWOwSx4cquEA +GwaCgOAfBiznEp8usxGJPWJ56JNeetnscAMkNXJWEMmT8i5RqLkH5UzwaKksmlk vyGosN0ibaWoJZKTupZE =lVSN -----END PGP SIGNATURE----- --O/Q8kNx4kEBIW7e9-- From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 06:22:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15A00299 for ; Fri, 8 Aug 2014 06:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF47D2168 for ; Fri, 8 Aug 2014 06:22:32 +0000 (UTC) Received: from jhibbits (uid 1274) (envelope-from jhibbits@FreeBSD.org) id 2c77 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 06:22:32 +0000 From: Justin Hibbits Date: Fri, 8 Aug 2014 06:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269701 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e46ca8.2c77.7ee57e2e@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 06:22:33 -0000 Author: jhibbits Date: Fri Aug 8 06:22:32 2014 New Revision: 269701 URL: http://svnweb.freebsd.org/changeset/base/269701 Log: Set the si_code appropriately for exception-caused signals. LLDB checks the si_code, and aborts if a code isn't known. MFC after: 2 weeks Relnotes: yes Modified: head/sys/powerpc/aim/trap.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Fri Aug 8 03:49:01 2014 (r269700) +++ head/sys/powerpc/aim/trap.c Fri Aug 8 06:22:32 2014 (r269701) @@ -192,6 +192,7 @@ trap(struct trapframe *frame) case EXC_TRC: frame->srr1 &= ~PSL_SE; sig = SIGTRAP; + ucode = TRAP_TRACE; break; #ifdef __powerpc64__ @@ -199,13 +200,17 @@ trap(struct trapframe *frame) case EXC_DSE: if (handle_user_slb_spill(&p->p_vmspace->vm_pmap, (type == EXC_ISE) ? frame->srr0 : - frame->cpu.aim.dar) != 0) + frame->cpu.aim.dar) != 0) { sig = SIGSEGV; + ucode = SEGV_MAPERR; + } break; #endif case EXC_DSI: case EXC_ISI: sig = trap_pfault(frame, 1); + if (sig == SIGSEGV) + ucode = SEGV_MAPERR; break; case EXC_SC: @@ -240,8 +245,10 @@ trap(struct trapframe *frame) break; case EXC_ALI: - if (fix_unaligned(td, frame) != 0) + if (fix_unaligned(td, frame) != 0) { sig = SIGBUS; + ucode = BUS_ADRALN; + } else frame->srr0 += 4; break; @@ -259,8 +266,16 @@ trap(struct trapframe *frame) } #endif sig = SIGTRAP; + ucode = TRAP_BRKPT; } else { sig = ppc_instr_emulate(frame, td->td_pcb); + if (sig == SIGILL) { + if (frame->srr1 & EXC_PGM_PRIV) + ucode = ILL_PRVOPC; + else if (frame->srr1 & EXC_PGM_ILLEGAL) + ucode = ILL_ILLOPC; + } else if (sig == SIGFPE) + ucode = FPE_FLTINV; /* Punt for now, invalid operation. */ } break; @@ -271,6 +286,7 @@ trap(struct trapframe *frame) * but it at least prevents the kernel from dying. */ sig = SIGBUS; + ucode = BUS_OBJERR; break; default: From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 06:29:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEDD6615 for ; Fri, 8 Aug 2014 06:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB14219D for ; Fri, 8 Aug 2014 06:29:30 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 2cb1 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 06:29:30 +0000 From: Nathan Whitehorn Date: Fri, 8 Aug 2014 06:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269702 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e46e4a.2cb1.29e4e203@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 06:29:31 -0000 Author: nwhitehorn Date: Fri Aug 8 06:29:30 2014 New Revision: 269702 URL: http://svnweb.freebsd.org/changeset/base/269702 Log: Use OF_getencprop() in preference to OF_getprop() and manual byte-swapping. Modified: head/sys/arm/samsung/exynos/chrome_kb.c head/sys/arm/samsung/exynos/exynos5_fimd.c head/sys/arm/samsung/exynos/exynos5_usb_phy.c Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Fri Aug 8 06:22:32 2014 (r269701) +++ head/sys/arm/samsung/exynos/chrome_kb.c Fri Aug 8 06:29:30 2014 (r269702) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -57,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -741,18 +739,18 @@ parse_dts(struct ckb_softc *sc) if ((len = OF_getproplen(node, "google,key-rows")) <= 0) return (ENXIO); - OF_getprop(node, "google,key-rows", &dts_value, len); - sc->rows = fdt32_to_cpu(dts_value); + OF_getencprop(node, "google,key-rows", &dts_value, len); + sc->rows = dts_value; if ((len = OF_getproplen(node, "google,key-columns")) <= 0) return (ENXIO); - OF_getprop(node, "google,key-columns", &dts_value, len); - sc->cols = fdt32_to_cpu(dts_value); + OF_getencprop(node, "google,key-columns", &dts_value, len); + sc->cols = dts_value; if ((len = OF_getproplen(node, "freebsd,intr-gpio")) <= 0) return (ENXIO); - OF_getprop(node, "freebsd,intr-gpio", &dts_value, len); - sc->gpio = fdt32_to_cpu(dts_value); + OF_getencprop(node, "freebsd,intr-gpio", &dts_value, len); + sc->gpio = dts_value; if (OF_hasprop(node, "freebsd,keymap")) { keymap_prop = "freebsd,keymap"; Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_fimd.c Fri Aug 8 06:22:32 2014 (r269701) +++ head/sys/arm/samsung/exynos/exynos5_fimd.c Fri Aug 8 06:29:30 2014 (r269702) @@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -#include #include #include #include @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" #include -#include #include #include @@ -213,37 +212,37 @@ get_panel_info(struct fimd_softc *sc, st /* panel size */ if ((len = OF_getproplen(node, "panel-size")) <= 0) return (ENXIO); - OF_getprop(node, "panel-size", &dts_value, len); - panel->width = fdt32_to_cpu(dts_value[0]); - panel->height = fdt32_to_cpu(dts_value[1]); + OF_getencprop(node, "panel-size", dts_value, len); + panel->width = dts_value[0]; + panel->height = dts_value[1]; /* hsync */ if ((len = OF_getproplen(node, "panel-hsync")) <= 0) return (ENXIO); - OF_getprop(node, "panel-hsync", &dts_value, len); - panel->h_back_porch = fdt32_to_cpu(dts_value[0]); - panel->h_pulse_width = fdt32_to_cpu(dts_value[1]); - panel->h_front_porch = fdt32_to_cpu(dts_value[2]); + OF_getencprop(node, "panel-hsync", dts_value, len); + panel->h_back_porch = dts_value[0]; + panel->h_pulse_width = dts_value[1]; + panel->h_front_porch = dts_value[2]; /* vsync */ if ((len = OF_getproplen(node, "panel-vsync")) <= 0) return (ENXIO); - OF_getprop(node, "panel-vsync", &dts_value, len); - panel->v_back_porch = fdt32_to_cpu(dts_value[0]); - panel->v_pulse_width = fdt32_to_cpu(dts_value[1]); - panel->v_front_porch = fdt32_to_cpu(dts_value[2]); + OF_getencprop(node, "panel-vsync", dts_value, len); + panel->v_back_porch = dts_value[0]; + panel->v_pulse_width = dts_value[1]; + panel->v_front_porch = dts_value[2]; /* clk divider */ if ((len = OF_getproplen(node, "panel-clk-div")) <= 0) return (ENXIO); - OF_getprop(node, "panel-clk-div", &dts_value, len); - panel->clk_div = fdt32_to_cpu(dts_value[0]); + OF_getencprop(node, "panel-clk-div", dts_value, len); + panel->clk_div = dts_value[0]; /* backlight pin */ if ((len = OF_getproplen(node, "panel-backlight-pin")) <= 0) return (ENXIO); - OF_getprop(node, "panel-backlight-pin", &dts_value, len); - panel->backlight_pin = fdt32_to_cpu(dts_value[0]); + OF_getencprop(node, "panel-backlight-pin", dts_value, len); + panel->backlight_pin = dts_value[0]; return (0); } Modified: head/sys/arm/samsung/exynos/exynos5_usb_phy.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_usb_phy.c Fri Aug 8 06:22:32 2014 (r269701) +++ head/sys/arm/samsung/exynos/exynos5_usb_phy.c Fri Aug 8 06:29:30 2014 (r269702) @@ -43,13 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include @@ -158,8 +156,8 @@ vbus_on(struct usb_phy_softc *sc) /* Power pin */ if ((len = OF_getproplen(node, "vbus-supply")) <= 0) return (-1); - OF_getprop(node, "vbus-supply", &dts_value, len); - pin = fdt32_to_cpu(dts_value[0]); + OF_getencprop(node, "vbus-supply", dts_value, len); + pin = dts_value[0]; gpio_dev = devclass_get_device(devclass_find("gpio"), 0); if (gpio_dev == NULL) { From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 06:30:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6F16851 for ; Fri, 8 Aug 2014 06:30:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9385421B2 for ; Fri, 8 Aug 2014 06:30:19 +0000 (UTC) Received: from nwhitehorn (uid 1171) (envelope-from nwhitehorn@FreeBSD.org) id 2cf2 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 06:30:17 +0000 From: Nathan Whitehorn Date: Fri, 8 Aug 2014 06:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269703 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e46e7a.2cf2.5e05997a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 06:30:19 -0000 Author: nwhitehorn Date: Fri Aug 8 06:30:17 2014 New Revision: 269703 URL: http://svnweb.freebsd.org/changeset/base/269703 Log: Remove unnecessary inclusion of FDT headers. Modified: head/sys/arm/samsung/exynos/chrome_ec.c head/sys/arm/samsung/exynos/chrome_ec_spi.c head/sys/arm/samsung/exynos/exynos5_combiner.c head/sys/arm/samsung/exynos/exynos5_ehci.c head/sys/arm/samsung/exynos/exynos5_i2c.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/samsung/exynos/exynos5_mct.c head/sys/arm/samsung/exynos/exynos5_pad.c head/sys/arm/samsung/exynos/exynos5_pmu.c head/sys/arm/samsung/exynos/exynos5_spi.c head/sys/arm/samsung/exynos/exynos5_xhci.c Modified: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/chrome_ec.c Fri Aug 8 06:30:17 2014 (r269703) @@ -43,13 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/chrome_ec_spi.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec_spi.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/chrome_ec_spi.c Fri Aug 8 06:30:17 2014 (r269703) @@ -43,13 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 8 06:30:17 2014 (r269703) @@ -43,13 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_ehci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_ehci.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_ehci.c Fri Aug 8 06:30:17 2014 (r269703) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include Modified: head/sys/arm/samsung/exynos/exynos5_i2c.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_i2c.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_i2c.c Fri Aug 8 06:30:17 2014 (r269703) @@ -47,13 +47,11 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Fri Aug 8 06:30:17 2014 (r269703) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - vm_offset_t platform_lastaddr(void) { Modified: head/sys/arm/samsung/exynos/exynos5_mct.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mct.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_mct.c Fri Aug 8 06:30:17 2014 (r269703) @@ -45,13 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #define MCT_CTRL_START (1 << 8) #define MCT_CTRL (0x240) Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 8 06:30:17 2014 (r269703) @@ -45,13 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_pmu.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pmu.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_pmu.c Fri Aug 8 06:30:17 2014 (r269703) @@ -42,13 +42,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_spi.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_spi.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_spi.c Fri Aug 8 06:30:17 2014 (r269703) @@ -47,13 +47,11 @@ __FBSDID("$FreeBSD$"); #include "spibus_if.h" -#include #include #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_xhci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_xhci.c Fri Aug 8 06:29:30 2014 (r269702) +++ head/sys/arm/samsung/exynos/exynos5_xhci.c Fri Aug 8 06:30:17 2014 (r269703) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 09:17:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C8D6297 for ; Fri, 8 Aug 2014 09:17:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7953258C for ; Fri, 8 Aug 2014 09:17:02 +0000 (UTC) Received: from bz (uid 1027) (envelope-from bz@FreeBSD.org) id 27c4 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 09:17:02 +0000 From: Bjoern A. Zeeb Date: Fri, 8 Aug 2014 09:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269705 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4958e.27c4.30e1554c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 09:17:03 -0000 Author: bz Date: Fri Aug 8 09:17:02 2014 New Revision: 269705 URL: http://svnweb.freebsd.org/changeset/base/269705 Log: Fix argument to KTR after r269699 to unbreak LINT builds. Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Fri Aug 8 06:36:26 2014 (r269704) +++ head/sys/netinet/igmp.c Fri Aug 8 09:17:02 2014 (r269705) @@ -1436,7 +1436,7 @@ igmp_input(struct mbuf **mp, int *offp, int minlen; int queryver; - CTR3(KTR_IGMPV3, "%s: called w/mbuf (%p,%d)", __func__, m, off); + CTR3(KTR_IGMPV3, "%s: called w/mbuf (%p,%d)", __func__, m, *offp); m = *mp; ifp = m->m_pkthdr.rcvif; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 09:47:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01B11C0B for ; Fri, 8 Aug 2014 09:47:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBB58286C for ; Fri, 8 Aug 2014 09:47:01 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 224c by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 09:47:01 +0000 From: Hans Petter Selasky Date: Fri, 8 Aug 2014 09:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269707 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e49c95.224c.59cce7d7@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 09:47:02 -0000 Author: hselasky Date: Fri Aug 8 09:47:01 2014 New Revision: 269707 URL: http://svnweb.freebsd.org/changeset/base/269707 Log: Remove some not needed directory properties. Modified: Directory Properties: head/sys/dev/usb/controller/ (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:39:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C5DFC0F for ; Fri, 8 Aug 2014 11:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B7592596 for ; Fri, 8 Aug 2014 11:39:05 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 2f82 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:39:05 +0000 From: Konstantin Belousov Date: Fri, 8 Aug 2014 11:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269708 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b6d9.2f82.d4811ca@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:39:05 -0000 Author: kib Date: Fri Aug 8 11:39:05 2014 New Revision: 269708 URL: http://svnweb.freebsd.org/changeset/base/269708 Log: VOP_LOOKUP() may relock the directory vnode for some reasons. Since nullfs vnode shares vnode lock with lower vnode, this allows the reclamation of nullfs directory vnode in null_lookup(). In this situation, VOP must return ENOENT. More, since after the reclamation, the locks of nullfs directory vnode and lower vnode are no longer shared, the relock of the ldvp does not restore the correct locking state of dvp, and leaks ldvp lock. Correct this by unlocking ldvp and locking dvp. Use cached value of dvp->v_mount. Reported by: bdrewery Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Fri Aug 8 09:47:01 2014 (r269707) +++ head/sys/fs/nullfs/null_vnops.c Fri Aug 8 11:39:05 2014 (r269708) @@ -361,9 +361,11 @@ null_lookup(struct vop_lookup_args *ap) struct vnode *dvp = ap->a_dvp; int flags = cnp->cn_flags; struct vnode *vp, *ldvp, *lvp; + struct mount *mp; int error; - if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && + mp = dvp->v_mount; + if ((flags & ISLASTCN) != 0 && (mp->mnt_flag & MNT_RDONLY) != 0 && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) return (EROFS); /* @@ -376,9 +378,43 @@ null_lookup(struct vop_lookup_args *ap) ((dvp->v_vflag & VV_ROOT) != 0 && (flags & ISDOTDOT) == 0), ("ldvp %p fl %#x dvp %p fl %#x flags %#x", ldvp, ldvp->v_vflag, dvp, dvp->v_vflag, flags)); + + /* + * Hold ldvp. The reference on it, owned by dvp, is lost in + * case of dvp reclamation, and we need ldvp to move our lock + * from ldvp to dvp. + */ + vhold(ldvp); + error = VOP_LOOKUP(ldvp, &lvp, cnp); - if (error == EJUSTRETURN && (flags & ISLASTCN) && - (dvp->v_mount->mnt_flag & MNT_RDONLY) && + + /* + * VOP_LOOKUP() on lower vnode may unlock ldvp, which allows + * dvp to be reclaimed due to shared v_vnlock. Check for the + * doomed state and return error. + */ + if ((error == 0 || error == EJUSTRETURN) && + (dvp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + if (lvp != NULL) + vput(lvp); + + /* + * If vgone() did reclaimed dvp before curthread + * relocked ldvp, the locks of dvp and ldpv are no + * longer shared. In this case, relock of ldvp in + * lower fs VOP_LOOKUP() does not restore the locking + * state of dvp. Compensate for this by unlocking + * ldvp and locking dvp, which is also correct if the + * locks are still shared. + */ + VOP_UNLOCK(ldvp, 0); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + } + vdrop(ldvp); + + if (error == EJUSTRETURN && (flags & ISLASTCN) != 0 && + (mp->mnt_flag & MNT_RDONLY) != 0 && (cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)) error = EROFS; @@ -388,7 +424,7 @@ null_lookup(struct vop_lookup_args *ap) VREF(dvp); vrele(lvp); } else { - error = null_nodeget(dvp->v_mount, lvp, &vp); + error = null_nodeget(mp, lvp, &vp); if (error == 0) *ap->a_vpp = vp; } From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:46:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 843FBFBE for ; Fri, 8 Aug 2014 11:46:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551902659 for ; Fri, 8 Aug 2014 11:46:46 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 23a2 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:46:46 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269709 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8a6.23a2.31680d8f@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:46:46 -0000 Author: imp Date: Fri Aug 8 11:46:45 2014 New Revision: 269709 URL: http://svnweb.freebsd.org/changeset/base/269709 Log: is_full_id is set to 0 and then not used. remove it. Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Aug 8 11:39:05 2014 (r269708) +++ head/sys/cam/scsi/scsi_all.c Fri Aug 8 11:46:45 2014 (r269709) @@ -6064,13 +6064,12 @@ scsi_parse_transportid_iscsi(char *id_st char *error_str, int error_str_len) { size_t id_len, sep_len, id_size, name_len; - int is_full_id, retval; + int retval; unsigned int i, sep_pos, sep_found; const char *sep_template = ",i,0x"; const char *iqn_prefix = "iqn."; struct scsi_transportid_iscsi_device *iscsi; - is_full_id = 0; retval = 0; sep_found = 0; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:47:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BEBA2A8 for ; Fri, 8 Aug 2014 11:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA472665 for ; Fri, 8 Aug 2014 11:47:05 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 23d3 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:47:05 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269710 - head/sys/dev/aic7xxx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8b9.23d3.261221b7@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:47:05 -0000 Author: imp Date: Fri Aug 8 11:47:04 2014 New Revision: 269710 URL: http://svnweb.freebsd.org/changeset/base/269710 Log: shared_scb_data set, but never used, remove it. Modified: head/sys/dev/aic7xxx/aic79xx_pci.c Modified: head/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_pci.c Fri Aug 8 11:46:45 2014 (r269709) +++ head/sys/dev/aic7xxx/aic79xx_pci.c Fri Aug 8 11:47:04 2014 (r269710) @@ -320,14 +320,12 @@ ahd_find_pci_device(aic_dev_softc_t pci) int ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry) { - struct scb_data *shared_scb_data; u_int command; uint32_t devconfig; uint16_t device; uint16_t subvendor; int error; - shared_scb_data = NULL; ahd->description = entry->name; /* * Record if this is a HostRAID board. From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:47:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 035263EA for ; Fri, 8 Aug 2014 11:47:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF777266D for ; Fri, 8 Aug 2014 11:47:09 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 23ed by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:47:09 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269711 - head/sys/dev/amr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8bd.23ed.75e3e478@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:47:10 -0000 Author: imp Date: Fri Aug 8 11:47:09 2014 New Revision: 269711 URL: http://svnweb.freebsd.org/changeset/base/269711 Log: Set but not used variables eliminated. Modified: head/sys/dev/amr/amr.c Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Fri Aug 8 11:47:04 2014 (r269710) +++ head/sys/dev/amr/amr.c Fri Aug 8 11:47:09 2014 (r269711) @@ -563,7 +563,7 @@ amr_linux_ioctl_int(struct cdev *dev, u_ struct amr_linux_ioctl ali; void *dp, *temp; int error; - int adapter, len, ac_flags = 0; + int len, ac_flags = 0; int logical_drives_changed = 0; u_int32_t linux_version = 0x02100000; u_int8_t status; @@ -606,8 +606,6 @@ amr_linux_ioctl_int(struct cdev *dev, u_ else len = ali.ui.fcs.length; - adapter = (ali.ui.fcs.adapno) ^ 'm' << 8; - mb = (void *)&ali.mbox[0]; if ((ali.mbox[0] == FC_DEL_LOGDRV && ali.mbox[2] == OP_DEL_LOGDRV) || /* delete */ @@ -761,7 +759,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, void *dp, *au_buffer; unsigned long au_length, real_length; unsigned char *au_cmd; - int *au_statusp, au_direction; + int *au_statusp; int error; struct amr_passthrough *ap; /* 60 bytes */ int logical_drives_changed = 0; @@ -793,7 +791,6 @@ amr_ioctl(struct cdev *dev, u_long cmd, au_cmd = arg.au32->au_cmd; au_buffer = (void *)(u_int64_t)arg.au32->au_buffer; au_length = arg.au32->au_length; - au_direction = arg.au32->au_direction; au_statusp = &arg.au32->au_status; break; #endif @@ -803,7 +800,6 @@ amr_ioctl(struct cdev *dev, u_long cmd, au_cmd = arg.au->au_cmd; au_buffer = (void *)arg.au->au_buffer; au_length = arg.au->au_length; - au_direction = arg.au->au_direction; au_statusp = &arg.au->au_status; break; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:47:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9CB0528 for ; Fri, 8 Aug 2014 11:47:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9183D2676 for ; Fri, 8 Aug 2014 11:47:14 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2406 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:47:14 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269712 - head/sys/dev/an X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8c2.2406.7d826ae@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:47:14 -0000 Author: imp Date: Fri Aug 8 11:47:14 2014 New Revision: 269712 URL: http://svnweb.freebsd.org/changeset/base/269712 Log: last is set and not used, most likely a cut and paste error from other sysctl setting functions in this module. Modified: head/sys/dev/an/if_an.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Fri Aug 8 11:47:09 2014 (r269711) +++ head/sys/dev/an/if_an.c Fri Aug 8 11:47:14 2014 (r269712) @@ -270,9 +270,7 @@ SYSCTL_PROC(_hw_an, OID_AUTO, an_dump, C static int sysctl_an_cache_mode(SYSCTL_HANDLER_ARGS) { - int error, last; - - last = an_cache_mode; + int error; switch (an_cache_mode) { case 1: From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:47:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BB84673 for ; Fri, 8 Aug 2014 11:47:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53D0B267D for ; Fri, 8 Aug 2014 11:47:19 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 241f by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:47:19 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269713 - head/sys/dev/ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8c7.241f.4ee338c4@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:47:19 -0000 Author: imp Date: Fri Aug 8 11:47:18 2014 New Revision: 269713 URL: http://svnweb.freebsd.org/changeset/base/269713 Log: err set but not used. Eliminate it. Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Fri Aug 8 11:47:14 2014 (r269712) +++ head/sys/dev/ata/chipsets/ata-promise.c Fri Aug 8 11:47:18 2014 (r269713) @@ -957,9 +957,9 @@ ata_promise_mio_softreset(device_t dev, /* wait for BUSY to go inactive */ for (timeout = 0; timeout < 100; timeout++) { - u_int8_t err, stat; + u_int8_t /* err, */ stat; - err = ATA_IDX_INB(ch, ATA_ERROR); + /* err = */ ATA_IDX_INB(ch, ATA_ERROR); stat = ATA_IDX_INB(ch, ATA_STATUS); //if (stat == err && timeout > (stat & ATA_S_BUSY ? 100 : 10)) From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 11:47:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC1C7AF for ; Fri, 8 Aug 2014 11:47:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7B202683 for ; Fri, 8 Aug 2014 11:47:23 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2439 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 11:47:23 +0000 From: Warner Losh Date: Fri, 8 Aug 2014 11:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269714 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4b8cb.2439.46392757@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 11:47:24 -0000 Author: imp Date: Fri Aug 8 11:47:23 2014 New Revision: 269714 URL: http://svnweb.freebsd.org/changeset/base/269714 Log: an isn't used, so eliminate it. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Aug 8 11:47:18 2014 (r269713) +++ head/sys/dev/ath/if_ath.c Fri Aug 8 11:47:23 2014 (r269714) @@ -4427,14 +4427,12 @@ ath_tx_process_buf_completion(struct ath struct ath_tx_status *ts, struct ath_buf *bf) { struct ieee80211_node *ni = bf->bf_node; - struct ath_node *an = NULL; ATH_TX_UNLOCK_ASSERT(sc); ATH_TXQ_UNLOCK_ASSERT(txq); /* If unicast frame, update general statistics */ if (ni != NULL) { - an = ATH_NODE(ni); /* update statistics */ ath_tx_update_stats(sc, ts, bf); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 15:40:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7A4EDB3; Fri, 8 Aug 2014 15:40:28 +0000 (UTC) Received: from felyko.com (felyko.com [65.49.80.26]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFDD23E6; Fri, 8 Aug 2014 15:40:28 +0000 (UTC) Received: from [IPv6:2601:9:8280:5fd:d52d:c118:dd20:86fd] (unknown [IPv6:2601:9:8280:5fd:d52d:c118:dd20:86fd]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 7E64334AAC4; Fri, 8 Aug 2014 08:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1407512422; bh=9x99lDcNkOo4TeSh/ibcgsQr3ES43ClJbR4AKRMtxzw=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=dETxBd46BD9KzCF8Mb4XRjVvMLrl/yvA9qruu+nLc1GQbfmVKuJrseDYUJNPJ49Wt 2/7N7xTFZq4Nm6xNJZiirPH/MeynV2jQnLNWmCtn7DtXiWm0fdsIDpjW33inJXnLr0 MIy0m9cjML+ZEXYhLgtYybIzdk0vpSQsF9ogv8O0= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269699 - in head/sys: net netinet netinet6 netipsec netpfil/pf sys From: Rui Paulo In-Reply-To: <53e42e7c.2d2c.122bcb35@svn.freebsd.org> Date: Fri, 8 Aug 2014 08:40:20 -0700 Content-Transfer-Encoding: 7bit Message-Id: <2C45FBCF-77E8-4ECC-A88E-47645D837362@felyko.com> References: <53e42e7c.2d2c.122bcb35@svn.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 15:40:28 -0000 On Aug 7, 2014, at 18:57, Kevin Lo wrote: > Author: kevlo > Date: Fri Aug 8 01:57:15 2014 > New Revision: 269699 > URL: http://svnweb.freebsd.org/changeset/base/269699 > > Log: > Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have > only one protocol switch structure that is shared between ipv4 and ipv6. That's a nice cleanup. Thanks. -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 15:50:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD12E631 for ; Fri, 8 Aug 2014 15:50:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3CDF24F6 for ; Fri, 8 Aug 2014 15:50:02 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 2b64 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 15:50:02 +0000 From: Konstantin Belousov Date: Fri, 8 Aug 2014 15:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269726 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4f1aa.2b64.1401cb18@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 15:50:02 -0000 Author: kib Date: Fri Aug 8 15:50:02 2014 New Revision: 269726 URL: http://svnweb.freebsd.org/changeset/base/269726 Log: Fix one more compiler warning, m is not initialized. Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Fri Aug 8 15:33:26 2014 (r269725) +++ head/sys/netinet/igmp.c Fri Aug 8 15:50:02 2014 (r269726) @@ -1436,7 +1436,7 @@ igmp_input(struct mbuf **mp, int *offp, int minlen; int queryver; - CTR3(KTR_IGMPV3, "%s: called w/mbuf (%p,%d)", __func__, m, *offp); + CTR3(KTR_IGMPV3, "%s: called w/mbuf (%p,%d)", __func__, *mp, *offp); m = *mp; ifp = m->m_pkthdr.rcvif; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 16:32:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE13EF54 for ; Fri, 8 Aug 2014 16:32:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCB1E29CA for ; Fri, 8 Aug 2014 16:32:06 +0000 (UTC) Received: from bjk (uid 1286) (envelope-from bjk@FreeBSD.org) id 2f07 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 16:32:06 +0000 From: Benjamin Kaduk Date: Fri, 8 Aug 2014 16:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269727 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e4fb86.2f07.7d153176@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 16:32:07 -0000 Author: bjk (doc committer) Date: Fri Aug 8 16:32:06 2014 New Revision: 269727 URL: http://svnweb.freebsd.org/changeset/base/269727 Log: Update vmstat usage for last-argument count/wait parameters Correct the usage in both the manpage and in usage() to indicate that the wait interval and repetition count may be given either with the respective -w/-c arguments, or as the final positional arguments. [0] The corresponding code to implement the positional arguments has been conditional on the (always-enabled) BACKWARD_COMPATIBILITY macro since the original 4.4-lite import. It's no longer reasonable to remove the functionality, so remove the macro and conditional instead. Note that multiple disks may be given on the command line. While here, sort arguments and apply minor mdoc fixes. PR: 184755 [0] Approved by: hrs (mentor, src committer) Modified: head/usr.bin/vmstat/vmstat.8 head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Fri Aug 8 15:50:02 2014 (r269726) +++ head/usr.bin/vmstat/vmstat.8 Fri Aug 8 16:32:06 2014 (r269727) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd October 21, 2006 +.Dd August 8, 2014 .Dt VMSTAT 8 .Os .Sh NAME @@ -38,9 +38,8 @@ .Nm .\" .Op Fl fimst .Op Fl afHhimPsz -.Op Fl c Ar count .Op Fl M Ar core Op Fl N Ar system -.Op Fl w Ar wait +.Op Fl c Ar count .Op Fl n Ar devs .Oo .Fl p @@ -48,7 +47,9 @@ .Ar type , if , pass .Sm on .Oc -.Op Ar disks +.Op Fl w Ar wait +.Op Ar disks ... +.Op wait Op count .Sh DESCRIPTION The .Nm @@ -91,10 +92,12 @@ and system calls since system startup, and the number of pages of virtual memory involved in each. .It Fl h -Changes memory columns into more easily human readable form. Default if +Changes memory columns into more easily human readable form. +The default if standard output is a terminal device. .It Fl H -Changes memory columns into straight numbers. Default if standard output +Changes memory columns into straight numbers. +The default if standard output is not a terminal device (such as a script). .It Fl i Report on the number of interrupts taken by each device since system @@ -214,6 +217,21 @@ Report on memory used by the kernel zone by zone. .El .Pp +The +.Ar wait +and +.Ar count +arguments may be given after their respective flags at any point +on the command line before the +.Ar disks +argument(s), or without their flags, as the final argument(s). +The latter form is accepted for backwards compatibility, but it is +preferred to use the forms with +.Fl w +and +.Fl c +to avoid ambiguity. +.Pp By default, .Nm displays the following information: Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Aug 8 15:50:02 2014 (r269726) +++ head/usr.bin/vmstat/vmstat.c Fri Aug 8 16:32:06 2014 (r269727) @@ -299,15 +299,12 @@ retry_nlist: argv = getdrivedata(argv); } -#define BACKWARD_COMPATIBILITY -#ifdef BACKWARD_COMPATIBILITY if (*argv) { f = atof(*argv); interval = f * 1000; if (*++argv) reps = atoi(*argv); } -#endif if (interval) { if (!reps) @@ -1360,7 +1357,7 @@ static void usage(void) { (void)fprintf(stderr, "%s%s", - "usage: vmstat [-afHhimPsz] [-c count] [-M core [-N system]] [-w wait]\n", - " [-n devs] [-p type,if,pass] [disks]\n"); + "usage: vmstat [-afHhimPsz] [-M core [-N system]] [-c count] [-n devs]\n", + " [-p type,if,pass] [-w wait] [disks] [wait [count]]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 17:12:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE21A144 for ; Fri, 8 Aug 2014 17:12:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 994B52EA1 for ; Fri, 8 Aug 2014 17:12:05 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 2f94 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 17:12:03 +0000 From: Konstantin Belousov Date: Fri, 8 Aug 2014 17:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269728 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen mips/mips powerpc/aim powerpc/booke powerpc/powerpc sparc64/sparc64 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e504e3.2f94.dca1d13@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 17:12:05 -0000 Author: kib Date: Fri Aug 8 17:12:03 2014 New Revision: 269728 URL: http://svnweb.freebsd.org/changeset/base/269728 Log: Change pmap_enter(9) interface to take flags parameter and superpage mapping size (currently unused). The flags includes the fault access bits, wired flag as PMAP_ENTER_WIRED, and a new flag PMAP_ENTER_NOSLEEP to indicate that pmap should not sleep. For powerpc aim both 32 and 64 bit, fix implementation to ensure that the requested mapping is created when PMAP_ENTER_NOSLEEP is not specified, in particular, wait for the available memory required to proceed. In collaboration with: alc Tested by: nwhitehorn (ppc aim32 and booke) Sponsored by: The FreeBSD Foundation and EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/pmap.h head/sys/vm/vm_fault.c head/sys/vm/vm_kern.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/amd64/amd64/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -4116,9 +4116,9 @@ setpte: * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind __unused) { struct rwlock *lock; pd_entry_t *pde; @@ -4127,6 +4127,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv_entry_t pv; vm_paddr_t opa, pa; vm_page_t mpte, om; + boolean_t nosleep; PG_A = pmap_accessed_bit(pmap); PG_G = pmap_global_bit(pmap); @@ -4143,10 +4144,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); - if ((access & VM_PROT_WRITE) != 0) + if ((flags & VM_PROT_WRITE) != 0) newpte |= PG_M; if ((prot & VM_PROT_WRITE) != 0) newpte |= PG_RW; @@ -4154,7 +4155,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, ("pmap_enter: access includes VM_PROT_WRITE but prot doesn't")); if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; - if (wired) + if ((flags & PMAP_ENTER_WIRED) != 0) newpte |= PG_W; if (va < VM_MAXUSER_ADDRESS) newpte |= PG_U; @@ -4196,7 +4197,15 @@ retry: * Here if the pte page isn't mapped, or if it has been * deallocated. */ - mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va), &lock); + nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; + mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va), + nosleep ? NULL : &lock); + if (mpte == NULL && nosleep) { + KASSERT(lock == NULL, ("lock leaked for nosleep")); + PMAP_UNLOCK(pmap); + rw_runlock(&pvh_global_lock); + return (KERN_RESOURCE_SHORTAGE); + } goto retry; } else panic("pmap_enter: invalid page directory va=%#lx", va); @@ -4328,6 +4337,7 @@ unchanged: rw_wunlock(lock); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); } /* Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/arm/arm/pmap-v6.c Fri Aug 8 17:12:03 2014 (r269728) @@ -231,8 +231,8 @@ static boolean_t pmap_pv_insert_section( static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vm_offset_t); static int pmap_pvh_wired_mappings(struct md_page *, int); -static void pmap_enter_locked(pmap_t, vm_offset_t, vm_prot_t, - vm_page_t, vm_prot_t, boolean_t, int); +static int pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, u_int); static vm_paddr_t pmap_extract_locked(pmap_t pmap, vm_offset_t va); static void pmap_alloc_l1(pmap_t); static void pmap_free_l1(pmap_t); @@ -2934,35 +2934,38 @@ pmap_protect(pmap_t pmap, vm_offset_t sv * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind __unused) { struct l2_bucket *l2b; + int rv; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); - pmap_enter_locked(pmap, va, access, m, prot, wired, M_WAITOK); - /* - * If both the l2b_occupancy and the reservation are fully - * populated, then attempt promotion. - */ - l2b = pmap_get_l2_bucket(pmap, va); - if ((l2b != NULL) && (l2b->l2b_occupancy == L2_PTE_NUM_TOTAL) && - sp_enabled && (m->flags & PG_FICTITIOUS) == 0 && - vm_reserv_level_iffullpop(m) == 0) - pmap_promote_section(pmap, va); - + rv = pmap_enter_locked(pmap, va, m, prot, flags); + if (rv == KERN_SUCCESS) { + /* + * If both the l2b_occupancy and the reservation are fully + * populated, then attempt promotion. + */ + l2b = pmap_get_l2_bucket(pmap, va); + if (l2b != NULL && l2b->l2b_occupancy == L2_PTE_NUM_TOTAL && + sp_enabled && (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) + pmap_promote_section(pmap, va); + } PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); + return (rv); } /* * The pvh global and pmap locks must be held. */ -static void -pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired, int flags) +static int +pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags) { struct l2_bucket *l2b = NULL; struct vm_page *om; @@ -2980,9 +2983,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & VPO_UNMANAGED) != 0 || - vm_page_xbusied(m) || (flags & M_NOWAIT) != 0, - ("pmap_enter_locked: page %p is not busy", m)); + if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) + VM_OBJECT_ASSERT_LOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); } @@ -3003,12 +3005,12 @@ pmap_enter_locked(pmap_t pmap, vm_offset if (prot & VM_PROT_WRITE) nflags |= PVF_WRITE; - if (wired) + if ((flags & PMAP_ENTER_WIRED) != 0) nflags |= PVF_WIRED; PDEBUG(1, printf("pmap_enter: pmap = %08x, va = %08x, m = %08x, " - "prot = %x, wired = %x\n", (uint32_t) pmap, va, (uint32_t) m, - prot, wired)); + "prot = %x, flags = %x\n", (uint32_t) pmap, va, (uint32_t) m, + prot, flags)); if (pmap == pmap_kernel()) { l2b = pmap_get_l2_bucket(pmap, va); @@ -3018,7 +3020,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset do_l2b_alloc: l2b = pmap_alloc_l2_bucket(pmap, va); if (l2b == NULL) { - if (flags & M_WAITOK) { + if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); VM_WAIT; @@ -3026,7 +3028,7 @@ do_l2b_alloc: PMAP_LOCK(pmap); goto do_l2b_alloc; } - return; + return (KERN_RESOURCE_SHORTAGE); } } @@ -3185,6 +3187,7 @@ validate: if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) cpu_icache_sync_range(va, PAGE_SIZE); + return (KERN_SUCCESS); } /* @@ -3206,13 +3209,12 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_offset_t va; vm_page_t m; vm_pindex_t diff, psize; - vm_prot_t access; VM_OBJECT_ASSERT_LOCKED(m_start->object); psize = atop(end - start); m = m_start; - access = prot = prot & (VM_PROT_READ | VM_PROT_EXECUTE); + prot &= VM_PROT_READ | VM_PROT_EXECUTE; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { @@ -3222,8 +3224,8 @@ pmap_enter_object(pmap_t pmap, vm_offset pmap_enter_section(pmap, va, m, prot)) m = &m[L1_S_SIZE / PAGE_SIZE - 1]; else - pmap_enter_locked(pmap, va, access, m, prot, - FALSE, M_NOWAIT); + pmap_enter_locked(pmap, va, m, prot, + PMAP_ENTER_NOSLEEP); m = TAILQ_NEXT(m, listq); } PMAP_UNLOCK(pmap); @@ -3242,12 +3244,11 @@ pmap_enter_object(pmap_t pmap, vm_offset void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_prot_t access; - access = prot = prot & (VM_PROT_READ | VM_PROT_EXECUTE); + prot &= VM_PROT_READ | VM_PROT_EXECUTE; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); - pmap_enter_locked(pmap, va, access, m, prot, FALSE, M_NOWAIT); + pmap_enter_locked(pmap, va, m, prot, PMAP_ENTER_NOSLEEP); PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); } @@ -3499,8 +3500,8 @@ pmap_pinit(pmap_t pmap) pmap->pm_stats.resident_count = 1; if (vector_page < KERNBASE) { pmap_enter(pmap, vector_page, - VM_PROT_READ, PHYS_TO_VM_PAGE(systempage.pv_pa), - VM_PROT_READ, 1); + PHYS_TO_VM_PAGE(systempage.pv_pa), VM_PROT_READ, + PMAP_ENTER_WIRED, 0); } return (1); } Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/arm/arm/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -199,8 +199,8 @@ extern int last_fault_code; static void pmap_free_pv_entry (pv_entry_t); static pv_entry_t pmap_get_pv_entry(void); -static void pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, - vm_prot_t, boolean_t, int); +static int pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, u_int); static vm_paddr_t pmap_extract_locked(pmap_t pmap, vm_offset_t va); static void pmap_fix_cache(struct vm_page *, pmap_t, vm_offset_t); static void pmap_alloc_l1(pmap_t); @@ -3208,24 +3208,26 @@ pmap_protect(pmap_t pm, vm_offset_t sva, * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind __unused) { + int rv; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); - pmap_enter_locked(pmap, va, m, prot, wired, M_WAITOK); + rv = pmap_enter_locked(pmap, va, m, prot, flags); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + return (rv); } /* * The pvh global and pmap locks must be held. */ -static void +static int pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - boolean_t wired, int flags) + u_int flags) { struct l2_bucket *l2b = NULL; struct vm_page *opg; @@ -3241,9 +3243,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & VPO_UNMANAGED) != 0 || - vm_page_xbusied(m) || (flags & M_NOWAIT) != 0, - ("pmap_enter_locked: page %p is not busy", m)); + if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) + VM_OBJECT_ASSERT_LOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); } nflags = 0; @@ -3251,10 +3252,10 @@ pmap_enter_locked(pmap_t pmap, vm_offset nflags |= PVF_WRITE; if (prot & VM_PROT_EXECUTE) nflags |= PVF_EXEC; - if (wired) + if ((flags & PMAP_ENTER_WIRED) != 0) nflags |= PVF_WIRED; PDEBUG(1, printf("pmap_enter: pmap = %08x, va = %08x, m = %08x, prot = %x, " - "wired = %x\n", (uint32_t) pmap, va, (uint32_t) m, prot, wired)); + "flags = %x\n", (uint32_t) pmap, va, (uint32_t) m, prot, flags)); if (pmap == pmap_kernel()) { l2b = pmap_get_l2_bucket(pmap, va); @@ -3264,7 +3265,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset do_l2b_alloc: l2b = pmap_alloc_l2_bucket(pmap, va); if (l2b == NULL) { - if (flags & M_WAITOK) { + if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); VM_WAIT; @@ -3272,7 +3273,7 @@ do_l2b_alloc: PMAP_LOCK(pmap); goto do_l2b_alloc; } - return; + return (KERN_RESOURCE_SHORTAGE); } } @@ -3486,6 +3487,7 @@ do_l2b_alloc: if (m) pmap_fix_cache(m, pmap, va); } + return (KERN_SUCCESS); } /* @@ -3515,7 +3517,7 @@ pmap_enter_object(pmap_t pmap, vm_offset PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pmap, start + ptoa(diff), m, prot & - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); + (VM_PROT_READ | VM_PROT_EXECUTE), PMAP_ENTER_NOSLEEP); m = TAILQ_NEXT(m, listq); } rw_wunlock(&pvh_global_lock); @@ -3538,7 +3540,7 @@ pmap_enter_quick(pmap_t pmap, vm_offset_ rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), - FALSE, M_NOWAIT); + PMAP_ENTER_NOSLEEP); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3769,9 +3771,8 @@ pmap_pinit(pmap_t pmap) bzero(&pmap->pm_stats, sizeof pmap->pm_stats); pmap->pm_stats.resident_count = 1; if (vector_page < KERNBASE) { - pmap_enter(pmap, vector_page, - VM_PROT_READ, PHYS_TO_VM_PAGE(systempage.pv_pa), - VM_PROT_READ, 1); + pmap_enter(pmap, vector_page, PHYS_TO_VM_PAGE(systempage.pv_pa), + VM_PROT_READ, PMAP_ENTER_WIRED | VM_PROT_READ, 0); } return (1); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/i386/i386/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -3458,9 +3458,9 @@ setpte: * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind) { pd_entry_t *pde; pt_entry_t *pte; @@ -3468,17 +3468,19 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv_entry_t pv; vm_paddr_t opa, pa; vm_page_t mpte, om; - boolean_t invlva; + boolean_t invlva, nosleep, wired; va = trunc_page(va); + mpte = NULL; + wired = (flags & PMAP_ENTER_WIRED) != 0; + nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; + KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) - VM_OBJECT_ASSERT_WLOCKED(m->object); - - mpte = NULL; + VM_OBJECT_ASSERT_LOCKED(m->object); rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); @@ -3489,7 +3491,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * resident, we are creating it here. */ if (va < VM_MAXUSER_ADDRESS) { - mpte = pmap_allocpte(pmap, va, M_WAITOK); + mpte = pmap_allocpte(pmap, va, nosleep ? M_NOWAIT : M_WAITOK); + if (mpte == NULL) { + KASSERT(nosleep, + ("pmap_allocpte failed with sleep allowed")); + sched_unpin(); + rw_wunlock(&pvh_global_lock); + PMAP_UNLOCK(pmap); + return (KERN_RESOURCE_SHORTAGE); + } } pde = pmap_pde(pmap, va); @@ -3607,7 +3617,7 @@ validate: */ if ((origpte & ~(PG_M|PG_A)) != newpte) { newpte |= PG_A; - if ((access & VM_PROT_WRITE) != 0) + if ((flags & VM_PROT_WRITE) != 0) newpte |= PG_M; if (origpte & PG_V) { invlva = FALSE; @@ -3652,6 +3662,7 @@ validate: sched_unpin(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); } /* Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/i386/xen/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -298,9 +298,9 @@ static void pmap_remove_entry(struct pma static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags); -static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags); static void _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free); static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); @@ -1546,21 +1546,17 @@ pmap_pinit(pmap_t pmap) * mapped correctly. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, u_int ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags) { vm_paddr_t ptema; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Allocate a page table page. */ if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { - if (flags & M_WAITOK) { + if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); VM_WAIT; @@ -1595,16 +1591,12 @@ _pmap_allocpte(pmap_t pmap, u_int ptepin } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags) { u_int ptepindex; pd_entry_t ptema; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Calculate pagetable page index */ @@ -1644,7 +1636,7 @@ retry: CTR3(KTR_PMAP, "pmap_allocpte: pmap=%p va=0x%08x flags=0x%x", pmap, va, flags); m = _pmap_allocpte(pmap, ptepindex, flags); - if (m == NULL && (flags & M_WAITOK)) + if (m == NULL && (flags & PMAP_ENTER_NOSLEEP) == 0) goto retry; KASSERT(pmap->pm_pdir[ptepindex], ("ptepindex=%d did not get mapped", ptepindex)); @@ -2643,9 +2635,9 @@ retry: * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind __unused) { pd_entry_t *pde; pt_entry_t *pte; @@ -2653,19 +2645,21 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv_entry_t pv; vm_paddr_t opa, pa; vm_page_t mpte, om; - boolean_t invlva; + boolean_t invlva, wired; - CTR6(KTR_PMAP, "pmap_enter: pmap=%08p va=0x%08x access=0x%x ma=0x%08x prot=0x%x wired=%d", - pmap, va, access, VM_PAGE_TO_MACH(m), prot, wired); + CTR5(KTR_PMAP, + "pmap_enter: pmap=%08p va=0x%08x ma=0x%08x prot=0x%x flags=0x%x", + pmap, va, VM_PAGE_TO_MACH(m), prot, flags); va = trunc_page(va); KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); mpte = NULL; + wired = (flags & PMAP_ENTER_WIRED) != 0; rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); @@ -2676,7 +2670,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * resident, we are creating it here. */ if (va < VM_MAXUSER_ADDRESS) { - mpte = pmap_allocpte(pmap, va, M_WAITOK); + mpte = pmap_allocpte(pmap, va, flags); + if (mpte == NULL) { + KASSERT((flags & PMAP_ENTER_NOSLEEP) != 0, + ("pmap_allocpte failed with sleep allowed")); + sched_unpin(); + rw_wunlock(&pvh_global_lock); + PMAP_UNLOCK(pmap); + return (KERN_RESOURCE_SHORTAGE); + } } pde = pmap_pde(pmap, va); @@ -2842,6 +2844,7 @@ validate: sched_unpin(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); } /* @@ -2996,7 +2999,7 @@ pmap_enter_quick_locked(multicall_entry_ mpte->wire_count++; } else { mpte = _pmap_allocpte(pmap, ptepindex, - M_NOWAIT); + PMAP_ENTER_NOSLEEP); if (mpte == NULL) return (mpte); } @@ -3305,7 +3308,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm */ if ((ptetemp & PG_MANAGED) != 0) { dstmpte = pmap_allocpte(dst_pmap, addr, - M_NOWAIT); + PMAP_ENTER_NOSLEEP); if (dstmpte == NULL) goto out; dst_pte = pmap_pte_quick(dst_pmap, addr); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/mips/mips/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -177,8 +177,8 @@ static void pmap_invalidate_all(pmap_t p static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va); static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m); -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); -static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags); +static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int flags); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t); static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot); @@ -1094,20 +1094,16 @@ pmap_pinit(pmap_t pmap) * mapped correctly. */ static vm_page_t -_pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags) +_pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int flags) { vm_offset_t pageva; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Find or fabricate a new pagetable page */ if ((m = pmap_alloc_direct_page(ptepindex, VM_ALLOC_NORMAL)) == NULL) { - if (flags & M_WAITOK) { + if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); pmap_grow_direct_page_cache(); @@ -1164,16 +1160,12 @@ _pmap_allocpte(pmap_t pmap, unsigned pte } static vm_page_t -pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +pmap_allocpte(pmap_t pmap, vm_offset_t va, u_int flags) { unsigned ptepindex; pd_entry_t *pde; vm_page_t m; - KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT || - (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, - ("pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); - /* * Calculate pagetable page index */ @@ -1197,7 +1189,7 @@ retry: * deallocated. */ m = _pmap_allocpte(pmap, ptepindex, flags); - if (m == NULL && (flags & M_WAITOK)) + if (m == NULL && (flags & PMAP_ENTER_NOSLEEP) == 0) goto retry; } return (m); @@ -1994,9 +1986,9 @@ pmap_protect(pmap_t pmap, vm_offset_t sv * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ -void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, - vm_prot_t prot, boolean_t wired) +int +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + u_int flags, int8_t psind __unused) { vm_paddr_t pa, opa; pt_entry_t *pte; @@ -2009,11 +2001,11 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT((m->oflags & VPO_UNMANAGED) != 0 || va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - KASSERT((m->oflags & VPO_UNMANAGED) != 0 || vm_page_xbusied(m), - ("pmap_enter: page %p is not busy", m)); + if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) + VM_OBJECT_ASSERT_LOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); - newpte = TLBLO_PA_TO_PFN(pa) | init_pte_prot(m, access, prot); - if (wired) + newpte = TLBLO_PA_TO_PFN(pa) | init_pte_prot(m, flags, prot); + if ((flags & PMAP_ENTER_WIRED) != 0) newpte |= PTE_W; if (is_kernel_pmap(pmap)) newpte |= PTE_G; @@ -2032,7 +2024,14 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * creating it here. */ if (va < VM_MAXUSER_ADDRESS) { - mpte = pmap_allocpte(pmap, va, M_WAITOK); + mpte = pmap_allocpte(pmap, va, flags); + if (mpte == NULL) { + KASSERT((flags & PMAP_ENTER_NOSLEEP) != 0, + ("pmap_allocpte failed with sleep allowed")); + rw_wunlock(&pvh_global_lock); + PMAP_UNLOCK(pmap); + return (KERN_RESOURCE_SHORTAGE); + } } pte = pmap_pte(pmap, va); @@ -2057,9 +2056,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * are valid mappings in them. Hence, if a user page is * wired, the PT page will be also. */ - if (wired && !pte_test(&origpte, PTE_W)) + if (pte_test(&newpte, PTE_W) && !pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count++; - else if (!wired && pte_test(&origpte, PTE_W)) + else if (!pte_test(&newpte, PTE_W) && pte_test(&origpte, + PTE_W)) pmap->pm_stats.wired_count--; KASSERT(!pte_test(&origpte, PTE_D | PTE_RO), @@ -2123,7 +2123,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Increment counters */ - if (wired) + if (pte_test(&newpte, PTE_W)) pmap->pm_stats.wired_count++; validate: @@ -2170,6 +2170,7 @@ validate: } rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + return (KERN_SUCCESS); } /* @@ -2235,7 +2236,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ mpte->wire_count++; } else { mpte = _pmap_allocpte(pmap, ptepindex, - M_NOWAIT); + PMAP_ENTER_NOSLEEP); if (mpte == NULL) return (mpte); } Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/powerpc/aim/mmu_oea.c Fri Aug 8 17:12:03 2014 (r269728) @@ -258,8 +258,8 @@ static struct pte *moea_pvo_to_pte(const /* * Utility routines. */ -static void moea_enter_locked(pmap_t, vm_offset_t, vm_page_t, - vm_prot_t, boolean_t); +static int moea_enter_locked(pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, u_int, int8_t); static void moea_syncicache(vm_offset_t, vm_size_t); static boolean_t moea_query_bit(vm_page_t, int); static u_int moea_clear_bit(vm_page_t, int); @@ -273,7 +273,8 @@ void moea_clear_modify(mmu_t, vm_page_t) void moea_copy_page(mmu_t, vm_page_t, vm_page_t); void moea_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, vm_page_t *mb, vm_offset_t b_offset, int xfersize); -void moea_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); +int moea_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, u_int, + int8_t); void moea_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, vm_prot_t); void moea_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); @@ -1100,16 +1101,25 @@ moea_zero_page_idle(mmu_t mmu, vm_page_t * target pmap with the protection requested. If specified the page * will be wired down. */ -void +int moea_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - boolean_t wired) + u_int flags, int8_t psind) { + int error; - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap); - moea_enter_locked(pmap, va, m, prot, wired); - rw_wunlock(&pvh_global_lock); - PMAP_UNLOCK(pmap); + for (;;) { + rw_wlock(&pvh_global_lock); + PMAP_LOCK(pmap); + error = moea_enter_locked(pmap, va, m, prot, flags, psind); + rw_wunlock(&pvh_global_lock); + PMAP_UNLOCK(pmap); + if (error != ENOMEM) + return (KERN_SUCCESS); + if ((flags & PMAP_ENTER_NOSLEEP) != 0) + return (KERN_RESOURCE_SHORTAGE); + VM_OBJECT_ASSERT_UNLOCKED(m->object); + VM_WAIT; + } } /* @@ -1119,9 +1129,9 @@ moea_enter(mmu_t mmu, pmap_t pmap, vm_of * * The global pvh and pmap must be locked. */ -static void +static int moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - boolean_t wired) + u_int flags, int8_t psind __unused) { struct pvo_head *pvo_head; uma_zone_t zone; @@ -1154,7 +1164,7 @@ moea_enter_locked(pmap_t pmap, vm_offset } else pte_lo |= PTE_BR; - if (wired) + if ((flags & PMAP_ENTER_WIRED) != 0) pvo_flags |= PVO_WIRED; error = moea_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), @@ -1169,6 +1179,8 @@ moea_enter_locked(pmap_t pmap, vm_offset if (pmap != kernel_pmap && error == ENOENT && (pte_lo & (PTE_I | PTE_G)) == 0) moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE); + + return (error); } /* @@ -1198,7 +1210,7 @@ moea_enter_object(mmu_t mmu, pmap_t pm, PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea_enter_locked(pm, start + ptoa(diff), m, prot & - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + (VM_PROT_READ | VM_PROT_EXECUTE), 0, 0); m = TAILQ_NEXT(m, listq); } rw_wunlock(&pvh_global_lock); @@ -1213,7 +1225,7 @@ moea_enter_quick(mmu_t mmu, pmap_t pm, v rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); moea_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), - FALSE); + 0, 0); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Aug 8 17:12:03 2014 (r269728) @@ -267,7 +267,7 @@ int moea64_large_page_shift = 0; * PVO calls. */ static int moea64_pvo_enter(mmu_t, pmap_t, uma_zone_t, struct pvo_head *, - vm_offset_t, vm_offset_t, uint64_t, int); + vm_offset_t, vm_offset_t, uint64_t, int, int8_t); static void moea64_pvo_remove(mmu_t, struct pvo_entry *); static struct pvo_entry *moea64_pvo_find_va(pmap_t, vm_offset_t); @@ -287,7 +287,8 @@ void moea64_clear_modify(mmu_t, vm_page_ void moea64_copy_page(mmu_t, vm_page_t, vm_page_t); void moea64_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, vm_page_t *mb, vm_offset_t b_offset, int xfersize); -void moea64_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); +int moea64_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, + u_int flags, int8_t psind); void moea64_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, vm_prot_t); void moea64_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); @@ -627,7 +628,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_o moea64_pvo_enter(mmup, kernel_pmap, moea64_upvo_zone, NULL, pa, pa, pte_lo, - PVO_WIRED | PVO_LARGE); + PVO_WIRED | PVO_LARGE, 0); } } PMAP_UNLOCK(kernel_pmap); @@ -1228,9 +1229,9 @@ moea64_zero_page_idle(mmu_t mmu, vm_page * will be wired down. */ -void +int moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_prot_t prot, boolean_t wired) + vm_prot_t prot, u_int flags, int8_t psind) { struct pvo_head *pvo_head; uma_zone_t zone; @@ -1264,15 +1265,23 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ if ((prot & VM_PROT_EXECUTE) == 0) pte_lo |= LPTE_NOEXEC; - if (wired) + if ((flags & PMAP_ENTER_WIRED) != 0) pvo_flags |= PVO_WIRED; - LOCK_TABLE_WR(); - PMAP_LOCK(pmap); - error = moea64_pvo_enter(mmu, pmap, zone, pvo_head, va, - VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); - PMAP_UNLOCK(pmap); - UNLOCK_TABLE_WR(); + for (;;) { + LOCK_TABLE_WR(); + PMAP_LOCK(pmap); + error = moea64_pvo_enter(mmu, pmap, zone, pvo_head, va, + VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags, psind); + PMAP_UNLOCK(pmap); + UNLOCK_TABLE_WR(); + if (error != ENOMEM) + break; + if ((flags & PMAP_ENTER_NOSLEEP) != 0) + return (KERN_RESOURCE_SHORTAGE); + VM_OBJECT_ASSERT_UNLOCKED(m->object); + VM_WAIT; + } /* * Flush the page from the instruction cache if this page is @@ -1283,6 +1292,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ vm_page_aflag_set(m, PGA_EXECUTABLE); moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); } + return (KERN_SUCCESS); } static void @@ -1347,7 +1357,7 @@ moea64_enter_object(mmu_t mmu, pmap_t pm m = m_start; while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea64_enter(mmu, pm, start + ptoa(diff), m, prot & - (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + (VM_PROT_READ | VM_PROT_EXECUTE), PMAP_ENTER_NOSLEEP, 0); m = TAILQ_NEXT(m, listq); } } @@ -1357,8 +1367,8 @@ moea64_enter_quick(mmu_t mmu, pmap_t pm, vm_prot_t prot) { - moea64_enter(mmu, pm, va, m, - prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + moea64_enter(mmu, pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), + PMAP_ENTER_NOSLEEP, 0); } vm_paddr_t @@ -1446,7 +1456,8 @@ moea64_uma_page_alloc(uma_zone_t zone, i PMAP_LOCK(kernel_pmap); moea64_pvo_enter(installed_mmu, kernel_pmap, moea64_upvo_zone, - NULL, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); + NULL, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP, + 0); if (needed_lock) PMAP_UNLOCK(kernel_pmap); @@ -1668,7 +1679,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ LOCK_TABLE_WR(); PMAP_LOCK(kernel_pmap); error = moea64_pvo_enter(mmu, kernel_pmap, moea64_upvo_zone, - NULL, va, pa, pte_lo, PVO_WIRED); + NULL, va, pa, pte_lo, PVO_WIRED, 0); PMAP_UNLOCK(kernel_pmap); UNLOCK_TABLE_WR(); @@ -2166,7 +2177,7 @@ moea64_bootstrap_alloc(vm_size_t size, u static int moea64_pvo_enter(mmu_t mmu, pmap_t pm, uma_zone_t zone, struct pvo_head *pvo_head, vm_offset_t va, vm_offset_t pa, - uint64_t pte_lo, int flags) + uint64_t pte_lo, int flags, int8_t psind __unused) { struct pvo_entry *pvo; uintptr_t pt; Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Aug 8 16:32:06 2014 (r269727) +++ head/sys/powerpc/booke/pmap.c Fri Aug 8 17:12:03 2014 (r269728) @@ -146,8 +146,8 @@ static struct mtx copy_page_mutex; /* PMAP */ /**************************************************************************/ -static void mmu_booke_enter_locked(mmu_t, pmap_t, vm_offset_t, vm_page_t, - vm_prot_t, boolean_t); +static int mmu_booke_enter_locked(mmu_t, pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, u_int flags, int8_t psind); unsigned int kptbl_min; /* Index of the first kernel ptbl. */ unsigned int kernel_ptbls; /* Number of KVA ptbls. */ @@ -228,14 +228,14 @@ static struct ptbl_buf *ptbl_buf_alloc(v static void ptbl_buf_free(struct ptbl_buf *); static void ptbl_free_pmap_ptbl(pmap_t, pte_t *); -static pte_t *ptbl_alloc(mmu_t, pmap_t, unsigned int); +static pte_t *ptbl_alloc(mmu_t, pmap_t, unsigned int, boolean_t); static void ptbl_free(mmu_t, pmap_t, unsigned int); static void ptbl_hold(mmu_t, pmap_t, unsigned int); static int ptbl_unhold(mmu_t, pmap_t, unsigned int); static vm_paddr_t pte_vatopa(mmu_t, pmap_t, vm_offset_t); static pte_t *pte_find(mmu_t, pmap_t, vm_offset_t); -static void pte_enter(mmu_t, pmap_t, vm_page_t, vm_offset_t, uint32_t); +static int pte_enter(mmu_t, pmap_t, vm_page_t, vm_offset_t, uint32_t, boolean_t); static int pte_remove(mmu_t, pmap_t, vm_offset_t, uint8_t); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 17:29:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63270C18 for ; Fri, 8 Aug 2014 17:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44F53209A for ; Fri, 8 Aug 2014 17:29:02 +0000 (UTC) Received: from dumbbell (uid 1042) (envelope-from dumbbell@FreeBSD.org) id 23d7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 17:29:01 +0000 From: Jean-Sebastien Pedron Date: Fri, 8 Aug 2014 17:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269729 - in head/usr.bin/sed: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e508dd.23d7.7477a7f9@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 17:29:02 -0000 Author: dumbbell Date: Fri Aug 8 17:29:01 2014 New Revision: 269729 URL: http://svnweb.freebsd.org/changeset/base/269729 Log: sed(1): Don't force a newline on last line, if input stream doesn't have one While here, change how we check if the current line is the last one. Before, we just checked if there were more files after the current one. Now, we check the actual content of those files: they files may not have a line at all. This matches the definition of the "last line" by the Open Group. The new behavior is closer to GNU sed. PR: 160745 Phabric: https://phabric.freebsd.org/D431 Reviewed by: jilles Approved by: jilles Exp-run by: antoine Modified: head/usr.bin/sed/defs.h head/usr.bin/sed/main.c head/usr.bin/sed/process.c head/usr.bin/sed/tests/regress.y.out Modified: head/usr.bin/sed/defs.h ============================================================================== --- head/usr.bin/sed/defs.h Fri Aug 8 17:12:03 2014 (r269728) +++ head/usr.bin/sed/defs.h Fri Aug 8 17:29:01 2014 (r269729) @@ -143,6 +143,7 @@ typedef struct { char *space; /* Current space pointer. */ size_t len; /* Current length. */ int deleted; /* If deleted. */ + int append_newline; /* If originally terminated by \n. */ char *back; /* Backing memory. */ size_t blen; /* Backing memory length. */ } SPACE; Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Fri Aug 8 17:12:03 2014 (r269728) +++ head/usr.bin/sed/main.c Fri Aug 8 17:29:01 2014 (r269729) @@ -439,8 +439,14 @@ mf_fgets(SPACE *sp, enum e_spflag spflag len = getline(&p, &plen, infile); if (len == -1) err(1, "%s", fname); - if (len != 0 && p[len - 1] == '\n') + if (len != 0 && p[len - 1] == '\n') { + sp->append_newline = 1; len--; + } else if (!lastline()) { + sp->append_newline = 1; + } else { + sp->append_newline = 0; + } cspace(sp, p, len, spflag); linenum++; @@ -481,15 +487,49 @@ add_file(char *s) fl_nextp = &fp->next; } +static int +next_files_have_lines() +{ + struct s_flist *file; + FILE *file_fd; + int ch; + + file = files; + while ((file = file->next) != NULL) { + if ((file_fd = fopen(file->fname, "r")) == NULL) + continue; + + if ((ch = getc(file_fd)) != EOF) { + /* + * This next file has content, therefore current + * file doesn't contains the last line. + */ + ungetc(ch, file_fd); + fclose(file_fd); + return (1); + } + + fclose(file_fd); + } + + return (0); +} + int lastline(void) { int ch; - if (files->next != NULL && (inplace == NULL || ispan)) - return (0); - if ((ch = getc(infile)) == EOF) - return (1); + if (feof(infile)) { + return !( + (inplace == NULL || ispan) && + next_files_have_lines()); + } + if ((ch = getc(infile)) == EOF) { + return !( + (inplace == NULL || ispan) && + next_files_have_lines()); + } ungetc(ch, infile); return (0); } Modified: head/usr.bin/sed/process.c ============================================================================== --- head/usr.bin/sed/process.c Fri Aug 8 17:12:03 2014 (r269728) +++ head/usr.bin/sed/process.c Fri Aug 8 17:29:01 2014 (r269729) @@ -63,6 +63,7 @@ static SPACE HS, PS, SS, YS; #define pd PS.deleted #define ps PS.space #define psl PS.len +#define psanl PS.append_newline #define hs HS.space #define hsl HS.len @@ -85,7 +86,10 @@ static regex_t *defpreg; size_t maxnsub; regmatch_t *match; -#define OUT() do {fwrite(ps, 1, psl, outfile); fputc('\n', outfile);} while (0) +#define OUT() do { \ + fwrite(ps, 1, psl, outfile); \ + if (psanl) fputc('\n', outfile); \ +} while (0) void process(void) @@ -94,6 +98,7 @@ process(void) SPACE tspace; size_t oldpsl = 0; char *p; + int oldpsanl; p = NULL; @@ -190,11 +195,15 @@ redirect: break; if ((p = memchr(ps, '\n', psl)) != NULL) { oldpsl = psl; + oldpsanl = psanl; psl = p - ps; + psanl = 1; } OUT(); - if (p != NULL) + if (p != NULL) { psl = oldpsl; + psanl = oldpsanl; + } break; case 'q': if (!nflag && !pd) @@ -244,6 +253,7 @@ redirect: cspace(&HS, "", 0, REPLACE); tspace = PS; PS = HS; + psanl = tspace.append_newline; HS = tspace; break; case 'y': @@ -452,6 +462,7 @@ substitute(struct s_command *cp) */ tspace = PS; PS = SS; + psanl = tspace.append_newline; SS = tspace; SS.space = SS.back; @@ -521,6 +532,7 @@ do_tr(struct s_tr *y) /* Swap the translation space and the pattern space. */ tmp = PS; PS = YS; + psanl = tmp.append_newline; YS = tmp; YS.space = YS.back; } Modified: head/usr.bin/sed/tests/regress.y.out ============================================================================== --- head/usr.bin/sed/tests/regress.y.out Fri Aug 8 17:12:03 2014 (r269728) +++ head/usr.bin/sed/tests/regress.y.out Fri Aug 8 17:29:01 2014 (r269729) @@ -1 +1 @@ -fOO +fOO \ No newline at end of file From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 18:00:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF266463 for ; Fri, 8 Aug 2014 18:00:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94A33251D for ; Fri, 8 Aug 2014 18:00:23 +0000 (UTC) Received: from sbruno (uid 1179) (envelope-from sbruno@FreeBSD.org) id 2062 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 18:00:23 +0000 From: Sean Bruno Date: Fri, 8 Aug 2014 18:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269730 - head/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e51037.2062.1b8ae85a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 18:00:23 -0000 Author: sbruno Date: Fri Aug 8 18:00:23 2014 New Revision: 269730 URL: http://svnweb.freebsd.org/changeset/base/269730 Log: Quiesce a printf warning from clang, %ul -> %lu Phabric: https://phabric.freebsd.org/D472 Reviewed by: mahrens delphij Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Aug 8 17:29:01 2014 (r269729) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Aug 8 18:00:23 2014 (r269730) @@ -687,7 +687,7 @@ __dprintf(const char *file, const char * if (dprintf_find_string("pid")) (void) printf("%d ", getpid()); if (dprintf_find_string("tid")) - (void) printf("%ul ", thr_self()); + (void) printf("%lu ", thr_self()); #if 0 if (dprintf_find_string("cpu")) (void) printf("%u ", getcpuid()); From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 18:36:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A636944A for ; Fri, 8 Aug 2014 18:36:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EC722918 for ; Fri, 8 Aug 2014 18:36:54 +0000 (UTC) Received: from np (uid 1205) (envelope-from np@FreeBSD.org) id 2089 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 18:36:54 +0000 From: Navdeep Parhar Date: Fri, 8 Aug 2014 18:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269731 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e518c6.2089.4cdf9952@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 18:36:54 -0000 Author: np Date: Fri Aug 8 18:36:53 2014 New Revision: 269731 URL: http://svnweb.freebsd.org/changeset/base/269731 Log: cxgbe(4): Do not poke T4-only registers on a T5 (and vice versa). Obtained from: Chelsio Communications MFC after: 1 week Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 8 18:00:23 2014 (r269730) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 8 18:36:53 2014 (r269731) @@ -2077,15 +2077,18 @@ static void pcie_intr_handler(struct ada int fat; - fat = t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - sysbus_intr_info) + - t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, - pcie_port_intr_info) + - t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, - is_t4(adapter) ? - pcie_intr_info : t5_pcie_intr_info); + if (is_t4(adapter)) + fat = t4_handle_intr_status(adapter, + A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, + sysbus_intr_info) + + t4_handle_intr_status(adapter, + A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, + pcie_port_intr_info) + + t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, + pcie_intr_info); + else + fat = t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, + t5_pcie_intr_info); if (fat) t4_fatal_err(adapter); } @@ -2466,9 +2469,15 @@ static void ma_intr_handler(struct adapt { u32 v, status = t4_read_reg(adapter, A_MA_INT_CAUSE); - if (status & F_MEM_PERR_INT_CAUSE) + if (status & F_MEM_PERR_INT_CAUSE) { CH_ALERT(adapter, "MA parity error, parity status %#x\n", - t4_read_reg(adapter, A_MA_PARITY_ERROR_STATUS)); + t4_read_reg(adapter, A_MA_PARITY_ERROR_STATUS1)); + if (is_t5(adapter)) + CH_ALERT(adapter, + "MA parity error, parity status %#x\n", + t4_read_reg(adapter, + A_MA_PARITY_ERROR_STATUS2)); + } if (status & F_MEM_WRAP_INT_CAUSE) { v = t4_read_reg(adapter, A_MA_INT_WRAP_STATUS); CH_ALERT(adapter, "MA address wrap-around error by client %u to" @@ -2685,10 +2694,8 @@ void t4_intr_clear(struct adapter *adapt { static const unsigned int cause_reg[] = { A_SGE_INT_CAUSE1, A_SGE_INT_CAUSE2, A_SGE_INT_CAUSE3, - A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_NONFAT_ERR, A_PCIE_INT_CAUSE, - A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS, A_MA_INT_CAUSE, + A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS1, A_MA_INT_CAUSE, A_EDC_INT_CAUSE, EDC_REG(A_EDC_INT_CAUSE, 1), A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, MYPF_REG(A_CIM_PF_HOST_INT_CAUSE), @@ -2710,6 +2717,14 @@ void t4_intr_clear(struct adapter *adapt t4_write_reg(adapter, is_t4(adapter) ? A_MC_INT_CAUSE : A_MC_P_INT_CAUSE, 0xffffffff); + if (is_t4(adapter)) { + t4_write_reg(adapter, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, + 0xffffffff); + t4_write_reg(adapter, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, + 0xffffffff); + } else + t4_write_reg(adapter, A_MA_PARITY_ERROR_STATUS2, 0xffffffff); + t4_write_reg(adapter, A_PL_INT_CAUSE, GLBL_INTR_MASK); (void) t4_read_reg(adapter, A_PL_INT_CAUSE); /* flush */ } From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 21:27:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91016BF5 for ; Fri, 8 Aug 2014 21:27:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62AC52EF6 for ; Fri, 8 Aug 2014 21:27:33 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 2ba5 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 21:27:33 +0000 From: Dimitry Andric Date: Fri, 8 Aug 2014 21:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269740 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e540c5.2ba5.21a63362@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 21:27:33 -0000 Author: dim Date: Fri Aug 8 21:27:33 2014 New Revision: 269740 URL: http://svnweb.freebsd.org/changeset/base/269740 Log: Pull in r214736 from upstream libc++ trunk (by Marshall Clow): Fix PR#20520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm This fixes an issue where std::list<>::remove_if() and remove() could erroneously visit elements twice. Reported by: Dominic Fandrey PR: 192303 MFC after: 3 days Modified: head/contrib/libc++/include/list Modified: head/contrib/libc++/include/list ============================================================================== --- head/contrib/libc++/include/list Fri Aug 8 21:09:22 2014 (r269739) +++ head/contrib/libc++/include/list Fri Aug 8 21:27:33 2014 (r269740) @@ -2046,6 +2046,8 @@ list<_Tp, _Alloc>::remove(const value_ty for (; __j != __e && *__j == __x; ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; @@ -2065,6 +2067,8 @@ list<_Tp, _Alloc>::remove_if(_Pred __pre for (; __j != __e && __pred(*__j); ++__j) ; __i = erase(__i, __j); + if (__i != __e) + __i = _VSTD::next(__i); } else ++__i; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 21:47:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C32A0293 for ; Fri, 8 Aug 2014 21:47:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9333E21D8 for ; Fri, 8 Aug 2014 21:47:47 +0000 (UTC) Received: from sbruno (uid 1179) (envelope-from sbruno@FreeBSD.org) id 2353 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 21:47:47 +0000 From: Sean Bruno Date: Fri, 8 Aug 2014 21:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269741 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e54583.2353.2c317825@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 21:47:47 -0000 Author: sbruno Date: Fri Aug 8 21:47:47 2014 New Revision: 269741 URL: http://svnweb.freebsd.org/changeset/base/269741 Log: Quiesce warning about discarding a const qualifier in assignement. Phabric: https://phabric.freebsd.org/D445 Reviewed by: neel Modified: head/sys/boot/userboot/userboot/devicename.c Modified: head/sys/boot/userboot/userboot/devicename.c ============================================================================== --- head/sys/boot/userboot/userboot/devicename.c Fri Aug 8 21:27:33 2014 (r269740) +++ head/sys/boot/userboot/userboot/devicename.c Fri Aug 8 21:47:47 2014 (r269741) @@ -91,7 +91,7 @@ userboot_parsedev(struct disk_devdesc ** struct disk_devdesc *idev; struct devsw *dv; int i, unit, err; - char *cp; + const char *cp; const char *np; /* minimum length check */ @@ -126,7 +126,7 @@ userboot_parsedev(struct disk_devdesc ** unit = 0; if (*np && (*np != ':')) { - unit = strtol(np, &cp, 0); /* get unit number if present */ + unit = strtol(np, (char **)&cp, 0); /* get unit number if present */ if (cp == np) { err = EUNIT; goto fail; From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 22:30:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FEA4AFA for ; Fri, 8 Aug 2014 22:30:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD982740 for ; Fri, 8 Aug 2014 22:30:42 +0000 (UTC) Received: from wblock (uid 1265) (envelope-from wblock@FreeBSD.org) id 239a by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 22:30:42 +0000 From: Warren Block Date: Fri, 8 Aug 2014 22:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269743 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e54f92.239a.3d3730af@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 22:30:42 -0000 Author: wblock (doc committer) Date: Fri Aug 8 22:30:41 2014 New Revision: 269743 URL: http://svnweb.freebsd.org/changeset/base/269743 Log: Update the comments in exec.h with help from jilles. PR: 180970 Submitted by: Carlos Jacobo Puga Medina Reviewed by: jilles MFC after: 1 week Modified: head/sys/sys/exec.h Modified: head/sys/sys/exec.h ============================================================================== --- head/sys/sys/exec.h Fri Aug 8 22:08:51 2014 (r269742) +++ head/sys/sys/exec.h Fri Aug 8 22:30:41 2014 (r269743) @@ -39,12 +39,17 @@ #define _SYS_EXEC_H_ /* - * The following structure is found at the top of the user stack of each - * user process. The ps program uses it to locate argv and environment - * strings. Programs that wish ps to display other information may modify - * it; normally ps_argvstr points to the argv vector, and ps_nargvstr - * is the same as the program's argc. The fields ps_envstr and ps_nenvstr - * are the equivalent for the environment. + * Before ps_args existed, the following structure, found at the top of + * the user stack of each user process, was used by ps(1) to locate + * environment and argv strings. Normally ps_argvstr points to the + * argv vector, and ps_nargvstr is the same as the program's argc. The + * fields ps_envstr and ps_nenvstr are the equivalent for the environment. + * + * Programs should now use setproctitle(3) to change ps output. + * setproctitle() always informs the kernel with sysctl and sets the + * pointers in ps_strings. The kern.proc.args sysctl first tries p_args. + * If p_args is NULL, it then falls back to reading ps_strings and following + * the pointers. */ struct ps_strings { char **ps_argvstr; /* first of 0 or more argument strings */ @@ -55,6 +60,7 @@ struct ps_strings { /* * Address of ps_strings structure (in user space). + * Prefer the kern.ps_strings or kern.proc.ps_strings sysctls to this constant. */ #define PS_STRINGS (USRSTACK - sizeof(struct ps_strings)) #define SPARE_USRSPACE 4096 From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 23:55:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97758A6D for ; Fri, 8 Aug 2014 23:55:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F14A2EE5 for ; Fri, 8 Aug 2014 23:55:22 +0000 (UTC) Received: from rpaulo (uid 1145) (envelope-from rpaulo@FreeBSD.org) id 29fa by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 23:55:22 +0000 From: Rui Paulo Date: Fri, 8 Aug 2014 23:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269744 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e5636a.29fa.ce25b61@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 23:55:22 -0000 Author: rpaulo Date: Fri Aug 8 23:55:22 2014 New Revision: 269744 URL: http://svnweb.freebsd.org/changeset/base/269744 Log: Run dtrace in 32-bit mode when compiling 32-bit libraries. MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 8 22:30:41 2014 (r269743) +++ head/Makefile.inc1 Fri Aug 8 23:55:22 2014 (r269744) @@ -395,7 +395,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR PATH=${TMPPATH} \ LIBDIR=/usr/lib32 \ SHLIBDIR=/usr/lib32 \ - LIBPRIVATEDIR=/usr/lib32/private + LIBPRIVATEDIR=/usr/lib32/private \ + DTRACE="${DTRACE} -32" LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ DESTDIR=${LIB32TMP} \ From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 01:16:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704CA3C3; Sat, 9 Aug 2014 01:16:01 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 32C8F2667; Sat, 9 Aug 2014 01:16:00 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 41ED4782531; Sat, 9 Aug 2014 10:52:46 +1000 (EST) Date: Sat, 9 Aug 2014 10:52:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Bruno Subject: Re: svn commit: r269741 - head/sys/boot/userboot/userboot In-Reply-To: <53e54583.2353.2c317825@svn.freebsd.org> Message-ID: <20140809101837.O1460@besplex.bde.org> References: <53e54583.2353.2c317825@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=41dIonQiZJoA:10 a=r3wscOWN9QkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=2WM0o05XAXqP8Rit2SYA:9 a=jR_EQs_rrjgG2URe:21 a=gn4EcROLcvGEgZUk:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 01:16:01 -0000 On Fri, 8 Aug 2014, Sean Bruno wrote: > Log: > Quiesce warning about discarding a const qualifier in assignement. This replaces an error by another error. (Non-C compilers like clang and gcc give only a warning for the first error and not even a warning for the second error when it is quiesced.) > Modified: head/sys/boot/userboot/userboot/devicename.c > ============================================================================== > --- head/sys/boot/userboot/userboot/devicename.c Fri Aug 8 21:27:33 2014 (r269740) > +++ head/sys/boot/userboot/userboot/devicename.c Fri Aug 8 21:47:47 2014 (r269741) > @@ -91,7 +91,7 @@ userboot_parsedev(struct disk_devdesc ** > struct disk_devdesc *idev; > struct devsw *dv; > int i, unit, err; > - char *cp; > + const char *cp; > const char *np; > > /* minimum length check */ This code also has bad style, with unsorted declarations and indentation in all the wrong places. Local declarations are not indented in KNF, but are excessively indented here. Statements are Indented by 1 tab in KNF, but by only 4 spaces here. > @@ -126,7 +126,7 @@ userboot_parsedev(struct disk_devdesc ** > unit = 0; > > if (*np && (*np != ':')) { > - unit = strtol(np, &cp, 0); /* get unit number if present */ > + unit = strtol(np, (char **)&cp, 0); /* get unit number if present */ > if (cp == np) { > err = EUNIT; > goto fail; A C compiler (TenDRA) says: "userboot.c", line 129: Error: [ISO C90 6.3.2.2]: In call of function 'strtol'. [ISO C90 6.1.2.6]: The types 'const char *' and 'char *' are incompatible. [ISO C90 6.3.4]: Types in pointer conversion should be compatible. [ISO C90 6.3.16]: Can't perform this conversion by assignment. [ISO C90 6.3.2.2]: Argument 2 is converted to parameter type. This is a well known problem in the strtol() API. endptr in it cannot have const qualifiers, and even bogus casts to remove the qualifiers are errors. In the above, you applied a bogus cast to break a warning that should be an error, but the cast itself is an error. Correct code: char *xcp; ... unit = strtol(np, &xcp, 0); /* banal comment deleted */ cp = xcp; strtol() must be passed a char **, not something else bogusly cast to break the warning that should be an error. Then it returns a char * (in xcp here). This can be assigned to a const char * with no problems. One reason strtol() takes doesn't take consts in its endptr is that if it returned a const char * then you couldn't assign it to a char * without problems. Note that calling strtol() reduces type safety, but no worse than strchr(). You start with a const char * like np and get back a plain char * like xcp. Assigning to *xcp would be an error. The only clearly safe use of the result is to assign xcp it to a const char * like cp above before using it. This is only needed when np is const char * of course. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 04:47:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3087AF11 for ; Sat, 9 Aug 2014 04:47:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06FEF2A82 for ; Sat, 9 Aug 2014 04:47:13 +0000 (UTC) Received: from marcel (uid 782) (envelope-from marcel@FreeBSD.org) id 2ec7 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 04:47:12 +0000 From: Marcel Moolenaar Date: Sat, 9 Aug 2014 04:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269745 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e5a7d0.2ec7.26d23fe2@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 04:47:13 -0000 Author: marcel Date: Sat Aug 9 04:47:12 2014 New Revision: 269745 URL: http://svnweb.freebsd.org/changeset/base/269745 Log: Create a redundant grain directory and table. Previously we were cheating by assigning the same sector offset to both directories, but it seems that VirtualBox doesn't like that. Neither does qemu from the looks of it. We now actually write the directory and table twice. MFC after: 3 days Modified: head/usr.bin/mkimg/vmdk.c Modified: head/usr.bin/mkimg/vmdk.c ============================================================================== --- head/usr.bin/mkimg/vmdk.c Fri Aug 8 23:55:22 2014 (r269744) +++ head/usr.bin/mkimg/vmdk.c Sat Aug 9 04:47:12 2014 (r269745) @@ -110,7 +110,7 @@ static int vmdk_write(int fd) { struct vmdk_header hdr; - uint32_t *gt, *gd; + uint32_t *gt, *gd, *rgd; char *buf, *desc; off_t cur, lim; uint64_t imagesz; @@ -143,25 +143,37 @@ vmdk_write(int fd) le32enc(&hdr.ngtes, VMDK_NGTES); sec = desc_len / VMDK_SECTOR_SIZE + 1; - le64enc(&hdr.rgd_offset, sec); - le64enc(&hdr.gd_offset, sec); ngrains = imagesz / grainsz; ngts = (ngrains + VMDK_NGTES - 1) / VMDK_NGTES; gdsz = (ngts * sizeof(uint32_t) + VMDK_SECTOR_SIZE - 1) & ~(VMDK_SECTOR_SIZE - 1); + gd = calloc(gdsz, 1); if (gd == NULL) { free(desc); return (ENOMEM); } - + le64enc(&hdr.gd_offset, sec); sec += gdsz / VMDK_SECTOR_SIZE; for (n = 0; n < ngts; n++) { le32enc(gd + n, sec); sec += VMDK_NGTES * sizeof(uint32_t) / VMDK_SECTOR_SIZE; } + rgd = calloc(gdsz, 1); + if (rgd == NULL) { + free(gd); + free(desc); + return (ENOMEM); + } + le64enc(&hdr.rgd_offset, sec); + sec += gdsz / VMDK_SECTOR_SIZE; + for (n = 0; n < ngts; n++) { + le32enc(rgd + n, sec); + sec += VMDK_NGTES * sizeof(uint32_t) / VMDK_SECTOR_SIZE; + } + sec = (sec + grainsz - 1) & ~(grainsz - 1); if (verbose) @@ -174,6 +186,7 @@ vmdk_write(int fd) gtsz = ngts * VMDK_NGTES * sizeof(uint32_t); gt = calloc(gtsz, 1); if (gt == NULL) { + free(rgd); free(gd); free(desc); return (ENOMEM); @@ -198,13 +211,18 @@ vmdk_write(int fd) error = errno; if (!error && sparse_write(fd, gt, gtsz) < 0) error = errno; + if (!error && sparse_write(fd, rgd, gdsz) < 0) + error = errno; + if (!error && sparse_write(fd, gt, gtsz) < 0) + error = errno; free(gt); + free(rgd); free(gd); free(desc); if (error) return (error); - cur = VMDK_SECTOR_SIZE + desc_len + gdsz + gtsz; + cur = VMDK_SECTOR_SIZE + desc_len + (gdsz + gtsz) * 2; lim = sec * VMDK_SECTOR_SIZE; if (cur < lim) { buf = calloc(VMDK_SECTOR_SIZE, 1); From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 05:00:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D72622A for ; Sat, 9 Aug 2014 05:00:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1072B5C for ; Sat, 9 Aug 2014 05:00:35 +0000 (UTC) Received: from kib (uid 1100) (envelope-from kib@FreeBSD.org) id 22cd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 05:00:34 +0000 From: Konstantin Belousov Date: Sat, 9 Aug 2014 05:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269746 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e5aaf2.22cd.547c7a6a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 05:00:35 -0000 Author: kib Date: Sat Aug 9 05:00:34 2014 New Revision: 269746 URL: http://svnweb.freebsd.org/changeset/base/269746 Log: Adapt vm_page_aflag_set(PGA_WRITEABLE) to the locking of pmap_enter(PMAP_ENTER_NOSLEEP). The PGA_WRITEABLE flag can be set when either the page is busied, or the owner object is locked. Update comments, move all assertions about page state when PGA_WRITEABLE flag is set, into new helper vm_page_assert_pga_writeable(). Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Aug 9 04:47:12 2014 (r269745) +++ head/sys/vm/vm_page.c Sat Aug 9 05:00:34 2014 (r269746) @@ -3134,6 +3134,24 @@ vm_page_object_lock_assert(vm_page_t m) if (m->object != NULL && !vm_page_xbusied(m)) VM_OBJECT_ASSERT_WLOCKED(m->object); } + +void +vm_page_assert_pga_writeable(vm_page_t m, uint8_t bits) +{ + + if ((bits & PGA_WRITEABLE) == 0) + return; + + /* + * The PGA_WRITEABLE flag can only be set if the page is + * managed, is exclusively busied or the object is locked. + * Currently, this flag is only set by pmap_enter(). + */ + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("PGA_WRITEABLE on unmanaged page")); + if (!vm_page_xbusied(m)) + VM_OBJECT_ASSERT_LOCKED(m->object); +} #endif #include "opt_ddb.h" Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Aug 9 04:47:12 2014 (r269745) +++ head/sys/vm/vm_page.h Sat Aug 9 05:00:34 2014 (r269746) @@ -305,10 +305,10 @@ extern struct mtx_padalign pa_lock[]; * both the MI and MD VM layers. However, kernel loadable modules should not * directly set this flag. They should call vm_page_reference() instead. * - * PGA_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it - * does so, the page must be exclusive busied. The MI VM layer must never - * access this flag directly. Instead, it should call - * pmap_page_is_write_mapped(). + * PGA_WRITEABLE is set exclusively on managed pages by pmap_enter(). + * When it does so, the object must be locked, or the page must be + * exclusive busied. The MI VM layer must never access this flag + * directly. Instead, it should call pmap_page_is_write_mapped(). * * PGA_EXECUTABLE may be set by pmap routines, and indicates that a page has * at least one executable mapping. It is not consumed by the MI VM layer. @@ -533,8 +533,12 @@ void vm_page_lock_assert_KBI(vm_page_t m #ifdef INVARIANTS void vm_page_object_lock_assert(vm_page_t m); #define VM_PAGE_OBJECT_LOCK_ASSERT(m) vm_page_object_lock_assert(m) +void vm_page_assert_pga_writeable(vm_page_t m, uint8_t bits); +#define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) \ + vm_page_assert_pga_writeable(m, bits) #else #define VM_PAGE_OBJECT_LOCK_ASSERT(m) (void)0 +#define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) (void)0 #endif /* @@ -582,13 +586,7 @@ vm_page_aflag_set(vm_page_t m, uint8_t b { uint32_t *addr, val; - /* - * The PGA_WRITEABLE flag can only be set if the page is managed and - * exclusive busied. Currently, this flag is only set by pmap_enter(). - */ - KASSERT((bits & PGA_WRITEABLE) == 0 || - ((m->oflags & VPO_UNMANAGED) == 0 && vm_page_xbusied(m)), - ("vm_page_aflag_set: PGA_WRITEABLE and not exclusive busy")); + VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits); /* * Access the whole 32-bit word containing the aflags field with an From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 09:12:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6A85E2B for ; Sat, 9 Aug 2014 09:12:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C4E12424 for ; Sat, 9 Aug 2014 09:12:25 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2eeb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 09:12:25 +0000 From: Adrian Chadd Date: Sat, 9 Aug 2014 09:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269748 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e5e5f9.2eeb.7727ac5c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 09:12:25 -0000 Author: adrian Date: Sat Aug 9 09:12:25 2014 New Revision: 269748 URL: http://svnweb.freebsd.org/changeset/base/269748 Log: Work around some rather annoying chip hangs in the AR9331 chip. If powersave is enabled and there are any transitions to network or full sleep - even if they're pretty damned brief - eventually something messes up somewhere and the bus glue between the AR9331 SoC and the AR9331 wifi stops working. It shows up as stuck DMA and LOCAL_TIMEOUT interrupts. Both ath9k and the reference driver does a full chip reset if things get stuck. So: * teach the AR9330 HAL about the force_full_reset option I added a couple of years ago; * if the chip is currently in full-sleep, do a full-reset; * if TX DMA and/or RX DMA are still enabled (eg, they did get stuck during reset) then do a full-reset. Tested: * AR9331 SoC, STA mode Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Aug 9 09:11:26 2014 (r269747) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Aug 9 09:12:25 2014 (r269748) @@ -1987,13 +1987,25 @@ HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan) { struct ath_hal_9300 *ahp = AH9300(ah); + int type = HAL_RESET_WARM; OS_MARK(ah, AH_MARK_CHIPRESET, chan ? chan->ic_freq : 0); /* * Warm reset is optimistic. - */ - if (!ar9300_set_reset_reg(ah, HAL_RESET_WARM)) { + * + * If the TX/RX DMA engines aren't shut down (eg, they're + * wedged) then we're better off doing a full cold reset + * to try and shake that condition. + */ + if (ahp->ah_chip_full_sleep || + (ah->ah_config.ah_force_full_reset == 1) || + OS_REG_READ(ah, AR_Q_TXE) || + (OS_REG_READ(ah, AR_CR) & AR_CR_RXE)) { + type = HAL_RESET_COLD; + } + + if (!ar9300_set_reset_reg(ah, type)) { return AH_FALSE; } From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 09:13:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A986F72 for ; Sat, 9 Aug 2014 09:13:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4E4242E for ; Sat, 9 Aug 2014 09:13:11 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2f00 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 09:13:11 +0000 From: Adrian Chadd Date: Sat, 9 Aug 2014 09:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269749 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e5e627.2f00.49c04cdf@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 09:13:11 -0000 Author: adrian Date: Sat Aug 9 09:13:10 2014 New Revision: 269749 URL: http://svnweb.freebsd.org/changeset/base/269749 Log: Add two new debug mark entries for chip power configuration. Modified: head/sys/dev/ath/ath_hal/ah_decode.h Modified: head/sys/dev/ath/ath_hal/ah_decode.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_decode.h Sat Aug 9 09:12:25 2014 (r269748) +++ head/sys/dev/ath/ath_hal/ah_decode.h Sat Aug 9 09:13:10 2014 (r269749) @@ -53,6 +53,8 @@ enum { AH_MARK_ANI_POLL, /* ar*AniReset, listen time */ AH_MARK_ANI_CONTROL, /* ar*AniReset, cmd */ AH_MARK_RX_CTL, /* RX DMA control */ + AH_MARK_CHIP_POWER, /* chip power control, mode */ + AH_MARK_CHIP_POWER_DONE, /* chip power control done, status */ }; enum { @@ -61,6 +63,7 @@ enum { AH_MARK_RX_CTL_DMA_START, AH_MARK_RX_CTL_DMA_STOP, AH_MARK_RX_CTL_DMA_STOP_ERR, + AH_MARK_RX_CTL_DMA_STOP_OK, }; #endif /* _ATH_AH_DECODE_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 12:25:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 999C51BC for ; Sat, 9 Aug 2014 12:25:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4AC24E3 for ; Sat, 9 Aug 2014 12:25:07 +0000 (UTC) Received: from dim (uid 1236) (envelope-from dim@FreeBSD.org) id 201e by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 12:25:07 +0000 From: Dimitry Andric Date: Sat, 9 Aug 2014 12:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269750 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e61323.201e.1f54ad21@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 12:25:07 -0000 Author: dim Date: Sat Aug 9 12:25:06 2014 New Revision: 269750 URL: http://svnweb.freebsd.org/changeset/base/269750 Log: In r268463, I misplaced a return in demangle(), causing the function to erroneously skip symbols that were not mangled at all. Fix this by moving the return into the preceding if block. While here, simplify the code by letting __cxa_demangle() allocate the needed space for the demangled symbol. This also fixes a memory leak, which would occur whenever __cxa_demangle() failed. Reported by: pgj MFC after: 3 days Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Sat Aug 9 09:13:10 2014 (r269749) +++ head/lib/libproc/proc_sym.c Sat Aug 9 12:25:06 2014 (r269750) @@ -57,21 +57,15 @@ demangle(const char *symbol, char *buf, { #ifndef NO_CXA_DEMANGLE char *dembuf; - size_t demlen; if (symbol[0] == '_' && symbol[1] == 'Z' && symbol[2]) { - dembuf = malloc(len); - if (!dembuf) - goto fail; - demlen = len; - dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL); + dembuf = __cxa_demangle(symbol, NULL, NULL, NULL); if (!dembuf) goto fail; strlcpy(buf, dembuf, len); free(dembuf); + return; } - - return; fail: #endif /* NO_CXA_DEMANGLE */ strlcpy(buf, symbol, len); From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 14:33:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F8C9C1 for ; Sat, 9 Aug 2014 14:33:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A62BB21A2 for ; Sat, 9 Aug 2014 14:33:44 +0000 (UTC) Received: from tuexen (uid 1198) (envelope-from tuexen@FreeBSD.org) id 291d by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 14:33:44 +0000 From: Michael Tuexen Date: Sat, 9 Aug 2014 14:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269753 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e63148.291d.71cb6cd3@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 14:33:44 -0000 Author: tuexen Date: Sat Aug 9 14:33:44 2014 New Revision: 269753 URL: http://svnweb.freebsd.org/changeset/base/269753 Log: Small modification of the sctp_input() cleanup to avoid having code between declariations. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Aug 9 14:05:01 2014 (r269752) +++ head/sys/netinet/sctp_input.c Sat Aug 9 14:33:44 2014 (r269753) @@ -6109,7 +6109,7 @@ extern int *sctp_cpuarry; #endif int -sctp_input(struct mbuf **mp, int *offp, int proto) +sctp_input(struct mbuf **mp, int *offp, int proto SCTP_UNUSED) { struct mbuf *m; int off; @@ -6117,13 +6117,13 @@ sctp_input(struct mbuf **mp, int *offp, m = *mp; off = *offp; #if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) - struct ip *ip; - struct sctphdr *sh; - int offset; - int cpu_to_use; - uint32_t flowid, tag; - if (mp_ncpus > 1) { + struct ip *ip; + struct sctphdr *sh; + int offset; + int cpu_to_use; + uint32_t flowid, tag; + if (m->m_flags & M_FLOWID) { flowid = m->m_pkthdr.flowid; } else { From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 15:53:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5755F6D0 for ; Sat, 9 Aug 2014 15:53:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476C729C0 for ; Sat, 9 Aug 2014 15:53:41 +0000 (UTC) Received: from kargl (uid 1204) (envelope-from kargl@FreeBSD.org) id 2c84 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 15:53:41 +0000 From: Steve Kargl Date: Sat, 9 Aug 2014 15:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269758 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e64405.2c84.6ed72ed5@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 15:53:41 -0000 Author: kargl Date: Sat Aug 9 15:53:40 2014 New Revision: 269758 URL: http://svnweb.freebsd.org/changeset/base/269758 Log: When r255294 was committed, it exposed the symbols lgammal, powl, and tgammal in libm. These functions are part of ISO/IEC 9899:1999 and their prototypes should have been moved into the appropriate __ISO_C_VISIBLE >= 1999 section. After moving the prototypes, remnants of r236148 can be removed. PR: standards/191754 Reviewed by: bde Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Aug 9 15:03:56 2014 (r269757) +++ head/lib/msun/src/math.h Sat Aug 9 15:53:40 2014 (r269758) @@ -465,6 +465,7 @@ long double frexpl(long double value, in long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); +long double lgammal(long double); long long llrintl(long double); long long llroundl(long double); long double log10l(long double); @@ -481,6 +482,7 @@ long double nextafterl(long double, long double nexttoward(double, long double); float nexttowardf(float, long double); long double nexttowardl(long double, long double); +long double powl(long double, long double); long double remainderl(long double, long double); long double remquol(long double, long double, int *); long double rintl(long double); @@ -492,31 +494,10 @@ long double sinl(long double); long double sqrtl(long double); long double tanhl(long double); long double tanl(long double); +long double tgammal(long double); long double truncl(long double); #endif /* __ISO_C_VISIBLE >= 1999 */ __END_DECLS #endif /* !_MATH_H_ */ - -/* separate header for cmath */ -#ifndef _MATH_EXTRA_H_ -#if __ISO_C_VISIBLE >= 1999 -#if _DECLARE_C99_LDBL_MATH - -#define _MATH_EXTRA_H_ - -/* - * extra long double versions of math functions for C99 and cmath - */ -__BEGIN_DECLS - -long double lgammal(long double); -long double powl(long double, long double); -long double tgammal(long double); - -__END_DECLS - -#endif /* !_DECLARE_C99_LDBL_MATH */ -#endif /* __ISO_C_VISIBLE >= 1999 */ -#endif /* !_MATH_EXTRA_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 17:13:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5779365C for ; Sat, 9 Aug 2014 17:13:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F60E21DC for ; Sat, 9 Aug 2014 17:13:03 +0000 (UTC) Received: from alc (uid 759) (envelope-from alc@FreeBSD.org) id 2d69 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 17:13:03 +0000 From: Alan Cox Date: Sat, 9 Aug 2014 17:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269759 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6569f.2d69.63e7d3a6@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 17:13:03 -0000 Author: alc Date: Sat Aug 9 17:13:02 2014 New Revision: 269759 URL: http://svnweb.freebsd.org/changeset/base/269759 Log: Update the text of a KASSERT() to reflect the changes in r269728. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Aug 9 15:53:40 2014 (r269758) +++ head/sys/amd64/amd64/pmap.c Sat Aug 9 17:13:02 2014 (r269759) @@ -4152,7 +4152,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((prot & VM_PROT_WRITE) != 0) newpte |= PG_RW; KASSERT((newpte & (PG_M | PG_RW)) != PG_M, - ("pmap_enter: access includes VM_PROT_WRITE but prot doesn't")); + ("pmap_enter: flags includes VM_PROT_WRITE but prot doesn't")); if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; if ((flags & PMAP_ENTER_WIRED) != 0) From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 18:15:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CB6DF63 for ; Sat, 9 Aug 2014 18:15:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E682788 for ; Sat, 9 Aug 2014 18:15:28 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2642 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 18:15:28 +0000 From: Adrian Chadd Date: Sat, 9 Aug 2014 18:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269760 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e66540.2642.8d597fa@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 18:15:29 -0000 Author: adrian Date: Sat Aug 9 18:15:28 2014 New Revision: 269760 URL: http://svnweb.freebsd.org/changeset/base/269760 Log: Bump the HAL_REGRANGE fields from 16 bit to 32 bit. The AR9380 and later chips have a 128KiB register window, so the register read diag api needs changing. The tools are about to be updated as well. No, they're not backwards compatible. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sat Aug 9 17:13:02 2014 (r269759) +++ head/sys/dev/ath/ath_hal/ah.c Sat Aug 9 18:15:28 2014 (r269760) @@ -850,10 +850,11 @@ ath_hal_getregdump(struct ath_hal *ah, c int i; for (i = 0; space >= 2*sizeof(uint32_t); i++) { - u_int r = regs[i].start; - u_int e = regs[i].end; - *dp++ = (r<<16) | e; - space -= sizeof(uint32_t); + uint32_t r = regs[i].start; + uint32_t e = regs[i].end; + *dp++ = r; + *dp++ = e; + space -= 2*sizeof(uint32_t); do { *dp++ = OS_REG_READ(ah, r); r += sizeof(uint32_t); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sat Aug 9 17:13:02 2014 (r269759) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sat Aug 9 18:15:28 2014 (r269760) @@ -50,8 +50,8 @@ #endif typedef struct { - uint16_t start; /* first register */ - uint16_t end; /* ending register or zero */ + uint32_t start; /* first register */ + uint32_t end; /* ending register or zero */ } HAL_REGRANGE; typedef struct { From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 18:17:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B3A31F5 for ; Sat, 9 Aug 2014 18:17:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6159C27AA for ; Sat, 9 Aug 2014 18:17:17 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2727 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 18:17:17 +0000 From: Adrian Chadd Date: Sat, 9 Aug 2014 18:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269761 - in head/tools/tools/ath: athpoke athregs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e665ad.2727.4918fd5@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 18:17:17 -0000 Author: adrian Date: Sat Aug 9 18:17:16 2014 New Revision: 269761 URL: http://svnweb.freebsd.org/changeset/base/269761 Log: Update athpoke/athregs to use the modified register read diagnostic API. Modified: head/tools/tools/ath/athpoke/athpoke.c head/tools/tools/ath/athregs/dumpregs.c Modified: head/tools/tools/ath/athpoke/athpoke.c ============================================================================== --- head/tools/tools/ath/athpoke/athpoke.c Sat Aug 9 18:15:28 2014 (r269760) +++ head/tools/tools/ath/athpoke/athpoke.c Sat Aug 9 18:17:16 2014 (r269761) @@ -123,7 +123,7 @@ static uint32_t regread(int s, struct ath_diag *atd, uint32_t r) { HAL_REGRANGE ra; - uint32_t v[2]; + uint32_t v[3]; ra.start = r; ra.end = 0; @@ -135,7 +135,7 @@ regread(int s, struct ath_diag *atd, uin atd->ad_id = HAL_DIAG_REGS | ATH_DIAG_IN | ATH_DIAG_DYN; if (ioctl(s, SIOCGATHDIAG, atd) < 0) err(1, atd->ad_name); - return v[1]; + return v[2]; } static void Modified: head/tools/tools/ath/athregs/dumpregs.c ============================================================================== --- head/tools/tools/ath/athregs/dumpregs.c Sat Aug 9 18:15:28 2014 (r269760) +++ head/tools/tools/ath/athregs/dumpregs.c Sat Aug 9 18:17:16 2014 (r269761) @@ -182,8 +182,9 @@ main(int argc, char *argv[]) dp = (u_int32_t *)atd.ad_out_data; ep = (u_int32_t *)(atd.ad_out_data + atd.ad_out_size); while (dp < ep) { - u_int r = dp[0] >> 16; /* start of range */ - u_int e = dp[0] & 0xffff; /* end of range */ + u_int r = dp[0]; /* start of range */ + u_int e = dp[1]; /* end of range */ + dp++; dp++; /* convert offsets to indices */ r >>= 2; e >>= 2; @@ -611,7 +612,7 @@ ath_hal_setupdiagregs(const HAL_REGRANGE space = 0; for (i = 0; i < nr; i++) { - u_int n = 2 * sizeof(u_int32_t); /* reg range + first */ + u_int n = sizeof(HAL_REGRANGE) + sizeof(u_int32_t); /* reg range + first */ if (regs[i].end) { if (regs[i].end < regs[i].start) { fprintf(stderr, "%s: bad register range, " From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 18:17:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E208342 for ; Sat, 9 Aug 2014 18:17:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DBA27B0 for ; Sat, 9 Aug 2014 18:17:49 +0000 (UTC) Received: from adrian (uid 753) (envelope-from adrian@FreeBSD.org) id 2781 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 18:17:49 +0000 From: Adrian Chadd Date: Sat, 9 Aug 2014 18:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269762 - head/tools/tools/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e665cd.2781.536a1bf9@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 18:17:50 -0000 Author: adrian Date: Sat Aug 9 18:17:49 2014 New Revision: 269762 URL: http://svnweb.freebsd.org/changeset/base/269762 Log: Add more tools to the build. Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Sat Aug 9 18:17:16 2014 (r269761) +++ head/tools/tools/ath/Makefile Sat Aug 9 18:17:49 2014 (r269762) @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= arcode athdebug athdecode athkey athpoke athprom athrd athregs +SUBDIR= arcode athdebug athdecode athkey athpoke athprom athrd athregs athalq SUBDIR+= athstats ath_prom_read athradar athaggrstats SUBDIR+= ath_ee_v14_print ath_ee_v4k_print ath_ee_9287_print ath_ee_9300_print SUBDIR+= athsurvey athratestats athspectral From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 20:25:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74DC78C3 for ; Sat, 9 Aug 2014 20:25:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A68424E4 for ; Sat, 9 Aug 2014 20:25:18 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 2f30 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 20:25:18 +0000 From: John-Mark Gurney Date: Sat, 9 Aug 2014 20:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269764 - in head/share/dtrace: . toolkit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e683ae.2f30.1521c256@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 20:25:18 -0000 Author: jmg Date: Sat Aug 9 20:25:17 2014 New Revision: 269764 URL: http://svnweb.freebsd.org/changeset/base/269764 Log: make the README a bit more clearer... Sort the scripts, and remove the trailing backslash... We really should install more of the toolkit scripts than just 5 of them.. Modified: head/share/dtrace/README head/share/dtrace/toolkit/Makefile Modified: head/share/dtrace/README ============================================================================== --- head/share/dtrace/README Sat Aug 9 20:03:40 2014 (r269763) +++ head/share/dtrace/README Sat Aug 9 20:25:17 2014 (r269764) @@ -1,11 +1,11 @@ $FreeBSD$ This directory contains scripts for use with the DTrace system. The -toolkit/ directory contains the latest vendor import of Brendan -Gregg's DTraceToolkit while all the other files and directories +toolkit/ directory installs the latest vendor import of Brendan +Gregg's DTraceToolkit while the other files and directories contain code generated by the FreeBSD Project for use with DTrace on FreeBSD. -NOTE: Do not add new scripts to the DTraceToolkit contained in this -directory. New DTraceToolkit scripts should be send to the maintainer -of the toolkit and then brought back into FreeBSD via future vendor imports. +NOTE: Do not add new scripts to the toolkit directory. New DTraceToolkit +scripts should be send to the maintainer of the toolkit and then brought +back into FreeBSD via future vendor imports. Modified: head/share/dtrace/toolkit/Makefile ============================================================================== --- head/share/dtrace/toolkit/Makefile Sat Aug 9 20:03:40 2014 (r269763) +++ head/share/dtrace/toolkit/Makefile Sat Aug 9 20:25:17 2014 (r269764) @@ -5,10 +5,10 @@ DTRACETOOLKIT= ../../../cddl/contrib/dtracetoolkit SCRIPTS= ${DTRACETOOLKIT}/execsnoop \ - ${DTRACETOOLKIT}/hotuser \ ${DTRACETOOLKIT}/hotkernel \ + ${DTRACETOOLKIT}/hotuser \ ${DTRACETOOLKIT}/opensnoop \ - ${DTRACETOOLKIT}/procsystime \ + ${DTRACETOOLKIT}/procsystime SCRIPTSDIR= ${SHAREDIR}/dtrace/toolkit From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 20:40:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3714D6F for ; Sat, 9 Aug 2014 20:40:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A182525DC for ; Sat, 9 Aug 2014 20:40:04 +0000 (UTC) Received: from jmg (uid 686) (envelope-from jmg@FreeBSD.org) id 23ee by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 20:40:04 +0000 From: John-Mark Gurney Date: Sat, 9 Aug 2014 20:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269765 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e68724.23ee.26a51c0a@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 20:40:04 -0000 Author: jmg Date: Sat Aug 9 20:40:03 2014 New Revision: 269765 URL: http://svnweb.freebsd.org/changeset/base/269765 Log: add my scripts to measure io latency per disk... Added: head/share/dtrace/disklatency (contents, props changed) head/share/dtrace/disklatencycmd (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Sat Aug 9 20:25:17 2014 (r269764) +++ head/share/dtrace/Makefile Sat Aug 9 20:40:03 2014 (r269765) @@ -12,7 +12,10 @@ SUBDIR= ${_toolkit} _toolkit= toolkit .endif -SCRIPTS= nfsclienttime hotopen +SCRIPTS= disklatency \ + disklatencycmd \ + hotopen \ + nfsclienttime SCRIPTSDIR= ${SHAREDIR}/dtrace Added: head/share/dtrace/disklatency ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/disklatency Sat Aug 9 20:40:03 2014 (r269765) @@ -0,0 +1,67 @@ +#!/usr/sbin/dtrace -s +/*- + * Copyright 2014 John-Mark Gurney. + * 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#pragma D option quiet +#pragma D option dynvarsize=16m + +dtrace:::BEGIN +{ + printf("Tracing... Hit Ctrl-C to end.\n"); +} + +io:::start +{ + start_time[arg0] = timestamp; +} + +io:::done +/this->start = start_time[arg0]/ +{ + this->delta = (timestamp - this->start) / 1000; + @q[args[1]->device_name, args[1]->unit_number] = + lquantize(this->delta, 4000, 80000, 4000); + @max[args[1]->device_name, args[1]->unit_number] = max(this->delta); + @avg[args[1]->device_name, args[1]->unit_number] = avg(this->delta); + @stddev[args[1]->device_name, args[1]->unit_number] = stddev(this->delta); + start_time[arg0] = 0; +} + +tick-10s +{ + printa(" %s (%d), us:\n%@d\n", @q); + printa("max%s (%d), us:\n%@d\n", @max); + printa("avg%s (%d), us:\n%@d\n", @avg); + printa("stddev%s (%d), us:\n%@d\n", @stddev); + + clear(@q); + clear(@max); + clear(@avg); + clear(@stddev); +} Added: head/share/dtrace/disklatencycmd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/disklatencycmd Sat Aug 9 20:40:03 2014 (r269765) @@ -0,0 +1,72 @@ +#!/usr/sbin/dtrace -s +/*- + * Copyright 2014 John-Mark Gurney. + * 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 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#pragma D option quiet + +/* from http://www.mail-archive.com/dtrace-discuss@opensolaris.org/msg03755.html */ +#pragma D option aggsize=8m +#pragma D option bufsize=16m +#pragma D option dynvarsize=32m +/* +#pragma D option aggrate=0 +#pragma D option cleanrate=50Hz +*/ + +dtrace:::BEGIN +{ + printf("Tracing... Hit Ctrl-C to end.\n"); + dstart = timestamp; +} + +io:::start +{ + start_time[arg0] = timestamp; +} + +io:::done +/this->start = start_time[arg0]/ +{ + this->delta = (timestamp - this->start) / 1000; + @q[args[1]->device_name, args[1]->unit_number] = + lquantize(this->delta, 4000, 80000, 4000); + @max[args[1]->device_name, args[1]->unit_number] = max(this->delta); + @avg[args[1]->device_name, args[1]->unit_number] = avg(this->delta); + @stddev[args[1]->device_name, args[1]->unit_number] = stddev(this->delta); + start_time[arg0] = 0; +} + +dtrace:::END +{ + printf("total time, us: %d\n", (timestamp - dstart) / 1000); + printa(" %s (%d), us:\n%@d\n", @q); + printa("max%s (%d), us: %@d\n", @max); + printa("avg%s (%d), us: %@d\n", @avg); + printa("stddev%s (%d), us: %@d\n", @stddev); +} From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 21:01:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A986267A for ; Sat, 9 Aug 2014 21:01:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80D2A283F for ; Sat, 9 Aug 2014 21:01:24 +0000 (UTC) Received: from hiren (uid 1318) (envelope-from hiren@FreeBSD.org) id 209b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 21:01:24 +0000 From: Hiren Panchasara Date: Sat, 9 Aug 2014 21:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269766 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e68c24.209b.71b21d96@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 21:01:24 -0000 Author: hiren Date: Sat Aug 9 21:01:24 2014 New Revision: 269766 URL: http://svnweb.freebsd.org/changeset/base/269766 Log: Improve comments by listing a criteria for automatic increment of receive socket buffer. Reviewed by: jmg Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Aug 9 20:40:03 2014 (r269765) +++ head/sys/netinet/tcp_input.c Sat Aug 9 21:01:24 2014 (r269766) @@ -1793,11 +1793,13 @@ tcp_do_segment(struct mbuf *m, struct tc * reassembly queue. * * The criteria to step up the receive buffer one notch are: - * 1. the number of bytes received during the time it takes + * 1. Application has not set receive buffer size with + * SO_RCVBUF. Setting SO_RCVBUF clears SB_AUTOSIZE. + * 2. the number of bytes received during the time it takes * one timestamp to be reflected back to us (the RTT); - * 2. received bytes per RTT is within seven eighth of the + * 3. received bytes per RTT is within seven eighth of the * current socket buffer size; - * 3. receive buffer size has not hit maximal automatic size; + * 4. receive buffer size has not hit maximal automatic size; * * This algorithm does one step per RTT at most and only if * we receive a bulk stream w/o packet losses or reorderings. From owner-svn-src-head@FreeBSD.ORG Sat Aug 9 22:51:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C3A115F for ; Sat, 9 Aug 2014 22:51:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D74723D7 for ; Sat, 9 Aug 2014 22:51:27 +0000 (UTC) Received: from imp (uid 547) (envelope-from imp@FreeBSD.org) id 2fbb by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sat, 09 Aug 2014 22:51:27 +0000 From: Warner Losh Date: Sat, 9 Aug 2014 22:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269767 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e6a5ef.2fbb.3bbe0e71@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 22:51:27 -0000 Author: imp Date: Sat Aug 9 22:51:26 2014 New Revision: 269767 URL: http://svnweb.freebsd.org/changeset/base/269767 Log: Per discussion on arm@, the compiler generates misaligned relocations. Cope with memcpy when needed. Submitted by: fabient@ (plus changes suggested by thread) Modified: head/sys/arm/arm/elf_machdep.c Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sat Aug 9 21:01:24 2014 (r269766) +++ head/sys/arm/arm/elf_machdep.c Sat Aug 9 22:51:26 2014 (r269767) @@ -120,6 +120,34 @@ elf32_dump_thread(struct thread *td __un { } +/* + * It is possible for the compiler to emit relocations for unaligned data. + * We handle this situation with these inlines. + */ +#define RELOC_ALIGNED_P(x) \ + (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) + +static __inline Elf_Addr +load_ptr(Elf_Addr *where) +{ + Elf_Addr res; + + if (RELOC_ALIGNED_P(where)) + return *where; + memcpy(&res, where, sizeof(res)); + return (res); +} + +static __inline void +store_ptr(Elf_Addr *where, Elf_Addr val) +{ + if (RELOC_ALIGNED_P(where)) + *where = val; + else + memcpy(where, &val, sizeof(val)); +} +#undef RELOC_ALIGNED_P + /* Process one elf relocation with addend. */ static int @@ -137,7 +165,7 @@ elf_reloc_internal(linker_file_t lf, Elf case ELF_RELOC_REL: rel = (const Elf_Rel *)data; where = (Elf_Addr *) (relocbase + rel->r_offset); - addend = *where; + addend = load_ptr(where); rtype = ELF_R_TYPE(rel->r_info); symidx = ELF_R_SYM(rel->r_info); break; @@ -155,8 +183,8 @@ elf_reloc_internal(linker_file_t lf, Elf if (local) { if (rtype == R_ARM_RELATIVE) { /* A + B */ addr = elf_relocaddr(lf, relocbase + addend); - if (*where != addr) - *where = addr; + if (load_ptr(where) != addr) + store_ptr(where, addr); } return (0); } @@ -170,7 +198,7 @@ elf_reloc_internal(linker_file_t lf, Elf addr = lookup(lf, symidx, 1); if (addr == 0) return -1; - *where += addr; + store_ptr(where, addr + load_ptr(where)); break; case R_ARM_COPY: /* none */ @@ -185,7 +213,7 @@ elf_reloc_internal(linker_file_t lf, Elf case R_ARM_JUMP_SLOT: addr = lookup(lf, symidx, 1); if (addr) { - *where = addr; + store_ptr(where, addr); return (0); } return (-1);