From owner-p4-projects@FreeBSD.ORG Sun Sep 18 10:43:29 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 35B0C16A421; Sun, 18 Sep 2005 10:43:29 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAD7C16A41F for ; Sun, 18 Sep 2005 10:43:28 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9617B43D45 for ; Sun, 18 Sep 2005 10:43:28 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8IAhSVb022126 for ; Sun, 18 Sep 2005 10:43:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8IAhSbR022123 for perforce@freebsd.org; Sun, 18 Sep 2005 10:43:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 18 Sep 2005 10:43:28 GMT Message-Id: <200509181043.j8IAhSbR022123@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 83824 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2005 10:43:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=83824 Change 83824 by rwatson@rwatson_peppercorn on 2005/09/18 10:42:51 Integrate netsmp from FreeBSD CVS: - MAC kernel configurations - ACPI/PCI/pci0/legacy bus fixes. - ACL system calls MPSAFE. - sbcompress() commenting. Affected files ... .. //depot/projects/netsmp/src/sys/alpha/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/amd64/amd64/mptable_pci.c#2 integrate .. //depot/projects/netsmp/src/sys/amd64/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/amd64/include/legacyvar.h#2 integrate .. //depot/projects/netsmp/src/sys/amd64/pci/pci_bus.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/i386/i386/mptable_pci.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/include/legacyvar.h#2 integrate .. //depot/projects/netsmp/src/sys/i386/pci/pci_bus.c#3 integrate .. //depot/projects/netsmp/src/sys/ia64/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/kern/kern_acl.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/subr_bus.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/uipc_socket2.c#4 integrate .. //depot/projects/netsmp/src/sys/pc98/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/powerpc/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/sparc64/conf/MAC#1 branch .. //depot/projects/netsmp/src/sys/sys/bus.h#2 integrate Differences ... ==== //depot/projects/netsmp/src/sys/amd64/amd64/mptable_pci.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.2 2004/05/16 20:30:46 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.3 2005/09/18 01:42:43 imp Exp $"); #include #include @@ -84,7 +84,7 @@ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), ==== //depot/projects/netsmp/src/sys/amd64/include/legacyvar.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/legacyvar.h,v 1.6 2005/04/15 18:41:32 peter Exp $ + * $FreeBSD: src/sys/amd64/include/legacyvar.h,v 1.7 2005/09/18 01:42:43 imp Exp $ */ #ifndef _MACHINE_LEGACYVAR_H_ @@ -49,5 +49,7 @@ int reg, u_int32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); +struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, + int type, int *rid, u_long start, u_long end, u_long count, u_int flags); #endif /* !_MACHINE_LEGACYVAR_H_ */ ==== //depot/projects/netsmp/src/sys/amd64/pci/pci_bus.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.113 2005/01/05 20:17:21 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.114 2005/09/18 01:42:43 imp Exp $"); #include "opt_cpu.h" @@ -273,7 +273,7 @@ "Limit the host bridge memory to being above this address. Must be\n\ set at boot via a tunable."); -static struct resource * +struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { @@ -291,6 +291,8 @@ */ if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) start = legacy_host_mem_start; + if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) + start = 0x1000; return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } ==== //depot/projects/netsmp/src/sys/i386/i386/mptable_pci.c#2 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/mptable_pci.c,v 1.2 2004/05/03 14:49:10 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/mptable_pci.c,v 1.3 2005/09/17 23:57:53 imp Exp $"); #include #include @@ -84,7 +84,7 @@ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), ==== //depot/projects/netsmp/src/sys/i386/include/legacyvar.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/include/legacyvar.h,v 1.6 2005/04/03 17:47:03 imp Exp $ + * $FreeBSD: src/sys/i386/include/legacyvar.h,v 1.7 2005/09/17 23:57:53 imp Exp $ */ #ifndef _MACHINE_LEGACYVAR_H_ @@ -49,5 +49,7 @@ int reg, u_int32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); +struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, + int type, int *rid, u_long start, u_long end, u_long count, u_int flags); #endif /* !_MACHINE_LEGACYVAR_H_ */ ==== //depot/projects/netsmp/src/sys/i386/pci/pci_bus.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.120 2005/09/16 07:02:29 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/pci/pci_bus.c,v 1.121 2005/09/17 23:57:53 imp Exp $"); #include "opt_cpu.h" @@ -485,7 +485,7 @@ "Limit the host bridge memory to being above this address. Must be\n\ set at boot via a tunable."); -static struct resource * +struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { ==== //depot/projects/netsmp/src/sys/kern/kern_acl.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_acl.c,v 1.46 2005/09/06 00:06:30 csjp Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_acl.c,v 1.47 2005/09/17 22:01:14 csjp Exp $"); #include "opt_mac.h" @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -772,16 +773,16 @@ __acl_get_file(struct thread *td, struct __acl_get_file_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -794,16 +795,16 @@ __acl_get_link(struct thread *td, struct __acl_get_link_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -816,16 +817,16 @@ __acl_set_file(struct thread *td, struct __acl_set_file_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -838,16 +839,16 @@ __acl_set_link(struct thread *td, struct __acl_set_link_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -860,15 +861,15 @@ __acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) { struct file *fp; - int error; + int vfslocked, error; - mtx_lock(&Giant); error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { + vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); + VFS_UNLOCK_GIANT(vfslocked); } - mtx_unlock(&Giant); return (error); } @@ -881,15 +882,15 @@ __acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) { struct file *fp; - int error; + int vfslocked, error; - mtx_lock(&Giant); error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { + vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); + VFS_UNLOCK_GIANT(vfslocked); } - mtx_unlock(&Giant); return (error); } @@ -902,16 +903,16 @@ __acl_delete_file(struct thread *td, struct __acl_delete_file_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_delete(td, nd.ni_vp, uap->type); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -924,16 +925,16 @@ __acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_delete(td, nd.ni_vp, uap->type); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -946,15 +947,15 @@ __acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) { struct file *fp; - int error; + int vfslocked, error; - mtx_lock(&Giant); error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { + vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_delete(td, fp->f_vnode, uap->type); fdrop(fp, td); + VFS_UNLOCK_GIANT(vfslocked); } - mtx_unlock(&Giant); return (error); } @@ -967,16 +968,16 @@ __acl_aclcheck_file(struct thread *td, struct __acl_aclcheck_file_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|FOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -989,16 +990,16 @@ __acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap) { struct nameidata nd; - int error; + int vfslocked, error; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, MPSAFE|NOFOLLOW, UIO_USERSPACE, uap->path, td); error = namei(&nd); + vfslocked = NDHASGIANT(&nd); if (error == 0) { error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp); NDFREE(&nd, 0); } - mtx_unlock(&Giant); + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1011,15 +1012,15 @@ __acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) { struct file *fp; - int error; + int vfslocked, error; - mtx_lock(&Giant); error = getvnode(td->td_proc->p_fd, uap->filedes, &fp); if (error == 0) { + vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); + VFS_UNLOCK_GIANT(vfslocked); } - mtx_unlock(&Giant); return (error); } ==== //depot/projects/netsmp/src/sys/kern/subr_bus.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.184 2005/06/09 05:50:01 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.185 2005/09/18 01:32:09 imp Exp $"); #include "opt_bus.h" @@ -1673,7 +1673,7 @@ /** * @internal */ -static int +int device_probe_child(device_t dev, device_t child) { devclass_t dc; ==== //depot/projects/netsmp/src/sys/kern/uipc_socket2.c#4 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.147 2005/07/01 16:28:30 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.148 2005/09/18 10:30:10 rwatson Exp $"); #include "opt_mac.h" #include "opt_param.h" @@ -1086,9 +1086,24 @@ } /* - * Compress mbuf chain m into the socket - * buffer sb following mbuf n. If n - * is null, the buffer is presumed empty. + * Append the data in mbuf chain (m) into the socket buffer sb following mbuf + * (n). If (n) is NULL, the buffer is presumed empty. + * + * When the data is compressed, mbufs in the chain may be handled in one of + * three ways: + * + * (1) The mbuf may simply be dropped, if it contributes nothing (no data, no + * record boundary, and no change in data type). + * + * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into + * an mbuf already in the socket buffer. This can occur if an + * appropriate mbuf exists, there is room, and no merging of data types + * will occur. + * + * (3) The mbuf may be appended to the end of the existing mbuf chain. + * + * If any of the new mbufs is marked as M_EOR, mark the last mbuf appended as + * end-of-record. */ void sbcompress(sb, m, n) @@ -1139,10 +1154,8 @@ n->m_next = 0; } if (eor) { - if (n) - n->m_flags |= eor; - else - printf("semi-panic: sbcompress\n"); + KASSERT(n != NULL, ("sbcompress: eor && n == NULL")); + n->m_flags |= eor; } SBLASTMBUFCHK(sb); } ==== //depot/projects/netsmp/src/sys/sys/bus.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/bus.h,v 1.70 2005/04/12 15:20:36 imp Exp $ + * $FreeBSD: src/sys/sys/bus.h,v 1.71 2005/09/18 01:32:09 imp Exp $ */ #ifndef _SYS_BUS_H_ @@ -360,6 +360,7 @@ int device_print_prettyname(device_t dev); int device_printf(device_t dev, const char *, ...) __printflike(2, 3); int device_probe_and_attach(device_t dev); +int device_probe_child(device_t bus, device_t dev); int device_quiesce(device_t dev); void device_quiet(device_t dev); void device_set_desc(device_t dev, const char* desc);