From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 01:06:28 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B796F3F0; Sun, 3 Mar 2013 01:06:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95C77BE2; Sun, 3 Mar 2013 01:06:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2316SUn017111; Sun, 3 Mar 2013 01:06:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2316Opw017081; Sun, 3 Mar 2013 01:06:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303030106.r2316Opw017081@svn.freebsd.org> From: Attilio Rao Date: Sun, 3 Mar 2013 01:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247679 - in user/attilio/vmcontention: . contrib/openbsm/etc etc lib/libc/sys lib/libprocstat sbin/ipfw sbin/mount_hpfs sbin/mount_ntfs share/examples/portal share/man/man4 share/man/m... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 01:06:28 -0000 Author: attilio Date: Sun Mar 3 01:06:24 2013 New Revision: 247679 URL: http://svnweb.freebsd.org/changeset/base/247679 Log: MFC Added: user/attilio/vmcontention/lib/libc/sys/bindat.2 - copied unchanged from r247678, head/lib/libc/sys/bindat.2 user/attilio/vmcontention/lib/libc/sys/connectat.2 - copied unchanged from r247678, head/lib/libc/sys/connectat.2 Deleted: user/attilio/vmcontention/lib/libprocstat/ntfs.c user/attilio/vmcontention/sbin/mount_hpfs/ user/attilio/vmcontention/sbin/mount_ntfs/ user/attilio/vmcontention/share/examples/portal/ user/attilio/vmcontention/share/man/man4/coda.4 user/attilio/vmcontention/share/man/man5/xfs.5 user/attilio/vmcontention/sys/fs/coda/ user/attilio/vmcontention/sys/fs/hpfs/ user/attilio/vmcontention/sys/fs/ntfs/ user/attilio/vmcontention/sys/fs/portalfs/ user/attilio/vmcontention/sys/gnu/fs/xfs/ user/attilio/vmcontention/sys/modules/coda/ user/attilio/vmcontention/sys/modules/coda5/ user/attilio/vmcontention/sys/modules/hpfs/ user/attilio/vmcontention/sys/modules/ntfs/ user/attilio/vmcontention/sys/modules/ntfs_iconv/ user/attilio/vmcontention/sys/modules/portalfs/ user/attilio/vmcontention/sys/modules/xfs/ user/attilio/vmcontention/usr.sbin/mount_portalfs/ Modified: user/attilio/vmcontention/ObsoleteFiles.inc user/attilio/vmcontention/contrib/openbsm/etc/audit_event user/attilio/vmcontention/etc/devd.conf user/attilio/vmcontention/lib/libc/sys/Makefile.inc user/attilio/vmcontention/lib/libc/sys/Symbol.map user/attilio/vmcontention/lib/libc/sys/cap_rights_limit.2 user/attilio/vmcontention/sbin/ipfw/ipfw2.c user/attilio/vmcontention/sys/bsm/audit_kevents.h user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master user/attilio/vmcontention/sys/dev/pci/pci.c user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c user/attilio/vmcontention/sys/i386/xen/pmap.c user/attilio/vmcontention/sys/kern/capabilities.conf user/attilio/vmcontention/sys/kern/init_sysent.c user/attilio/vmcontention/sys/kern/syscalls.c user/attilio/vmcontention/sys/kern/syscalls.master user/attilio/vmcontention/sys/kern/systrace_args.c user/attilio/vmcontention/sys/kern/uipc_domain.c user/attilio/vmcontention/sys/kern/uipc_socket.c user/attilio/vmcontention/sys/kern/uipc_syscalls.c user/attilio/vmcontention/sys/kern/uipc_usrreq.c user/attilio/vmcontention/sys/netpfil/ipfw/ip_fw_dynamic.c user/attilio/vmcontention/sys/ofed/include/linux/timer.h user/attilio/vmcontention/sys/security/audit/audit.h user/attilio/vmcontention/sys/security/audit/audit_arg.c user/attilio/vmcontention/sys/security/audit/audit_bsm.c user/attilio/vmcontention/sys/sys/capability.h user/attilio/vmcontention/sys/sys/protosw.h user/attilio/vmcontention/sys/sys/socket.h user/attilio/vmcontention/sys/sys/socketvar.h user/attilio/vmcontention/sys/sys/syscall.h user/attilio/vmcontention/sys/sys/syscall.mk user/attilio/vmcontention/sys/sys/sysproto.h user/attilio/vmcontention/sys/sys/time.h user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/tools/regression/capsicum/syscalls/cap_ioctls_limit.c user/attilio/vmcontention/tools/regression/pjdfstest/Makefile user/attilio/vmcontention/tools/regression/pjdfstest/pjdfstest.c user/attilio/vmcontention/usr.bin/procstat/procstat_files.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/contrib/openbsm/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) Modified: user/attilio/vmcontention/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmcontention/ObsoleteFiles.inc Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/ObsoleteFiles.inc Sun Mar 3 01:06:24 2013 (r247679) @@ -38,6 +38,27 @@ # xargs -n1 | sort | uniq -d; # done +# 20130302: NTFS support removed +OLD_FILES+=usr/include/fs/ntfs/ntfs.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_inode.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_subr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_vfsops.h +OLD_FILES+=usr/include/fs/ntfs/ntfsmount.h +OLD_DIRS+=usr/include/fs/ntfs +OLD_FILES+=usr/share/man/man8/mount_ntfs.8.gz +# 20130302: PORTALFS support removed +OLD_FILES+=usr/include/fs/portalfs/portal.h +OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/share/examples/portal/README +OLD_FILES+=usr/share/examples/portal/portal.conf +OLD_DIRS+=usr/share/examples/portal +OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz +# 20130302: CODAFS support removed +OLD_FILES+=usr/share/man/man4/coda.4.gz +# 20130302: XFS support removed +OLD_FILES+=usr/share/man/man5/xfs.5.gz # 20130116: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout Modified: user/attilio/vmcontention/contrib/openbsm/etc/audit_event ============================================================================== --- user/attilio/vmcontention/contrib/openbsm/etc/audit_event Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/contrib/openbsm/etc/audit_event Sun Mar 3 01:06:24 2013 (r247679) @@ -568,6 +568,8 @@ 43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm 43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm 43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm +43207:AUE_BINDAT:bindat(2):nt +43208:AUE_CONNECTAT:connectat(2):nt # # Solaris userspace events. # Modified: user/attilio/vmcontention/etc/devd.conf ============================================================================== --- user/attilio/vmcontention/etc/devd.conf Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/etc/devd.conf Sun Mar 3 01:06:24 2013 (r247679) @@ -34,7 +34,7 @@ options { # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create # of a device with the same name; e.g. -# ifconfig bridge0 destroy; ifconfig bridge0 create +# ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { match "system" "IFNET"; @@ -165,7 +165,7 @@ notify 100 { }; # -# Rescan scsi device-names on attach, but not detach. However, it is +# Rescan SCSI device-names on attach, but not detach. However, it is # disabled by default due to reports of problems. # attach 0 { @@ -305,13 +305,13 @@ detach 10 { # events. See the ACPI specification for more information about # notifies. Here is the information returned for each subsystem: # -# ACAD: AC line state (0 is offline, 1 is online) -# Button: Button pressed (0 for power, 1 for sleep) -# CMBAT: ACPI battery events -# Lid: Lid state (0 is closed, 1 is open) -# RCTL: Resource limits +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification -# Thermal: ACPI thermal zone events +# Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the # notify value as the first argument. If the state is 0x00, it might Modified: user/attilio/vmcontention/lib/libc/sys/Makefile.inc ============================================================================== --- user/attilio/vmcontention/lib/libc/sys/Makefile.inc Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/lib/libc/sys/Makefile.inc Sun Mar 3 01:06:24 2013 (r247679) @@ -91,6 +91,7 @@ MAN+= abort2.2 \ aio_waitcomplete.2 \ aio_write.2 \ bind.2 \ + bindat.2 \ brk.2 \ cap_enter.2 \ cap_fcntls_limit.2 \ @@ -105,6 +106,7 @@ MAN+= abort2.2 \ close.2 \ closefrom.2 \ connect.2 \ + connectat.2 \ cpuset.2 \ cpuset_getaffinity.2 \ dup.2 \ Modified: user/attilio/vmcontention/lib/libc/sys/Symbol.map ============================================================================== --- user/attilio/vmcontention/lib/libc/sys/Symbol.map Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/lib/libc/sys/Symbol.map Sun Mar 3 01:06:24 2013 (r247679) @@ -378,6 +378,7 @@ FBSD_1.2 { }; FBSD_1.3 { + bindat; cap_fcntls_get; cap_fcntls_limit; cap_ioctls_get; @@ -386,6 +387,7 @@ FBSD_1.3 { cap_rights_limit; cap_sandboxed; clock_getcpuclockid2; + connectat; ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; Copied: user/attilio/vmcontention/lib/libc/sys/bindat.2 (from r247678, head/lib/libc/sys/bindat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/lib/libc/sys/bindat.2 Sun Mar 3 01:06:24 2013 (r247679, copy of r247678, head/lib/libc/sys/bindat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt BINDAT 2 +.Os +.Sh NAME +.Nm bindat +.Nd assign a local protocol address to a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn bindat "int fd" "int s" "const struct sockaddr *addr" "socklen_t addrlen" +.Sh DESCRIPTION +The +.Fn bindat +system call assigns the local protocol address to a socket. +It works just like the +.Xr bind 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn bindat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr bind 2 . +.El +.Sh RETURN VALUES +.Rv -std bindat +.Sh ERRORS +The +.Fn bindat +system call may fail with the same errors as the +.Xr bind 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bind 2 , +.Xr connectat 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmcontention/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- user/attilio/vmcontention/lib/libc/sys/cap_rights_limit.2 Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/lib/libc/sys/cap_rights_limit.2 Sun Mar 3 01:06:24 2013 (r247679) @@ -104,12 +104,20 @@ or and that socket options set with .Xr setsockopt 2 may also affect binding behavior. +.It Dv CAP_BINDAT +Permit +.Xr bindat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CONNECT Permit .Xr connect 2 ; also required for .Xr sendto 2 with a non-NULL destination address. +.It Dv CAP_CONNECTAT +Permit +.Xr connectat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CREATE Permit .Xr openat 2 @@ -511,11 +519,13 @@ argument points at an invalid address. .Xr aio_read 2 , .Xr aio_write 2 , .Xr bind 2 , +.Xr bindat 2 , .Xr cap_enter 2 , .Xr cap_fcntls_limit 2 , .Xr cap_ioctls_limit 2 , .Xr cap_rights_limit 2 , .Xr connect 2 , +.Xr connectat 2 , .Xr dup 2 , .Xr dup2 2 , .Xr extattr_delete_fd 2 , Copied: user/attilio/vmcontention/lib/libc/sys/connectat.2 (from r247678, head/lib/libc/sys/connectat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/lib/libc/sys/connectat.2 Sun Mar 3 01:06:24 2013 (r247679, copy of r247678, head/lib/libc/sys/connectat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt CONNECTAT 2 +.Os +.Sh NAME +.Nm connectat +.Nd initiate a connection on a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn connectat "int fd" "int s" "const struct sockaddr *name" "socklen_t namelen" +.Sh DESCRIPTION +The +.Fn connectat +system call initiates a connection on a socket. +It works just like the +.Xr connect 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn connectat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr connect 2 . +.El +.Sh RETURN VALUES +.Rv -std connectat +.Sh ERRORS +The +.Fn connectat +system call may fail with the same errors as the +.Xr connect 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bindat 2 , +.Xr connect 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmcontention/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipfw2.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sbin/ipfw/ipfw2.c Sun Mar 3 01:06:24 2013 (r247679) @@ -3912,6 +3912,7 @@ ipfw_flush(int force) static void table_list(uint16_t num, int need_header); +static void table_fill_xentry(char *arg, ipfw_table_xentry *xent); /* * This one handles all table-related commands @@ -3927,8 +3928,7 @@ ipfw_table_handler(int ac, char *av[]) int do_add; int is_all; size_t len; - char *p; - uint32_t a, type, mask, addrlen; + uint32_t a, mask; uint32_t tables_max; mask = 0; // XXX uninitialized ? @@ -3965,57 +3965,8 @@ ipfw_table_handler(int ac, char *av[]) ac--; av++; if (!ac) errx(EX_USAGE, "address required"); - /* - * Let's try to guess type by agrument. - * Possible types: - * 1) IPv4[/mask] - * 2) IPv6[/mask] - * 3) interface name - * 4) port ? - */ - type = 0; - if (ishexnumber(*av[0])) { - /* Remove / if exists */ - if ((p = strchr(*av, '/')) != NULL) { - *p = '\0'; - mask = atoi(p + 1); - } - - if (inet_pton(AF_INET, *av, &xent.k.addr6) == 1) { - type = IPFW_TABLE_CIDR; - if ((p != NULL) && (mask > 32)) - errx(EX_DATAERR, "bad IPv4 mask width: %s", p + 1); - xent.masklen = p ? mask : 32; - addrlen = sizeof(struct in_addr); - } else if (inet_pton(AF_INET6, *av, &xent.k.addr6) == 1) { - type = IPFW_TABLE_CIDR; - if ((p != NULL) && (mask > 128)) - errx(EX_DATAERR, "bad IPv6 mask width: %s", p + 1); - xent.masklen = p ? mask : 128; - addrlen = sizeof(struct in6_addr); - } - } - - if ((type == 0) && (strchr(*av, '.') == NULL)) { - /* Assume interface name. Copy significant data only */ - mask = MIN(strlen(*av), IF_NAMESIZE - 1); - memcpy(xent.k.iface, *av, mask); - /* Set mask to exact match */ - xent.masklen = 8 * IF_NAMESIZE; - type = IPFW_TABLE_INTERFACE; - addrlen = IF_NAMESIZE; - } - if (type == 0) { - if (lookup_host(*av, (struct in_addr *)&xent.k.addr6) != 0) - errx(EX_NOHOST, "hostname ``%s'' unknown", *av); - xent.masklen = 32; - type = IPFW_TABLE_CIDR; - addrlen = sizeof(struct in_addr); - } - - xent.type = type; - xent.len = offsetof(ipfw_table_xentry, k) + addrlen; + table_fill_xentry(*av, &xent); ac--; av++; if (do_add && ac) { @@ -4065,6 +4016,93 @@ ipfw_table_handler(int ac, char *av[]) } static void +table_fill_xentry(char *arg, ipfw_table_xentry *xent) +{ + int addrlen, mask, masklen, type; + struct in6_addr *paddr; + uint32_t *pkey; + char *p; + uint32_t key; + + mask = 0; + type = 0; + addrlen = 0; + masklen = 0; + + /* + * Let's try to guess type by agrument. + * Possible types: + * 1) IPv4[/mask] + * 2) IPv6[/mask] + * 3) interface name + * 4) port, uid/gid or other u32 key (base 10 format) + * 5) hostname + */ + paddr = &xent->k.addr6; + if (ishexnumber(*arg) != 0 || *arg == ':') { + /* Remove / if exists */ + if ((p = strchr(arg, '/')) != NULL) { + *p = '\0'; + mask = atoi(p + 1); + } + + if (inet_pton(AF_INET, arg, paddr) == 1) { + if (p != NULL && mask > 32) + errx(EX_DATAERR, "bad IPv4 mask width: %s", + p + 1); + + type = IPFW_TABLE_CIDR; + masklen = p ? mask : 32; + addrlen = sizeof(struct in_addr); + } else if (inet_pton(AF_INET6, arg, paddr) == 1) { + if (IN6_IS_ADDR_V4COMPAT(paddr)) + errx(EX_DATAERR, + "Use IPv4 instead of v4-compatible"); + if (p != NULL && mask > 128) + errx(EX_DATAERR, "bad IPv6 mask width: %s", + p + 1); + + type = IPFW_TABLE_CIDR; + masklen = p ? mask : 128; + addrlen = sizeof(struct in6_addr); + } else { + /* Port or any other key */ + key = strtol(arg, &p, 10); + /* Skip non-base 10 entries like 'fa1' */ + if (p != arg) { + pkey = (uint32_t *)paddr; + *pkey = htonl(key); + type = IPFW_TABLE_CIDR; + addrlen = sizeof(uint32_t); + } + } + } + + if (type == 0 && strchr(arg, '.') == NULL) { + /* Assume interface name. Copy significant data only */ + mask = MIN(strlen(arg), IF_NAMESIZE - 1); + memcpy(xent->k.iface, arg, mask); + /* Set mask to exact match */ + masklen = 8 * IF_NAMESIZE; + type = IPFW_TABLE_INTERFACE; + addrlen = IF_NAMESIZE; + } + + if (type == 0) { + if (lookup_host(arg, (struct in_addr *)paddr) != 0) + errx(EX_NOHOST, "hostname ``%s'' unknown", arg); + + masklen = 32; + type = IPFW_TABLE_CIDR; + addrlen = sizeof(struct in_addr); + } + + xent->type = type; + xent->masklen = masklen; + xent->len = offsetof(ipfw_table_xentry, k) + addrlen; +} + +static void table_list(uint16_t num, int need_header) { ipfw_xtable *tbl; @@ -4107,8 +4145,8 @@ table_list(uint16_t num, int need_header tval = xent->value; addr6 = &xent->k.addr6; - if ((addr6->s6_addr32[0] == 0) && (addr6->s6_addr32[1] == 0) && - (addr6->s6_addr32[2] == 0)) { + + if (IN6_IS_ADDR_V4COMPAT(addr6)) { /* IPv4 address */ inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf)); } else { Modified: user/attilio/vmcontention/sys/bsm/audit_kevents.h ============================================================================== --- user/attilio/vmcontention/sys/bsm/audit_kevents.h Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/bsm/audit_kevents.h Sun Mar 3 01:06:24 2013 (r247679) @@ -608,6 +608,8 @@ #define AUE_CAP_IOCTLS_GET 43204 /* TrustedBSD. */ #define AUE_CAP_FCNTLS_LIMIT 43205 /* TrustedBSD. */ #define AUE_CAP_FCNTLS_GET 43206 /* TrustedBSD. */ +#define AUE_BINDAT 43207 /* TrustedBSD. */ +#define AUE_CONNECTAT 43208 /* TrustedBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_proto.h Sun Mar 3 01:06:24 2013 (r247679) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscall.h Sun Mar 3 01:06:24 2013 (r247679) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #define FREEBSD32_SYS_syscall 0 @@ -435,4 +435,6 @@ #define FREEBSD32_SYS_cap_ioctls_get 535 #define FREEBSD32_SYS_cap_fcntls_limit 536 #define FREEBSD32_SYS_cap_fcntls_get 537 -#define FREEBSD32_SYS_MAXSYSCALL 538 +#define FREEBSD32_SYS_bindat 538 +#define FREEBSD32_SYS_connectat 539 +#define FREEBSD32_SYS_MAXSYSCALL 540 Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_syscalls.c Sun Mar 3 01:06:24 2013 (r247679) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ const char *freebsd32_syscallnames[] = { @@ -561,4 +561,6 @@ const char *freebsd32_syscallnames[] = { "cap_ioctls_get", /* 535 = cap_ioctls_get */ "cap_fcntls_limit", /* 536 = cap_fcntls_limit */ "cap_fcntls_get", /* 537 = cap_fcntls_get */ + "bindat", /* 538 = bindat */ + "connectat", /* 539 = connectat */ }; Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_sysent.c Sun Mar 3 01:06:24 2013 (r247679) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #include "opt_compat.h" @@ -598,4 +598,6 @@ struct sysent freebsd32_sysent[] = { { AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = cap_ioctls_get */ { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */ { AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 537 = cap_fcntls_get */ + { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */ + { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ }; Modified: user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Mar 3 01:06:24 2013 (r247679) @@ -3130,6 +3130,26 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* bindat */ + case 538: { + struct bindat_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->s; /* int */ + uarg[2] = (intptr_t) p->name; /* caddr_t */ + iarg[3] = p->namelen; /* int */ + *n_args = 4; + break; + } + /* connectat */ + case 539: { + struct connectat_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->s; /* int */ + uarg[2] = (intptr_t) p->name; /* caddr_t */ + iarg[3] = p->namelen; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8356,6 +8376,44 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* bindat */ + case 538: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "caddr_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; + /* connectat */ + case 539: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "caddr_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10143,6 +10201,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* bindat */ + case 538: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* connectat */ + case 539: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master ============================================================================== --- user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/compat/freebsd32/syscalls.master Sun Mar 3 01:06:24 2013 (r247679) @@ -1015,3 +1015,7 @@ uint32_t fcntlrights); } 537 AUE_CAP_FCNTLS_GET NOPROTO { int cap_fcntls_get(int fd, \ uint32_t *fcntlrightsp); } +538 AUE_BINDAT NOPROTO { int bindat(int fd, int s, caddr_t name, \ + int namelen); } +539 AUE_CONNECTAT NOPROTO { int connectat(int fd, int s, caddr_t name, \ + int namelen); } Modified: user/attilio/vmcontention/sys/dev/pci/pci.c ============================================================================== --- user/attilio/vmcontention/sys/dev/pci/pci.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/dev/pci/pci.c Sun Mar 3 01:06:24 2013 (r247679) @@ -234,10 +234,11 @@ static const struct pci_quirk pci_quirks { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X doesn't work with at least LSI SAS1068E passed through by - * VMware. + * MSI-X allocation doesn't work properly for devices passed through + * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCIe */ /* * Some virtualization environments emulate an older chipset @@ -3643,11 +3644,11 @@ pci_print_child(device_t dev, device_t c return (retval); } -static struct +static const struct { - int class; - int subclass; - char *desc; + int class; + int subclass; + const char *desc; } pci_nomatch_tab[] = { {PCIC_OLD, -1, "old"}, {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, @@ -3739,8 +3740,9 @@ static struct void pci_probe_nomatch(device_t dev, device_t child) { - int i; - char *cp, *scp, *device; + int i; + const char *cp, *scp; + char *device; /* * Look for a listing for this device in a loaded device database. @@ -3773,7 +3775,6 @@ pci_probe_nomatch(device_t dev, device_t printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); - return; } /* Modified: user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c ============================================================================== --- user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c Sun Mar 3 01:06:24 2013 (r247679) @@ -32,21 +32,72 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include +#define NTFS_A_VOLUMENAME 0x60 +#define NTFS_FILEMAGIC ((uint32_t)(0x454C4946)) +#define NTFS_VOLUMEINO 3 + #define G_LABEL_NTFS_DIR "ntfs" +struct ntfs_attr { + uint32_t a_type; + uint32_t reclen; + uint8_t a_flag; + uint8_t a_namelen; + uint8_t a_nameoff; + uint8_t reserved1; + uint8_t a_compression; + uint8_t reserved2; + uint16_t a_index; + uint16_t a_datalen; + uint16_t reserved3; + uint16_t a_dataoff; + uint16_t a_indexed; +}; + +struct ntfs_filerec { + uint32_t fr_hdrmagic; + uint16_t fr_hdrfoff; + uint16_t fr_hdrfnum; + uint8_t reserved[8]; + uint16_t fr_seqnum; + uint16_t fr_nlink; + uint16_t fr_attroff; + uint16_t fr_flags; + uint32_t fr_size; + uint32_t fr_allocated; + uint64_t fr_mainrec; + uint16_t fr_attrnum; +}; + +struct ntfs_bootfile { + uint8_t reserved1[3]; + uint8_t bf_sysid[8]; + uint16_t bf_bps; + uint8_t bf_spc; + uint8_t reserved2[7]; + uint8_t bf_media; + uint8_t reserved3[2]; + uint16_t bf_spt; + uint16_t bf_heads; + uint8_t reserver4[12]; + uint64_t bf_spv; + uint64_t bf_mftcn; + uint64_t bf_mftmirrcn; + uint8_t bf_mftrecsz; + uint32_t bf_ibsz; + uint32_t bf_volsn; +}; static void g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) { struct g_provider *pp; - struct bootfile *bf; - struct filerec *fr; - struct attr *atr; + struct ntfs_bootfile *bf; + struct ntfs_filerec *fr; + struct ntfs_attr *atr; off_t voloff; char *filerecp, *ap; char mftrecsz, vnchar; @@ -58,7 +109,7 @@ g_label_ntfs_taste(struct g_consumer *cp pp = cp->provider; filerecp = NULL; - bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); + bf = (struct ntfs_bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; @@ -75,16 +126,16 @@ g_label_ntfs_taste(struct g_consumer *cp filerecp = g_read_data(cp, voloff, recsize, NULL); if (filerecp == NULL) goto done; - fr = (struct filerec *)filerecp; + fr = (struct ntfs_filerec *)filerecp; - if (fr->fr_fixup.fh_magic != NTFS_FILEMAGIC) + if (fr->fr_hdrmagic != NTFS_FILEMAGIC) goto done; for (ap = filerecp + fr->fr_attroff; - atr = (struct attr *)ap, atr->a_hdr.a_type != -1; - ap += atr->a_hdr.reclen) { - if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) { - if(atr->a_r.a_datalen >= size *2){ + atr = (struct ntfs_attr *)ap, atr->a_type != -1; + ap += atr->reclen) { + if (atr->a_type == NTFS_A_VOLUMENAME) { + if(atr->a_datalen >= size *2){ label[0] = 0; goto done; } @@ -92,8 +143,8 @@ g_label_ntfs_taste(struct g_consumer *cp *UNICODE to ASCII. * Should we need to use iconv(9)? */ - for (j = 0; j < atr->a_r.a_datalen; j++) { - vnchar = *(ap + atr->a_r.a_dataoff + j); + for (j = 0; j < atr->a_datalen; j++) { + vnchar = *(ap + atr->a_dataoff + j); if (j & 1) { if (vnchar) { label[0] = 0; Modified: user/attilio/vmcontention/sys/i386/xen/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/i386/xen/pmap.c Sun Mar 3 01:02:57 2013 (r247678) +++ user/attilio/vmcontention/sys/i386/xen/pmap.c Sun Mar 3 01:06:24 2013 (r247679) @@ -2038,7 +2038,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if ((tpte & PG_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); pc->pc_map[field] |= 1UL << bit; @@ -2239,9 +2239,9 @@ pmap_pvh_remove(struct md_page *pvh, pma pv_entry_t pv; rw_assert(&pvh_global_lock, RA_WLOCKED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); break; } } @@ -2281,7 +2281,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm if (pv_entry_count < pv_entry_high_water && (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2503,7 +2503,7 @@ pmap_remove_all(vm_page_t m) vm_page_dirty(m); pmap_unuse_pt(pmap, pv->pv_va, &free); pmap_invalidate_page(pmap, pv->pv_va); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2770,7 +2770,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3465,7 +3465,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; rw_wlock(&pvh_global_lock); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -3497,7 +3497,7 @@ pmap_page_wired_mappings(vm_page_t m) return (count); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3602,7 +3602,7 @@ pmap_remove_pages(pmap_t pmap) if (tpte & PG_M) vm_page_dirty(m); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3662,7 +3662,7 @@ pmap_is_modified(vm_page_t m) return (rv); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 01:10:53 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C650552C; Sun, 3 Mar 2013 01:10:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6A05BF6; Sun, 3 Mar 2013 01:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r231ArTE019508; Sun, 3 Mar 2013 01:10:53 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r231An08019467; Sun, 3 Mar 2013 01:10:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303030110.r231An08019467@svn.freebsd.org> From: Attilio Rao Date: Sun, 3 Mar 2013 01:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247680 - in user/attilio/vmc-playground: . contrib/openbsm/etc etc lib/libc/sys lib/libprocstat sbin/ipfw sbin/mount_hpfs sbin/mount_ntfs share/examples/portal share/man/man4 share/man... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 01:10:53 -0000 Author: attilio Date: Sun Mar 3 01:10:49 2013 New Revision: 247680 URL: http://svnweb.freebsd.org/changeset/base/247680 Log: Merge from vmcontention Added: user/attilio/vmc-playground/lib/libc/sys/bindat.2 - copied unchanged from r247679, user/attilio/vmcontention/lib/libc/sys/bindat.2 user/attilio/vmc-playground/lib/libc/sys/connectat.2 - copied unchanged from r247679, user/attilio/vmcontention/lib/libc/sys/connectat.2 Deleted: user/attilio/vmc-playground/lib/libprocstat/ntfs.c user/attilio/vmc-playground/sbin/mount_hpfs/ user/attilio/vmc-playground/sbin/mount_ntfs/ user/attilio/vmc-playground/share/examples/portal/ user/attilio/vmc-playground/share/man/man4/coda.4 user/attilio/vmc-playground/share/man/man5/xfs.5 user/attilio/vmc-playground/sys/fs/coda/ user/attilio/vmc-playground/sys/fs/hpfs/ user/attilio/vmc-playground/sys/fs/ntfs/ user/attilio/vmc-playground/sys/fs/portalfs/ user/attilio/vmc-playground/sys/gnu/fs/xfs/ user/attilio/vmc-playground/sys/modules/coda/ user/attilio/vmc-playground/sys/modules/coda5/ user/attilio/vmc-playground/sys/modules/hpfs/ user/attilio/vmc-playground/sys/modules/ntfs/ user/attilio/vmc-playground/sys/modules/ntfs_iconv/ user/attilio/vmc-playground/sys/modules/portalfs/ user/attilio/vmc-playground/sys/modules/xfs/ user/attilio/vmc-playground/usr.sbin/mount_portalfs/ Modified: user/attilio/vmc-playground/ObsoleteFiles.inc user/attilio/vmc-playground/contrib/openbsm/etc/audit_event user/attilio/vmc-playground/etc/devd.conf user/attilio/vmc-playground/lib/libc/sys/Makefile.inc user/attilio/vmc-playground/lib/libc/sys/Symbol.map user/attilio/vmc-playground/lib/libc/sys/cap_rights_limit.2 user/attilio/vmc-playground/sbin/ipfw/ipfw2.c user/attilio/vmc-playground/sys/bsm/audit_kevents.h user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_proto.h user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscall.h user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscalls.c user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_sysent.c user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_systrace_args.c user/attilio/vmc-playground/sys/compat/freebsd32/syscalls.master user/attilio/vmc-playground/sys/dev/pci/pci.c user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c user/attilio/vmc-playground/sys/i386/xen/pmap.c user/attilio/vmc-playground/sys/kern/capabilities.conf user/attilio/vmc-playground/sys/kern/init_sysent.c user/attilio/vmc-playground/sys/kern/syscalls.c user/attilio/vmc-playground/sys/kern/syscalls.master user/attilio/vmc-playground/sys/kern/systrace_args.c user/attilio/vmc-playground/sys/kern/uipc_domain.c user/attilio/vmc-playground/sys/kern/uipc_socket.c user/attilio/vmc-playground/sys/kern/uipc_syscalls.c user/attilio/vmc-playground/sys/kern/uipc_usrreq.c user/attilio/vmc-playground/sys/netpfil/ipfw/ip_fw_dynamic.c user/attilio/vmc-playground/sys/ofed/include/linux/timer.h user/attilio/vmc-playground/sys/security/audit/audit.h user/attilio/vmc-playground/sys/security/audit/audit_arg.c user/attilio/vmc-playground/sys/security/audit/audit_bsm.c user/attilio/vmc-playground/sys/sys/capability.h user/attilio/vmc-playground/sys/sys/protosw.h user/attilio/vmc-playground/sys/sys/socket.h user/attilio/vmc-playground/sys/sys/socketvar.h user/attilio/vmc-playground/sys/sys/syscall.h user/attilio/vmc-playground/sys/sys/syscall.mk user/attilio/vmc-playground/sys/sys/sysproto.h user/attilio/vmc-playground/sys/sys/time.h user/attilio/vmc-playground/sys/vm/vm_object.c user/attilio/vmc-playground/tools/regression/capsicum/syscalls/cap_ioctls_limit.c user/attilio/vmc-playground/tools/regression/pjdfstest/Makefile user/attilio/vmc-playground/tools/regression/pjdfstest/pjdfstest.c user/attilio/vmc-playground/usr.bin/procstat/procstat_files.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/contrib/openbsm/ (props changed) user/attilio/vmc-playground/lib/libc/ (props changed) user/attilio/vmc-playground/sbin/ (props changed) user/attilio/vmc-playground/sbin/ipfw/ (props changed) user/attilio/vmc-playground/share/man/man4/ (props changed) user/attilio/vmc-playground/sys/ (props changed) user/attilio/vmc-playground/usr.bin/procstat/ (props changed) Modified: user/attilio/vmc-playground/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmc-playground/ObsoleteFiles.inc Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/ObsoleteFiles.inc Sun Mar 3 01:10:49 2013 (r247680) @@ -38,6 +38,27 @@ # xargs -n1 | sort | uniq -d; # done +# 20130302: NTFS support removed +OLD_FILES+=usr/include/fs/ntfs/ntfs.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_inode.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_subr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_vfsops.h +OLD_FILES+=usr/include/fs/ntfs/ntfsmount.h +OLD_DIRS+=usr/include/fs/ntfs +OLD_FILES+=usr/share/man/man8/mount_ntfs.8.gz +# 20130302: PORTALFS support removed +OLD_FILES+=usr/include/fs/portalfs/portal.h +OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/share/examples/portal/README +OLD_FILES+=usr/share/examples/portal/portal.conf +OLD_DIRS+=usr/share/examples/portal +OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz +# 20130302: CODAFS support removed +OLD_FILES+=usr/share/man/man4/coda.4.gz +# 20130302: XFS support removed +OLD_FILES+=usr/share/man/man5/xfs.5.gz # 20130116: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout Modified: user/attilio/vmc-playground/contrib/openbsm/etc/audit_event ============================================================================== --- user/attilio/vmc-playground/contrib/openbsm/etc/audit_event Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/contrib/openbsm/etc/audit_event Sun Mar 3 01:10:49 2013 (r247680) @@ -568,6 +568,8 @@ 43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm 43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm 43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm +43207:AUE_BINDAT:bindat(2):nt +43208:AUE_CONNECTAT:connectat(2):nt # # Solaris userspace events. # Modified: user/attilio/vmc-playground/etc/devd.conf ============================================================================== --- user/attilio/vmc-playground/etc/devd.conf Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/etc/devd.conf Sun Mar 3 01:10:49 2013 (r247680) @@ -34,7 +34,7 @@ options { # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create # of a device with the same name; e.g. -# ifconfig bridge0 destroy; ifconfig bridge0 create +# ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { match "system" "IFNET"; @@ -165,7 +165,7 @@ notify 100 { }; # -# Rescan scsi device-names on attach, but not detach. However, it is +# Rescan SCSI device-names on attach, but not detach. However, it is # disabled by default due to reports of problems. # attach 0 { @@ -305,13 +305,13 @@ detach 10 { # events. See the ACPI specification for more information about # notifies. Here is the information returned for each subsystem: # -# ACAD: AC line state (0 is offline, 1 is online) -# Button: Button pressed (0 for power, 1 for sleep) -# CMBAT: ACPI battery events -# Lid: Lid state (0 is closed, 1 is open) -# RCTL: Resource limits +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification -# Thermal: ACPI thermal zone events +# Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the # notify value as the first argument. If the state is 0x00, it might Modified: user/attilio/vmc-playground/lib/libc/sys/Makefile.inc ============================================================================== --- user/attilio/vmc-playground/lib/libc/sys/Makefile.inc Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/lib/libc/sys/Makefile.inc Sun Mar 3 01:10:49 2013 (r247680) @@ -91,6 +91,7 @@ MAN+= abort2.2 \ aio_waitcomplete.2 \ aio_write.2 \ bind.2 \ + bindat.2 \ brk.2 \ cap_enter.2 \ cap_fcntls_limit.2 \ @@ -105,6 +106,7 @@ MAN+= abort2.2 \ close.2 \ closefrom.2 \ connect.2 \ + connectat.2 \ cpuset.2 \ cpuset_getaffinity.2 \ dup.2 \ Modified: user/attilio/vmc-playground/lib/libc/sys/Symbol.map ============================================================================== --- user/attilio/vmc-playground/lib/libc/sys/Symbol.map Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/lib/libc/sys/Symbol.map Sun Mar 3 01:10:49 2013 (r247680) @@ -378,6 +378,7 @@ FBSD_1.2 { }; FBSD_1.3 { + bindat; cap_fcntls_get; cap_fcntls_limit; cap_ioctls_get; @@ -386,6 +387,7 @@ FBSD_1.3 { cap_rights_limit; cap_sandboxed; clock_getcpuclockid2; + connectat; ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; Copied: user/attilio/vmc-playground/lib/libc/sys/bindat.2 (from r247679, user/attilio/vmcontention/lib/libc/sys/bindat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/lib/libc/sys/bindat.2 Sun Mar 3 01:10:49 2013 (r247680, copy of r247679, user/attilio/vmcontention/lib/libc/sys/bindat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt BINDAT 2 +.Os +.Sh NAME +.Nm bindat +.Nd assign a local protocol address to a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn bindat "int fd" "int s" "const struct sockaddr *addr" "socklen_t addrlen" +.Sh DESCRIPTION +The +.Fn bindat +system call assigns the local protocol address to a socket. +It works just like the +.Xr bind 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn bindat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr bind 2 . +.El +.Sh RETURN VALUES +.Rv -std bindat +.Sh ERRORS +The +.Fn bindat +system call may fail with the same errors as the +.Xr bind 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bind 2 , +.Xr connectat 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmc-playground/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- user/attilio/vmc-playground/lib/libc/sys/cap_rights_limit.2 Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/lib/libc/sys/cap_rights_limit.2 Sun Mar 3 01:10:49 2013 (r247680) @@ -104,12 +104,20 @@ or and that socket options set with .Xr setsockopt 2 may also affect binding behavior. +.It Dv CAP_BINDAT +Permit +.Xr bindat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CONNECT Permit .Xr connect 2 ; also required for .Xr sendto 2 with a non-NULL destination address. +.It Dv CAP_CONNECTAT +Permit +.Xr connectat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CREATE Permit .Xr openat 2 @@ -511,11 +519,13 @@ argument points at an invalid address. .Xr aio_read 2 , .Xr aio_write 2 , .Xr bind 2 , +.Xr bindat 2 , .Xr cap_enter 2 , .Xr cap_fcntls_limit 2 , .Xr cap_ioctls_limit 2 , .Xr cap_rights_limit 2 , .Xr connect 2 , +.Xr connectat 2 , .Xr dup 2 , .Xr dup2 2 , .Xr extattr_delete_fd 2 , Copied: user/attilio/vmc-playground/lib/libc/sys/connectat.2 (from r247679, user/attilio/vmcontention/lib/libc/sys/connectat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/lib/libc/sys/connectat.2 Sun Mar 3 01:10:49 2013 (r247680, copy of r247679, user/attilio/vmcontention/lib/libc/sys/connectat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt CONNECTAT 2 +.Os +.Sh NAME +.Nm connectat +.Nd initiate a connection on a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn connectat "int fd" "int s" "const struct sockaddr *name" "socklen_t namelen" +.Sh DESCRIPTION +The +.Fn connectat +system call initiates a connection on a socket. +It works just like the +.Xr connect 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn connectat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr connect 2 . +.El +.Sh RETURN VALUES +.Rv -std connectat +.Sh ERRORS +The +.Fn connectat +system call may fail with the same errors as the +.Xr connect 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bindat 2 , +.Xr connect 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmc-playground/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Sun Mar 3 01:10:49 2013 (r247680) @@ -3912,6 +3912,7 @@ ipfw_flush(int force) static void table_list(uint16_t num, int need_header); +static void table_fill_xentry(char *arg, ipfw_table_xentry *xent); /* * This one handles all table-related commands @@ -3927,8 +3928,7 @@ ipfw_table_handler(int ac, char *av[]) int do_add; int is_all; size_t len; - char *p; - uint32_t a, type, mask, addrlen; + uint32_t a, mask; uint32_t tables_max; mask = 0; // XXX uninitialized ? @@ -3965,57 +3965,8 @@ ipfw_table_handler(int ac, char *av[]) ac--; av++; if (!ac) errx(EX_USAGE, "address required"); - /* - * Let's try to guess type by agrument. - * Possible types: - * 1) IPv4[/mask] - * 2) IPv6[/mask] - * 3) interface name - * 4) port ? - */ - type = 0; - if (ishexnumber(*av[0])) { - /* Remove / if exists */ - if ((p = strchr(*av, '/')) != NULL) { - *p = '\0'; - mask = atoi(p + 1); - } - - if (inet_pton(AF_INET, *av, &xent.k.addr6) == 1) { - type = IPFW_TABLE_CIDR; - if ((p != NULL) && (mask > 32)) - errx(EX_DATAERR, "bad IPv4 mask width: %s", p + 1); - xent.masklen = p ? mask : 32; - addrlen = sizeof(struct in_addr); - } else if (inet_pton(AF_INET6, *av, &xent.k.addr6) == 1) { - type = IPFW_TABLE_CIDR; - if ((p != NULL) && (mask > 128)) - errx(EX_DATAERR, "bad IPv6 mask width: %s", p + 1); - xent.masklen = p ? mask : 128; - addrlen = sizeof(struct in6_addr); - } - } - - if ((type == 0) && (strchr(*av, '.') == NULL)) { - /* Assume interface name. Copy significant data only */ - mask = MIN(strlen(*av), IF_NAMESIZE - 1); - memcpy(xent.k.iface, *av, mask); - /* Set mask to exact match */ - xent.masklen = 8 * IF_NAMESIZE; - type = IPFW_TABLE_INTERFACE; - addrlen = IF_NAMESIZE; - } - if (type == 0) { - if (lookup_host(*av, (struct in_addr *)&xent.k.addr6) != 0) - errx(EX_NOHOST, "hostname ``%s'' unknown", *av); - xent.masklen = 32; - type = IPFW_TABLE_CIDR; - addrlen = sizeof(struct in_addr); - } - - xent.type = type; - xent.len = offsetof(ipfw_table_xentry, k) + addrlen; + table_fill_xentry(*av, &xent); ac--; av++; if (do_add && ac) { @@ -4065,6 +4016,93 @@ ipfw_table_handler(int ac, char *av[]) } static void +table_fill_xentry(char *arg, ipfw_table_xentry *xent) +{ + int addrlen, mask, masklen, type; + struct in6_addr *paddr; + uint32_t *pkey; + char *p; + uint32_t key; + + mask = 0; + type = 0; + addrlen = 0; + masklen = 0; + + /* + * Let's try to guess type by agrument. + * Possible types: + * 1) IPv4[/mask] + * 2) IPv6[/mask] + * 3) interface name + * 4) port, uid/gid or other u32 key (base 10 format) + * 5) hostname + */ + paddr = &xent->k.addr6; + if (ishexnumber(*arg) != 0 || *arg == ':') { + /* Remove / if exists */ + if ((p = strchr(arg, '/')) != NULL) { + *p = '\0'; + mask = atoi(p + 1); + } + + if (inet_pton(AF_INET, arg, paddr) == 1) { + if (p != NULL && mask > 32) + errx(EX_DATAERR, "bad IPv4 mask width: %s", + p + 1); + + type = IPFW_TABLE_CIDR; + masklen = p ? mask : 32; + addrlen = sizeof(struct in_addr); + } else if (inet_pton(AF_INET6, arg, paddr) == 1) { + if (IN6_IS_ADDR_V4COMPAT(paddr)) + errx(EX_DATAERR, + "Use IPv4 instead of v4-compatible"); + if (p != NULL && mask > 128) + errx(EX_DATAERR, "bad IPv6 mask width: %s", + p + 1); + + type = IPFW_TABLE_CIDR; + masklen = p ? mask : 128; + addrlen = sizeof(struct in6_addr); + } else { + /* Port or any other key */ + key = strtol(arg, &p, 10); + /* Skip non-base 10 entries like 'fa1' */ + if (p != arg) { + pkey = (uint32_t *)paddr; + *pkey = htonl(key); + type = IPFW_TABLE_CIDR; + addrlen = sizeof(uint32_t); + } + } + } + + if (type == 0 && strchr(arg, '.') == NULL) { + /* Assume interface name. Copy significant data only */ + mask = MIN(strlen(arg), IF_NAMESIZE - 1); + memcpy(xent->k.iface, arg, mask); + /* Set mask to exact match */ + masklen = 8 * IF_NAMESIZE; + type = IPFW_TABLE_INTERFACE; + addrlen = IF_NAMESIZE; + } + + if (type == 0) { + if (lookup_host(arg, (struct in_addr *)paddr) != 0) + errx(EX_NOHOST, "hostname ``%s'' unknown", arg); + + masklen = 32; + type = IPFW_TABLE_CIDR; + addrlen = sizeof(struct in_addr); + } + + xent->type = type; + xent->masklen = masklen; + xent->len = offsetof(ipfw_table_xentry, k) + addrlen; +} + +static void table_list(uint16_t num, int need_header) { ipfw_xtable *tbl; @@ -4107,8 +4145,8 @@ table_list(uint16_t num, int need_header tval = xent->value; addr6 = &xent->k.addr6; - if ((addr6->s6_addr32[0] == 0) && (addr6->s6_addr32[1] == 0) && - (addr6->s6_addr32[2] == 0)) { + + if (IN6_IS_ADDR_V4COMPAT(addr6)) { /* IPv4 address */ inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf)); } else { Modified: user/attilio/vmc-playground/sys/bsm/audit_kevents.h ============================================================================== --- user/attilio/vmc-playground/sys/bsm/audit_kevents.h Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/bsm/audit_kevents.h Sun Mar 3 01:10:49 2013 (r247680) @@ -608,6 +608,8 @@ #define AUE_CAP_IOCTLS_GET 43204 /* TrustedBSD. */ #define AUE_CAP_FCNTLS_LIMIT 43205 /* TrustedBSD. */ #define AUE_CAP_FCNTLS_GET 43206 /* TrustedBSD. */ +#define AUE_BINDAT 43207 /* TrustedBSD. */ +#define AUE_CONNECTAT 43208 /* TrustedBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_proto.h Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_proto.h Sun Mar 3 01:10:49 2013 (r247680) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscall.h Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscall.h Sun Mar 3 01:10:49 2013 (r247680) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #define FREEBSD32_SYS_syscall 0 @@ -435,4 +435,6 @@ #define FREEBSD32_SYS_cap_ioctls_get 535 #define FREEBSD32_SYS_cap_fcntls_limit 536 #define FREEBSD32_SYS_cap_fcntls_get 537 -#define FREEBSD32_SYS_MAXSYSCALL 538 +#define FREEBSD32_SYS_bindat 538 +#define FREEBSD32_SYS_connectat 539 +#define FREEBSD32_SYS_MAXSYSCALL 540 Modified: user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscalls.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_syscalls.c Sun Mar 3 01:10:49 2013 (r247680) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ const char *freebsd32_syscallnames[] = { @@ -561,4 +561,6 @@ const char *freebsd32_syscallnames[] = { "cap_ioctls_get", /* 535 = cap_ioctls_get */ "cap_fcntls_limit", /* 536 = cap_fcntls_limit */ "cap_fcntls_get", /* 537 = cap_fcntls_get */ + "bindat", /* 538 = bindat */ + "connectat", /* 539 = connectat */ }; Modified: user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_sysent.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_sysent.c Sun Mar 3 01:10:49 2013 (r247680) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247602 2013-03-02 00:53:12Z pjd + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 247667 2013-03-02 21:11:30Z pjd */ #include "opt_compat.h" @@ -598,4 +598,6 @@ struct sysent freebsd32_sysent[] = { { AS(cap_ioctls_get_args), (sy_call_t *)sys_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = cap_ioctls_get */ { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */ { AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 537 = cap_fcntls_get */ + { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */ + { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ }; Modified: user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/freebsd32_systrace_args.c Sun Mar 3 01:10:49 2013 (r247680) @@ -3130,6 +3130,26 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* bindat */ + case 538: { + struct bindat_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->s; /* int */ + uarg[2] = (intptr_t) p->name; /* caddr_t */ + iarg[3] = p->namelen; /* int */ + *n_args = 4; + break; + } + /* connectat */ + case 539: { + struct connectat_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->s; /* int */ + uarg[2] = (intptr_t) p->name; /* caddr_t */ + iarg[3] = p->namelen; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8356,6 +8376,44 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* bindat */ + case 538: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "caddr_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; + /* connectat */ + case 539: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "caddr_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10143,6 +10201,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* bindat */ + case 538: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* connectat */ + case 539: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: user/attilio/vmc-playground/sys/compat/freebsd32/syscalls.master ============================================================================== --- user/attilio/vmc-playground/sys/compat/freebsd32/syscalls.master Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/compat/freebsd32/syscalls.master Sun Mar 3 01:10:49 2013 (r247680) @@ -1015,3 +1015,7 @@ uint32_t fcntlrights); } 537 AUE_CAP_FCNTLS_GET NOPROTO { int cap_fcntls_get(int fd, \ uint32_t *fcntlrightsp); } +538 AUE_BINDAT NOPROTO { int bindat(int fd, int s, caddr_t name, \ + int namelen); } +539 AUE_CONNECTAT NOPROTO { int connectat(int fd, int s, caddr_t name, \ + int namelen); } Modified: user/attilio/vmc-playground/sys/dev/pci/pci.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/pci/pci.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/dev/pci/pci.c Sun Mar 3 01:10:49 2013 (r247680) @@ -234,10 +234,11 @@ static const struct pci_quirk pci_quirks { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X doesn't work with at least LSI SAS1068E passed through by - * VMware. + * MSI-X allocation doesn't work properly for devices passed through + * by VMware up to at least ESXi 5.1. */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCI/PCI-X */ + { 0x07a015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* PCIe */ /* * Some virtualization environments emulate an older chipset @@ -3643,11 +3644,11 @@ pci_print_child(device_t dev, device_t c return (retval); } -static struct +static const struct { - int class; - int subclass; - char *desc; + int class; + int subclass; + const char *desc; } pci_nomatch_tab[] = { {PCIC_OLD, -1, "old"}, {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, @@ -3739,8 +3740,9 @@ static struct void pci_probe_nomatch(device_t dev, device_t child) { - int i; - char *cp, *scp, *device; + int i; + const char *cp, *scp; + char *device; /* * Look for a listing for this device in a loaded device database. @@ -3773,7 +3775,6 @@ pci_probe_nomatch(device_t dev, device_t printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); - return; } /* Modified: user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c ============================================================================== --- user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c Sun Mar 3 01:10:49 2013 (r247680) @@ -32,21 +32,72 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include +#define NTFS_A_VOLUMENAME 0x60 +#define NTFS_FILEMAGIC ((uint32_t)(0x454C4946)) +#define NTFS_VOLUMEINO 3 + #define G_LABEL_NTFS_DIR "ntfs" +struct ntfs_attr { + uint32_t a_type; + uint32_t reclen; + uint8_t a_flag; + uint8_t a_namelen; + uint8_t a_nameoff; + uint8_t reserved1; + uint8_t a_compression; + uint8_t reserved2; + uint16_t a_index; + uint16_t a_datalen; + uint16_t reserved3; + uint16_t a_dataoff; + uint16_t a_indexed; +}; + +struct ntfs_filerec { + uint32_t fr_hdrmagic; + uint16_t fr_hdrfoff; + uint16_t fr_hdrfnum; + uint8_t reserved[8]; + uint16_t fr_seqnum; + uint16_t fr_nlink; + uint16_t fr_attroff; + uint16_t fr_flags; + uint32_t fr_size; + uint32_t fr_allocated; + uint64_t fr_mainrec; + uint16_t fr_attrnum; +}; + +struct ntfs_bootfile { + uint8_t reserved1[3]; + uint8_t bf_sysid[8]; + uint16_t bf_bps; + uint8_t bf_spc; + uint8_t reserved2[7]; + uint8_t bf_media; + uint8_t reserved3[2]; + uint16_t bf_spt; + uint16_t bf_heads; + uint8_t reserver4[12]; + uint64_t bf_spv; + uint64_t bf_mftcn; + uint64_t bf_mftmirrcn; + uint8_t bf_mftrecsz; + uint32_t bf_ibsz; + uint32_t bf_volsn; +}; static void g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) { struct g_provider *pp; - struct bootfile *bf; - struct filerec *fr; - struct attr *atr; + struct ntfs_bootfile *bf; + struct ntfs_filerec *fr; + struct ntfs_attr *atr; off_t voloff; char *filerecp, *ap; char mftrecsz, vnchar; @@ -58,7 +109,7 @@ g_label_ntfs_taste(struct g_consumer *cp pp = cp->provider; filerecp = NULL; - bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); + bf = (struct ntfs_bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; @@ -75,16 +126,16 @@ g_label_ntfs_taste(struct g_consumer *cp filerecp = g_read_data(cp, voloff, recsize, NULL); if (filerecp == NULL) goto done; - fr = (struct filerec *)filerecp; + fr = (struct ntfs_filerec *)filerecp; - if (fr->fr_fixup.fh_magic != NTFS_FILEMAGIC) + if (fr->fr_hdrmagic != NTFS_FILEMAGIC) goto done; for (ap = filerecp + fr->fr_attroff; - atr = (struct attr *)ap, atr->a_hdr.a_type != -1; - ap += atr->a_hdr.reclen) { - if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) { - if(atr->a_r.a_datalen >= size *2){ + atr = (struct ntfs_attr *)ap, atr->a_type != -1; + ap += atr->reclen) { + if (atr->a_type == NTFS_A_VOLUMENAME) { + if(atr->a_datalen >= size *2){ label[0] = 0; goto done; } @@ -92,8 +143,8 @@ g_label_ntfs_taste(struct g_consumer *cp *UNICODE to ASCII. * Should we need to use iconv(9)? */ - for (j = 0; j < atr->a_r.a_datalen; j++) { - vnchar = *(ap + atr->a_r.a_dataoff + j); + for (j = 0; j < atr->a_datalen; j++) { + vnchar = *(ap + atr->a_dataoff + j); if (j & 1) { if (vnchar) { label[0] = 0; Modified: user/attilio/vmc-playground/sys/i386/xen/pmap.c ============================================================================== --- user/attilio/vmc-playground/sys/i386/xen/pmap.c Sun Mar 3 01:06:24 2013 (r247679) +++ user/attilio/vmc-playground/sys/i386/xen/pmap.c Sun Mar 3 01:10:49 2013 (r247680) @@ -2038,7 +2038,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if ((tpte & PG_A) != 0) vm_page_aflag_set(m, PGA_REFERENCED); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); pc->pc_map[field] |= 1UL << bit; @@ -2239,9 +2239,9 @@ pmap_pvh_remove(struct md_page *pvh, pma pv_entry_t pv; rw_assert(&pvh_global_lock, RA_WLOCKED); - TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { - TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); break; } } @@ -2281,7 +2281,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm if (pv_entry_count < pv_entry_high_water && (pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); return (TRUE); } else return (FALSE); @@ -2503,7 +2503,7 @@ pmap_remove_all(vm_page_t m) vm_page_dirty(m); pmap_unuse_pt(pmap, pv->pv_va, &free); pmap_invalidate_page(pmap, pv->pv_va); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2770,7 +2770,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pv == NULL) pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; - TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); pa |= PG_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -3465,7 +3465,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; rw_wlock(&pvh_global_lock); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { if (PV_PMAP(pv) == pmap) { rv = TRUE; break; @@ -3497,7 +3497,7 @@ pmap_page_wired_mappings(vm_page_t m) return (count); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); pte = pmap_pte_quick(pmap, pv->pv_va); @@ -3602,7 +3602,7 @@ pmap_remove_pages(pmap_t pmap) if (tpte & PG_M) vm_page_dirty(m); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); @@ -3662,7 +3662,7 @@ pmap_is_modified(vm_page_t m) return (rv); rw_wlock(&pvh_global_lock); sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 01:26:12 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C1057D5; Sun, 3 Mar 2013 01:26:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79045CB2; Sun, 3 Mar 2013 01:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r231QCRT023448; Sun, 3 Mar 2013 01:26:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r231QCoO023447; Sun, 3 Mar 2013 01:26:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303030126.r231QCoO023447@svn.freebsd.org> From: Attilio Rao Date: Sun, 3 Mar 2013 01:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247681 - user/attilio/vmc-playground/sys/i386/xen X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 01:26:12 -0000 Author: attilio Date: Sun Mar 3 01:26:11 2013 New Revision: 247681 URL: http://svnweb.freebsd.org/changeset/base/247681 Log: Fixup XEN pmap to cope with removal of left/right iterators from pages. Sponsored by: EMC / Isilon storage division Modified: user/attilio/vmc-playground/sys/i386/xen/pmap.c Modified: user/attilio/vmc-playground/sys/i386/xen/pmap.c ============================================================================== --- user/attilio/vmc-playground/sys/i386/xen/pmap.c Sun Mar 3 01:10:49 2013 (r247680) +++ user/attilio/vmc-playground/sys/i386/xen/pmap.c Sun Mar 3 01:26:11 2013 (r247681) @@ -1335,7 +1335,8 @@ pmap_free_zero_pages(vm_page_t free) while (free != NULL) { m = free; - free = m->right; + free = (void *)m->object; + m->object = NULL; vm_page_free_zero(m); } } @@ -1393,7 +1394,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t * Put page on a list so that it is released after * *ALL* TLB shootdown is done */ - m->right = *free; + m->object = (void *)*free; *free = m; } @@ -2090,7 +2091,7 @@ out: } if (m_pc == NULL && pv_vafree != 0 && free != NULL) { m_pc = free; - free = m_pc->right; + free = (void *)m_pc->object; /* Recycle a freed page table page. */ m_pc->wire_count = 1; atomic_add_int(&cnt.v_wire_count, 1); From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 01:36:32 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 45F1ACCD; Sun, 3 Mar 2013 01:36:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21AEBD09; Sun, 3 Mar 2013 01:36:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r231aW32026795; Sun, 3 Mar 2013 01:36:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r231aVlv026794; Sun, 3 Mar 2013 01:36:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303030136.r231aVlv026794@svn.freebsd.org> From: Alan Cox Date: Sun, 3 Mar 2013 01:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247682 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 01:36:32 -0000 Author: alc Date: Sun Mar 3 01:36:31 2013 New Revision: 247682 URL: http://svnweb.freebsd.org/changeset/base/247682 Log: Two out of three times that vm_page_find_least() is called, it's going to return the vm object's first page. In those cases, there is no need to traverse the trie. Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_page.c Modified: user/attilio/vmc-playground/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_page.c Sun Mar 3 01:26:11 2013 (r247681) +++ user/attilio/vmc-playground/sys/vm/vm_page.c Sun Mar 3 01:36:31 2013 (r247682) @@ -929,9 +929,12 @@ vm_page_lookup(vm_object_t object, vm_pi vm_page_t vm_page_find_least(vm_object_t object, vm_pindex_t pindex) { + vm_page_t m; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - return (vm_radix_lookup_ge(&object->rtree, pindex)); + if ((m = TAILQ_FIRST(&object->memq)) != NULL && m->pindex < pindex) + m = vm_radix_lookup_ge(&object->rtree, pindex); + return (m); } /* From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 09:09:37 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8F09380; Sun, 3 Mar 2013 09:09:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A64FB58; Sun, 3 Mar 2013 09:09:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2399bgA065277; Sun, 3 Mar 2013 09:09:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2399acv065267; Sun, 3 Mar 2013 09:09:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303030909.r2399acv065267@svn.freebsd.org> From: Adrian Chadd Date: Sun, 3 Mar 2013 09:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247696 - user/adrian/net80211_tx/sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 09:09:37 -0000 Author: adrian Date: Sun Mar 3 09:09:35 2013 New Revision: 247696 URL: http://svnweb.freebsd.org/changeset/base/247696 Log: Migrate the call to parent->if_transmit() to a platform function - ieee80211_parent_transmit(ic, m). This allows me to enforce that the lock is being held when transmitting. Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c user/adrian/net80211_tx/sys/net80211/ieee80211_output.c user/adrian/net80211_tx/sys/net80211/ieee80211_power.c user/adrian/net80211_tx/sys/net80211/ieee80211_superg.c user/adrian/net80211_tx/sys/net80211/ieee80211_wds.c Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Sun Mar 3 09:09:35 2013 (r247696) @@ -504,6 +504,26 @@ ieee80211_process_callback(struct ieee80 } } +/* + * Transmit a frame to the parent interface. + * + * TODO: if the transmission fails, make sure the parent node is freed + * (the callers will first need modifying.) + */ +int +ieee80211_parent_transmit(struct ieee80211com *ic, + struct mbuf *m) +{ + struct ifnet *parent = ic->ic_ifp; + /* + * Assert the IC lock is held - this enforces the + * processing -> queuing order is maintained + */ + IEEE80211_TX_LOCK_ASSERT(ic); + + return (parent->if_transmit(parent, m)); +} + #include void Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Sun Mar 3 09:09:35 2013 (r247696) @@ -296,6 +296,9 @@ int ieee80211_add_callback(struct mbuf * void (*func)(struct ieee80211_node *, void *, int), void *arg); void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); +struct ieee80211com; +int ieee80211_parent_transmit(struct ieee80211com *, struct mbuf *); + void get_random_bytes(void *, size_t); struct ieee80211com; Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c Sun Mar 3 09:09:35 2013 (r247696) @@ -1041,7 +1041,6 @@ mesh_transmit_to_gate(struct ieee80211va { struct ifnet *ifp = vap->iv_ifp; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *parent = ic->ic_ifp; struct ieee80211_node *ni; struct ether_header *eh; int error; @@ -1143,9 +1142,8 @@ mesh_transmit_to_gate(struct ieee80211va return; } } - error = parent->if_transmit(parent, m); + error = ieee80211_parent_transmit(ic, m); if (error != 0) { - m_freem(m); ieee80211_free_node(ni); } else { ifp->if_opackets++; @@ -1240,7 +1238,6 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211com *ic = vap->iv_ic; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ifnet *ifp = vap->iv_ifp; - struct ifnet *parent = ic->ic_ifp; const struct ieee80211_frame *wh = mtod(m, const struct ieee80211_frame *); struct mbuf *mcopy; @@ -1320,7 +1317,7 @@ mesh_forward(struct ieee80211vap *vap, s /* XXX do we know m_nextpkt is NULL? */ mcopy->m_pkthdr.rcvif = (void *) ni; - err = parent->if_transmit(parent, mcopy); + err = ieee80211_parent_transmit(ic, mcopy); if (err != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_output.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_output.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_output.c Sun Mar 3 09:09:35 2013 (r247696) @@ -126,7 +126,6 @@ ieee80211_start_pkt(struct ieee80211vap (vap->iv_opmode == IEEE80211_M_WDS && \ (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) struct ieee80211com *ic = vap->iv_ic; - struct ifnet *parent = ic->ic_ifp; struct ifnet *ifp = vap->iv_ifp; struct ieee80211_node *ni; struct ether_header *eh; @@ -340,7 +339,7 @@ ieee80211_start_pkt(struct ieee80211vap return (ENOBUFS); } } - error = parent->if_transmit(parent, m); + error = ieee80211_parent_transmit(ic, m); /* * Unlock at this point - no need to hold it across Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_power.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_power.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_power.c Sun Mar 3 09:09:35 2013 (r247696) @@ -413,6 +413,7 @@ static void pwrsave_flushq(struct ieee80211_node *ni) { struct ieee80211_psq *psq = &ni->ni_psq; + struct ieee80211com *ic = ni->ni_ic; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_psq_head *qhead; struct ifnet *parent, *ifp; @@ -463,7 +464,7 @@ pwrsave_flushq(struct ieee80211_node *ni * For encaped frames, we need to free the node * reference upon failure. */ - if (parent->if_transmit(parent, m) != 0) + if (ieee80211_parent_transmit(ic, m) != 0) ieee80211_free_node(ni); } } Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_superg.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_superg.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_superg.c Sun Mar 3 09:09:35 2013 (r247696) @@ -501,6 +501,7 @@ static void ff_transmit(struct ieee80211_node *ni, struct mbuf *m) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; int error; IEEE80211_TX_LOCK_ASSERT(vap->iv_ic); @@ -509,9 +510,8 @@ ff_transmit(struct ieee80211_node *ni, s m = ieee80211_encap(vap, ni, m); if (m != NULL) { struct ifnet *ifp = vap->iv_ifp; - struct ifnet *parent = ni->ni_ic->ic_ifp; - error = parent->if_transmit(parent, m); + error = ieee80211_parent_transmit(ic, m);; if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_wds.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_wds.c Sun Mar 3 08:56:10 2013 (r247695) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_wds.c Sun Mar 3 09:09:35 2013 (r247696) @@ -232,7 +232,6 @@ void ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) { struct ieee80211com *ic = vap0->iv_ic; - struct ifnet *parent = ic->ic_ifp; const struct ether_header *eh = mtod(m, const struct ether_header *); struct ieee80211_node *ni; struct ieee80211vap *vap; @@ -296,7 +295,7 @@ ieee80211_dwds_mcast(struct ieee80211vap mcopy->m_flags |= M_MCAST; mcopy->m_pkthdr.rcvif = (void *) ni; - err = parent->if_transmit(parent, mcopy); + err = ieee80211_parent_transmit(ic, mcopy); if (err) { /* NB: IFQ_HANDOFF reclaims mbuf */ ifp->if_oerrors++; From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 10:02:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EB835FC; Sun, 3 Mar 2013 10:02:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00492D82; Sun, 3 Mar 2013 10:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23A29Ra082518; Sun, 3 Mar 2013 10:02:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23A29Ja082513; Sun, 3 Mar 2013 10:02:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303031002.r23A29Ja082513@svn.freebsd.org> From: Adrian Chadd Date: Sun, 3 Mar 2013 10:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247706 - user/adrian/net80211_tx/sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 10:02:10 -0000 Author: adrian Date: Sun Mar 3 10:02:08 2013 New Revision: 247706 URL: http://svnweb.freebsd.org/changeset/base/247706 Log: Migrate the vap if_transmit calls to ieee80211_vap_transmit(). * Do a mechanical conversion of vap ifp -> ieee80211_vap_transmit(). * Tidy up the hostap pspoll receive code - have it call either ieee80211_parent_transmit() or ieee80211_vap_transmit() as appropriate. * Tidy up the hwmp discover code to send via ieee80211_vap_transmit() as we shouldn't ever see encapsulated frames here. Tested: * AR5416, STA mode TODO: * Lots, lots more hostap testing! Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h user/adrian/net80211_tx/sys/net80211/ieee80211_hostap.c user/adrian/net80211_tx/sys/net80211/ieee80211_hwmp.c user/adrian/net80211_tx/sys/net80211/ieee80211_power.c Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Sun Mar 3 09:47:47 2013 (r247705) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.c Sun Mar 3 10:02:08 2013 (r247706) @@ -516,7 +516,7 @@ ieee80211_parent_transmit(struct ieee802 { struct ifnet *parent = ic->ic_ifp; /* - * Assert the IC lock is held - this enforces the + * Assert the IC TX lock is held - this enforces the * processing -> queuing order is maintained */ IEEE80211_TX_LOCK_ASSERT(ic); @@ -524,6 +524,24 @@ ieee80211_parent_transmit(struct ieee802 return (parent->if_transmit(parent, m)); } +/* + * Transmit a frame to the VAP interface. + */ +int +ieee80211_vap_transmit(struct ieee80211vap *vap, struct mbuf *m) +{ + struct ifnet *ifp = vap->iv_ifp; + + /* + * When transmitting via the VAP, we shouldn't hold + * any IC TX lock as the VAP TX path will acquire it. + */ + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); + + return (ifp->if_transmit(ifp, m)); + +} + #include void Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Sun Mar 3 09:47:47 2013 (r247705) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_freebsd.h Sun Mar 3 10:02:08 2013 (r247706) @@ -298,11 +298,10 @@ void ieee80211_process_callback(struct i struct ieee80211com; int ieee80211_parent_transmit(struct ieee80211com *, struct mbuf *); +int ieee80211_vap_transmit(struct ieee80211vap *, struct mbuf *); void get_random_bytes(void *, size_t); -struct ieee80211com; - void ieee80211_sysctl_attach(struct ieee80211com *); void ieee80211_sysctl_detach(struct ieee80211com *); void ieee80211_sysctl_vattach(struct ieee80211vap *); Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_hostap.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_hostap.c Sun Mar 3 09:47:47 2013 (r247705) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_hostap.c Sun Mar 3 10:02:08 2013 (r247706) @@ -412,7 +412,7 @@ hostap_deliver_data(struct ieee80211vap if (mcopy != NULL) { int len, err; len = mcopy->m_pkthdr.len; - err = ifp->if_transmit(ifp, mcopy); + err = ieee80211_vap_transmit(vap, mcopy); if (err) { /* NB: IFQ_HANDOFF reclaims mcopy */ } else { @@ -2255,8 +2255,8 @@ void ieee80211_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = vap->iv_ic; struct ieee80211_frame_min *wh; - struct ifnet *ifp; struct mbuf *m; uint16_t aid; int qlen; @@ -2320,23 +2320,15 @@ ieee80211_recv_pspoll(struct ieee80211_n } m->m_flags |= M_PWR_SAV; /* bypass PS handling */ - if (m->m_flags & M_ENCAP) - ifp = vap->iv_ic->ic_ifp; - else - ifp = vap->iv_ifp; - /* - * Free any node ref which this mbuf may have. - * - * Much like psq_mfree(), we assume that M_ENCAP nodes have - * node references. + * Do the right thing; if it's an encap'ed frame then + * call ieee80211_parent_transmit() (and free the ref) else + * call ieee80211_vap_transmit(). */ - if (ifp->if_transmit(ifp, m) != 0) { - /* - * XXX m is invalid (freed) at this point, determine M_ENCAP - * an alternate way. - */ - if (ifp == vap->iv_ic->ic_ifp) + if (m->m_flags & M_ENCAP) { + if (ieee80211_parent_transmit(ic, m) != 0) ieee80211_free_node(ni); + } else { + (void) ieee80211_vap_transmit(vap, m); } } Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_hwmp.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_hwmp.c Sun Mar 3 09:47:47 2013 (r247705) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_hwmp.c Sun Mar 3 10:02:08 2013 (r247706) @@ -1277,12 +1277,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_mesh_route *rtext = NULL; struct ieee80211_hwmp_route *hr; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = vap->iv_ifp; struct mbuf *m, *next; uint32_t metric = 0; const uint8_t *addr; - int is_encap; - struct ieee80211_node *ni_encap; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", @@ -1456,22 +1453,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, m = ieee80211_ageq_remove(&ic->ic_stageq, (struct ieee80211_node *)(uintptr_t) ieee80211_mac_hash(ic, addr)); /* either dest or ext_dest */ + + /* + * All frames in the stageq here should be non-M_ENCAP; or things + * will get very unhappy. + */ for (; m != NULL; m = next) { - is_encap = !! (m->m_flags & M_ENCAP); - ni_encap = (struct ieee80211_node *) m->m_pkthdr.rcvif; next = m->m_nextpkt; m->m_nextpkt = NULL; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "flush queued frame %p len %d", m, m->m_pkthdr.len); - /* * If the mbuf has M_ENCAP set, ensure we free it. * Note that after if_transmit() is called, m is invalid. */ - if (ifp->if_transmit(ifp, m) != 0) { - if (is_encap) - ieee80211_free_node(ni_encap); - } + (void) ieee80211_vap_transmit(vap, m); } #undef IS_PROXY #undef PROXIED_BY_US Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_power.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_power.c Sun Mar 3 09:47:47 2013 (r247705) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_power.c Sun Mar 3 10:02:08 2013 (r247706) @@ -476,7 +476,7 @@ pwrsave_flushq(struct ieee80211_node *ni ifp_q = m->m_nextpkt; KASSERT((!(m->m_flags & M_ENCAP)), ("%s: vapq with M_ENCAP frame!\n", __func__)); - (void) ifp->if_transmit(ifp, m); + (void) ieee80211_vap_transmit(vap, m); } } } From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 10:05:20 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C950733; Sun, 3 Mar 2013 10:05:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0973D97; Sun, 3 Mar 2013 10:05:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23A5JSF083138; Sun, 3 Mar 2013 10:05:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23A5G9t083112; Sun, 3 Mar 2013 10:05:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303031005.r23A5G9t083112@svn.freebsd.org> From: Adrian Chadd Date: Sun, 3 Mar 2013 10:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247707 - in user/adrian/net80211_tx: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/openbsm/etc etc lib/libc/gen lib/libc/include lib/libc/regex ... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 10:05:20 -0000 Author: adrian Date: Sun Mar 3 10:05:15 2013 New Revision: 247707 URL: http://svnweb.freebsd.org/changeset/base/247707 Log: MFH Added: user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.3 - copied unchanged from r247706, head/lib/libc/gen/cap_sandboxed.3 user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.c - copied unchanged from r247706, head/lib/libc/gen/cap_sandboxed.c user/adrian/net80211_tx/lib/libc/sys/bindat.2 - copied unchanged from r247706, head/lib/libc/sys/bindat.2 user/adrian/net80211_tx/lib/libc/sys/cap_fcntls_limit.2 - copied unchanged from r247706, head/lib/libc/sys/cap_fcntls_limit.2 user/adrian/net80211_tx/lib/libc/sys/cap_ioctls_limit.2 - copied unchanged from r247706, head/lib/libc/sys/cap_ioctls_limit.2 user/adrian/net80211_tx/lib/libc/sys/cap_rights_limit.2 - copied unchanged from r247706, head/lib/libc/sys/cap_rights_limit.2 user/adrian/net80211_tx/lib/libc/sys/connectat.2 - copied unchanged from r247706, head/lib/libc/sys/connectat.2 user/adrian/net80211_tx/tools/regression/capsicum/ - copied from r247706, head/tools/regression/capsicum/ Deleted: user/adrian/net80211_tx/lib/libc/sys/cap_new.2 user/adrian/net80211_tx/lib/libprocstat/ntfs.c user/adrian/net80211_tx/sbin/mount_hpfs/ user/adrian/net80211_tx/sbin/mount_ntfs/ user/adrian/net80211_tx/share/examples/portal/ user/adrian/net80211_tx/share/man/man4/coda.4 user/adrian/net80211_tx/share/man/man5/xfs.5 user/adrian/net80211_tx/sys/fs/coda/ user/adrian/net80211_tx/sys/fs/hpfs/ user/adrian/net80211_tx/sys/fs/ntfs/ user/adrian/net80211_tx/sys/fs/portalfs/ user/adrian/net80211_tx/sys/gnu/fs/xfs/ user/adrian/net80211_tx/sys/modules/coda/ user/adrian/net80211_tx/sys/modules/coda5/ user/adrian/net80211_tx/sys/modules/hpfs/ user/adrian/net80211_tx/sys/modules/ntfs/ user/adrian/net80211_tx/sys/modules/ntfs_iconv/ user/adrian/net80211_tx/sys/modules/portalfs/ user/adrian/net80211_tx/sys/modules/xfs/ user/adrian/net80211_tx/usr.sbin/mount_portalfs/ Modified: user/adrian/net80211_tx/ObsoleteFiles.inc user/adrian/net80211_tx/UPDATING user/adrian/net80211_tx/cddl/contrib/opensolaris/cmd/zfs/zfs.8 user/adrian/net80211_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h user/adrian/net80211_tx/contrib/openbsm/etc/audit_event user/adrian/net80211_tx/etc/devd.conf user/adrian/net80211_tx/lib/libc/gen/Makefile.inc user/adrian/net80211_tx/lib/libc/include/compat.h user/adrian/net80211_tx/lib/libc/regex/regcomp.c user/adrian/net80211_tx/lib/libc/rpc/clnt_vc.c user/adrian/net80211_tx/lib/libc/sys/Makefile.inc user/adrian/net80211_tx/lib/libc/sys/Symbol.map user/adrian/net80211_tx/lib/libc/sys/cap_enter.2 user/adrian/net80211_tx/lib/libc/sys/dup.2 user/adrian/net80211_tx/lib/libedit/Makefile user/adrian/net80211_tx/lib/libprocstat/libprocstat.c user/adrian/net80211_tx/lib/libprocstat/libprocstat.h user/adrian/net80211_tx/lib/libstand/nandfs.c user/adrian/net80211_tx/sbin/ipfw/ipfw2.c user/adrian/net80211_tx/sys/amd64/amd64/pmap.c user/adrian/net80211_tx/sys/amd64/conf/GENERIC user/adrian/net80211_tx/sys/amd64/include/pmap.h user/adrian/net80211_tx/sys/arm/arm/locore.S user/adrian/net80211_tx/sys/arm/conf/RPI-B user/adrian/net80211_tx/sys/arm/econa/econa_machdep.c user/adrian/net80211_tx/sys/arm/include/vmparam.h user/adrian/net80211_tx/sys/arm/s3c2xx0/s3c24x0_machdep.c user/adrian/net80211_tx/sys/arm/xscale/i80321/ep80219_machdep.c user/adrian/net80211_tx/sys/arm/xscale/i80321/iq31244_machdep.c user/adrian/net80211_tx/sys/arm/xscale/i8134x/crb_machdep.c user/adrian/net80211_tx/sys/arm/xscale/ixp425/avila_machdep.c user/adrian/net80211_tx/sys/arm/xscale/pxa/pxa_machdep.c user/adrian/net80211_tx/sys/bsm/audit_kevents.h user/adrian/net80211_tx/sys/cddl/compat/opensolaris/sys/file.h user/adrian/net80211_tx/sys/cddl/compat/opensolaris/sys/kcondvar.h user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/adrian/net80211_tx/sys/compat/freebsd32/freebsd32_proto.h user/adrian/net80211_tx/sys/compat/freebsd32/freebsd32_syscall.h user/adrian/net80211_tx/sys/compat/freebsd32/freebsd32_syscalls.c user/adrian/net80211_tx/sys/compat/freebsd32/freebsd32_sysent.c user/adrian/net80211_tx/sys/compat/freebsd32/freebsd32_systrace_args.c user/adrian/net80211_tx/sys/compat/freebsd32/syscalls.master user/adrian/net80211_tx/sys/compat/linux/linux_file.c user/adrian/net80211_tx/sys/compat/ndis/kern_ndis.c user/adrian/net80211_tx/sys/compat/svr4/svr4_fcntl.c user/adrian/net80211_tx/sys/compat/svr4/svr4_filio.c user/adrian/net80211_tx/sys/compat/svr4/svr4_misc.c user/adrian/net80211_tx/sys/compat/svr4/svr4_stream.c user/adrian/net80211_tx/sys/conf/options.sparc64 user/adrian/net80211_tx/sys/dev/aac/aac.c user/adrian/net80211_tx/sys/dev/aac/aac_cam.c user/adrian/net80211_tx/sys/dev/aac/aac_disk.c user/adrian/net80211_tx/sys/dev/aac/aac_pci.c user/adrian/net80211_tx/sys/dev/aac/aac_tables.h user/adrian/net80211_tx/sys/dev/aac/aacvar.h user/adrian/net80211_tx/sys/dev/bce/if_bce.c user/adrian/net80211_tx/sys/dev/bce/if_bcereg.h user/adrian/net80211_tx/sys/dev/cas/if_cas.c user/adrian/net80211_tx/sys/dev/iscsi/initiator/iscsi.c user/adrian/net80211_tx/sys/dev/mfi/mfi.c user/adrian/net80211_tx/sys/dev/mps/mps.c user/adrian/net80211_tx/sys/dev/pci/pci.c user/adrian/net80211_tx/sys/dev/puc/pucdata.c user/adrian/net80211_tx/sys/dev/tws/tws_hdm.c user/adrian/net80211_tx/sys/fs/fdescfs/fdesc_vfsops.c user/adrian/net80211_tx/sys/fs/fdescfs/fdesc_vnops.c user/adrian/net80211_tx/sys/fs/nfs/nfsdport.h user/adrian/net80211_tx/sys/fs/nfsclient/nfs_clport.c user/adrian/net80211_tx/sys/fs/nfsserver/nfs_nfsdport.c user/adrian/net80211_tx/sys/fs/nullfs/null_vfsops.c user/adrian/net80211_tx/sys/geom/label/g_label_ntfs.c user/adrian/net80211_tx/sys/i386/conf/GENERIC user/adrian/net80211_tx/sys/i386/i386/pmap.c user/adrian/net80211_tx/sys/i386/ibcs2/ibcs2_misc.c user/adrian/net80211_tx/sys/i386/include/pmap.h user/adrian/net80211_tx/sys/i386/xen/pmap.c user/adrian/net80211_tx/sys/kern/capabilities.conf user/adrian/net80211_tx/sys/kern/init_sysent.c user/adrian/net80211_tx/sys/kern/kern_descrip.c user/adrian/net80211_tx/sys/kern/kern_exec.c user/adrian/net80211_tx/sys/kern/kern_exit.c user/adrian/net80211_tx/sys/kern/kern_fork.c user/adrian/net80211_tx/sys/kern/kern_sysctl.c user/adrian/net80211_tx/sys/kern/kern_timeout.c user/adrian/net80211_tx/sys/kern/subr_sleepqueue.c user/adrian/net80211_tx/sys/kern/subr_trap.c user/adrian/net80211_tx/sys/kern/sys_capability.c user/adrian/net80211_tx/sys/kern/sys_generic.c user/adrian/net80211_tx/sys/kern/syscalls.c user/adrian/net80211_tx/sys/kern/syscalls.master user/adrian/net80211_tx/sys/kern/systrace_args.c user/adrian/net80211_tx/sys/kern/tty.c user/adrian/net80211_tx/sys/kern/uipc_domain.c user/adrian/net80211_tx/sys/kern/uipc_mqueue.c user/adrian/net80211_tx/sys/kern/uipc_sem.c user/adrian/net80211_tx/sys/kern/uipc_shm.c user/adrian/net80211_tx/sys/kern/uipc_socket.c user/adrian/net80211_tx/sys/kern/uipc_syscalls.c user/adrian/net80211_tx/sys/kern/uipc_usrreq.c user/adrian/net80211_tx/sys/kern/vfs_aio.c user/adrian/net80211_tx/sys/kern/vfs_default.c user/adrian/net80211_tx/sys/kern/vfs_lookup.c user/adrian/net80211_tx/sys/kern/vfs_syscalls.c user/adrian/net80211_tx/sys/kern/vfs_vnops.c user/adrian/net80211_tx/sys/netpfil/ipfw/ip_fw_dynamic.c user/adrian/net80211_tx/sys/netsmb/smb_dev.c user/adrian/net80211_tx/sys/nfsserver/nfs_srvkrpc.c user/adrian/net80211_tx/sys/ofed/include/linux/file.h user/adrian/net80211_tx/sys/ofed/include/linux/timer.h user/adrian/net80211_tx/sys/security/audit/audit.h user/adrian/net80211_tx/sys/security/audit/audit_arg.c user/adrian/net80211_tx/sys/security/audit/audit_bsm.c user/adrian/net80211_tx/sys/security/audit/audit_private.h user/adrian/net80211_tx/sys/sparc64/pci/ofw_pcib.c user/adrian/net80211_tx/sys/sparc64/pci/psycho.c user/adrian/net80211_tx/sys/sparc64/pci/sbbc.c user/adrian/net80211_tx/sys/sparc64/sbus/sbus.c user/adrian/net80211_tx/sys/sys/capability.h user/adrian/net80211_tx/sys/sys/file.h user/adrian/net80211_tx/sys/sys/filedesc.h user/adrian/net80211_tx/sys/sys/namei.h user/adrian/net80211_tx/sys/sys/proc.h user/adrian/net80211_tx/sys/sys/protosw.h user/adrian/net80211_tx/sys/sys/rmlock.h user/adrian/net80211_tx/sys/sys/socket.h user/adrian/net80211_tx/sys/sys/socketvar.h user/adrian/net80211_tx/sys/sys/syscall.h user/adrian/net80211_tx/sys/sys/syscall.mk user/adrian/net80211_tx/sys/sys/sysproto.h user/adrian/net80211_tx/sys/sys/time.h user/adrian/net80211_tx/sys/sys/user.h user/adrian/net80211_tx/sys/vm/vm_mmap.c user/adrian/net80211_tx/sys/vm/vm_object.c user/adrian/net80211_tx/tools/regression/pjdfstest/Makefile user/adrian/net80211_tx/tools/regression/pjdfstest/pjdfstest.c user/adrian/net80211_tx/tools/regression/security/cap_test/cap_test_capabilities.c user/adrian/net80211_tx/tools/regression/security/cap_test/cap_test_relative.c user/adrian/net80211_tx/usr.bin/kdump/kdump.c user/adrian/net80211_tx/usr.bin/kdump/mksubr user/adrian/net80211_tx/usr.bin/procstat/procstat_files.c user/adrian/net80211_tx/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh user/adrian/net80211_tx/usr.sbin/pc-sysinstall/backend/functions-parse.sh user/adrian/net80211_tx/usr.sbin/pc-sysinstall/backend/parseconfig.sh user/adrian/net80211_tx/usr.sbin/pc-sysinstall/examples/README Directory Properties: user/adrian/net80211_tx/ (props changed) user/adrian/net80211_tx/cddl/contrib/opensolaris/ (props changed) user/adrian/net80211_tx/cddl/contrib/opensolaris/cmd/zfs/ (props changed) user/adrian/net80211_tx/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/adrian/net80211_tx/contrib/openbsm/ (props changed) user/adrian/net80211_tx/lib/libc/ (props changed) user/adrian/net80211_tx/sbin/ (props changed) user/adrian/net80211_tx/sbin/ipfw/ (props changed) user/adrian/net80211_tx/share/man/man4/ (props changed) user/adrian/net80211_tx/sys/ (props changed) user/adrian/net80211_tx/sys/cddl/contrib/opensolaris/ (props changed) user/adrian/net80211_tx/sys/conf/ (props changed) user/adrian/net80211_tx/usr.bin/procstat/ (props changed) Modified: user/adrian/net80211_tx/ObsoleteFiles.inc ============================================================================== --- user/adrian/net80211_tx/ObsoleteFiles.inc Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/ObsoleteFiles.inc Sun Mar 3 10:05:15 2013 (r247707) @@ -38,6 +38,27 @@ # xargs -n1 | sort | uniq -d; # done +# 20130302: NTFS support removed +OLD_FILES+=usr/include/fs/ntfs/ntfs.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_inode.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_subr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_vfsops.h +OLD_FILES+=usr/include/fs/ntfs/ntfsmount.h +OLD_DIRS+=usr/include/fs/ntfs +OLD_FILES+=usr/share/man/man8/mount_ntfs.8.gz +# 20130302: PORTALFS support removed +OLD_FILES+=usr/include/fs/portalfs/portal.h +OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/share/examples/portal/README +OLD_FILES+=usr/share/examples/portal/portal.conf +OLD_DIRS+=usr/share/examples/portal +OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz +# 20130302: CODAFS support removed +OLD_FILES+=usr/share/man/man4/coda.4.gz +# 20130302: XFS support removed +OLD_FILES+=usr/share/man/man5/xfs.5.gz # 20130116: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout Modified: user/adrian/net80211_tx/UPDATING ============================================================================== --- user/adrian/net80211_tx/UPDATING Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/UPDATING Sun Mar 3 10:05:15 2013 (r247707) @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130301: + The ctl device has been disabled in GENERIC for i386 and amd64. + This was done due to the extra memory being allocated at system + initialisation time by the ctl driver which was only used if + a CAM target device was created. This makes a FreeBSD system + unusable on 128MB or less of RAM. + 20130208: A new compression method (lz4) has been merged to -HEAD. Please refer to zpool-features(7) for more information. Modified: user/adrian/net80211_tx/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- user/adrian/net80211_tx/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Mar 3 10:05:15 2013 (r247707) @@ -526,6 +526,39 @@ if the snapshot has been marked for defe .Qq Nm Cm destroy -d command. Otherwise, the property is .Cm off . +.It Sy logicalreferenced +The amount of space that is +.Qq logically +accessible by this dataset. +See the +.Sy referenced +property. +The logical space ignores the effect of the +.Sy compression +and +.Sy copies +properties, giving a quantity closer to the amount of data that applications +see. +However, it does include space consumed by metadata. +.Pp +This property can also be referred to by its shortened column name, +.Sy lrefer . +.It Sy logicalused +The amount of space that is +.Qq logically +consumed by this dataset and all its descendents. +See the +.Sy used +property. +The logical space ignores the effect of the +.Sy compression +and +.Sy copies +properties, giving a quantity closer to the amount of data that applications +see. +.Pp +This property can also be referred to by its shortened column name, +.Sy lused . .It Sy mounted For file systems, indicates whether the file system is currently mounted. This property can be either Modified: user/adrian/net80211_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- user/adrian/net80211_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Sun Mar 3 10:05:15 2013 (r247707) @@ -24,6 +24,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 Martin Matuska . All rights reserved. */ #ifndef _LIBFS_IMPL_H @@ -216,6 +217,7 @@ extern void libzfs_fru_clear(libzfs_hand #ifndef sun static int zfs_kernel_version = 0; +static int zfs_ioctl_version = 0; /* * This is FreeBSD version of ioctl, because Solaris' ioctl() updates @@ -225,19 +227,34 @@ static int zfs_kernel_version = 0; static __inline int zcmd_ioctl(int fd, unsigned long cmd, zfs_cmd_t *zc) { - size_t oldsize, zfs_kernel_version_size; + size_t oldsize, zfs_kernel_version_size, zfs_ioctl_version_size; int version, ret, cflag = ZFS_CMD_COMPAT_NONE; - zfs_kernel_version_size = sizeof(zfs_kernel_version); - if (zfs_kernel_version == 0) { - sysctlbyname("vfs.zfs.version.spa", &zfs_kernel_version, - &zfs_kernel_version_size, NULL, 0); + zfs_ioctl_version_size = sizeof(zfs_ioctl_version); + if (zfs_ioctl_version == 0) { + sysctlbyname("vfs.zfs.version.ioctl", &zfs_ioctl_version, + &zfs_ioctl_version_size, NULL, 0); } - if (zfs_kernel_version == SPA_VERSION_15 || - zfs_kernel_version == SPA_VERSION_14 || - zfs_kernel_version == SPA_VERSION_13) - cflag = ZFS_CMD_COMPAT_V15; + /* + * If vfs.zfs.version.ioctl is not defined, assume we have v28 + * compatible binaries and use vfs.zfs.version.spa to test for v15 + */ + if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) { + cflag = ZFS_CMD_COMPAT_V28; + zfs_kernel_version_size = sizeof(zfs_kernel_version); + + if (zfs_kernel_version == 0) { + sysctlbyname("vfs.zfs.version.spa", + &zfs_kernel_version, + &zfs_kernel_version_size, NULL, 0); + } + + if (zfs_kernel_version == SPA_VERSION_15 || + zfs_kernel_version == SPA_VERSION_14 || + zfs_kernel_version == SPA_VERSION_13) + cflag = ZFS_CMD_COMPAT_V15; + } oldsize = zc->zc_nvlist_dst_size; ret = zcmd_ioctl_compat(fd, cmd, zc, cflag); Modified: user/adrian/net80211_tx/contrib/openbsm/etc/audit_event ============================================================================== --- user/adrian/net80211_tx/contrib/openbsm/etc/audit_event Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/contrib/openbsm/etc/audit_event Sun Mar 3 10:05:15 2013 (r247707) @@ -548,7 +548,7 @@ 43184:AUE_OPENAT:openat(2) - attr only:fa 43185:AUE_POSIX_OPENPT:posix_openpt(2):ip 43186:AUE_CAP_NEW:cap_new(2):fm -43187:AUE_CAP_GETRIGHTS:cap_getrights(2):fm +43187:AUE_CAP_RIGHTS_GET:cap_rights_get(2):fm 43188:AUE_CAP_ENTER:cap_enter(2):pc 43189:AUE_CAP_GETMODE:cap_getmode(2):pc 43190:AUE_POSIX_SPAWN:posix_spawn(2):pc @@ -563,6 +563,13 @@ 43199:AUE_PDGETPID:pdgetpid(2):pc 43200:AUE_PDWAIT:pdwait(2):pc 43201:AUE_WAIT6:wait6(2):pc +43202:AUE_CAP_RIGHTS_LIMIT:cap_rights_limit(2):fm +43203:AUE_CAP_IOCTLS_LIMIT:cap_ioctls_limit(2):fm +43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm +43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm +43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm +43207:AUE_BINDAT:bindat(2):nt +43208:AUE_CONNECTAT:connectat(2):nt # # Solaris userspace events. # Modified: user/adrian/net80211_tx/etc/devd.conf ============================================================================== --- user/adrian/net80211_tx/etc/devd.conf Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/etc/devd.conf Sun Mar 3 10:05:15 2013 (r247707) @@ -34,7 +34,7 @@ options { # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create # of a device with the same name; e.g. -# ifconfig bridge0 destroy; ifconfig bridge0 create +# ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { match "system" "IFNET"; @@ -165,7 +165,7 @@ notify 100 { }; # -# Rescan scsi device-names on attach, but not detach. However, it is +# Rescan SCSI device-names on attach, but not detach. However, it is # disabled by default due to reports of problems. # attach 0 { @@ -305,13 +305,13 @@ detach 10 { # events. See the ACPI specification for more information about # notifies. Here is the information returned for each subsystem: # -# ACAD: AC line state (0 is offline, 1 is online) -# Button: Button pressed (0 for power, 1 for sleep) -# CMBAT: ACPI battery events -# Lid: Lid state (0 is closed, 1 is open) -# RCTL: Resource limits +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification -# Thermal: ACPI thermal zone events +# Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the # notify value as the first argument. If the state is 0x00, it might Modified: user/adrian/net80211_tx/lib/libc/gen/Makefile.inc ============================================================================== --- user/adrian/net80211_tx/lib/libc/gen/Makefile.inc Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/gen/Makefile.inc Sun Mar 3 10:05:15 2013 (r247707) @@ -16,6 +16,7 @@ SRCS+= __getosreldate.c \ assert.c \ auxv.c \ basename.c \ + cap_sandboxed.c \ check_utility_compat.c \ clock.c \ clock_getcpuclockid.c \ @@ -168,6 +169,7 @@ SYM_MAPS+=${.CURDIR}/gen/Symbol.map MAN+= alarm.3 \ arc4random.3 \ basename.3 \ + cap_sandboxed.3 \ check_utility_compat.3 \ clock.3 \ clock_getcpuclockid.3 \ Copied: user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.3 (from r247706, head/lib/libc/gen/cap_sandboxed.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.3 Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/gen/cap_sandboxed.3) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2012 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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 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$ +.\" +.Dd September 18, 2012 +.Dt CAP_SANDBOXED 3 +.Os +.Sh NAME +.Nm cap_sandboxed +.Nd Check if in a capability mode sandbox +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/capability.h +.In stdbool.h +.Ft bool +.Fn cap_sandboxed "void" +.Sh DESCRIPTION +.Fn cap_sandboxed +returns +.Va true +if the process is in a capability mode sandbox or +.Va false +if it is not. +This function is a more handy alternative to the +.Xr cap_getmode 2 +system call as it always succeeds, so there is no need for error checking. +If the support for capability mode is not compiled into the kernel, +.Fn cap_sandboxed +will always return +.Va false . +.Sh RETURN VALUES +Function +.Fn cap_sandboxed +is always successful and will return either +.Va true +or +.Va false . +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr capsicum 4 +.Sh AUTHORS +This function was implemented and manual page was written by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship of the FreeBSD Foundation. Copied: user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.c (from r247706, head/lib/libc/gen/cap_sandboxed.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/gen/cap_sandboxed.c Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/gen/cap_sandboxed.c) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2012 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include + +bool +cap_sandboxed(void) +{ + u_int mode; + + if (cap_getmode(&mode) != 0) { + assert(errno == ENOSYS); + return (false); + } + assert(mode == 0 || mode == 1); + return (mode == 1); +} Modified: user/adrian/net80211_tx/lib/libc/include/compat.h ============================================================================== --- user/adrian/net80211_tx/lib/libc/include/compat.h Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/include/compat.h Sun Mar 3 10:05:15 2013 (r247707) @@ -42,6 +42,8 @@ __sym_compat(__semctl, freebsd7___semctl __sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0); __sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0); +__sym_compat(cap_getrights, cap_rights_get, FBSD_1.2); + #undef __sym_compat #endif /* __LIBC_COMPAT_H__ */ Modified: user/adrian/net80211_tx/lib/libc/regex/regcomp.c ============================================================================== --- user/adrian/net80211_tx/lib/libc/regex/regcomp.c Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/regex/regcomp.c Sun Mar 3 10:05:15 2013 (r247707) @@ -1212,7 +1212,7 @@ CHaddrange(struct parse *p, cset *cs, wi } cs->ranges = newranges; cs->ranges[cs->nranges].min = min; - cs->ranges[cs->nranges].min = max; + cs->ranges[cs->nranges].max = max; cs->nranges++; } Modified: user/adrian/net80211_tx/lib/libc/rpc/clnt_vc.c ============================================================================== --- user/adrian/net80211_tx/lib/libc/rpc/clnt_vc.c Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/rpc/clnt_vc.c Sun Mar 3 10:05:15 2013 (r247707) @@ -260,7 +260,7 @@ clnt_vc_create(fd, raddr, prog, vers, se if (ct->ct_addr.buf == NULL) goto err; memcpy(ct->ct_addr.buf, raddr->buf, raddr->len); - ct->ct_addr.len = raddr->maxlen; + ct->ct_addr.len = raddr->len; ct->ct_addr.maxlen = raddr->maxlen; /* Modified: user/adrian/net80211_tx/lib/libc/sys/Makefile.inc ============================================================================== --- user/adrian/net80211_tx/lib/libc/sys/Makefile.inc Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/sys/Makefile.inc Sun Mar 3 10:05:15 2013 (r247707) @@ -91,9 +91,12 @@ MAN+= abort2.2 \ aio_waitcomplete.2 \ aio_write.2 \ bind.2 \ + bindat.2 \ brk.2 \ cap_enter.2 \ - cap_new.2 \ + cap_fcntls_limit.2 \ + cap_ioctls_limit.2 \ + cap_rights_limit.2 \ chdir.2 \ chflags.2 \ chmod.2 \ @@ -103,6 +106,7 @@ MAN+= abort2.2 \ close.2 \ closefrom.2 \ connect.2 \ + connectat.2 \ cpuset.2 \ cpuset_getaffinity.2 \ dup.2 \ @@ -270,7 +274,9 @@ MLINKS+=access.2 eaccess.2 \ access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 MLINKS+=cap_enter.2 cap_getmode.2 -MLINKS+=cap_new.2 cap_getrights.2 +MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2 +MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2 +MLINKS+=cap_rights_limit.2 cap_rights_get.2 MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 fchflags.2 \ chflags.2 lchflags.2 Modified: user/adrian/net80211_tx/lib/libc/sys/Symbol.map ============================================================================== --- user/adrian/net80211_tx/lib/libc/sys/Symbol.map Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/sys/Symbol.map Sun Mar 3 10:05:15 2013 (r247707) @@ -364,7 +364,6 @@ FBSD_1.2 { cap_enter; cap_getmode; cap_new; - cap_getrights; getloginclass; pdfork; pdgetpid; @@ -379,7 +378,16 @@ FBSD_1.2 { }; FBSD_1.3 { + bindat; + cap_fcntls_get; + cap_fcntls_limit; + cap_ioctls_get; + cap_ioctls_limit; + cap_rights_get; + cap_rights_limit; + cap_sandboxed; clock_getcpuclockid2; + connectat; ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; Copied: user/adrian/net80211_tx/lib/libc/sys/bindat.2 (from r247706, head/lib/libc/sys/bindat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/sys/bindat.2 Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/sys/bindat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt BINDAT 2 +.Os +.Sh NAME +.Nm bindat +.Nd assign a local protocol address to a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn bindat "int fd" "int s" "const struct sockaddr *addr" "socklen_t addrlen" +.Sh DESCRIPTION +The +.Fn bindat +system call assigns the local protocol address to a socket. +It works just like the +.Xr bind 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn bindat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr bind 2 . +.El +.Sh RETURN VALUES +.Rv -std bindat +.Sh ERRORS +The +.Fn bindat +system call may fail with the same errors as the +.Xr bind 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bind 2 , +.Xr connectat 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/adrian/net80211_tx/lib/libc/sys/cap_enter.2 ============================================================================== --- user/adrian/net80211_tx/lib/libc/sys/cap_enter.2 Sun Mar 3 10:02:08 2013 (r247706) +++ user/adrian/net80211_tx/lib/libc/sys/cap_enter.2 Sun Mar 3 10:05:15 2013 (r247707) @@ -58,8 +58,10 @@ or .Xr pdfork 2 will be placed in capability mode from inception. .Pp -When combined with capabilities created with -.Xr cap_new 2 , +When combined with +.Xr cap_rights_limit 2 , +.Xr cap_ioctls_limit 2 , +.Xr cap_fcntls_limit 2 , .Fn cap_enter may be used to create kernel-enforced sandboxes in which appropriately-crafted applications or application components may be run. @@ -71,11 +73,6 @@ sandbox. Creating effective process sandboxes is a tricky process that involves identifying the least possible rights required by the process and then passing those rights into the process in a safe manner. -See the CAVEAT -section of -.Xr cap_new 2 -for why this is particularly tricky with UNIX file descriptors as the -canonical representation of a right. Consumers of .Fn cap_enter should also be aware of other inherited rights, such as access to VM @@ -87,9 +84,35 @@ to create a runtime environment inside t acquired rights as possible. .Sh RETURN VALUES .Rv -std cap_enter cap_getmode +.Sh ERRORS +The +.Fn cap_enter +and +.Fn cap_getmode +system calls +will fail if: +.Bl -tag -width Er +.It Bq Er ENOSYS +The kernel is compiled without: +.Pp +.Cd "options CAPABILITY_MODE" +.El +.Pp +The +.Fn cap_getmode +system call may also return the following error: +.Bl -tag -width Er +.It Bq Er EFAULT +Pointer +.Fa modep +points outside the process's allocated address space. +.El .Sh SEE ALSO -.Xr cap_new 2 , +.Xr cap_fcntls_limit 2 , +.Xr cap_ioctls_limit 2 , +.Xr cap_rights_limit 2 , .Xr fexecve 2 , +.Xr cap_sandboxed 3 , .Xr capsicum 4 .Sh HISTORY Support for capabilities and capabilities mode was developed as part of the Copied: user/adrian/net80211_tx/lib/libc/sys/cap_fcntls_limit.2 (from r247706, head/lib/libc/sys/cap_fcntls_limit.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/sys/cap_fcntls_limit.2 Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/sys/cap_fcntls_limit.2) @@ -0,0 +1,126 @@ +.\" +.\" Copyright (c) 2012 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship +.\" 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 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$ +.\" +.Dd September 20, 2012 +.Dt CAP_FCNTLS_LIMIT 2 +.Os +.Sh NAME +.Nm cap_fcntls_limit , +.Nm cap_fcntls_get +.Nd manage allowed fcntl commands +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/capability.h +.Ft int +.Fn cap_fcntls_limit "int fd" "uint32_t fcntlrights" +.Ft int +.Fn cap_fcntls_get "int fd" "uint32_t *fcntlrightsp" +.Sh DESCRIPTION +If a file descriptor is granted the +.Dv CAP_FCNTL +capability right, the list of allowed +.Xr fcntl 2 +commands can be selectively reduced (but never expanded) with the +.Fn cap_fcntls_limit +system call. +.Pp +A bitmask of allowed fcntls commands for a given file descriptor can be obtained +with the +.Fn cap_fcntls_get +system call. +.Sh FLAGS +The following flags may be specified in the +.Fa fcntlrights +argument or returned in the +.Fa fcntlrightsp +argument: +.Bl -tag -width CAP_FCNTL_GETOWN +.It Dv CAP_FCNTL_GETFL +Permit +.Dv F_GETFL +command. +.It Dv CAP_FCNTL_SETFL +Permit +.Dv F_SETFL +command. +.It Dv CAP_FCNTL_GETOWN +Permit +.Dv F_GETOWN +command. +.It Dv CAP_FCNTL_SETOWN +Permit +.Dv F_SETOWN +command. +.El +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +.Fn cap_fcntls_limit +succeeds unless: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid descriptor. +.It Bq Er EINVAL +An invalid flag has been passed in +.Fa fcntlrights . +.It Bq Er ENOTCAPABLE +.Fa fcntlrights +would expand the list of allowed +.Xr fcntl 2 +commands. +.El +.Pp +.Fn cap_fcntls_get +succeeds unless: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid descriptor. +.It Bq Er EFAULT +The +.Fa fcntlrightsp +argument points at an invalid address. +.El +.Sh SEE ALSO +.Xr cap_ioctls_limit 2 , +.Xr cap_rights_limit 2 , +.Xr fcntl 2 +.Sh HISTORY +Support for capabilities and capabilities mode was developed as part of the +.Tn TrustedBSD +Project. +.Sh AUTHORS +This function was created by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship of the FreeBSD Foundation. Copied: user/adrian/net80211_tx/lib/libc/sys/cap_ioctls_limit.2 (from r247706, head/lib/libc/sys/cap_ioctls_limit.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/sys/cap_ioctls_limit.2 Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/sys/cap_ioctls_limit.2) @@ -0,0 +1,157 @@ +.\" +.\" Copyright (c) 2012 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship +.\" 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 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$ +.\" +.Dd September 20, 2012 +.Dt CAP_IOCTLS_LIMIT 2 +.Os +.Sh NAME +.Nm cap_ioctls_limit , +.Nm cap_ioctls_get +.Nd manage allowed ioctl commands +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/capability.h +.Ft int +.Fn cap_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds" +.Ft ssize_t +.Fn cap_ioctls_get "int fd" "unsigned long *cmds" "size_t maxcmds" +.Sh DESCRIPTION +If a file descriptor is granted the +.Dv CAP_IOCTL +capability right, the list of allowed +.Xr ioctl 2 +commands can be selectively reduced (but never expanded) with the +.Fn cap_ioctls_limit +system call. +The +.Fa cmds +argument is an array of +.Xr ioctl 2 +commands and the +.Fa ncmds +argument specifies the number of elements in the array. +There might be up to +.Va 256 +elements in the array. +.Pp +The list of allowed ioctl commands for a given file descriptor can be obtained +with the +.Fn cap_ioctls_get +system call. +The +.Fa cmds +argument points at memory that can hold up to +.Fa maxcmds +values. +The function populates the provided buffer with up to +.Fa maxcmds +elements, but always returns the total number of ioctl commands allowed for the +given file descriptor. +The total number of ioctls commands for the given file descriptor can be +obtained by passing +.Dv NULL as the +.Fa cmds +argument and +.Va 0 +as the +.Fa maxcmds +argument. +If all ioctl commands are allowed +.Dv ( CAP_IOCTL +capability right is assigned to the file descriptor and the +.Fn cap_ioctls_limit +system call was never called for this file descriptor), the +.Fn cap_ioctls_get +system call will return +.Dv CAP_IOCTLS_ALL +and won't modify the buffer pointed out by the +.Fa cmds +argument. +.Sh RETURN VALUES +.Rv -std cap_ioctls_limit +.Pp +The +.Fn cap_ioctls_limit +function, if successfull, returns the total number of allowed ioctl commands or +the value +.Dv INT_MAX +if all ioctls commands are allowed. +On failure the value +.Va -1 +is returned and the global variable errno is set to indicate the error. +.Sh ERRORS +.Fn cap_ioctls_limit +succeeds unless: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid descriptor. +.It Bq Er EFAULT +The +.Fa cmds +argument points at an invalid address. +.It Bq Er EINVAL +The +.Fa ncmds +argument is greater than +.Va 256 . +.It Bq Er ENOTCAPABLE +.Fa cmds +would expand the list of allowed +.Xr ioctl 2 +commands. +.El +.Pp +.Fn cap_ioctls_get +succeeds unless: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid descriptor. +.It Bq Er EFAULT +The +.Fa cmds +argument points at invalid address. +.El +.Sh SEE ALSO +.Xr cap_fcntls_limit 2 , +.Xr cap_rights_limit 2 , +.Xr ioctl 2 +.Sh HISTORY +Support for capabilities and capabilities mode was developed as part of the +.Tn TrustedBSD +Project. +.Sh AUTHORS +This function was created by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship of the FreeBSD Foundation. Copied: user/adrian/net80211_tx/lib/libc/sys/cap_rights_limit.2 (from r247706, head/lib/libc/sys/cap_rights_limit.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/adrian/net80211_tx/lib/libc/sys/cap_rights_limit.2 Sun Mar 3 10:05:15 2013 (r247707, copy of r247706, head/lib/libc/sys/cap_rights_limit.2) @@ -0,0 +1,612 @@ +.\" +.\" Copyright (c) 2008-2010 Robert N. M. Watson +.\" Copyright (c) 2012-2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This software was developed at the University of Cambridge Computer +.\" Laboratory with support from a grant from Google, Inc. +.\" +.\" Portions of this documentation were written 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 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$ +.\" +.Dd February 23, 2013 +.Dt CAP_RIGHTS_LIMIT 2 +.Os +.Sh NAME +.Nm cap_rights_limit , +.Nm cap_rights_get +.Nd manage capability rights +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/capability.h +.Ft int +.Fn cap_rights_limit "int fd" "cap_rights_t rights" +.Ft int +.Fn cap_rights_get "int fd" "cap_rights_t *rightsp" +.Sh DESCRIPTION +When a file descriptor is created by a function such as +.Xr fhopen 2 , +.Xr kqueue 2 , +.Xr mq_open 2 , +.Xr open 2 , +.Xr openat 2 , +.Xr pdfork 2 , +.Xr pipe 2 , +.Xr shm_open 2 , +.Xr socket 2 , +or +.Xr socketpair 2 , +it is assigned all capability rights. +Those rights can be reduced (but never expanded) by using the +.Fn cap_rights_limit +system call. +Once capability rights are reduced, operations on the file descriptor will be +limited to those permitted by +.Fa rights . +.Pp +A bitmask of capability rights assigned to a file descriptor can be obtained with +the +.Fn cap_rights_get +system call. +.Sh RIGHTS +The following rights may be specified in a rights mask: +.Bl -tag -width CAP_EXTATTR_DELETE +.It Dv CAP_ACCEPT *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Mar 3 20:37:27 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CEAA9BAB; Sun, 3 Mar 2013 20:37:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B82878A8; Sun, 3 Mar 2013 20:37:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23KbRD6077563; Sun, 3 Mar 2013 20:37:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23KbRuX077562; Sun, 3 Mar 2013 20:37:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303032037.r23KbRuX077562@svn.freebsd.org> From: Alan Cox Date: Sun, 3 Mar 2013 20:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247731 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 20:37:27 -0000 Author: alc Date: Sun Mar 3 20:37:27 2013 New Revision: 247731 URL: http://svnweb.freebsd.org/changeset/base/247731 Log: We don't need to reinitialize the root of the page cache trie on every vm object allocation. We can, instead, rely on the type stability of the vm object zone. (Note that we already assert that the page cache trie is empty in the vm object zone destructor.) Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_object.c Modified: user/attilio/vmc-playground/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_object.c Sun Mar 3 20:10:56 2013 (r247730) +++ user/attilio/vmc-playground/sys/vm/vm_object.c Sun Mar 3 20:37:27 2013 (r247731) @@ -203,6 +203,7 @@ vm_object_zinit(void *mem, int size, int object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; + object->cache.rt_root = 0; return (0); } @@ -249,7 +250,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - object->cache.rt_root = 0; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list); From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 00:07:21 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25420C0B; Mon, 4 Mar 2013 00:07:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3A56FC5; Mon, 4 Mar 2013 00:07:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2407Kvc042613; Mon, 4 Mar 2013 00:07:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2407KDM042608; Mon, 4 Mar 2013 00:07:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303040007.r2407KDM042608@svn.freebsd.org> From: Adrian Chadd Date: Mon, 4 Mar 2013 00:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247741 - in user/adrian/net80211_tx/sys/dev/ath: . ath_hal ath_hal/ar5416 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 00:07:21 -0000 Author: adrian Date: Mon Mar 4 00:07:19 2013 New Revision: 247741 URL: http://svnweb.freebsd.org/changeset/base/247741 Log: Add a method to set/clear the VMF field in the TX descriptor. Obtained from: Qualcomm Atheros Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah.h user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah.h Sun Mar 3 23:39:30 2013 (r247740) +++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ah.h Mon Mar 4 00:07:19 2013 (r247741) @@ -1527,11 +1527,13 @@ struct ath_hal { struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); - void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nVirtMoreFrag)(struct ath_hal *, + struct ath_desc *, u_int); + HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *, HAL_SURVEY_SAMPLE *); Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Mar 3 23:39:30 2013 (r247740) +++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 00:07:19 2013 (r247741) @@ -409,8 +409,9 @@ extern void ar5416Set11nAggrFirst(struct u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); - extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, + struct ath_desc *ds, u_int vmf); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Mar 3 23:39:30 2013 (r247740) +++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 00:07:19 2013 (r247741) @@ -194,6 +194,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; + ah->ah_set11nVirtMoreFrag = ar5416Set11nVirtualMoreFrag; /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sun Mar 3 23:39:30 2013 (r247740) +++ user/adrian/net80211_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 00:07:19 2013 (r247741) @@ -825,6 +825,17 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +void +ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, struct ath_desc *ds, + u_int vmf) +{ + struct ar5416_desc *ads = AR5416DESC(ds); + if (vmf) + ads->ds_ctl0 |= AR_VirtMoreFrag; + else + ads->ds_ctl0 &= ~AR_VirtMoreFrag; +} + /* * Program the burst duration, with the included BA delta if it's * applicable. Modified: user/adrian/net80211_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Sun Mar 3 23:39:30 2013 (r247740) +++ user/adrian/net80211_tx/sys/dev/ath/if_athvar.h Mon Mar 4 00:07:19 2013 (r247741) @@ -1297,6 +1297,8 @@ void ath_intr(void *); ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_set11n_virtmorefrag(_ah, _ds, _v) \ + ((*(_ah)->ah_set11nVirtMoreFrag)((_ah), (_ds), (_v))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 00:07:25 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 27536C0F; Mon, 4 Mar 2013 00:07:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9FCFC8; Mon, 4 Mar 2013 00:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r2407OVt042663; Mon, 4 Mar 2013 00:07:24 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r2407OAi042658; Mon, 4 Mar 2013 00:07:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303040007.r2407OAi042658@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 00:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247742 - in user/attilio/vmc-playground/sys: conf vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 00:07:25 -0000 Author: attilio Date: Mon Mar 4 00:07:23 2013 New Revision: 247742 URL: http://svnweb.freebsd.org/changeset/base/247742 Log: Remove the boot-time cache support and rely on UMA boot-time slab cache for allocating the nodes before to have the possibility to carve directly from the UMA subsystem. Sponsored by: EMC / Isilon storage division Reviewed by: alc Modified: user/attilio/vmc-playground/sys/conf/options user/attilio/vmc-playground/sys/vm/vm_object.c user/attilio/vmc-playground/sys/vm/vm_radix.c user/attilio/vmc-playground/sys/vm/vm_radix.h Modified: user/attilio/vmc-playground/sys/conf/options ============================================================================== --- user/attilio/vmc-playground/sys/conf/options Mon Mar 4 00:07:19 2013 (r247741) +++ user/attilio/vmc-playground/sys/conf/options Mon Mar 4 00:07:23 2013 (r247742) @@ -591,7 +591,6 @@ VM_KMEM_SIZE_MAX opt_vm.h VM_NDOMAIN opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h -VM_RADIX_BOOT_CACHE opt_vm.h NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h MALLOC_PROFILE opt_vm.h Modified: user/attilio/vmc-playground/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_object.c Mon Mar 4 00:07:19 2013 (r247741) +++ user/attilio/vmc-playground/sys/vm/vm_object.c Mon Mar 4 00:07:23 2013 (r247742) @@ -295,6 +295,8 @@ vm_object_init(void) NULL, #endif vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); + + vm_radix_init(); } void Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 00:07:19 2013 (r247741) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 00:07:23 2013 (r247742) @@ -45,7 +45,6 @@ #include #include "opt_ddb.h" -#include "opt_vm.h" #include #include @@ -62,10 +61,6 @@ #include #endif -#ifndef VM_RADIX_BOOT_CACHE -#define VM_RADIX_BOOT_CACHE 150 -#endif - /* * Such sizes should permit to keep node children contained into a single * cache-line, or to at least not span many of those. @@ -102,27 +97,6 @@ struct vm_radix_node { static uma_zone_t vm_radix_node_zone; /* - * Boot-time cache of struct vm_radix_node objects. - * This cache is used to cater page allocations before the UMA zone is - * actually setup and pre-allocated (ie. pmap_init()). - */ -static u_int boot_cache_cnt; -static struct vm_radix_node boot_cache[VM_RADIX_BOOT_CACHE]; - -static struct vm_radix_node * -vm_radix_carve_bootcache(void) -{ - struct vm_radix_node *rnode; - - if (boot_cache_cnt == VM_RADIX_BOOT_CACHE) - panic("%s: Increase VM_RADIX_BOOT_CACHE (%u)", __func__, - VM_RADIX_BOOT_CACHE); - rnode = &boot_cache[boot_cache_cnt]; - boot_cache_cnt++; - return (rnode); -} - -/* * Allocate a radix node. Pre-allocation ensures that the request will be * always successfully satisfied. */ @@ -131,26 +105,22 @@ vm_radix_node_get(vm_pindex_t owner, uin { struct vm_radix_node *rnode; - if (__predict_false(boot_cache_cnt <= VM_RADIX_BOOT_CACHE)) - rnode = vm_radix_carve_bootcache(); - else { - rnode = uma_zalloc(vm_radix_node_zone, M_NOWAIT | M_ZERO); + rnode = uma_zalloc(vm_radix_node_zone, M_NOWAIT | M_ZERO); - /* - * The required number of nodes might be already correctly - * pre-allocated in vm_radix_init(). However, UMA can reserve - * few nodes on per-cpu specific buckets, which will not be - * accessible from the curcpu. The allocation could then - * return NULL when the pre-allocation pool is close to be - * exhausted. Anyway, in practice this should never be a - * problem because a new node is not always required for - * insert, thus the pre-allocation pool should already have - * some extra-pages that indirectly deal with this situation. - */ - if (rnode == NULL) - panic("%s: uma_zalloc() returned NULL for a new node", - __func__); - } + /* + * The required number of nodes might be already correctly + * pre-allocated in vm_radix_init(). However, UMA can reserve + * few nodes on per-cpu specific buckets, which will not be + * accessible from the curcpu. The allocation could then + * return NULL when the pre-allocation pool is close to be + * exhausted. Anyway, in practice this should never be a + * problem because a new node is not always required for + * insert, thus the pre-allocation pool should already have + * some extra-pages that indirectly deal with this situation. + */ + if (rnode == NULL) + panic("%s: uma_zalloc() returned NULL for a new node", + __func__); rnode->rn_owner = owner; rnode->rn_count = count; rnode->rn_clev = clevel; @@ -164,9 +134,6 @@ static __inline void vm_radix_node_put(struct vm_radix_node *rnode) { - if (__predict_false(rnode > boot_cache && - rnode <= &boot_cache[VM_RADIX_BOOT_CACHE])) - return; uma_zfree(vm_radix_node_zone, rnode); } @@ -367,7 +334,23 @@ vm_radix_node_zone_dtor(void *mem, int s * Pre-allocate intermediate nodes from the UMA slab zone. */ static void -vm_radix_init(void *arg __unused) +vm_radix_prealloc(void *arg __unused) +{ + + if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) + panic("%s: unable to create new zone", __func__); + uma_prealloc(vm_radix_node_zone, cnt.v_page_count); +} +SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc, + NULL); + +/* + * Initialize the UMA slab zone. + * Until vm_radix_prealloc() is called, the zone will be served by the + * UMA boot-time pre-allocated pool of pages. + */ +void +vm_radix_init(void) { vm_radix_node_zone = uma_zcreate("RADIX NODE", @@ -378,12 +361,7 @@ vm_radix_init(void *arg __unused) NULL, #endif NULL, NULL, VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_NOFREE); - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) - panic("%s: unable to create new zone", __func__); - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); - boot_cache_cnt = VM_RADIX_BOOT_CACHE + 1; } -SYSINIT(vm_radix_init, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_init, NULL); /* * Inserts the key-value pair in to the trie. Modified: user/attilio/vmc-playground/sys/vm/vm_radix.h ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.h Mon Mar 4 00:07:19 2013 (r247741) +++ user/attilio/vmc-playground/sys/vm/vm_radix.h Mon Mar 4 00:07:23 2013 (r247742) @@ -34,6 +34,7 @@ #ifdef _KERNEL +void vm_radix_init(void); void vm_radix_insert(struct vm_radix *rtree, vm_pindex_t index, vm_page_t page); vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index); From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 00:16:48 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 337F8EAE; Mon, 4 Mar 2013 00:16:48 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06FF8FFC; Mon, 4 Mar 2013 00:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r240Gmh1045816; Mon, 4 Mar 2013 00:16:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r240GjLl045800; Mon, 4 Mar 2013 00:16:45 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303040016.r240GjLl045800@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 00:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247743 - in user/attilio/vmcontention: . bin/sh sbin/ipfw share/man/man4 sys/cddl/compat/opensolaris/sys sys/kern sys/modules/mqueue sys/sys tools/regression/bin/sh/builtins usr.bin/fi... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 00:16:48 -0000 Author: attilio Date: Mon Mar 4 00:16:45 2013 New Revision: 247743 URL: http://svnweb.freebsd.org/changeset/base/247743 Log: MFC Added: user/attilio/vmcontention/tools/regression/bin/sh/builtins/trap12.0 - copied unchanged from r247742, head/tools/regression/bin/sh/builtins/trap12.0 Modified: user/attilio/vmcontention/MAINTAINERS (contents, props changed) user/attilio/vmcontention/ObsoleteFiles.inc user/attilio/vmcontention/bin/sh/trap.c user/attilio/vmcontention/sbin/ipfw/ipfw2.c user/attilio/vmcontention/sbin/ipfw/ipfw2.h user/attilio/vmcontention/sbin/ipfw/ipv6.c user/attilio/vmcontention/share/man/man4/mvs.4 user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/kcondvar.h user/attilio/vmcontention/sys/kern/kern_descrip.c user/attilio/vmcontention/sys/kern/kern_timeout.c user/attilio/vmcontention/sys/kern/uipc_usrreq.c user/attilio/vmcontention/sys/modules/mqueue/Makefile user/attilio/vmcontention/sys/sys/filedesc.h user/attilio/vmcontention/sys/sys/systm.h user/attilio/vmcontention/usr.bin/find/extern.h user/attilio/vmcontention/usr.bin/find/find.1 user/attilio/vmcontention/usr.bin/find/function.c user/attilio/vmcontention/usr.bin/find/option.c user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-disk.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-newfs.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-packages.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions-parse.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/functions.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/backend/parseconfig.sh user/attilio/vmcontention/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf user/attilio/vmcontention/usr.sbin/pc-sysinstall/examples/README Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) Modified: user/attilio/vmcontention/MAINTAINERS ============================================================================== --- user/attilio/vmcontention/MAINTAINERS Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/MAINTAINERS Mon Mar 4 00:16:45 2013 (r247743) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. Modified: user/attilio/vmcontention/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmcontention/ObsoleteFiles.inc Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/ObsoleteFiles.inc Mon Mar 4 00:16:45 2013 (r247743) @@ -39,6 +39,8 @@ # done # 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs OLD_FILES+=usr/include/fs/ntfs/ntfs.h OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h @@ -51,6 +53,7 @@ OLD_FILES+=usr/share/man/man8/mount_ntfs # 20130302: PORTALFS support removed OLD_FILES+=usr/include/fs/portalfs/portal.h OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs OLD_FILES+=usr/share/examples/portal/README OLD_FILES+=usr/share/examples/portal/portal.conf OLD_DIRS+=usr/share/examples/portal @@ -79,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz Modified: user/attilio/vmcontention/bin/sh/trap.c ============================================================================== --- user/attilio/vmcontention/bin/sh/trap.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/bin/sh/trap.c Mon Mar 4 00:16:45 2013 (r247743) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Modified: user/attilio/vmcontention/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipfw2.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sbin/ipfw/ipfw2.c Mon Mar 4 00:16:45 2013 (r247743) @@ -64,6 +64,22 @@ int ipfw_socket = -1; #define s6_addr32 __u6_addr.__u6_addr32 #endif +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) +/* + * Check if we have enough space in cmd buffer. Note that since + * first 8? u32 words are reserved by reserved header, full cmd + * buffer can't be used, so we need to protect from buffer overrun + * only. At the beginnig, cblen is less than actual buffer size by + * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need + * for checking small instructions fitting in given range. + * We also (ab)use the fact that ipfw_insn is always the first field + * for any custom instruction. + */ +#define CHECK_CMDLEN CHECK_LENGTH(cblen, F_LEN((ipfw_insn *)cmd)) + #define GET_UINT_ARG(arg, min, max, tok, s_x) do { \ if (!av[0]) \ errx(EX_USAGE, "%s: missing argument", match_value(s_x, tok)); \ @@ -653,7 +669,7 @@ strtoport(char *s, char **end, int base, * Fill the body of the command with the list of port ranges. */ static int -fill_newports(ipfw_insn_u16 *cmd, char *av, int proto) +fill_newports(ipfw_insn_u16 *cmd, char *av, int proto, int cblen) { uint16_t a, b, *p = cmd->ports; int i = 0; @@ -664,6 +680,8 @@ fill_newports(ipfw_insn_u16 *cmd, char * if (s == av) /* empty or invalid argument */ return (0); + CHECK_LENGTH(cblen, i + 2); + switch (*s) { case '-': /* a range */ av = s + 1; @@ -2068,7 +2086,7 @@ lookup_host (char *host, struct in_addr * We can have multiple comma-separated address/mask entries. */ static void -fill_ip(ipfw_insn_ip *cmd, char *av) +fill_ip(ipfw_insn_ip *cmd, char *av, int cblen) { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; @@ -2108,6 +2126,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av) int masklen; char md, nd = '\0'; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn) + 2 + len); + if (p) { md = *p; *p++ = '\0'; @@ -2366,11 +2386,13 @@ ipfw_delete(char *av[]) * patterns which match interfaces. */ static void -fill_iface(ipfw_insn_if *cmd, char *arg) +fill_iface(ipfw_insn_if *cmd, char *arg, int cblen) { cmd->name[0] = '\0'; cmd->o.len |= F_INSN_SIZE(ipfw_insn_if); + CHECK_CMDLEN; + /* Parse the interface or address */ if (strcmp(arg, "any") == 0) cmd->o.len = 0; /* effectively ignore this command */ @@ -2441,8 +2463,10 @@ get_mac_addr_mask(const char *p, uint8_t * the new command in case it has been clobbered before. */ static ipfw_insn * -next_cmd(ipfw_insn *cmd) +next_cmd(ipfw_insn *cmd, int *len) { + *len -= F_LEN(cmd); + CHECK_LENGTH(*len, 0); cmd += F_LEN(cmd); bzero(cmd, sizeof(*cmd)); return cmd; @@ -2452,7 +2476,7 @@ next_cmd(ipfw_insn *cmd) * Takes arguments and copies them into a comment */ static void -fill_comment(ipfw_insn *cmd, char **av) +fill_comment(ipfw_insn *cmd, char **av, int cblen) { int i, l; char *p = (char *)(cmd + 1); @@ -2470,6 +2494,8 @@ fill_comment(ipfw_insn *cmd, char **av) "comment too long (max 80 chars)"); l = 1 + (l+3)/4; cmd->len = (cmd->len & (F_NOT | F_OR)) | l; + CHECK_CMDLEN; + for (i = 0; av[i] != NULL; i++) { strcpy(p, av[i]); p += strlen(av[i]); @@ -2495,7 +2521,7 @@ fill_cmd(ipfw_insn *cmd, enum ipfw_opcod * two microinstructions, and returns the pointer to the last one. */ static ipfw_insn * -add_mac(ipfw_insn *cmd, char *av[]) +add_mac(ipfw_insn *cmd, char *av[], int cblen) { ipfw_insn_mac *mac; @@ -2504,6 +2530,7 @@ add_mac(ipfw_insn *cmd, char *av[]) cmd->opcode = O_MACADDR2; cmd->len = (cmd->len & (F_NOT | F_OR)) | F_INSN_SIZE(ipfw_insn_mac); + CHECK_CMDLEN; mac = (ipfw_insn_mac *)cmd; get_mac_addr_mask(av[0], mac->addr, mac->mask); /* dst */ @@ -2513,12 +2540,13 @@ add_mac(ipfw_insn *cmd, char *av[]) } static ipfw_insn * -add_mactype(ipfw_insn *cmd, char *av) +add_mactype(ipfw_insn *cmd, char *av, int cblen) { if (!av) errx(EX_DATAERR, "missing MAC type"); if (strcmp(av, "any") != 0) { /* we have a non-null type */ - fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE); + fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE, + cblen); cmd->opcode = O_MAC_TYPE; return cmd; } else @@ -2587,9 +2615,9 @@ add_proto_compat(ipfw_insn *cmd, char *a } static ipfw_insn * -add_srcip(ipfw_insn *cmd, char *av) +add_srcip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2604,9 +2632,9 @@ add_srcip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_dstip(ipfw_insn *cmd, char *av) +add_dstip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2621,12 +2649,12 @@ add_dstip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode) +add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode, int cblen) { /* XXX "any" is trapped before. Perhaps "to" */ if (_substrcmp(av, "any") == 0) { return NULL; - } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto)) { + } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto, cblen)) { /* XXX todo: check that we have a protocol with ports */ cmd->opcode = opcode; return cmd; @@ -2635,7 +2663,7 @@ add_ports(ipfw_insn *cmd, char *av, u_ch } static ipfw_insn * -add_src(ipfw_insn *cmd, char *av, u_char proto) +add_src(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2648,11 +2676,11 @@ add_src(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_srcip6(cmd, av); + ret = add_srcip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_srcip(cmd, av); + ret = add_srcip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2661,7 +2689,7 @@ add_src(ipfw_insn *cmd, char *av, u_char } static ipfw_insn * -add_dst(ipfw_insn *cmd, char *av, u_char proto) +add_dst(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2674,11 +2702,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_dstip6(cmd, av); + ret = add_dstip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_dstip(cmd, av); + ret = add_dstip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2708,6 +2736,7 @@ ipfw_add(char *av[]) * go into actbuf[]. */ static uint32_t rulebuf[255], actbuf[255], cmdbuf[255]; + int rblen, ablen, cblen; ipfw_insn *src, *dst, *cmd, *action, *prev=NULL; ipfw_insn *first_cmd; /* first match pattern */ @@ -2738,6 +2767,15 @@ ipfw_add(char *av[]) cmd = (ipfw_insn *)cmdbuf; action = (ipfw_insn *)actbuf; + rblen = sizeof(rulebuf) / sizeof(rulebuf[0]); + rblen -= offsetof(struct ip_fw, cmd) / sizeof(rulebuf[0]); + ablen = sizeof(actbuf) / sizeof(actbuf[0]); + cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; + +#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } +#define CHECK_ACTLEN CHECK_LENGTH(ablen, action->len) + av++; /* [rule N] -- Rule number optional */ @@ -2769,6 +2807,7 @@ ipfw_add(char *av[]) i = match_token(rule_actions, *av); av++; action->len = 1; /* default */ + CHECK_ACTLEN; switch(i) { case TOK_CHECKSTATE: have_state = action; @@ -2820,6 +2859,7 @@ ipfw_add(char *av[]) case TOK_NAT: action->opcode = O_NAT; action->len = F_INSN_SIZE(ipfw_insn_nat); + CHECK_ACTLEN; if (_substrcmp(*av, "global") == 0) { action->arg1 = 0; av++; @@ -2936,6 +2976,7 @@ chkarg: action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); + CHECK_ACTLEN; /* * In the kernel we assume AF_INET and use only @@ -2952,6 +2993,7 @@ chkarg: action->opcode = O_FORWARD_IP6; action->len = F_INSN_SIZE(ipfw_insn_sa6); + CHECK_ACTLEN; p->sa.sin6_len = sizeof(struct sockaddr_in6); p->sa.sin6_family = AF_INET6; @@ -3005,7 +3047,7 @@ chkarg: default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } - action = next_cmd(action); + action = next_cmd(action, &ablen); /* * [altq queuename] -- altq tag, optional @@ -3027,6 +3069,7 @@ chkarg: "log cannot be specified more than once"); have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); + CHECK_CMDLEN; cmd->opcode = O_LOG; if (av[0] && _substrcmp(*av, "logamount") == 0) { av++; @@ -3058,6 +3101,7 @@ chkarg: "altq cannot be specified more than once"); have_altq = (ipfw_insn *)a; cmd->len = F_INSN_SIZE(ipfw_insn_altq); + CHECK_CMDLEN; cmd->opcode = O_ALTQ; a->qid = altq_name_to_qid(*av); av++; @@ -3083,7 +3127,7 @@ chkarg: default: abort(); } - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } if (have_state) /* must be a check-state, we are done */ @@ -3168,7 +3212,7 @@ chkarg: av++; if (F_LEN(cmd) != 0) { prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); @@ -3189,11 +3233,11 @@ chkarg: OR_START(source_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing source address"); - if (add_src(cmd, *av, proto)) { + if (add_src(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx(EX_USAGE, "bad source address %s", *av); @@ -3205,10 +3249,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if ( av[0] != NULL ) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3225,11 +3269,11 @@ chkarg: OR_START(dest_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing dst address"); - if (add_dst(cmd, *av, proto)) { + if (add_dst(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx( EX_USAGE, "bad destination address %s", *av); @@ -3241,10 +3285,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if (av[0]) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3332,7 +3376,7 @@ read_options: case TOK_VIA: NEED1("recv, xmit, via require interface name" " or address"); - fill_iface((ipfw_insn_if *)cmd, av[0]); + fill_iface((ipfw_insn_if *)cmd, av[0], cblen); av++; if (F_LEN(cmd) == 0) /* not a valid address */ break; @@ -3352,14 +3396,14 @@ read_options: case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); - fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); + fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av, cblen); av++; break; case TOK_IPTTL: NEED1("ipttl requires TTL"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPTTL)) + if (!add_ports(cmd, *av, 0, O_IPTTL, cblen)) errx(EX_DATAERR, "invalid ipttl %s", *av); } else fill_cmd(cmd, O_IPTTL, 0, strtoul(*av, NULL, 0)); @@ -3369,7 +3413,7 @@ read_options: case TOK_IPID: NEED1("ipid requires id"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPID)) + if (!add_ports(cmd, *av, 0, O_IPID, cblen)) errx(EX_DATAERR, "invalid ipid %s", *av); } else fill_cmd(cmd, O_IPID, 0, strtoul(*av, NULL, 0)); @@ -3379,7 +3423,7 @@ read_options: case TOK_IPLEN: NEED1("iplen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPLEN)) + if (!add_ports(cmd, *av, 0, O_IPLEN, cblen)) errx(EX_DATAERR, "invalid ip len %s", *av); } else fill_cmd(cmd, O_IPLEN, 0, strtoul(*av, NULL, 0)); @@ -3475,7 +3519,7 @@ read_options: case TOK_TCPDATALEN: NEED1("tcpdatalen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPDATALEN)) + if (!add_ports(cmd, *av, 0, O_TCPDATALEN, cblen)) errx(EX_DATAERR, "invalid tcpdata len %s", *av); } else fill_cmd(cmd, O_TCPDATALEN, 0, @@ -3501,7 +3545,7 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN)) + if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) errx(EX_DATAERR, "invalid tcpwin len %s", *av); } else fill_cmd(cmd, O_TCPWIN, 0, @@ -3540,6 +3584,7 @@ read_options: have_state = cmd; cmd->len = F_INSN_SIZE(ipfw_insn_limit); + CHECK_CMDLEN; cmd->opcode = O_LIMIT; c->limit_mask = c->conn_limit = 0; @@ -3571,28 +3616,28 @@ read_options: case TOK_SRCIP: NEED1("missing source IP"); - if (add_srcip(cmd, *av)) { + if (add_srcip(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP: NEED1("missing destination IP"); - if (add_dstip(cmd, *av)) { + if (add_dstip(cmd, *av, cblen)) { av++; } break; case TOK_SRCIP6: NEED1("missing source IP6"); - if (add_srcip6(cmd, *av)) { + if (add_srcip6(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP6: NEED1("missing destination IP6"); - if (add_dstip6(cmd, *av)) { + if (add_dstip6(cmd, *av, cblen)) { av++; } break; @@ -3600,7 +3645,7 @@ read_options: case TOK_SRCPORT: NEED1("missing source port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid source port %s", *av); @@ -3609,7 +3654,7 @@ read_options: case TOK_DSTPORT: NEED1("missing destination port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid destination port %s", @@ -3617,13 +3662,13 @@ read_options: break; case TOK_MAC: - if (add_mac(cmd, av)) + if (add_mac(cmd, av, cblen)) av += 2; break; case TOK_MACTYPE: NEED1("missing mac type"); - if (!add_mactype(cmd, *av)) + if (!add_mactype(cmd, *av, cblen)) errx(EX_DATAERR, "invalid mac type %s", *av); av++; break; @@ -3661,18 +3706,18 @@ read_options: if (proto != IPPROTO_IPV6 ) errx( EX_USAGE, "flow-id filter is active " "only for ipv6 protocol\n"); - fill_flow6( (ipfw_insn_u32 *) cmd, *av ); + fill_flow6( (ipfw_insn_u32 *) cmd, *av, cblen); av++; break; case TOK_COMMENT: - fill_comment(cmd, av); + fill_comment(cmd, av, cblen); av[0]=NULL; break; case TOK_TAGGED: if (av[0] && strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TAGGED)) + if (!add_ports(cmd, *av, 0, O_TAGGED, cblen)) errx(EX_DATAERR, "tagged: invalid tag" " list: %s", *av); } @@ -3725,7 +3770,7 @@ read_options: } if (F_LEN(cmd) > 0) { /* prepare to advance */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3754,12 +3799,13 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { fill_cmd(dst, O_PROBE_STATE, 0, 0); - dst = next_cmd(dst); + dst = next_cmd(dst, &rblen); } /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); switch (src->opcode) { case O_LOG: @@ -3779,6 +3825,7 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { i = F_LEN(have_state); + CHECK_RBUFLEN(i); bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } @@ -3790,24 +3837,29 @@ done: /* put back O_LOG, O_ALTQ, O_TAG if necessary */ if (have_log) { i = F_LEN(have_log); + CHECK_RBUFLEN(i); bcopy(have_log, dst, i * sizeof(uint32_t)); dst += i; } if (have_altq) { i = F_LEN(have_altq); + CHECK_RBUFLEN(i); bcopy(have_altq, dst, i * sizeof(uint32_t)); dst += i; } if (have_tag) { i = F_LEN(have_tag); + CHECK_RBUFLEN(i); bcopy(have_tag, dst, i * sizeof(uint32_t)); dst += i; } + /* * copy all other actions */ for (src = (ipfw_insn *)actbuf; src != action; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); bcopy(src, dst, i * sizeof(uint32_t)); dst += i; } Modified: user/attilio/vmcontention/sbin/ipfw/ipfw2.h ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipfw2.h Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sbin/ipfw/ipfw2.h Mon Mar 4 00:16:45 2013 (r247743) @@ -283,10 +283,10 @@ void print_flow6id(struct _ipfw_insn_u32 void print_icmp6types(struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct _ipfw_insn *cmd ); -struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av); -struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av); +struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av, int cblen); +struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av, int cblen); -void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av ); +void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av, int cblen); void fill_unreach6_code(u_short *codep, char *str); -void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av); +void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); Modified: user/attilio/vmcontention/sbin/ipfw/ipv6.c ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipv6.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sbin/ipfw/ipv6.c Mon Mar 4 00:16:45 2013 (r247743) @@ -42,6 +42,11 @@ #include #include +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) + static struct _s_x icmp6codes[] = { { "no-route", ICMP6_DST_UNREACH_NOROUTE }, { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, @@ -131,10 +136,12 @@ print_ip6(ipfw_insn_ip6 *cmd, char const } void -fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av) +fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) { uint8_t type; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); + bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') @@ -327,7 +334,7 @@ lookup_host6 (char *host, struct in6_add * Return 1 on success, 0 on failure. */ static int -fill_ip6(ipfw_insn_ip6 *cmd, char *av) +fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen) { int len = 0; struct in6_addr *d = &(cmd->addr6); @@ -379,6 +386,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) int masklen; char md = '\0'; + CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); + if ((p = strpbrk(av, "/,")) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ @@ -453,7 +462,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * additional flow-id we want to filter, the basic is 1 */ void -fill_flow6( ipfw_insn_u32 *cmd, char *av ) +fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) { u_int32_t type; /* Current flow number */ u_int16_t nflow = 0; /* Current flow index */ @@ -461,6 +470,8 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av cmd->d[0] = 0; /* Initializing the base number*/ while (s) { + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_u32) + nflow + 1); + av = strsep( &s, ",") ; type = strtoul(av, &av, 0); if (*av != ',' && *av != '\0') @@ -481,10 +492,10 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av } ipfw_insn * -add_srcip6(ipfw_insn *cmd, char *av) +add_srcip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -503,10 +514,10 @@ add_srcip6(ipfw_insn *cmd, char *av) } ipfw_insn * -add_dstip6(ipfw_insn *cmd, char *av) +add_dstip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ Modified: user/attilio/vmcontention/share/man/man4/mvs.4 ============================================================================== --- user/attilio/vmcontention/share/man/man4/mvs.4 Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/share/man/man4/mvs.4 Mon Mar 4 00:16:45 2013 (r247743) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2010 +.Dd March 3, 2013 .Dt MVS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ command latency. .It Va hint.mvs. Ns Ar X Ns Va .cccc defines number of completed commands for CCC, which trigger interrupt without waiting for specified coalescing timeout. -.It Va hint.mvs. Ns Ar X Ns Va .pm_level +.It Va hint.mvsch. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. @@ -82,7 +82,7 @@ driver initiates SLUMBER PM state transi Note that interface Power Management is not compatible with device presence detection. A manual bus reset is needed on device hot-plug. -.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +.It Va hint.mvsch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El Modified: user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/kcondvar.h ============================================================================== --- user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/kcondvar.h Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/kcondvar.h Mon Mar 4 00:16:45 2013 (r247743) @@ -55,7 +55,7 @@ typedef enum { _name = #cv; \ cv_init((cv), _name); \ } while (0) -#define cv_init(cv, name, type, arg) zfs_cv_init((cv), (name), (type), (arg)) +#define cv_init(cv, name, type, arg) zfs_cv_init(cv, name, type, arg) #endif /* _KERNEL */ Modified: user/attilio/vmcontention/sys/kern/kern_descrip.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_descrip.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sys/kern/kern_descrip.c Mon Mar 4 00:16:45 2013 (r247743) @@ -104,6 +104,7 @@ static MALLOC_DEFINE(M_FILEDESC, "filede static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader", "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DEFINE(M_FILECAPS, "filecaps", "descriptor capabilities"); MALLOC_DECLARE(M_FADVISE); @@ -1389,7 +1390,7 @@ filecaps_copy(const struct filecaps *src ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; - dst->fc_ioctls = malloc(size, M_TEMP, M_WAITOK); + dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); } } @@ -1397,7 +1398,7 @@ filecaps_copy(const struct filecaps *src /* * Move filecaps structure to the new place and clear the old place. */ -static void +void filecaps_move(struct filecaps *src, struct filecaps *dst) { @@ -1425,7 +1426,7 @@ void filecaps_free(struct filecaps *fcaps) { - free(fcaps->fc_ioctls, M_TEMP); + free(fcaps->fc_ioctls, M_FILECAPS); bzero(fcaps, sizeof(*fcaps)); } Modified: user/attilio/vmcontention/sys/kern/kern_timeout.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_timeout.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sys/kern/kern_timeout.c Mon Mar 4 00:16:45 2013 (r247743) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -84,7 +83,7 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca * TODO: * allocate more timeout table slots when table overflows. */ -int callwheelsize, callwheelmask; +u_int callwheelsize, callwheelmask; /* * The callout cpu migration entity represents informations necessary for @@ -205,7 +204,7 @@ cc_cme_migrating(struct callout_cpu *cc) } /* - * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization + * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization * * This code is called very early in the kernel initialization sequence, * and may be called more then once. @@ -704,7 +703,7 @@ softclock(void *arg) * Initialize a handle so that using it with untimeout is benign. * * See AT&T BCI Driver Reference Manual for specification. This - * implementation differs from that one in that although an + * implementation differs from that one in that although an * identification value is returned from timeout, the original * arguments to timeout as well as the identifier are used to * identify entries for untimeout. Modified: user/attilio/vmcontention/sys/kern/uipc_usrreq.c ============================================================================== --- user/attilio/vmcontention/sys/kern/uipc_usrreq.c Mon Mar 4 00:07:23 2013 (r247742) +++ user/attilio/vmcontention/sys/kern/uipc_usrreq.c Mon Mar 4 00:16:45 2013 (r247743) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #include +MALLOC_DECLARE(M_FILECAPS); + /* * Locking key: * (l) Locked using list lock @@ -282,7 +284,7 @@ static void unp_drop(struct unpcb *, int static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct file *)); static void unp_discard(struct file *); -static void unp_freerights(struct filedescent *, int); +static void unp_freerights(struct filedescent **, int); static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); @@ -1679,16 +1681,17 @@ unp_drop(struct unpcb *unp, int errno) } static void -unp_freerights(struct filedescent *fde, int fdcount) +unp_freerights(struct filedescent **fdep, int fdcount) { struct file *fp; int i; - for (i = 0; i < fdcount; i++, fde++) { - fp = fde->fde_file; - bzero(fde, sizeof(*fde)); + for (i = 0; i < fdcount; i++) { + fp = fdep[i]->fde_file; + filecaps_free(&fdep[i]->fde_caps); unp_discard(fp); } + free(fdep[0], M_FILECAPS); } static int @@ -1699,7 +1702,7 @@ unp_externalize(struct mbuf *control, st int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep; void *data; socklen_t clen = control->m_len, datalen; int error, newfds; @@ -1755,16 +1758,18 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < newfds; i++, fdep++, fdp++) { + for (i = 0; i < newfds; i++, fdp++) { if (fdalloc(td, 0, &f)) panic("unp_externalize fdalloc failed"); fde = &fdesc->fd_ofiles[f]; - fde->fde_file = fdep->fde_file; - filecaps_copy(&fdep->fde_caps, &fde->fde_caps); + fde->fde_file = fdep[0]->fde_file; + filecaps_move(&fdep[0]->fde_caps, + &fde->fde_caps); unp_externalize_fp(fde->fde_file); *fdp = f; } FILEDESC_XUNLOCK(fdesc); + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1839,7 +1844,7 @@ unp_internalize(struct mbuf **controlp, struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; int i, fd, *fdp; @@ -1913,7 +1918,7 @@ unp_internalize(struct mbuf **controlp, * Now replace the integer FDs with pointers to the * file structure and capability rights. */ - newlen = oldfds * sizeof(*fdep); + newlen = oldfds * sizeof(fdep[0]); *controlp = sbcreatecontrol(NULL, newlen, SCM_RIGHTS, SOL_SOCKET); if (*controlp == NULL) { @@ -1922,13 +1927,17 @@ unp_internalize(struct mbuf **controlp, goto out; } fdp = data; - fdep = (struct filedescent *) + fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < oldfds; i++, fdep++, fdp++) { + fdev = malloc(sizeof(*fdev) * oldfds, M_FILECAPS, + M_WAITOK); + for (i = 0; i < oldfds; i++, fdev++, fdp++) { fde = &fdesc->fd_ofiles[*fdp]; - fdep->fde_file = fde->fde_file; - filecaps_copy(&fde->fde_caps, &fdep->fde_caps); - unp_internalize_fp(fdep->fde_file); + fdep[i] = fdev; + fdep[i]->fde_file = fde->fde_file; + filecaps_copy(&fde->fde_caps, + &fdep[i]->fde_caps); + unp_internalize_fp(fdep[i]->fde_file); } FILEDESC_SUNLOCK(fdesc); break; @@ -2290,7 +2299,7 @@ static void unp_scan(struct mbuf *m0, void (*op)(struct file *)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 00:21:40 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5E6EFED; Mon, 4 Mar 2013 00:21:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B988C7A; Mon, 4 Mar 2013 00:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r240Leca048075; Mon, 4 Mar 2013 00:21:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r240LcgQ048057; Mon, 4 Mar 2013 00:21:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303040021.r240LcgQ048057@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 00:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247744 - in user/attilio/vmc-playground: . bin/sh sbin/ipfw share/man/man4 sys/cddl/compat/opensolaris/sys sys/kern sys/modules/mqueue sys/sys tools/regression/bin/sh/builtins usr.bin/... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 00:21:40 -0000 Author: attilio Date: Mon Mar 4 00:21:38 2013 New Revision: 247744 URL: http://svnweb.freebsd.org/changeset/base/247744 Log: Merge from vmcontention Added: user/attilio/vmc-playground/tools/regression/bin/sh/builtins/trap12.0 - copied unchanged from r247743, user/attilio/vmcontention/tools/regression/bin/sh/builtins/trap12.0 Modified: user/attilio/vmc-playground/MAINTAINERS (contents, props changed) user/attilio/vmc-playground/ObsoleteFiles.inc user/attilio/vmc-playground/bin/sh/trap.c user/attilio/vmc-playground/sbin/ipfw/ipfw2.c user/attilio/vmc-playground/sbin/ipfw/ipfw2.h user/attilio/vmc-playground/sbin/ipfw/ipv6.c user/attilio/vmc-playground/share/man/man4/mvs.4 user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/kcondvar.h user/attilio/vmc-playground/sys/kern/kern_descrip.c user/attilio/vmc-playground/sys/kern/kern_timeout.c user/attilio/vmc-playground/sys/kern/uipc_usrreq.c user/attilio/vmc-playground/sys/modules/mqueue/Makefile user/attilio/vmc-playground/sys/sys/filedesc.h user/attilio/vmc-playground/sys/sys/systm.h user/attilio/vmc-playground/usr.bin/find/extern.h user/attilio/vmc-playground/usr.bin/find/find.1 user/attilio/vmc-playground/usr.bin/find/function.c user/attilio/vmc-playground/usr.bin/find/option.c user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-disk.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-newfs.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-packages.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions-parse.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/functions.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/backend/parseconfig.sh user/attilio/vmc-playground/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf user/attilio/vmc-playground/usr.sbin/pc-sysinstall/examples/README Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/sbin/ (props changed) user/attilio/vmc-playground/sbin/ipfw/ (props changed) user/attilio/vmc-playground/share/man/man4/ (props changed) user/attilio/vmc-playground/sys/ (props changed) Modified: user/attilio/vmc-playground/MAINTAINERS ============================================================================== --- user/attilio/vmc-playground/MAINTAINERS Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/MAINTAINERS Mon Mar 4 00:21:38 2013 (r247744) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. Modified: user/attilio/vmc-playground/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmc-playground/ObsoleteFiles.inc Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/ObsoleteFiles.inc Mon Mar 4 00:21:38 2013 (r247744) @@ -39,6 +39,8 @@ # done # 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs OLD_FILES+=usr/include/fs/ntfs/ntfs.h OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h @@ -51,6 +53,7 @@ OLD_FILES+=usr/share/man/man8/mount_ntfs # 20130302: PORTALFS support removed OLD_FILES+=usr/include/fs/portalfs/portal.h OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs OLD_FILES+=usr/share/examples/portal/README OLD_FILES+=usr/share/examples/portal/portal.conf OLD_DIRS+=usr/share/examples/portal @@ -79,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz Modified: user/attilio/vmc-playground/bin/sh/trap.c ============================================================================== --- user/attilio/vmc-playground/bin/sh/trap.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/bin/sh/trap.c Mon Mar 4 00:21:38 2013 (r247744) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Modified: user/attilio/vmc-playground/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Mon Mar 4 00:21:38 2013 (r247744) @@ -64,6 +64,22 @@ int ipfw_socket = -1; #define s6_addr32 __u6_addr.__u6_addr32 #endif +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) +/* + * Check if we have enough space in cmd buffer. Note that since + * first 8? u32 words are reserved by reserved header, full cmd + * buffer can't be used, so we need to protect from buffer overrun + * only. At the beginnig, cblen is less than actual buffer size by + * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need + * for checking small instructions fitting in given range. + * We also (ab)use the fact that ipfw_insn is always the first field + * for any custom instruction. + */ +#define CHECK_CMDLEN CHECK_LENGTH(cblen, F_LEN((ipfw_insn *)cmd)) + #define GET_UINT_ARG(arg, min, max, tok, s_x) do { \ if (!av[0]) \ errx(EX_USAGE, "%s: missing argument", match_value(s_x, tok)); \ @@ -653,7 +669,7 @@ strtoport(char *s, char **end, int base, * Fill the body of the command with the list of port ranges. */ static int -fill_newports(ipfw_insn_u16 *cmd, char *av, int proto) +fill_newports(ipfw_insn_u16 *cmd, char *av, int proto, int cblen) { uint16_t a, b, *p = cmd->ports; int i = 0; @@ -664,6 +680,8 @@ fill_newports(ipfw_insn_u16 *cmd, char * if (s == av) /* empty or invalid argument */ return (0); + CHECK_LENGTH(cblen, i + 2); + switch (*s) { case '-': /* a range */ av = s + 1; @@ -2068,7 +2086,7 @@ lookup_host (char *host, struct in_addr * We can have multiple comma-separated address/mask entries. */ static void -fill_ip(ipfw_insn_ip *cmd, char *av) +fill_ip(ipfw_insn_ip *cmd, char *av, int cblen) { int len = 0; uint32_t *d = ((ipfw_insn_u32 *)cmd)->d; @@ -2108,6 +2126,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av) int masklen; char md, nd = '\0'; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn) + 2 + len); + if (p) { md = *p; *p++ = '\0'; @@ -2366,11 +2386,13 @@ ipfw_delete(char *av[]) * patterns which match interfaces. */ static void -fill_iface(ipfw_insn_if *cmd, char *arg) +fill_iface(ipfw_insn_if *cmd, char *arg, int cblen) { cmd->name[0] = '\0'; cmd->o.len |= F_INSN_SIZE(ipfw_insn_if); + CHECK_CMDLEN; + /* Parse the interface or address */ if (strcmp(arg, "any") == 0) cmd->o.len = 0; /* effectively ignore this command */ @@ -2441,8 +2463,10 @@ get_mac_addr_mask(const char *p, uint8_t * the new command in case it has been clobbered before. */ static ipfw_insn * -next_cmd(ipfw_insn *cmd) +next_cmd(ipfw_insn *cmd, int *len) { + *len -= F_LEN(cmd); + CHECK_LENGTH(*len, 0); cmd += F_LEN(cmd); bzero(cmd, sizeof(*cmd)); return cmd; @@ -2452,7 +2476,7 @@ next_cmd(ipfw_insn *cmd) * Takes arguments and copies them into a comment */ static void -fill_comment(ipfw_insn *cmd, char **av) +fill_comment(ipfw_insn *cmd, char **av, int cblen) { int i, l; char *p = (char *)(cmd + 1); @@ -2470,6 +2494,8 @@ fill_comment(ipfw_insn *cmd, char **av) "comment too long (max 80 chars)"); l = 1 + (l+3)/4; cmd->len = (cmd->len & (F_NOT | F_OR)) | l; + CHECK_CMDLEN; + for (i = 0; av[i] != NULL; i++) { strcpy(p, av[i]); p += strlen(av[i]); @@ -2495,7 +2521,7 @@ fill_cmd(ipfw_insn *cmd, enum ipfw_opcod * two microinstructions, and returns the pointer to the last one. */ static ipfw_insn * -add_mac(ipfw_insn *cmd, char *av[]) +add_mac(ipfw_insn *cmd, char *av[], int cblen) { ipfw_insn_mac *mac; @@ -2504,6 +2530,7 @@ add_mac(ipfw_insn *cmd, char *av[]) cmd->opcode = O_MACADDR2; cmd->len = (cmd->len & (F_NOT | F_OR)) | F_INSN_SIZE(ipfw_insn_mac); + CHECK_CMDLEN; mac = (ipfw_insn_mac *)cmd; get_mac_addr_mask(av[0], mac->addr, mac->mask); /* dst */ @@ -2513,12 +2540,13 @@ add_mac(ipfw_insn *cmd, char *av[]) } static ipfw_insn * -add_mactype(ipfw_insn *cmd, char *av) +add_mactype(ipfw_insn *cmd, char *av, int cblen) { if (!av) errx(EX_DATAERR, "missing MAC type"); if (strcmp(av, "any") != 0) { /* we have a non-null type */ - fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE); + fill_newports((ipfw_insn_u16 *)cmd, av, IPPROTO_ETHERTYPE, + cblen); cmd->opcode = O_MAC_TYPE; return cmd; } else @@ -2587,9 +2615,9 @@ add_proto_compat(ipfw_insn *cmd, char *a } static ipfw_insn * -add_srcip(ipfw_insn *cmd, char *av) +add_srcip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2604,9 +2632,9 @@ add_srcip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_dstip(ipfw_insn *cmd, char *av) +add_dstip(ipfw_insn *cmd, char *av, int cblen) { - fill_ip((ipfw_insn_ip *)cmd, av); + fill_ip((ipfw_insn_ip *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -2621,12 +2649,12 @@ add_dstip(ipfw_insn *cmd, char *av) } static ipfw_insn * -add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode) +add_ports(ipfw_insn *cmd, char *av, u_char proto, int opcode, int cblen) { /* XXX "any" is trapped before. Perhaps "to" */ if (_substrcmp(av, "any") == 0) { return NULL; - } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto)) { + } else if (fill_newports((ipfw_insn_u16 *)cmd, av, proto, cblen)) { /* XXX todo: check that we have a protocol with ports */ cmd->opcode = opcode; return cmd; @@ -2635,7 +2663,7 @@ add_ports(ipfw_insn *cmd, char *av, u_ch } static ipfw_insn * -add_src(ipfw_insn *cmd, char *av, u_char proto) +add_src(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2648,11 +2676,11 @@ add_src(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_srcip6(cmd, av); + ret = add_srcip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_srcip(cmd, av); + ret = add_srcip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2661,7 +2689,7 @@ add_src(ipfw_insn *cmd, char *av, u_char } static ipfw_insn * -add_dst(ipfw_insn *cmd, char *av, u_char proto) +add_dst(ipfw_insn *cmd, char *av, u_char proto, int cblen) { struct in6_addr a; char *host, *ch; @@ -2674,11 +2702,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 || inet_pton(AF_INET6, host, &a) == 1) - ret = add_dstip6(cmd, av); + ret = add_dstip6(cmd, av, cblen); /* XXX: should check for IPv4, not !IPv6 */ if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 || inet_pton(AF_INET6, host, &a) != 1)) - ret = add_dstip(cmd, av); + ret = add_dstip(cmd, av, cblen); if (ret == NULL && strcmp(av, "any") != 0) ret = cmd; @@ -2708,6 +2736,7 @@ ipfw_add(char *av[]) * go into actbuf[]. */ static uint32_t rulebuf[255], actbuf[255], cmdbuf[255]; + int rblen, ablen, cblen; ipfw_insn *src, *dst, *cmd, *action, *prev=NULL; ipfw_insn *first_cmd; /* first match pattern */ @@ -2738,6 +2767,15 @@ ipfw_add(char *av[]) cmd = (ipfw_insn *)cmdbuf; action = (ipfw_insn *)actbuf; + rblen = sizeof(rulebuf) / sizeof(rulebuf[0]); + rblen -= offsetof(struct ip_fw, cmd) / sizeof(rulebuf[0]); + ablen = sizeof(actbuf) / sizeof(actbuf[0]); + cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]); + cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1; + +#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; } +#define CHECK_ACTLEN CHECK_LENGTH(ablen, action->len) + av++; /* [rule N] -- Rule number optional */ @@ -2769,6 +2807,7 @@ ipfw_add(char *av[]) i = match_token(rule_actions, *av); av++; action->len = 1; /* default */ + CHECK_ACTLEN; switch(i) { case TOK_CHECKSTATE: have_state = action; @@ -2820,6 +2859,7 @@ ipfw_add(char *av[]) case TOK_NAT: action->opcode = O_NAT; action->len = F_INSN_SIZE(ipfw_insn_nat); + CHECK_ACTLEN; if (_substrcmp(*av, "global") == 0) { action->arg1 = 0; av++; @@ -2936,6 +2976,7 @@ chkarg: action->opcode = O_FORWARD_IP; action->len = F_INSN_SIZE(ipfw_insn_sa); + CHECK_ACTLEN; /* * In the kernel we assume AF_INET and use only @@ -2952,6 +2993,7 @@ chkarg: action->opcode = O_FORWARD_IP6; action->len = F_INSN_SIZE(ipfw_insn_sa6); + CHECK_ACTLEN; p->sa.sin6_len = sizeof(struct sockaddr_in6); p->sa.sin6_family = AF_INET6; @@ -3005,7 +3047,7 @@ chkarg: default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } - action = next_cmd(action); + action = next_cmd(action, &ablen); /* * [altq queuename] -- altq tag, optional @@ -3027,6 +3069,7 @@ chkarg: "log cannot be specified more than once"); have_log = (ipfw_insn *)c; cmd->len = F_INSN_SIZE(ipfw_insn_log); + CHECK_CMDLEN; cmd->opcode = O_LOG; if (av[0] && _substrcmp(*av, "logamount") == 0) { av++; @@ -3058,6 +3101,7 @@ chkarg: "altq cannot be specified more than once"); have_altq = (ipfw_insn *)a; cmd->len = F_INSN_SIZE(ipfw_insn_altq); + CHECK_CMDLEN; cmd->opcode = O_ALTQ; a->qid = altq_name_to_qid(*av); av++; @@ -3083,7 +3127,7 @@ chkarg: default: abort(); } - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } if (have_state) /* must be a check-state, we are done */ @@ -3168,7 +3212,7 @@ chkarg: av++; if (F_LEN(cmd) != 0) { prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else if (first_cmd != cmd) { errx(EX_DATAERR, "invalid protocol ``%s''", *av); @@ -3189,11 +3233,11 @@ chkarg: OR_START(source_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing source address"); - if (add_src(cmd, *av, proto)) { + if (add_src(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx(EX_USAGE, "bad source address %s", *av); @@ -3205,10 +3249,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if ( av[0] != NULL ) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3225,11 +3269,11 @@ chkarg: OR_START(dest_ip); NOT_BLOCK; /* optional "not" */ NEED1("missing dst address"); - if (add_dst(cmd, *av, proto)) { + if (add_dst(cmd, *av, proto, cblen)) { av++; if (F_LEN(cmd) != 0) { /* ! any */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } else errx( EX_USAGE, "bad destination address %s", *av); @@ -3241,10 +3285,10 @@ chkarg: NOT_BLOCK; /* optional "not" */ if (av[0]) { if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; if (F_LEN(cmd) != 0) - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3332,7 +3376,7 @@ read_options: case TOK_VIA: NEED1("recv, xmit, via require interface name" " or address"); - fill_iface((ipfw_insn_if *)cmd, av[0]); + fill_iface((ipfw_insn_if *)cmd, av[0], cblen); av++; if (F_LEN(cmd) == 0) /* not a valid address */ break; @@ -3352,14 +3396,14 @@ read_options: case TOK_ICMP6TYPES: NEED1("icmptypes requires list of types"); - fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av); + fill_icmp6types((ipfw_insn_icmp6 *)cmd, *av, cblen); av++; break; case TOK_IPTTL: NEED1("ipttl requires TTL"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPTTL)) + if (!add_ports(cmd, *av, 0, O_IPTTL, cblen)) errx(EX_DATAERR, "invalid ipttl %s", *av); } else fill_cmd(cmd, O_IPTTL, 0, strtoul(*av, NULL, 0)); @@ -3369,7 +3413,7 @@ read_options: case TOK_IPID: NEED1("ipid requires id"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPID)) + if (!add_ports(cmd, *av, 0, O_IPID, cblen)) errx(EX_DATAERR, "invalid ipid %s", *av); } else fill_cmd(cmd, O_IPID, 0, strtoul(*av, NULL, 0)); @@ -3379,7 +3423,7 @@ read_options: case TOK_IPLEN: NEED1("iplen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_IPLEN)) + if (!add_ports(cmd, *av, 0, O_IPLEN, cblen)) errx(EX_DATAERR, "invalid ip len %s", *av); } else fill_cmd(cmd, O_IPLEN, 0, strtoul(*av, NULL, 0)); @@ -3475,7 +3519,7 @@ read_options: case TOK_TCPDATALEN: NEED1("tcpdatalen requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPDATALEN)) + if (!add_ports(cmd, *av, 0, O_TCPDATALEN, cblen)) errx(EX_DATAERR, "invalid tcpdata len %s", *av); } else fill_cmd(cmd, O_TCPDATALEN, 0, @@ -3501,7 +3545,7 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN)) + if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) errx(EX_DATAERR, "invalid tcpwin len %s", *av); } else fill_cmd(cmd, O_TCPWIN, 0, @@ -3540,6 +3584,7 @@ read_options: have_state = cmd; cmd->len = F_INSN_SIZE(ipfw_insn_limit); + CHECK_CMDLEN; cmd->opcode = O_LIMIT; c->limit_mask = c->conn_limit = 0; @@ -3571,28 +3616,28 @@ read_options: case TOK_SRCIP: NEED1("missing source IP"); - if (add_srcip(cmd, *av)) { + if (add_srcip(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP: NEED1("missing destination IP"); - if (add_dstip(cmd, *av)) { + if (add_dstip(cmd, *av, cblen)) { av++; } break; case TOK_SRCIP6: NEED1("missing source IP6"); - if (add_srcip6(cmd, *av)) { + if (add_srcip6(cmd, *av, cblen)) { av++; } break; case TOK_DSTIP6: NEED1("missing destination IP6"); - if (add_dstip6(cmd, *av)) { + if (add_dstip6(cmd, *av, cblen)) { av++; } break; @@ -3600,7 +3645,7 @@ read_options: case TOK_SRCPORT: NEED1("missing source port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_SRCPORT)) { + add_ports(cmd, *av, proto, O_IP_SRCPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid source port %s", *av); @@ -3609,7 +3654,7 @@ read_options: case TOK_DSTPORT: NEED1("missing destination port"); if (_substrcmp(*av, "any") == 0 || - add_ports(cmd, *av, proto, O_IP_DSTPORT)) { + add_ports(cmd, *av, proto, O_IP_DSTPORT, cblen)) { av++; } else errx(EX_DATAERR, "invalid destination port %s", @@ -3617,13 +3662,13 @@ read_options: break; case TOK_MAC: - if (add_mac(cmd, av)) + if (add_mac(cmd, av, cblen)) av += 2; break; case TOK_MACTYPE: NEED1("missing mac type"); - if (!add_mactype(cmd, *av)) + if (!add_mactype(cmd, *av, cblen)) errx(EX_DATAERR, "invalid mac type %s", *av); av++; break; @@ -3661,18 +3706,18 @@ read_options: if (proto != IPPROTO_IPV6 ) errx( EX_USAGE, "flow-id filter is active " "only for ipv6 protocol\n"); - fill_flow6( (ipfw_insn_u32 *) cmd, *av ); + fill_flow6( (ipfw_insn_u32 *) cmd, *av, cblen); av++; break; case TOK_COMMENT: - fill_comment(cmd, av); + fill_comment(cmd, av, cblen); av[0]=NULL; break; case TOK_TAGGED: if (av[0] && strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TAGGED)) + if (!add_ports(cmd, *av, 0, O_TAGGED, cblen)) errx(EX_DATAERR, "tagged: invalid tag" " list: %s", *av); } @@ -3725,7 +3770,7 @@ read_options: } if (F_LEN(cmd) > 0) { /* prepare to advance */ prev = cmd; - cmd = next_cmd(cmd); + cmd = next_cmd(cmd, &cblen); } } @@ -3754,12 +3799,13 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { fill_cmd(dst, O_PROBE_STATE, 0, 0); - dst = next_cmd(dst); + dst = next_cmd(dst, &rblen); } /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); switch (src->opcode) { case O_LOG: @@ -3779,6 +3825,7 @@ done: */ if (have_state && have_state->opcode != O_CHECK_STATE) { i = F_LEN(have_state); + CHECK_RBUFLEN(i); bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } @@ -3790,24 +3837,29 @@ done: /* put back O_LOG, O_ALTQ, O_TAG if necessary */ if (have_log) { i = F_LEN(have_log); + CHECK_RBUFLEN(i); bcopy(have_log, dst, i * sizeof(uint32_t)); dst += i; } if (have_altq) { i = F_LEN(have_altq); + CHECK_RBUFLEN(i); bcopy(have_altq, dst, i * sizeof(uint32_t)); dst += i; } if (have_tag) { i = F_LEN(have_tag); + CHECK_RBUFLEN(i); bcopy(have_tag, dst, i * sizeof(uint32_t)); dst += i; } + /* * copy all other actions */ for (src = (ipfw_insn *)actbuf; src != action; src += i) { i = F_LEN(src); + CHECK_RBUFLEN(i); bcopy(src, dst, i * sizeof(uint32_t)); dst += i; } Modified: user/attilio/vmc-playground/sbin/ipfw/ipfw2.h ============================================================================== --- user/attilio/vmc-playground/sbin/ipfw/ipfw2.h Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sbin/ipfw/ipfw2.h Mon Mar 4 00:21:38 2013 (r247744) @@ -283,10 +283,10 @@ void print_flow6id(struct _ipfw_insn_u32 void print_icmp6types(struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct _ipfw_insn *cmd ); -struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av); -struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av); +struct _ipfw_insn *add_srcip6(struct _ipfw_insn *cmd, char *av, int cblen); +struct _ipfw_insn *add_dstip6(struct _ipfw_insn *cmd, char *av, int cblen); -void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av ); +void fill_flow6(struct _ipfw_insn_u32 *cmd, char *av, int cblen); void fill_unreach6_code(u_short *codep, char *str); -void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av); +void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); Modified: user/attilio/vmc-playground/sbin/ipfw/ipv6.c ============================================================================== --- user/attilio/vmc-playground/sbin/ipfw/ipv6.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sbin/ipfw/ipv6.c Mon Mar 4 00:21:38 2013 (r247744) @@ -42,6 +42,11 @@ #include #include +#define CHECK_LENGTH(v, len) do { \ + if ((v) < (len)) \ + errx(EX_DATAERR, "Rule too long"); \ + } while (0) + static struct _s_x icmp6codes[] = { { "no-route", ICMP6_DST_UNREACH_NOROUTE }, { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, @@ -131,10 +136,12 @@ print_ip6(ipfw_insn_ip6 *cmd, char const } void -fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av) +fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cblen) { uint8_t type; + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_icmp6)); + bzero(cmd, sizeof(*cmd)); while (*av) { if (*av == ',') @@ -327,7 +334,7 @@ lookup_host6 (char *host, struct in6_add * Return 1 on success, 0 on failure. */ static int -fill_ip6(ipfw_insn_ip6 *cmd, char *av) +fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen) { int len = 0; struct in6_addr *d = &(cmd->addr6); @@ -379,6 +386,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) int masklen; char md = '\0'; + CHECK_LENGTH(cblen, 1 + len + 2 * F_INSN_SIZE(struct in6_addr)); + if ((p = strpbrk(av, "/,")) ) { md = *p; /* save the separator */ *p = '\0'; /* terminate address string */ @@ -453,7 +462,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av) * additional flow-id we want to filter, the basic is 1 */ void -fill_flow6( ipfw_insn_u32 *cmd, char *av ) +fill_flow6( ipfw_insn_u32 *cmd, char *av, int cblen) { u_int32_t type; /* Current flow number */ u_int16_t nflow = 0; /* Current flow index */ @@ -461,6 +470,8 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av cmd->d[0] = 0; /* Initializing the base number*/ while (s) { + CHECK_LENGTH(cblen, F_INSN_SIZE(ipfw_insn_u32) + nflow + 1); + av = strsep( &s, ",") ; type = strtoul(av, &av, 0); if (*av != ',' && *av != '\0') @@ -481,10 +492,10 @@ fill_flow6( ipfw_insn_u32 *cmd, char *av } ipfw_insn * -add_srcip6(ipfw_insn *cmd, char *av) +add_srcip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ cmd->opcode = O_IP_SRC_SET; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ @@ -503,10 +514,10 @@ add_srcip6(ipfw_insn *cmd, char *av) } ipfw_insn * -add_dstip6(ipfw_insn *cmd, char *av) +add_dstip6(ipfw_insn *cmd, char *av, int cblen) { - fill_ip6((ipfw_insn_ip6 *)cmd, av); + fill_ip6((ipfw_insn_ip6 *)cmd, av, cblen); if (cmd->opcode == O_IP_DST_SET) /* set */ ; else if (cmd->opcode == O_IP_DST_LOOKUP) /* table */ Modified: user/attilio/vmc-playground/share/man/man4/mvs.4 ============================================================================== --- user/attilio/vmc-playground/share/man/man4/mvs.4 Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/share/man/man4/mvs.4 Mon Mar 4 00:21:38 2013 (r247744) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2010 +.Dd March 3, 2013 .Dt MVS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ command latency. .It Va hint.mvs. Ns Ar X Ns Va .cccc defines number of completed commands for CCC, which trigger interrupt without waiting for specified coalescing timeout. -.It Va hint.mvs. Ns Ar X Ns Va .pm_level +.It Va hint.mvsch. Ns Ar X Ns Va .pm_level controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. @@ -82,7 +82,7 @@ driver initiates SLUMBER PM state transi Note that interface Power Management is not compatible with device presence detection. A manual bus reset is needed on device hot-plug. -.It Va hint.mvs. Ns Ar X Ns Va .sata_rev +.It Va hint.mvsch. Ns Ar X Ns Va .sata_rev setting to nonzero value limits maximum SATA revision (speed). Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. .El Modified: user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/kcondvar.h ============================================================================== --- user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/kcondvar.h Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/kcondvar.h Mon Mar 4 00:21:38 2013 (r247744) @@ -55,7 +55,7 @@ typedef enum { _name = #cv; \ cv_init((cv), _name); \ } while (0) -#define cv_init(cv, name, type, arg) zfs_cv_init((cv), (name), (type), (arg)) +#define cv_init(cv, name, type, arg) zfs_cv_init(cv, name, type, arg) #endif /* _KERNEL */ Modified: user/attilio/vmc-playground/sys/kern/kern_descrip.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_descrip.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sys/kern/kern_descrip.c Mon Mar 4 00:21:38 2013 (r247744) @@ -104,6 +104,7 @@ static MALLOC_DEFINE(M_FILEDESC, "filede static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader", "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DEFINE(M_FILECAPS, "filecaps", "descriptor capabilities"); MALLOC_DECLARE(M_FADVISE); @@ -1389,7 +1390,7 @@ filecaps_copy(const struct filecaps *src ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; - dst->fc_ioctls = malloc(size, M_TEMP, M_WAITOK); + dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); } } @@ -1397,7 +1398,7 @@ filecaps_copy(const struct filecaps *src /* * Move filecaps structure to the new place and clear the old place. */ -static void +void filecaps_move(struct filecaps *src, struct filecaps *dst) { @@ -1425,7 +1426,7 @@ void filecaps_free(struct filecaps *fcaps) { - free(fcaps->fc_ioctls, M_TEMP); + free(fcaps->fc_ioctls, M_FILECAPS); bzero(fcaps, sizeof(*fcaps)); } Modified: user/attilio/vmc-playground/sys/kern/kern_timeout.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_timeout.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sys/kern/kern_timeout.c Mon Mar 4 00:21:38 2013 (r247744) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -84,7 +83,7 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca * TODO: * allocate more timeout table slots when table overflows. */ -int callwheelsize, callwheelmask; +u_int callwheelsize, callwheelmask; /* * The callout cpu migration entity represents informations necessary for @@ -205,7 +204,7 @@ cc_cme_migrating(struct callout_cpu *cc) } /* - * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization + * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization * * This code is called very early in the kernel initialization sequence, * and may be called more then once. @@ -704,7 +703,7 @@ softclock(void *arg) * Initialize a handle so that using it with untimeout is benign. * * See AT&T BCI Driver Reference Manual for specification. This - * implementation differs from that one in that although an + * implementation differs from that one in that although an * identification value is returned from timeout, the original * arguments to timeout as well as the identifier are used to * identify entries for untimeout. Modified: user/attilio/vmc-playground/sys/kern/uipc_usrreq.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/uipc_usrreq.c Mon Mar 4 00:16:45 2013 (r247743) +++ user/attilio/vmc-playground/sys/kern/uipc_usrreq.c Mon Mar 4 00:21:38 2013 (r247744) @@ -102,6 +102,8 @@ __FBSDID("$FreeBSD$"); #include +MALLOC_DECLARE(M_FILECAPS); + /* * Locking key: * (l) Locked using list lock @@ -282,7 +284,7 @@ static void unp_drop(struct unpcb *, int static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct file *)); static void unp_discard(struct file *); -static void unp_freerights(struct filedescent *, int); +static void unp_freerights(struct filedescent **, int); static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); @@ -1679,16 +1681,17 @@ unp_drop(struct unpcb *unp, int errno) } static void -unp_freerights(struct filedescent *fde, int fdcount) +unp_freerights(struct filedescent **fdep, int fdcount) { struct file *fp; int i; - for (i = 0; i < fdcount; i++, fde++) { - fp = fde->fde_file; - bzero(fde, sizeof(*fde)); + for (i = 0; i < fdcount; i++) { + fp = fdep[i]->fde_file; + filecaps_free(&fdep[i]->fde_caps); unp_discard(fp); } + free(fdep[0], M_FILECAPS); } static int @@ -1699,7 +1702,7 @@ unp_externalize(struct mbuf *control, st int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep; void *data; socklen_t clen = control->m_len, datalen; int error, newfds; @@ -1755,16 +1758,18 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < newfds; i++, fdep++, fdp++) { + for (i = 0; i < newfds; i++, fdp++) { if (fdalloc(td, 0, &f)) panic("unp_externalize fdalloc failed"); fde = &fdesc->fd_ofiles[f]; - fde->fde_file = fdep->fde_file; - filecaps_copy(&fdep->fde_caps, &fde->fde_caps); + fde->fde_file = fdep[0]->fde_file; + filecaps_move(&fdep[0]->fde_caps, + &fde->fde_caps); unp_externalize_fp(fde->fde_file); *fdp = f; } FILEDESC_XUNLOCK(fdesc); + free(fdep[0], M_FILECAPS); } else { /* We can just copy anything else across. */ if (error || controlp == NULL) @@ -1839,7 +1844,7 @@ unp_internalize(struct mbuf **controlp, struct bintime *bt; struct cmsghdr *cm = mtod(control, struct cmsghdr *); struct cmsgcred *cmcred; - struct filedescent *fde, *fdep; + struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; int i, fd, *fdp; @@ -1913,7 +1918,7 @@ unp_internalize(struct mbuf **controlp, * Now replace the integer FDs with pointers to the * file structure and capability rights. */ - newlen = oldfds * sizeof(*fdep); + newlen = oldfds * sizeof(fdep[0]); *controlp = sbcreatecontrol(NULL, newlen, SCM_RIGHTS, SOL_SOCKET); if (*controlp == NULL) { @@ -1922,13 +1927,17 @@ unp_internalize(struct mbuf **controlp, goto out; } fdp = data; - fdep = (struct filedescent *) + fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); - for (i = 0; i < oldfds; i++, fdep++, fdp++) { + fdev = malloc(sizeof(*fdev) * oldfds, M_FILECAPS, + M_WAITOK); + for (i = 0; i < oldfds; i++, fdev++, fdp++) { fde = &fdesc->fd_ofiles[*fdp]; - fdep->fde_file = fde->fde_file; - filecaps_copy(&fde->fde_caps, &fdep->fde_caps); - unp_internalize_fp(fdep->fde_file); + fdep[i] = fdev; + fdep[i]->fde_file = fde->fde_file; + filecaps_copy(&fde->fde_caps, + &fdep[i]->fde_caps); + unp_internalize_fp(fdep[i]->fde_file); } FILEDESC_SUNLOCK(fdesc); break; @@ -2290,7 +2299,7 @@ static void unp_scan(struct mbuf *m0, void (*op)(struct file *)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 01:56:04 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DCE8E11C; Mon, 4 Mar 2013 01:56:04 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C8A562D8; Mon, 4 Mar 2013 01:56:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r241u4Kk075686; Mon, 4 Mar 2013 01:56:04 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r241u0pZ075652; Mon, 4 Mar 2013 01:56:00 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201303040156.r241u0pZ075652@svn.freebsd.org> From: Colin Percival Date: Mon, 4 Mar 2013 01:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247750 - in user/cperciva: . portsnap-build portsnap-build/s X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 01:56:04 -0000 Author: cperciva Date: Mon Mar 4 01:56:00 2013 New Revision: 247750 URL: http://svnweb.freebsd.org/changeset/base/247750 Log: Add Portsnap build code. To set up portsnap builds: 1. Edit build.conf, 2. Run setup.sh and follow the instructions it prints, 3. Run keygen.sh and follow the instructions it prints. After that, # build.sh snap does a portsnap build and generates a snapshot tarball (these are used to provide a faster bootstrap than downloading 23000+ individual files), # build.sh update does a portsnap build without a snapshot tarball, and # upload.sh uploads files over SSH to the target host. Alternatively, # loop.sh & will do a continuous loop of builds and uploads with one snapshot per day. Added: user/cperciva/ user/cperciva/portsnap-build/ user/cperciva/portsnap-build/build.conf (contents, props changed) user/cperciva/portsnap-build/build.sh (contents, props changed) user/cperciva/portsnap-build/keygen.sh (contents, props changed) user/cperciva/portsnap-build/loop.sh (contents, props changed) user/cperciva/portsnap-build/releasesnap.sh (contents, props changed) user/cperciva/portsnap-build/s/ user/cperciva/portsnap-build/s/alias-all.sh (contents, props changed) user/cperciva/portsnap-build/s/alias-index.sh (contents, props changed) user/cperciva/portsnap-build/s/describes-err.sh (contents, props changed) user/cperciva/portsnap-build/s/describes-fallback.sh (contents, props changed) user/cperciva/portsnap-build/s/describes-icbm.sh (contents, props changed) user/cperciva/portsnap-build/s/describes-run.sh (contents, props changed) user/cperciva/portsnap-build/s/describes-warn.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-addfiles.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-findnew-cleanup.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-findnew.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-mergedb.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-mirrorlists.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-mkpatches.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-prune.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-publish-tindex.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-publish.sh (contents, props changed) user/cperciva/portsnap-build/s/fileset-snap.sh (contents, props changed) user/cperciva/portsnap-build/s/svn-getrev.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-build.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-index.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-mktars-all.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-mktars.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-publishsigs.sh (contents, props changed) user/cperciva/portsnap-build/s/treesnap-sign.sh (contents, props changed) user/cperciva/portsnap-build/setup.sh (contents, props changed) user/cperciva/portsnap-build/upload.sh (contents, props changed) Added: user/cperciva/portsnap-build/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/build.conf Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,68 @@ +# SVN repository +export REPO=svn://svn.freebsd.org/ports + +# tar(1) utility for building tarballs +export TAR=`which tar` + +# sizes of memory disks +export PORTSMDSIZE=500M +export SNAPMDSIZE=300M +export JAILMDSIZE=100M +export TMPMDSIZE=100M + +# number of jobs to run in parallel +export JNUM=16 + +# world tarball to use for INDEX building +export WORLDTAR=`pwd`/world.tar + +# file listing "aliases" for tarballs to allow widespread changes (e.g., +# switching from cvs to svn, or between versions of tar) to be reverted. +# NOTE: This is used by freebsd.org portsnap builds but is unlikely to +# be needed by anyone else. +# export ALIASFILE=`pwd`/ALIAS + +# internal work directory +export STATEDIR=`pwd`/state + +# From: and To: for INDEX-breakage notifications +export INDEXMAIL_FROM="your@email.address" +export INDEXMAIL_TO="your@email.address" + +# From: and To: for build status emails +export BUILDMAIL_FROM="your@email.address" +export BUILDMAIL_TO="your@email.address" + +# Duration to keep port tarballs and generate binary patches +export MAXAGE_DATA=2592000 + +# Duration to keep metadata files on mirrors and generate patches +export MAXAGE_META=691200 + +# Duration to keep "extra" files (tags and snapshot tarballs) around +export MAXAGE_EXTRA=172800 + +# Describes files to build (on HEAD) +export DESCRIBES_BUILD="7 8 9" + +# Describes files to publish (on HEAD) +export DESCRIBES_PUBLISH="4 5 6 7 8 9" + +# Keys to sign builds with (get this from keygen.sh) +export SIGNKEYS="XXXX" + +# Key to generate backwards-compatible signature with (until new +# multi-signature functionality is added to portsnap in mid-2013). +export SIGNKEYS_PRIMARY="XXXX" + +# SSH key for uploading bits +UPLOAD_KEY=/root/id_dsa_upload + +# Account to ssh into for uploading bits +UPLOAD_ACCT=ssh-user@ssh-host + +# Directory (relative to the home directory) to extract uploaded bits into +UPLOAD_DIR=htmldocs + +# keep this here +export PORTSNAP_BUILD_CONF_READ=1 Added: user/cperciva/portsnap-build/build.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/build.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,98 @@ +#!/bin/sh -e +set -e + +# usage: sh -e build.sh MODE +MODE=$1 + +# Sanity-check input +if ! [ "${MODE}" = "update" ] && ! [ "${MODE}" = "snap" ]; then + echo "usage: sh -e build.sh (update|snap)" + exit 1 +fi + +# Load configuration +. build.conf + +# Create working direcories +WORKDIR=${STATEDIR}/work +SNAPDIR=${WORKDIR}/snap +TMPDIR=${WORKDIR}/tmp +SIGDIR=${WORKDIR}/sigs +mkdir ${WORKDIR} ${SNAPDIR} ${TMPDIR} ${SIGDIR} + +# Record when we're starting +SNAPDATE=`date "+%s"` + +# Get the latest revision # on the tree +NEWREV=`sh -e s/svn-getrev.sh head` + +# Create a memory disk for holding the snapshot files. +SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` +newfs -O 1 -n /dev/md${SNAPMD} >/dev/null +mount /dev/md${SNAPMD} ${SNAPDIR} + +# Build a snapshot +sh -e s/treesnap-build.sh head@${NEWREV} "${DESCRIBES_BUILD}" \ + ${TMPDIR} ${SNAPDIR} + +# Replace tarballs with "aliased" tarballs +if ! [ -z ${ALIASFILE} ]; then + if [ ${MODE} = "snap" ]; then + sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ + ${ALIASFILE} ${WORKDIR} + else + sh -e s/alias-index.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ + ${ALIASFILE} ${WORKDIR} + fi +fi + +# Send emails if INDEX was broken or fixed +sh -e s/describes-warn.sh ${SNAPDIR} ${NEWREV} ${STATEDIR}/describes \ + "${DESCRIBES_BUILD}" + +# Use old DESCRIBE files if the latest ones didn't build +sh -e s/describes-fallback.sh ${SNAPDIR} ${STATEDIR}/describes \ + "${DESCRIBES_PUBLISH}" + +# Collect metadata +sh -e s/treesnap-index.sh ${SNAPDIR} ${WORKDIR}/INDEX ${WORKDIR}/tINDEX + +# Add these files to our (overlapping) set of snapshots +sh -e s/fileset-snap.sh ${SNAPDATE} ${STATEDIR}/fileset ${SNAPDIR} \ + ${WORKDIR}/INDEX ${WORKDIR}/tINDEX ${STATEDIR}/stage ${TMPDIR} + +# Sign the tree +sh -e s/treesnap-sign.sh ${SNAPDATE} ${WORKDIR}/tINDEX ${SIGDIR} + +# Publish signatures as the "latest" build +sh -e s/treesnap-publishsigs.sh ${SIGDIR} ${STATEDIR}/stage latest + +# Build a snapshot tarball if necessary +if [ ${MODE} = "snap" ]; then + echo "`date`: Building snapshot tarball" + SNAPSHOTHASH=`sha256 -q ${WORKDIR}/tINDEX` + tar -czf ${STATEDIR}/stage/s/${SNAPSHOTHASH}.tgz -C ${WORKDIR} snap + echo "${SNAPDATE}|s/${SNAPSHOTHASH}.tgz" \ + >> ${STATEDIR}/fileset/extradb + sh -e s/treesnap-publishsigs.sh ${SIGDIR} ${STATEDIR}/stage snapshot +fi + +# Delete signatures +rm ${SIGDIR}/*.ssl + +# Unmount and delete the snapshot disk +umount /dev/md${SNAPMD} +mdconfig -d -u ${SNAPMD} + +# Delete indexes +rm ${WORKDIR}/INDEX ${WORKDIR}/tINDEX + +# Delete temporary directories +rmdir ${SIGDIR} ${TMPDIR} ${SNAPDIR} ${WORKDIR} + +# Publish file lists for mirroring +sh -e s/fileset-mirrorlists.sh ${STATEDIR}/fileset ${STATEDIR}/stage + +# Report sucess +echo "`date`: Finished" + Added: user/cperciva/portsnap-build/keygen.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/keygen.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,37 @@ +#!/bin/sh -e +set -e + +# usage: sh -e keygen.sh + +# Load configuration +. build.conf + +# Create temporary working space +mkdir ${STATEDIR}/work + +# Create key +openssl genrsa -F4 2048 > ${STATEDIR}/work/priv.ssl +openssl rsa -in ${STATEDIR}/work/priv.ssl -pubout > ${STATEDIR}/work/pub.ssl + +# Compute key hash +KEYHASH=`sha256 -q ${STATEDIR}/work/pub.ssl` + +# Move files into their permanent location +mv ${STATEDIR}/work/priv.ssl ${STATEDIR}/keys/priv-${KEYHASH}.ssl +mv ${STATEDIR}/work/pub.ssl ${STATEDIR}/keys/pub-${KEYHASH}.ssl + +# Announce the public key hash +cat <<- EOF + + A key has been generated with hash: + ${KEYHASH} + +EOF +xargs -s 80 <<- EOF + Add this to the SIGNKEYS list in build.conf to start signing builds + with it; and set it as the KEYPRINT value in /etc/portsnap.conf on + systems which need to use these updates. +EOF + +# Remove our temporary working directory +rmdir ${STATEDIR}/work Added: user/cperciva/portsnap-build/loop.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/loop.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +# Load configuration +. build.conf + +# Loop until we fail or the looping is stopped administratively +while ! [ -f failed ] && ! [ -f adminlock ]; do + # Figure out if this is the first build of a new day + touch -t `date "+%Y%m%d0000"` ${STATEDIR}/midnight + if ! [ ${STATEDIR}/lastsnap -nt ${STATEDIR}/midnight ]; then + BUILDTYPE=snap + touch ${STATEDIR}/lastsnap + else + BUILDTYPE=update + fi + rm ${STATEDIR}/midnight + + # Send an email + ( + echo "From: ${BUILDMAIL_FROM}" + for ADDR in ${BUILDMAIL_TO}; do + echo "To: ${ADDR}" + done + echo "Subject: `hostname` Portsnap build.sh ${BUILDTYPE}" + echo + + # Do the build + if ! sh -e build.sh ${BUILDTYPE} 2>&1; then + touch failed; + else + # Upload if the build succeeded + sh upload.sh 2>&1 || true + fi + + # Once a day, clean up portsnap-master + if [ ${BUILDTYPE} = "snap" ]; then + echo "`date`: Cleaning bits on portsnap-master" + ssh -i ${UPLOAD_KEY} ${UPLOAD_ACCT} \ + sh portsnap-clean.sh 2>&1 + fi + ) | sendmail -t +done + +# Send a warning if builds stop running +echo "Subject: `hostname` Portsnap builds no longer running!" | + sendmail ${BUILDMAIL_TO} Added: user/cperciva/portsnap-build/releasesnap.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/releasesnap.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,69 @@ +#!/bin/sh -e +set -e + +# usage: sh -e releasesnap.sh TREE DESCRIBES TARBALL +# e.g., sh -e releasesnap.sh tags/RELEASE_9_1_0 "7 8 9" portsnap.tgz +TREE="$1" +DESCRIBES="$2" +TARBALL="$3" + +# Sanity-check input +if [ -z "${TREE}" ] || [ -z "${DESCRIBES}" ] || [ -z "${TARBALL}" ]; then + echo "usage: sh -e releasesnap.sh TREE DESCRIBES TARBALL" + exit 1 +fi + +# Load configuration +. build.conf + +# Get the latest revision # on the tree +NEWREV=`sh -e s/svn-getrev.sh ${TREE}` + +# Create a memory disk for holding everything which will end up in +# /var/db/portsnap. Note that for normal (head) builds we mount the disk +# on ${SNAPDIR}; we can't do that here because we want everything to be on +# a single filesystem so that hardlinks work. +SNAPMD=`mdconfig -a -t swap -s ${SNAPMDSIZE} -n` +newfs -O 1 -n /dev/md${SNAPMD} >/dev/null + +# Mount the memory disk +WORKDIR=${STATEDIR}/work +mkdir ${WORKDIR} +mount /dev/md${SNAPMD} ${WORKDIR} + +# Build a snapshot +SNAPDIR=${STATEDIR}/work/files +mkdir ${SNAPDIR} +sh -e s/treesnap-build.sh ${TREE}@${NEWREV} "${DESCRIBES}" ${WORKDIR} ${SNAPDIR} + +# Replace tarballs with "aliased" tarballs +if ! [ -z ${ALIASFILE} ]; then + sh -e s/alias-all.sh ${SNAPDIR} ${STATEDIR}/fileset/oldfiles \ + ${ALIASFILE} ${WORKDIR} +fi + +# Make sure we have the required describe files +sh -e s/describes-err.sh ${SNAPDIR} "${DESCRIBES}" + +# Collect metadata +sh -e s/treesnap-index.sh ${SNAPDIR} ${WORKDIR}/INDEX ${WORKDIR}/tINDEX + +# Hard-link compressed index file and remove the uncompressed file +ln ${SNAPDIR}/`sha256 -q ${WORKDIR}/INDEX`.gz ${WORKDIR}/INDEX.gz +rm ${WORKDIR}/INDEX + +# Create tag file +echo "portsnap|`date "+%s"`|`sha256 -q ${WORKDIR}/tINDEX`" > ${WORKDIR}/tag + +# Create tarball +tar -czf ${TARBALL} -C ${WORKDIR} tag tINDEX INDEX.gz files + +# Unmount and delete the snapshot disk +umount /dev/md${SNAPMD} +mdconfig -d -u ${SNAPMD} + +# Delete temporary directories +rmdir ${WORKDIR} + +# Report sucess +echo "`date`: Finished" Added: user/cperciva/portsnap-build/s/alias-all.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/alias-all.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,40 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e alias-all.sh SNAP OLDFILES ALIASFILE WORKDIR +SNAP="$1" +OLDFILES="$2" +ALIASFILE="$3" +WORKDIR="$4" + +# Report progress +echo "`date`: Reverting files to aliased versions" + +# Revert index +sort -k2 -t '|' ${SNAP}/INDEX | + join -1 2 -t '|' -o 1.1,1.2,2.2 - ${ALIASFILE} > ${WORKDIR}/INDEX.remap +cut -f 1,2 -d '|' ${WORKDIR}/INDEX.remap | + sort > ${WORKDIR}/INDEX.remap.delete +cut -f 1,3 -d '|' ${WORKDIR}/INDEX.remap | + sort > ${WORKDIR}/INDEX.remap.add +sort ${SNAP}/INDEX | + comm -23 - ${WORKDIR}/INDEX.remap.delete | + sort -k 1,1 -t '|' - ${WORKDIR}/INDEX.remap.add > ${SNAP}/INDEX.new +mv ${SNAP}/INDEX.new ${SNAP}/INDEX + +# Revert files +cut -f 2,3 -d '|' ${WORKDIR}/INDEX.remap | + tr '|' ' ' | while read OLD NEW; do + rm ${SNAP}/${OLD}.gz + cp ${OLDFILES}/${NEW}.gz ${SNAP}/ +done + +# Clean up +rm ${WORKDIR}/INDEX.remap +rm ${WORKDIR}/INDEX.remap.add +rm ${WORKDIR}/INDEX.remap.delete Added: user/cperciva/portsnap-build/s/alias-index.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/alias-index.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,33 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e alias-index.sh SNAP OLDFILES ALIASFILE WORKDIR +SNAP="$1" +OLDFILES="$2" +ALIASFILE="$3" +WORKDIR="$4" + +# Report progress +echo "`date`: Reverting files to aliased versions" + +# Revert index +sort -k2 -t '|' ${SNAP}/INDEX | + join -1 2 -t '|' -o 1.1,1.2,2.2 - ${ALIASFILE} > ${WORKDIR}/INDEX.remap +cut -f 1,2 -d '|' ${WORKDIR}/INDEX.remap | + sort > ${WORKDIR}/INDEX.remap.delete +cut -f 1,3 -d '|' ${WORKDIR}/INDEX.remap | + sort > ${WORKDIR}/INDEX.remap.add +sort ${SNAP}/INDEX | + comm -23 - ${WORKDIR}/INDEX.remap.delete | + sort -k 1,1 -t '|' - ${WORKDIR}/INDEX.remap.add > ${SNAP}/INDEX.new +mv ${SNAP}/INDEX.new ${SNAP}/INDEX + +# Clean up +rm ${WORKDIR}/INDEX.remap +rm ${WORKDIR}/INDEX.remap.add +rm ${WORKDIR}/INDEX.remap.delete Added: user/cperciva/portsnap-build/s/describes-err.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/describes-err.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e describes-err.sh SNAP DESCRIBES +SNAP="$1" +DESCRIBES="$2" + +# Check that the required describes files exist +for N in $DESCRIBES; do + if ! [ -f ${SNAP}/DESCRIBE.${N} ]; then + echo "DESCRIBE.${N} does not exist!" + exit 1 + fi +done Added: user/cperciva/portsnap-build/s/describes-fallback.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/describes-fallback.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,24 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e describes-fallback.sh SNAP DESCDIR DESCRIBES +SNAP="$1" +DESCDIR="$2" +DESCRIBES="$3" + +# For each DESCRIBE file... +for N in ${DESCRIBES}; do + # If a DESCRIBE failed... + if ! [ -f ${SNAP}/DESCRIBE.${N} ]; then + # ... use an old version ... + cp ${DESCDIR}/DESCRIBE.${N} ${SNAP}/DESCRIBE.${N} + else + # ... otherwise, store what we have for future reference. + cp ${SNAP}/DESCRIBE.${N} ${DESCDIR}/DESCRIBE.${N} + fi +done Added: user/cperciva/portsnap-build/s/describes-icbm.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/describes-icbm.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,62 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e describes-icbm.sh GOODREV BADREV ERRFILE +GOODREV="$1" +BADREV="$2" +ERRFILE="$3" + +# The first potentially faulty commit is GOODREV+1 +BADSTART=`expr "$GOODREV" + 1` + +# Standard From/To/Subject lines +cat </dev/null +newfs -O 1 -n /dev/md${TMPMD} >/dev/null + +# Mount filesystems under jail mount point +mount -o noatime,nosuid /dev/md${JAILMD} ${JAILDIR} +mkdir ${JAILDIR}/tmp +mount -o noatime,nosuid,noexec /dev/md${TMPMD} ${JAILDIR}/tmp +chmod 1777 ${JAILDIR}/tmp +mkdir ${JAILDIR}/usr ${JAILDIR}/usr/ports +mount -o noatime,nosuid,noexec,ro ${PORTSDISK} ${JAILDIR}/usr/ports + +# Attach device filesystem with null, fd/*, and std* +mkdir ${JAILDIR}/dev +mount -t devfs devfs ${JAILDIR}/dev +RULESET=`findruleset` +devfs rule -s ${RULESET} add hide +devfs rule -s ${RULESET} add path null unhide +devfs rule -s ${RULESET} add path fd unhide +devfs rule -s ${RULESET} add path 'fd/*' unhide +devfs rule -s ${RULESET} add path 'std*' unhide +devfs -m ${JAILDIR}/dev ruleset ${RULESET} +devfs -m ${JAILDIR}/dev rule applyset + +# Extract world tarball +tar -xf ${WORLDTAR} -C ${JAILDIR} + +# Protect against naughtiness +mount -u -o noatime,nosuid,ro /dev/md${JAILMD} + +# Build the describes output +if env - PATH=${PATH} jail -c path=${JAILDIR} host.hostname=localhost \ + exec.jail_user=nobody exec.system_jail_user command=/bin/sh -e \ + > ${DESCFILE} <<- EOF + export __MAKE_CONF=/nonexistant + export OSVERSION=${OSVERSION} + export PORTOBJFORMAT=elf + export INDEX_TMPDIR=/tmp + export WRKDIRPREFIX=/tmp + export BUILDING_INDEX=1 + export LOCALBASE=/removeme/usr/local + export ECHO_MSG="echo >/dev/null" + cd /usr/ports && make describe -j ${JNUM} 1>&2 + cd /tmp && cat INDEX* | sed -e 's/ */ /g' -e 's/| */|/g' \ + -e 's/ *|/|/g' -e 's./removeme..g' | \ + sed -E -e ':x' -e 's|/[^/]+/\.\.||' -e 'tx' | \ + sort -k 1,1 -t '|' | tr -d '\r' +EOF +then + R=0 +else + R=1 +fi + +# Clean up +umount ${JAILDIR}/dev +umount ${JAILDIR}/tmp +umount ${JAILDIR}/usr/ports +umount ${JAILDIR} +mdconfig -d -u ${JAILMD} +mdconfig -d -u ${TMPMD} +devfs rule -s ${RULESET} delset + +# Test if make_index works +if [ ${R} = 0 ] && ! /usr/libexec/make_index ${DESCFILE} >/dev/null; then + R=1 +fi + +# Return success/failure +exit ${R} Added: user/cperciva/portsnap-build/s/describes-warn.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/describes-warn.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,51 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e describes-warn.sh SNAP NEWREV DESCDIR DESCRIBES +SNAP="$1" +NEWREV="$2" +DESCDIR="$3" +DESCRIBES="$4" + +# Haven't found any broken describes yet +BROKEN=0 + +# Check if any describes broke +for N in ${DESCRIBES}; do + # Did this one break? + if [ -f ${SNAP}/DESCRIBE.${N}.err ]; then + # Yep, remember this + BROKEN=1 + + # Launch an ICBM if this is new breakage + if [ -f ${DESCDIR}/indexok ]; then + sh -e s/describes-icbm.sh `cat ${DESCDIR}/indexok` \ + ${NEWREV} ${SNAP}/DESCRIBE.${N}.err | + sendmail -t + rm ${DESCDIR}/indexok + fi + + # Delete the error messages + rm ${SNAP}/DESCRIBE.${N}.err + fi +done + +# If the tree is non-broken but was previously broken, send an email +if [ ${BROKEN} = 0 ] && ! [ -f ${DESCDIR}/indexok ]; then + sendmail -t <<- EOF + From: ${INDEXMAIL_FROM} + To: ${INDEXMAIL_TO} + Subject: INDEX build fixed + + EOF +fi + +# If the tree is non-broken, record the new index-ok-at SVN # +if [ ${BROKEN} = 0 ]; then + echo ${NEWREV} > ${DESCDIR}/indexok +fi Added: user/cperciva/portsnap-build/s/fileset-addfiles.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-addfiles.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,20 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-addfiles.sh FSETDIR SNAP +FSETDIR="$1" +SNAP="$2" + +# Report progress +echo "`date`: Copying files into /oldfiles/" + +# Copy data files -- we don't need metadata files since we +# don't generate patches for those here +cut -f 2 -d '|' ${FSETDIR}/filedb.news | + lam -s "${SNAP}/" - -s '.gz' | + xargs -J % cp % ${FSETDIR}/oldfiles/ Added: user/cperciva/portsnap-build/s/fileset-findnew-cleanup.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-findnew-cleanup.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,13 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-findnew-cleanup.sh FSETDIR +FSETDIR="$1" + +# Clean up new-files lists generated be fileset-findnew.sh +rm ${FSETDIR}/filedb.news ${FSETDIR}/metadb.news Added: user/cperciva/portsnap-build/s/fileset-findnew.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-findnew.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,36 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-findnew.sh FSETDIR INDEX tINDEX TMP +FSETDIR="$1" +INDEX="$2" +tINDEX="$3" +TMP="$4" + +# Report progress +echo "`date`: Identifying new files" + +# Find new port tarballs +sort -k 3,3 -t '|' ${FSETDIR}/filedb > ${TMP}/filedb.sorted +sort -k 2,2 -t '|' ${INDEX} | + join -1 3 -2 2 -t '|' -v 2 ${TMP}/filedb.sorted - | + sort -k 1,1 -t '|' > ${FSETDIR}/filedb.news + +# Report new files +echo "New files:" +cut -f 1 -d '|' < ${FSETDIR}/filedb.news | + lam -s ' ' - + +# Find new metadata files +sort -k 3,3 -t '|' ${FSETDIR}/metadb > ${TMP}/metadb.sorted +sort -k 2,2 -t '|' ${tINDEX} | + join -1 3 -2 2 -t '|' -v 2 ${TMP}/metadb.sorted - | + sort -k 1,1 -t '|' > ${FSETDIR}/metadb.news + +# Clean up temporary files +rm ${TMP}/filedb.sorted ${TMP}/metadb.sorted Added: user/cperciva/portsnap-build/s/fileset-mergedb.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-mergedb.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,45 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-mergedb.sh FSETDIR SNAPDATE INDEX tINDEX TMP +FSETDIR="$1" +SNAPDATE="$2" +INDEX="$3" +tINDEX="$4" +TMP="$5" + +# Report progress +echo "`date`: Updating databases" + +# The filedb and metadb files contain lines of the form +# FILENAME|TIMESTAMP|HASH +# where TIMESTAMP is the *most recent* SNAPDATE for which the data +# associated with FILENAME is HASH.gz (and has SHA256 hash HASH). +# We use this to tell us which binary patches to generate, which +# also tells us which old data files to keep around; the mirrors +# use this to prune the data they publihsh and figure out which +# metadata patches they should generate. + +# Update filedb using INDEX +sed -e "s/|/|${SNAPDATE}|/" ${INDEX} | + sort -k 3,3 -t '|' > ${TMP}/new.dated +sort -k 3,3 -t '|' ${FSETDIR}/filedb | + join -1 3 -2 3 -t '|' -v 1 - ${TMP}/new.dated | + sort -k 1,1 -t '|' - ${TMP}/new.dated > ${FSETDIR}/filedb.tmp +mv ${FSETDIR}/filedb.tmp ${FSETDIR}/filedb + +# Update metadb using tINDEX +sed -e "s/|/|${SNAPDATE}|/" ${tINDEX} | + sort -k 3,3 -t '|' > ${TMP}/new.dated +sort -k 3,3 -t '|' ${FSETDIR}/metadb | + join -1 3 -2 3 -t '|' -v 1 - ${TMP}/new.dated | + sort -k 1,1 -t '|' - ${TMP}/new.dated > ${FSETDIR}/metadb.tmp +mv ${FSETDIR}/metadb.tmp ${FSETDIR}/metadb + +# Clean up +rm ${TMP}/new.dated Added: user/cperciva/portsnap-build/s/fileset-mirrorlists.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-mirrorlists.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-mirrorlists.sh FSETDIR STAGE +FSETDIR="$1" +STAGE="$2" + +# Publish file lists +echo "`date`: Copying file lists into staging area" +gzip -c < ${FSETDIR}/filedb > ${STAGE}/bl.gz +gzip -c < ${FSETDIR}/metadb > ${STAGE}/tl.gz +cut -f 2 -d '|' ${FSETDIR}/extradb | + sort -u | + gzip -c > ${STAGE}/el.gz Added: user/cperciva/portsnap-build/s/fileset-mkpatches.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-mkpatches.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,32 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-mkpatches.sh FSETDIR SNAP STAGE TMP +FSETDIR="$1" +SNAP="$2" +STAGE="$3" +TMP="$4" + +# Report progress +echo "`date`: Building patches" + +# Figure out which "OLD NEW" pairs we need +sort -k 1,1 -t '|' ${FSETDIR}/filedb | + join -t '|' -o 1.3,2.2 - ${FSETDIR}/filedb.news | + tr '|' ' ' > ${TMP}/patches + +# Build the patches +while read X Y; do + gunzip -c ${FSETDIR}/oldfiles/${X}.gz > ${TMP}/${X} + gunzip -c ${SNAP}/${Y}.gz > ${TMP}/${Y} + bsdiff ${TMP}/${X} ${TMP}/${Y} ${STAGE}/bp/${X}-${Y} + rm ${TMP}/${X} ${TMP}/${Y} +done < ${TMP}/patches + +# Clean up temporary file +rm ${TMP}/patches Added: user/cperciva/portsnap-build/s/fileset-prune.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-prune.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,45 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-prune.sh SNAPDATE FSETDIR TMP +SNAPDATE="$1" +FSETDIR="$2" +TMP="$3" + +# Report progress +echo "`date`: Removing old files and database entries" + +# Sort list of files so we can use comm(1) on it +sort ${FSETDIR}/filedb > ${TMP}/filedb.sorted + +# Find lines corresponding to files we don't want any more +awk -F \| -v cutoff=`expr ${SNAPDATE} - ${MAXAGE_DATA}` \ + '{ if ($2 < cutoff) { print } }' ${TMP}/filedb.sorted > ${TMP}/filedb.olds + +# Delete old files +cut -f 3 -d '|' ${TMP}/filedb.olds | + grep -E '^[0-9a-f]{64}$' | + lam -s "${FSETDIR}/oldfiles/" - -s '.gz' | + xargs rm -f + +# Construct a new old-files list +comm -23 ${TMP}/filedb.sorted ${TMP}/filedb.olds | + sort -k 1,1 -t '|' > ${FSETDIR}/filedb.tmp +mv ${FSETDIR}/filedb.tmp ${FSETDIR}/filedb + +# Remove old lines from metadb and extradb +echo "`date`: Removing old metadata and extra database entries" +awk -F \| -v cutoff=`expr ${SNAPDATE} - ${MAXAGE_META}` \ + '{ if ($2 >= cutoff) { print } }' ${FSETDIR}/metadb > ${FSETDIR}/metadb.tmp +mv ${FSETDIR}/metadb.tmp ${FSETDIR}/metadb +awk -F \| -v cutoff=`expr ${SNAPDATE} - ${MAXAGE_EXTRA}` \ + '{ if ($1 >= cutoff) { print } }' ${FSETDIR}/extradb > ${FSETDIR}/extradb.tmp +mv ${FSETDIR}/extradb.tmp ${FSETDIR}/extradb + +# Remove temporary files +rm ${TMP}/filedb.sorted ${TMP}/filedb.olds Added: user/cperciva/portsnap-build/s/fileset-publish-tindex.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-publish-tindex.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-publish-tindex.sh FSETDIR SNAPDATE tINDEX STAGE +FSETDIR="$1" +SNAPDATE="$2" +tINDEX="$3" +STAGE="$4" + +# Figure out the tINDEX hash +SNAPSHOTHASH=`sha256 -q ${tINDEX}` + +# Copy the tINDEX file into place in the staging directory +cp ${tINDEX} ${STAGE}/t/${SNAPSHOTHASH} + +# Add to our database +echo "${SNAPDATE}|t/${SNAPSHOTHASH}" >> ${FSETDIR}/extradb Added: user/cperciva/portsnap-build/s/fileset-publish.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-publish.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,20 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-publish.sh FSETDIR SNAP STAGE +FSETDIR="$1" +SNAP="$2" +STAGE="$3" + +# Report progress +echo "`date`: Copying files into staging area" + +# Copy new files +cut -f 2 -d '|' ${FSETDIR}/filedb.news ${FSETDIR}/metadb.news | + lam -s "${SNAP}/" - -s '.gz' | + xargs -J % cp % ${STAGE}/f/ Added: user/cperciva/portsnap-build/s/fileset-snap.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-build/s/fileset-snap.sh Mon Mar 4 01:56:00 2013 (r247750) @@ -0,0 +1,47 @@ +#!/bin/sh -e + +# No user-serviceable parts +if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then + echo "Do not run $0 manually" + exit 1 +fi + +# usage: sh -e fileset-snap.sh SNAPDATE FSETDIR SNAP INDEX tINDEX STAGE WORKDIR +SNAPDATE="$1" +FSETDIR="$2" +SNAP="$3" +INDEX="$4" +tINDEX="$5" +STAGE="$6" +WORKDIR="$7" + +# Create temporary directory +TMPDIR=${WORKDIR}/tmp +mkdir ${TMPDIR} + +# Prune old files from the file set +sh -e s/fileset-prune.sh ${SNAPDATE} ${FSETDIR} ${TMP} + +# Figure out which files in this snapshot are new +sh -e s/fileset-findnew.sh ${FSETDIR} ${INDEX} ${tINDEX} ${TMP} + +# Build binary patches and place them into the staging directory +sh -e s/fileset-mkpatches.sh ${FSETDIR} ${SNAP} ${STAGE} ${TMP} + +# Make copies of old files so we can use them for future patch-building +sh -e s/fileset-addfiles.sh ${FSETDIR} ${SNAP} + +# Copy new files into the staging directory +sh -e s/fileset-publish.sh ${FSETDIR} ${SNAP} ${STAGE} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 02:36:05 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 029EFDA0; Mon, 4 Mar 2013 02:36:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2AC36C1; Mon, 4 Mar 2013 02:36:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r242a4ZK088998; Mon, 4 Mar 2013 02:36:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r242a4wk088997; Mon, 4 Mar 2013 02:36:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201303040236.r242a4wk088997@svn.freebsd.org> From: Adrian Chadd Date: Mon, 4 Mar 2013 02:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247765 - user/adrian/net80211_tx/sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 02:36:05 -0000 Author: adrian Date: Mon Mar 4 02:36:04 2013 New Revision: 247765 URL: http://svnweb.freebsd.org/changeset/base/247765 Log: Wrap some locks around the mesh transmit path. The mesh forwarding frames path is a little special - one of the paths involves rewriting the DA and then forwarding the frame direct to the parent interface rather than going via the vap layer. This is likely not a "good" solution moving forward, but I'll talk with Monthadar about how to fix this. So for now, just wrap the parent call in the TX lock. Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c Modified: user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c Mon Mar 4 02:21:34 2013 (r247764) +++ user/adrian/net80211_tx/sys/net80211/ieee80211_mesh.c Mon Mar 4 02:36:04 2013 (r247765) @@ -1045,6 +1045,8 @@ mesh_transmit_to_gate(struct ieee80211va struct ether_header *eh; int error; + IEEE80211_TX_UNLOCK_ASSERT(ic); + eh = mtod(m, struct ether_header *); ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { @@ -1131,6 +1133,8 @@ mesh_transmit_to_gate(struct ieee80211va } } #endif /* IEEE80211_SUPPORT_SUPERG */ + + IEEE80211_TX_LOCK(ic); if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { /* * Encapsulate the packet in prep for transmission. @@ -1143,6 +1147,7 @@ mesh_transmit_to_gate(struct ieee80211va } } error = ieee80211_parent_transmit(ic, m); + IEEE80211_TX_UNLOCK(ic); if (error != 0) { ieee80211_free_node(ni); } else { @@ -1169,6 +1174,8 @@ ieee80211_mesh_forward_to_gates(struct i struct ieee80211_mesh_gate_route *gr = NULL, *gr_next; struct mbuf *m, *mcopy, *next; + IEEE80211_TX_UNLOCK_ASSERT(ic); + KASSERT( rt_dest->rt_flags == IEEE80211_MESHRT_FLAGS_DISCOVER, ("Route is not marked with IEEE80211_MESHRT_FLAGS_DISCOVER")); @@ -1246,6 +1253,9 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211_node *ni; int err; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + /* * mesh ttl of 1 means we are the last one receving it, * according to amendment we decrement and then check if @@ -1317,7 +1327,20 @@ mesh_forward(struct ieee80211vap *vap, s /* XXX do we know m_nextpkt is NULL? */ mcopy->m_pkthdr.rcvif = (void *) ni; + + /* + * XXX this bypasses all of the VAP TX handling; it passes frames + * directly to the parent interface. + * + * Because of this, there's no TX lock being held as there's no + * encaps state being used. + * + * Doing a direct parent transmit may not be the correct thing + * to do here; we'll have to re-think this soon. + */ + IEEE80211_TX_LOCK(ic); err = ieee80211_parent_transmit(ic, mcopy); + IEEE80211_TX_UNLOCK(ic); if (err != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); @@ -1454,6 +1477,10 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1509,8 +1536,12 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; + struct ieee80211com *ic = vap->iv_ic; int ae; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1572,6 +1603,10 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); mesh_forward(vap, m, mc); @@ -1618,6 +1653,9 @@ mesh_input(struct ieee80211_node *ni, st need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 05:26:11 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5187C918; Mon, 4 Mar 2013 05:26:11 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33DAFCE2; Mon, 4 Mar 2013 05:26:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r245QABY031422; Mon, 4 Mar 2013 05:26:10 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r245QAx8031421; Mon, 4 Mar 2013 05:26:10 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201303040526.r245QAx8031421@svn.freebsd.org> From: Colin Percival Date: Mon, 4 Mar 2013 05:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247766 - user/cperciva/portsnap-mirror X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 05:26:11 -0000 Author: cperciva Date: Mon Mar 4 05:26:09 2013 New Revision: 247766 URL: http://svnweb.freebsd.org/changeset/base/247766 Log: Add portsnap mirroring code, previously in the (now defunct) CVS projects repository. Added: user/cperciva/portsnap-mirror/ user/cperciva/portsnap-mirror/pmirror.sh (contents, props changed) Added: user/cperciva/portsnap-mirror/pmirror.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/portsnap-mirror/pmirror.sh Mon Mar 4 05:26:09 2013 (r247766) @@ -0,0 +1,337 @@ +#!/bin/sh -e + +#- +# Copyright 2005 Colin Percival +# All rights reserved +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing 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. + +# $FreeBSD$ + +# READ THIS BEFORE USING THIS CODE +# -------------------------------- +# +# On average, portsnap requires 2-5MB/month of bandwidth to keep a +# single machine up to date. If several machines are sharing an +# HTTP proxy, a significant fraction of this can be cached. +# +# In contrast, using this code to keep a portsnap *mirror* up to +# date requires roughly 1GB of disk space and 5GB/month of bandwidth. +# This is because of the "graceful failure" mechanisms built into +# portsnap -- it can usually take advantage of pregenerated patches, +# but a mirror needs to have lots of larger files just in case they +# are needed. +# +# This means that, in terms of bandwidth, running a portsnap mirror +# is completely and utterly pointless unless you expect more than +# 1000 portsnap-running systems to be using the mirror. In fact, +# it's worse than pointless, since it would consume bandwidth and +# increase the load on existing mirrors (since the mirroring would +# require more work than serving those <1000 machines from the +# existing mirrors). +# +# For reference, the number of systems running portsnap at the end +# of 2005 is roughly 4500. +# +# In short: Even if you already run FreeBSD CVSup, WWW, and FTP +# mirrors, you shouldn't necessarily start running a portsnap mirror +# as well. Please talk to me (cperciva@FreeBSD.org) before you +# start chewing up bandwidth. + +# Usage: +# lockf -s -t 0 lockfile \ +# sh -e pmirror.sh portsnap-master.freebsd.org /path/to/www + +if [ $# -ne 2 ]; then + echo "Usage: pmirror.sh portsnap-master.freebsd.org /path/to/www" + exit 1 +fi + +WRKDIR=`mktemp -d -t pmirror` || exit 1 +chown :`id -ng` ${WRKDIR} +cd ${WRKDIR} + +SERVER=$1 +PUBDIR=$2 +PHTTPGET="/usr/libexec/phttpget ${SERVER}" + +export HTTP_USER_AGENT="pmirror/0.9" + +# If ${PUBDIR}/pub.ssl does not exist, assume we have an empty +# mirror directory and set things up. +if ! [ -f ${PUBDIR}/pub.ssl ]; then + mkdir -p ${PUBDIR} ${PUBDIR}/bp ${PUBDIR}/f \ + ${PUBDIR}/s ${PUBDIR}/t ${PUBDIR}/tp + touch ${PUBDIR}/latest.ssl + echo 'User-agent: *' > ${PUBDIR}/robots.txt + echo 'Disallow: /' >> ${PUBDIR}/robots.txt +fi + +${PHTTPGET} pub.ssl snapshot.ssl latest.ssl 2>&1 | + grep -v "200 OK" || true +[ -f pub.ssl -a -f snapshot.ssl -a -f latest.ssl ] + +if cmp -s latest.ssl ${PUBDIR}/latest.ssl; then + cd /tmp/ + rm -r ${WRKDIR} + exit 0 +fi + +echo "`date`: Fetching binary files list" +rm -f bl.gz bl bp.wanted bp.present +fetch -q http://${SERVER}/bl.gz +[ -f bl.gz ] || exit 1 +gunzip -c bl.gz > bl + +echo "`date`: Constructing list of binary patches wanted" +LASTSNAP=`cut -f 2 -d '|' bl | grep -E '^[0-9]+$' | sort -urn | head -1` +awk -F \| -v cutoff=`expr ${LASTSNAP} - 86400` \ + '{ if ($2 > cutoff) { print } }' bl | + join -t '|' bl - | + awk -F \| '{ if ($4 > $2) { print $3 "-" $5 } }' | + sort | grep -E '^[0-9a-f]{64}-[0-9a-f]{64}$' > bp.wanted +( cd ${PUBDIR}/bp/ && ls ) | + grep -E '^[0-9a-f]{64}-[0-9a-f]{64}$' > bp.present || true +echo "`date`: Fetching needed binary patches" +comm -13 bp.present bp.wanted | lam -s 'bp/' - | + ( cd ${PUBDIR}/bp/ && xargs ${PHTTPGET} ) 2>&1 | + grep -v "200 OK" || true +echo "`date`: Removing unneeded binary patches" +comm -23 bp.present bp.wanted | ( cd ${PUBDIR}/bp/ && xargs rm ) + +echo "`date`: Fetching metadata files list" +rm -f tl.gz tl +fetch -q http://${SERVER}/tl.gz +[ -f tl.gz ] || exit 1 +gunzip -c tl.gz > tl + +echo "`date`: Constructing list of files wanted" +awk -F \| -v cutoff=`expr ${LASTSNAP} - 86400` \ + '{ if ($2 > cutoff) { print $3 ".gz" } }' bl | + grep -E '^[0-9a-f]{64}\.gz$' > f.wanted || true +awk -F \| -v cutoff=`expr ${LASTSNAP} - 691200` \ + '{ if ($2 > cutoff) { print $3 ".gz" } }' tl | + grep -E '^[0-9a-f]{64}\.gz$' >> f.wanted || true +sort f.wanted > f.wanted.tmp +mv f.wanted.tmp f.wanted +( cd ${PUBDIR}/f/ && ls ) | + grep -E '^[0-9a-f]{64}\.gz$' > f.present || true +echo "`date`: Fetching needed files" +comm -13 f.present f.wanted | lam -s 'f/' - | + ( cd ${PUBDIR}/f/ && xargs ${PHTTPGET} ) 2>&1 | + grep -v "200 OK" || true +echo "`date`: Removing corrupt files" +comm -13 f.present f.wanted | tr -d '.gz' | while read F; do + if [ -f ${PUBDIR}/f/${F}.gz ] && + ! [ `gunzip < ${PUBDIR}/f/${F}.gz` | sha256` = $F ]; then + echo "Deleting f/$F.gz" + rm ${PUBDIR}/f/${F}.gz + fi +done +echo "`date`: Removing unneeded files" +comm -23 f.present f.wanted | ( cd ${PUBDIR}/f/ && xargs rm ) + +echo "`date`: Fetching extra files list" +rm -f el.gz el +fetch -q http://${SERVER}/el.gz +[ -f el.gz ] || exit 1 +gunzip -c el.gz > el + +echo "`date`: Constructing list of snapshots wanted" +grep -E '^s/' el | cut -f 2 -d '/' | + sort | grep -E '^[0-9a-f]{64}\.tgz$' > s.wanted || true +( cd ${PUBDIR}/s/ && ls ) | + grep -E '^[0-9a-f]{64}\.tgz$' > s.present || true +echo "`date`: Fetching needed snapshots" +comm -13 s.present s.wanted | lam -s 's/' - | + ( cd ${PUBDIR}/s/ && xargs ${PHTTPGET} ) 2>&1 | + grep -v "200 OK" || true +echo "`date`: Removing unneeded snapshots" +comm -23 s.present s.wanted | ( cd ${PUBDIR}/s/ && xargs rm ) + +echo "`date`: Constructing list of tags wanted" +grep -E '^t/' el | cut -f 2 -d '/' | + sort | grep -E '^[0-9a-f]{64}$' > t.wanted || true +( cd ${PUBDIR}/t/ && ls ) | + grep -E '^[0-9a-f]{64}$' > t.present || true +echo "`date`: Fetching needed tags" +comm -13 t.present t.wanted | lam -s 't/' - | + ( cd ${PUBDIR}/t/ && xargs ${PHTTPGET} ) 2>&1 | + grep -v "200 OK" || true + +# Don't bother deleting old tag files. They don't take up any +# significant space, and keeping them is useful for statistical +# purposes. +# echo "`date`: Removing unneeded tags" +# comm -23 t.present t.wanted | ( cd ${PUBDIR}/t/ && xargs rm ) + +echo "`date`: Constructing list of metadata patches wanted" +awk -F \| -v cutoff=`expr ${LASTSNAP} - 86400` \ + '{ if ($2 > cutoff) { print } }' tl | + join -t '|' tl - | + awk -F \| '{ if ($4 > $2) { print $3 "-" $5 ".gz" } }' | + sort | grep -E '^[0-9a-f]{64}-[0-9a-f]{64}\.gz$' > tp.wanted || true +awk -F \| -v cutoff=`expr ${LASTSNAP} - 86400` \ + '{ if ($2 > cutoff) { print } }' tl | + join -t '|' tl - | + fgrep "|${LASTSNAP}|" | + awk -F \| '{ if ($4 > $2) { print $3 "-" $5 ".gz" } }' | + sort | grep -E '^[0-9a-f]{64}-[0-9a-f]{64}\.gz$' > tp.needed || true +( cd ${PUBDIR}/tp/ && ls ) | + grep -E '^[0-9a-f]{64}-[0-9a-f]{64}\.gz$' > tp.present || true + +echo "`date`: Generating needed metadata patches" +# This generates lines of the form RECENTHASH|OLDHASH|NEWHASH, +# where RECENTHASH is the most recent metadata file of the same +# type which existed prior to this mirroring run. +# This list is also sorted starting with the most recent OLDHASH. +# +# If there are no existing metadata files of the relevant type +# then the metadata patches won't be created. Sorry. They'll +# all be created the next time. + +sort -k 3 -t '|' tl > tl.sorted + +cut -f 1 -d '.' f.present | + join -2 3 -t '|' - tl.sorted | + sort -k 3 -t '|' | + perl -e ' + while (<>) { + @_ = split /\|/; + $l{$_[1]} = $_[0] + }; + for $f (sort(keys %l)) { + print "$f|$l{$f}\n" + }' > metadata.latest + +comm -13 tp.present tp.needed | + cut -f 1 -d '.' | + tr '-' '|' | + join -o 1.1,1.2,2.1,2.2 -1 3 -t '|' tl.sorted - | + sort | + join -o 1.2,2.2,2.3,2.4 -t '|' metadata.latest - | + sort -rn -k 2 -t '|' | + cut -f 1,3,4 -d '|' | +while read LINE; do + X=`echo ${LINE} | cut -f 2 -d '|'` + Y=`echo ${LINE} | cut -f 3 -d '|'` + M=`echo ${LINE} | cut -f 1 -d '|'` + + if [ ! -f "${PUBDIR}/tp/${X}-${M}.gz" ] || + [ ! -f "${PUBDIR}/tp/${M}-${Y}.gz" ]; then + gunzip -c < ${PUBDIR}/f/${X}.gz | sort > ${X} + gunzip -c < ${PUBDIR}/f/${Y}.gz | sort > ${Y} + perl -e ' + open F, $ARGV[0]; + open G, $ARGV[1]; + $s = ; + $t = ; + do { + if ($s eq $t) { + $s = ; + $t = ; + } elsif ((! $t) || ($s && ($s lt $t))) { + @s = split /\|/, $s; + print "-$s[0]\n"; + $s = ; + } else { + print "+$t"; + $t = ; + } + } while ($s || $t)' ${X} ${Y} | + sort -k 1.2,1 -t '|' > ${X}-${Y} + rm ${X} ${Y} + else + gunzip -c "${PUBDIR}/tp/${X}-${M}.gz" | sort -r | + sort -s -k 1.2,1 -t '|' > ${X}-${M} + gunzip -c "${PUBDIR}/tp/${M}-${Y}.gz" | sort -r | + sort -s -k 1.2,1 -t '|' > ${M}-${Y} + perl -e ' + open F, $ARGV[0]; + open G, $ARGV[1]; + $s = ; + $t = ; + while ($s || $t) { + chomp $s; + chomp $t; + + if (! $t) { + print "$s\n"; + $s = ; + next; + }; + if (! $s) { + print "$t\n"; + $t = ; + next; + }; + + @s = split //, $s, 2; + @s2 = split /\|/, $s[1]; + @t = split //, $t, 2; + @t2 = split /\|/, $t[1]; + + if ($s2[0] lt $t2[0]) { + print "$s\n"; + $s = ; + next; + }; + if ($s2[0] gt $t2[0]) { + print "$t\n"; + $t = ; + next; + }; + + if ($s[0] eq "-") { + print "$s\n"; + } else { + $t = ; + }; + $s = ; + }' ${X}-${M} ${M}-${Y} \ + > ${X}-${Y} + rm ${X}-${M} ${M}-${Y} + fi + + gzip -9n ${X}-${Y} + mv ${X}-${Y}.gz ${PUBDIR}/tp/ +done + +echo "`date`: Removing unneeded metadata patches" +comm -23 tp.present tp.wanted | ( cd ${PUBDIR}/tp/ && xargs rm ) + +echo "`date`: Publishing file lists and signatures" +mv bl.gz el.gz tl.gz ${PUBDIR} +mv latest.ssl pub.ssl snapshot.ssl ${PUBDIR} + +echo "`date`: Removing temporary files" +rm bl el tl +rm tl.sorted metadata.latest +rm bp.wanted bp.present +rm f.wanted f.present +rm s.present s.wanted +rm t.present t.wanted +rm tp.present tp.wanted tp.needed + +# Remove temporary directory +cd /tmp/ +rmdir ${WRKDIR} From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 06:13:27 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F58D241; Mon, 4 Mar 2013 06:13:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 488B8DFD; Mon, 4 Mar 2013 06:13:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r246DRvi017627; Mon, 4 Mar 2013 06:13:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r246DRfu017626; Mon, 4 Mar 2013 06:13:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303040613.r246DRfu017626@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Mar 2013 06:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247769 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 06:13:27 -0000 Author: alc Date: Mon Mar 4 06:13:26 2013 New Revision: 247769 URL: http://svnweb.freebsd.org/changeset/base/247769 Log: Fix spelling. Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 05:46:54 2013 (r247768) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 06:13:26 2013 (r247769) @@ -297,7 +297,7 @@ vm_radix_declev(vm_pindex_t *idx, boolea /* * Internal handwork for vm_radix_reclaim_allonodes() primitive. - * This function is recrusive. + * This function is recursive. */ static void vm_radix_reclaim_allnodes_int(struct vm_radix_node *rnode) From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 06:26:26 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A9C88528; Mon, 4 Mar 2013 06:26:26 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A141E40; Mon, 4 Mar 2013 06:26:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r246QQW5021084; Mon, 4 Mar 2013 06:26:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r246QQpD021082; Mon, 4 Mar 2013 06:26:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303040626.r246QQpD021082@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Mar 2013 06:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247770 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 06:26:26 -0000 Author: alc Date: Mon Mar 4 06:26:25 2013 New Revision: 247770 URL: http://svnweb.freebsd.org/changeset/base/247770 Log: Simplify Boolean expressions. Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 06:13:26 2013 (r247769) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 06:26:25 2013 (r247770) @@ -259,7 +259,7 @@ vm_radix_addlev(vm_pindex_t *idx, boolea vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1); ilev--) if (ilev == 0) break; - KASSERT(ilev > 0 || levels[0] == TRUE, + KASSERT(ilev > 0 || levels[0], ("%s: levels back-scanning problem", __func__)); if (ilev == 0 && vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1)) return (1); @@ -284,7 +284,7 @@ vm_radix_declev(vm_pindex_t *idx, boolea vm_radix_slot(*idx, ilev) == 0; ilev--) if (ilev == 0) break; - KASSERT(ilev > 0 || levels[0] == TRUE, + KASSERT(ilev > 0 || levels[0], ("%s: levels back-scanning problem", __func__)); if (ilev == 0 && vm_radix_slot(*idx, ilev) == 0) return (1); @@ -388,7 +388,7 @@ vm_radix_insert(struct vm_radix *rtree, return; } while (rnode != NULL) { - if (vm_radix_keybarr(rnode, index) == TRUE) + if (vm_radix_keybarr(rnode, index)) break; slot = vm_radix_slot(index, rnode->rn_clev); m = vm_radix_node_page(rnode->rn_child[slot]); @@ -464,7 +464,7 @@ vm_radix_lookup(struct vm_radix *rtree, rnode = vm_radix_getroot(rtree); while (rnode != NULL) { - if (vm_radix_keybarr(rnode, index) == TRUE) + if (vm_radix_keybarr(rnode, index)) return (NULL); slot = vm_radix_slot(index, rnode->rn_clev); rnode = rnode->rn_child[slot]; @@ -513,7 +513,7 @@ restart: * the use of maplevels array which should bring immediately * a lower useful level, skipping holes. */ - if (vm_radix_keybarr(rnode, index) == TRUE) { + if (vm_radix_keybarr(rnode, index)) { difflev = vm_radix_keydiff(index, rnode->rn_owner); if (index > rnode->rn_owner) { if (vm_radix_addlev(&index, maplevels, @@ -602,7 +602,7 @@ restart: * the use of maplevels array which should bring immediately * a lower useful level, skipping holes. */ - if (vm_radix_keybarr(rnode, index) == TRUE) { + if (vm_radix_keybarr(rnode, index)) { difflev = vm_radix_keydiff(index, rnode->rn_owner); if (index > rnode->rn_owner) { index = vm_radix_trimkey(rnode->rn_owner, From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 07:11:11 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A365E83; Mon, 4 Mar 2013 07:11:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D86CF83; Mon, 4 Mar 2013 07:11:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r247BBxu064559; Mon, 4 Mar 2013 07:11:11 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r247BAge064558; Mon, 4 Mar 2013 07:11:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303040711.r247BAge064558@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Mar 2013 07:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247771 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 07:11:11 -0000 Author: alc Date: Mon Mar 4 07:11:10 2013 New Revision: 247771 URL: http://svnweb.freebsd.org/changeset/base/247771 Log: Make a pass over most of the comments. Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 06:26:25 2013 (r247770) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 07:11:10 2013 (r247771) @@ -62,10 +62,9 @@ #endif /* - * Such sizes should permit to keep node children contained into a single - * cache-line, or to at least not span many of those. - * In particular, sparse tries should however be compressed properly and - * then make some extra-levels not a big deal. + * These widths should allow the pointers to a node's children to fit within + * a single cache line. The extra levels from a narrow width should not be + * a problem thanks to path compression. */ #ifdef __LP64__ #define VM_RADIX_WIDTH 4 @@ -97,8 +96,8 @@ struct vm_radix_node { static uma_zone_t vm_radix_node_zone; /* - * Allocate a radix node. Pre-allocation ensures that the request will be - * always successfully satisfied. + * Allocate a radix node. Pre-allocation should ensure that the request + * will always be satisfied. */ static __inline struct vm_radix_node * vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel) @@ -108,15 +107,15 @@ vm_radix_node_get(vm_pindex_t owner, uin rnode = uma_zalloc(vm_radix_node_zone, M_NOWAIT | M_ZERO); /* - * The required number of nodes might be already correctly - * pre-allocated in vm_radix_init(). However, UMA can reserve - * few nodes on per-cpu specific buckets, which will not be - * accessible from the curcpu. The allocation could then - * return NULL when the pre-allocation pool is close to be - * exhausted. Anyway, in practice this should never be a - * problem because a new node is not always required for - * insert, thus the pre-allocation pool should already have - * some extra-pages that indirectly deal with this situation. + * The required number of nodes should already be pre-allocated + * by vm_radix_prealloc(). However, UMA can hold a few nodes + * in per-CPU buckets, which will not be accessible by the + * current CPU. Thus, the allocation could return NULL when + * the pre-allocated pool is close to exhaustion. Anyway, + * in practice this should never occur because a new node + * is not always required for insert. Thus, the pre-allocated + * pool should have some extra pages that prevent this from + * becoming a problem. */ if (rnode == NULL) panic("%s: uma_zalloc() returned NULL for a new node", @@ -184,7 +183,7 @@ vm_radix_setroot(struct vm_radix *rtree, /* * Returns the associated page extracted from rnode if available, - * NULL otherwise. + * and NULL otherwise. */ static __inline vm_page_t vm_radix_node_page(struct vm_radix_node *rnode) @@ -195,7 +194,7 @@ vm_radix_node_page(struct vm_radix_node } /* - * Adds the page as a child of provided node. + * Adds the page as a child of the provided node. */ static __inline void vm_radix_addpage(struct vm_radix_node *rnode, vm_pindex_t index, uint16_t clev, @@ -229,7 +228,7 @@ vm_radix_keydiff(vm_pindex_t index1, vm_ /* * Returns TRUE if it can be determined that key does not belong to the - * specified rnode. FALSE otherwise. + * specified rnode. Otherwise, returns FALSE. */ static __inline boolean_t vm_radix_keybarr(struct vm_radix_node *rnode, vm_pindex_t idx) @@ -296,7 +295,7 @@ vm_radix_declev(vm_pindex_t *idx, boolea } /* - * Internal handwork for vm_radix_reclaim_allonodes() primitive. + * Internal helper for vm_radix_reclaim_allonodes(). * This function is recursive. */ static void @@ -364,7 +363,7 @@ vm_radix_init(void) } /* - * Inserts the key-value pair in to the trie. + * Inserts the key-value pair into the trie. * Panics if the key already exists. */ void @@ -452,7 +451,7 @@ vm_radix_insert(struct vm_radix *rtree, } /* - * Returns the value stored at the index. If the index is not present + * Returns the value stored at the index. If the index is not present, * NULL is returned. */ vm_page_t @@ -480,7 +479,7 @@ vm_radix_lookup(struct vm_radix *rtree, } /* - * Look up any entry at a position bigger than or equal to index. + * Look up the nearest entry at a position bigger than or equal to index. */ vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index) @@ -553,7 +552,7 @@ restart: } /* - * If a valid page or edge, bigger than the search slot, is + * If a valid page or edge bigger than the search slot is * found in the traversal, skip to the next higher-level key. */ if (slot == (VM_RADIX_COUNT - 1) && @@ -569,7 +568,7 @@ restart: } /* - * Look up any entry at a position less than or equal to index. + * Look up the nearest entry at a position less than or equal to index. */ vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index) @@ -643,7 +642,7 @@ restart: } /* - * If a valid page or edge, smaller than the search slot, is + * If a valid page or edge smaller than the search slot is * found in the traversal, skip to the next higher-level key. */ if (slot == 0 && (rnode->rn_child[slot] == NULL || m != NULL)) { @@ -710,7 +709,7 @@ vm_radix_remove(struct vm_radix *rtree, /* * Remove and free all the nodes from the radix tree. - * This function is recrusive but there is a tight control on it as the + * This function is recursive but there is a tight control on it as the * maximum depth of the tree is fixed. */ void From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 07:21:00 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AA4872CC; Mon, 4 Mar 2013 07:21:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 925B2FFE; Mon, 4 Mar 2013 07:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r247L00I069480; Mon, 4 Mar 2013 07:21:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r247L0fA069474; Mon, 4 Mar 2013 07:21:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303040721.r247L0fA069474@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Mar 2013 07:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247772 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 07:21:00 -0000 Author: alc Date: Mon Mar 4 07:20:59 2013 New Revision: 247772 URL: http://svnweb.freebsd.org/changeset/base/247772 Log: A Boolean is more appropriate than an int here. Use what I think is a slightly better variable name. Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_page.c Modified: user/attilio/vmc-playground/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_page.c Mon Mar 4 07:11:10 2013 (r247771) +++ user/attilio/vmc-playground/sys/vm/vm_page.c Mon Mar 4 07:20:59 2013 (r247772) @@ -2132,7 +2132,7 @@ void vm_page_cache(vm_page_t m) { vm_object_t object; - int old_empty_cache; + boolean_t cache_was_empty; vm_page_lock_assert(m, MA_OWNED); object = m->object; @@ -2184,8 +2184,8 @@ vm_page_cache(vm_page_t m) m->flags &= ~PG_ZERO; mtx_lock(&vm_page_queue_free_mtx); m->flags |= PG_CACHED; - old_empty_cache = vm_object_cache_is_empty(object); cnt.v_cache_count++; + cache_was_empty = vm_object_cache_is_empty(object); vm_radix_insert(&object->cache, m->pindex, m); #if VM_NRESERVLEVEL > 0 if (!vm_reserv_free_page(m)) { @@ -2204,10 +2204,9 @@ vm_page_cache(vm_page_t m) * the object's only resident page. */ if (object->type == OBJT_VNODE) { - if (old_empty_cache != 0 && object->resident_page_count != 0) + if (cache_was_empty && object->resident_page_count != 0) vhold(object->handle); - else if (old_empty_cache == 0 && - object->resident_page_count == 0) + else if (!cache_was_empty && object->resident_page_count == 0) vdrop(object->handle); } } From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 07:25:11 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EBA8A411; Mon, 4 Mar 2013 07:25:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C76A186; Mon, 4 Mar 2013 07:25:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r247PBIf070075; Mon, 4 Mar 2013 07:25:11 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r247PBfP070074; Mon, 4 Mar 2013 07:25:11 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201303040725.r247PBfP070074@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Mar 2013 07:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247773 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 07:25:12 -0000 Author: alc Date: Mon Mar 4 07:25:11 2013 New Revision: 247773 URL: http://svnweb.freebsd.org/changeset/base/247773 Log: Fix a typo. Sponsored by: EMC / Isilon Storage Division Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 07:20:59 2013 (r247772) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Mon Mar 4 07:25:11 2013 (r247773) @@ -295,7 +295,7 @@ vm_radix_declev(vm_pindex_t *idx, boolea } /* - * Internal helper for vm_radix_reclaim_allonodes(). + * Internal helper for vm_radix_reclaim_allnodes(). * This function is recursive. */ static void From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 12:33:41 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A153E10; Mon, 4 Mar 2013 12:33:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58CFA1638; Mon, 4 Mar 2013 12:33:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24CXfG6049018; Mon, 4 Mar 2013 12:33:41 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24CXeHD049012; Mon, 4 Mar 2013 12:33:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303041233.r24CXeHD049012@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 12:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247786 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 12:33:41 -0000 Author: attilio Date: Mon Mar 4 12:33:40 2013 New Revision: 247786 URL: http://svnweb.freebsd.org/changeset/base/247786 Log: Evaluations on the likelyhood of empty object cache cannot be made in general way but must be evaluated case by case. Embedd the decision in the caller themselves rather than in a general purpose KPI. Sponsored by: EMC / Isilon storage division Reported by: alc Reviewed by: alc Modified: user/attilio/vmc-playground/sys/vm/vm_object.c user/attilio/vmc-playground/sys/vm/vm_object.h user/attilio/vmc-playground/sys/vm/vm_page.c Modified: user/attilio/vmc-playground/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_object.c Mon Mar 4 12:20:48 2013 (r247785) +++ user/attilio/vmc-playground/sys/vm/vm_object.c Mon Mar 4 12:33:40 2013 (r247786) @@ -755,7 +755,7 @@ vm_object_terminate(vm_object_t object) if (__predict_false(!LIST_EMPTY(&object->rvq))) vm_reserv_break_all(object); #endif - if (!vm_object_cache_is_empty(object)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, 0, 0); /* @@ -1380,7 +1380,7 @@ retry: * should still be OBJT_DEFAULT and orig_object should not * contain any cached pages within the specified range. */ - if (!vm_object_cache_is_empty(orig_object)) + if (__predict_false(!vm_object_cache_is_empty(orig_object))) vm_page_cache_transfer(orig_object, offidxstart, new_object); } @@ -1729,7 +1729,8 @@ vm_object_collapse(vm_object_t object) /* * Free any cached pages from backing_object. */ - if (!vm_object_cache_is_empty(backing_object)) + if (__predict_false( + !vm_object_cache_is_empty(backing_object))) vm_page_cache_free(backing_object, 0, 0); } /* @@ -1923,7 +1924,7 @@ again: } vm_object_pip_wakeup(object); skipmemq: - if (!vm_object_cache_is_empty(object)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, start, end); } Modified: user/attilio/vmc-playground/sys/vm/vm_object.h ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_object.h Mon Mar 4 12:20:48 2013 (r247785) +++ user/attilio/vmc-playground/sys/vm/vm_object.h Mon Mar 4 12:33:40 2013 (r247786) @@ -235,7 +235,7 @@ static __inline boolean_t vm_object_cache_is_empty(vm_object_t object) { - return (__predict_true(object->cache.rt_root == 0)); + return (object->cache.rt_root == 0); } vm_object_t vm_object_allocate (objtype_t, vm_pindex_t); Modified: user/attilio/vmc-playground/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_page.c Mon Mar 4 12:20:48 2013 (r247785) +++ user/attilio/vmc-playground/sys/vm/vm_page.c Mon Mar 4 12:33:40 2013 (r247786) @@ -1017,7 +1017,7 @@ vm_page_cache_free(vm_object_t object, v boolean_t empty; mtx_lock(&vm_page_queue_free_mtx); - if (vm_object_cache_is_empty(object)) { + if (__predict_false(vm_object_cache_is_empty(object))) { mtx_unlock(&vm_page_queue_free_mtx); return; } @@ -1136,7 +1136,7 @@ vm_page_is_cached(vm_object_t object, vm * exist. */ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (vm_object_cache_is_empty(object)) + if (__predict_true(vm_object_cache_is_empty(object))) return (FALSE); mtx_lock(&vm_page_queue_free_mtx); m = vm_page_cache_lookup(object, pindex); From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 13:15:02 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE0D3869; Mon, 4 Mar 2013 13:15:02 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF6C617BD; Mon, 4 Mar 2013 13:15:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24DF2Bd061820; Mon, 4 Mar 2013 13:15:02 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24DExt7061771; Mon, 4 Mar 2013 13:14:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303041314.r24DExt7061771@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 13:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247789 - in user/attilio/vmcontention: contrib/libyaml lib lib/libyaml sbin/devd share/mk sys/arm/arm sys/compat/linprocfs sys/compat/linux sys/conf sys/dev/ath sys/dev/ath/ath_hal sys... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 13:15:03 -0000 Author: attilio Date: Mon Mar 4 13:14:59 2013 New Revision: 247789 URL: http://svnweb.freebsd.org/changeset/base/247789 Log: MFC Added: user/attilio/vmcontention/contrib/libyaml/ - copied from r247788, head/contrib/libyaml/ user/attilio/vmcontention/lib/libyaml/ - copied from r247788, head/lib/libyaml/ Modified: user/attilio/vmcontention/lib/Makefile user/attilio/vmcontention/sbin/devd/devd.cc user/attilio/vmcontention/sbin/devd/devd.hh user/attilio/vmcontention/share/mk/bsd.libnames.mk user/attilio/vmcontention/sys/arm/arm/busdma_machdep-v6.c user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c user/attilio/vmcontention/sys/compat/linux/linux_file.c user/attilio/vmcontention/sys/compat/linux/linux_socket.c user/attilio/vmcontention/sys/conf/NOTES user/attilio/vmcontention/sys/conf/options user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416.h user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/attilio/vmcontention/sys/dev/ath/if_athvar.h user/attilio/vmcontention/sys/kern/kern_clock.c user/attilio/vmcontention/sys/kern/kern_clocksource.c user/attilio/vmcontention/sys/kern/kern_condvar.c user/attilio/vmcontention/sys/kern/kern_intr.c user/attilio/vmcontention/sys/kern/kern_synch.c user/attilio/vmcontention/sys/kern/kern_tc.c user/attilio/vmcontention/sys/kern/kern_timeout.c user/attilio/vmcontention/sys/kern/subr_param.c user/attilio/vmcontention/sys/kern/subr_sleepqueue.c user/attilio/vmcontention/sys/netinet/tcp_timer.c user/attilio/vmcontention/sys/sys/_callout.h user/attilio/vmcontention/sys/sys/callout.h user/attilio/vmcontention/sys/sys/condvar.h user/attilio/vmcontention/sys/sys/mutex.h user/attilio/vmcontention/sys/sys/rwlock.h user/attilio/vmcontention/sys/sys/sleepqueue.h user/attilio/vmcontention/sys/sys/sx.h user/attilio/vmcontention/sys/sys/systm.h user/attilio/vmcontention/sys/sys/time.h user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/tools/make_libdeps.sh user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday user/attilio/vmcontention/usr.bin/hexdump/conv.c user/attilio/vmcontention/usr.sbin/tzsetup/tzsetup.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/usr.bin/calendar/ (props changed) Modified: user/attilio/vmcontention/lib/Makefile ============================================================================== --- user/attilio/vmcontention/lib/Makefile Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/lib/Makefile Mon Mar 4 13:14:59 2013 (r247789) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Modified: user/attilio/vmcontention/sbin/devd/devd.cc ============================================================================== --- user/attilio/vmcontention/sbin/devd/devd.cc Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sbin/devd/devd.cc Mon Mar 4 13:14:59 2013 (r247789) @@ -116,7 +116,7 @@ static struct pidfh *pfh; int Dflag; int dflag; int nflag; -int romeo_must_die = 0; +static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -319,7 +319,7 @@ media::do_match(config &c) // the name of interest, first try device-name and fall back // to subsystem if none exists. value = c.get_variable("device-name"); - if (value.length() == 0) + if (value.empty()) value = c.get_variable("subsystem"); if (Dflag) fprintf(stderr, "Testing media type of %s against 0x%x\n", @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -585,7 +585,7 @@ config::expand_one(const char *&src, str src++; // $$ -> $ if (*src == '$') { - dst.append(src++, 1); + dst += *src++; return; } @@ -593,7 +593,7 @@ config::expand_one(const char *&src, str // Not sure if I want to support this or not, so for now we just pass // it through. if (*src == '(') { - dst.append("$"); + dst += '$'; count = 1; /* If the string ends before ) is matched , return. */ while (count > 0 && *src) { @@ -601,23 +601,23 @@ config::expand_one(const char *&src, str count--; else if (*src == '(') count++; - dst.append(src++, 1); + dst += *src++; } return; } - // ${^A-Za-z] -> $\1 + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { - dst.append("$"); - dst.append(src++, 1); + dst += '$'; + dst += *src++; return; } // $var -> replace with value do { - buffer.append(src++, 1); + buffer += *src++; } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string @@ -653,7 +653,7 @@ config::expand_string(const char *src, c } bool -config::chop_var(char *&buffer, char *&lhs, char *&rhs) +config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; @@ -912,9 +912,7 @@ event_loop(void) server_fd = create_socket(PIPE); accepting = 1; max_fd = max(fd, server_fd) + 1; - while (1) { - if (romeo_must_die) - break; + while (!romeo_must_die) { if (!once && !dflag && !nflag) { // Check to see if we have any events pending. tv.tv_sec = 0; @@ -1076,8 +1074,7 @@ set_variable(const char *var, const char static void gensighand(int) { - romeo_must_die++; - _exit(0); + romeo_must_die = 1; } static void Modified: user/attilio/vmcontention/sbin/devd/devd.hh ============================================================================== --- user/attilio/vmcontention/sbin/devd/devd.hh Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sbin/devd/devd.hh Mon Mar 4 13:14:59 2013 (r247789) @@ -41,8 +41,6 @@ class config; class var_list { public: - var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -68,7 +66,6 @@ private: struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ @@ -144,7 +141,7 @@ private: class config { public: - config() : _pidfile("") { push_var_table(); } + config() { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); @@ -172,7 +169,7 @@ protected: void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); bool is_id_char(char) const; - bool chop_var(char *&buffer, char *&lhs, char *&rhs); + bool chop_var(char *&buffer, char *&lhs, char *&rhs) const; private: std::vector _dir_list; std::string _pidfile; Modified: user/attilio/vmcontention/share/mk/bsd.libnames.mk ============================================================================== --- user/attilio/vmcontention/share/mk/bsd.libnames.mk Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/share/mk/bsd.libnames.mk Mon Mar 4 13:14:59 2013 (r247789) @@ -25,6 +25,7 @@ LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9. .endif LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a +LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a Modified: user/attilio/vmcontention/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 13:14:59 2013 (r247789) @@ -1007,6 +1007,9 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm } else { sl = &map->slist[map->sync_count - 1]; if (map->sync_count == 0 || +#ifdef ARM_L2_PIPT + curaddr != sl->busaddr + sl->datacount || +#endif vaddr != sl->vaddr + sl->datacount) { if (++map->sync_count > dmat->nsegments) goto cleanup; Modified: user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c Mon Mar 4 13:14:59 2013 (r247789) @@ -386,8 +386,7 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } mtx_unlock(&mountlist_mtx); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } @@ -447,8 +446,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) } g_topology_unlock(); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } Modified: user/attilio/vmcontention/sys/compat/linux/linux_file.c ============================================================================== --- user/attilio/vmcontention/sys/compat/linux/linux_file.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/compat/linux/linux_file.c Mon Mar 4 13:14:59 2013 (r247789) @@ -517,8 +517,7 @@ eof: td->td_retval[0] = nbytes - resid; out: - if (cookies) - free(cookies, M_TEMP); + free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); Modified: user/attilio/vmcontention/sys/compat/linux/linux_socket.c ============================================================================== --- user/attilio/vmcontention/sys/compat/linux/linux_socket.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/compat/linux/linux_socket.c Mon Mar 4 13:14:59 2013 (r247789) @@ -1443,10 +1443,8 @@ out: bad: free(iov, M_IOV); - if (control != NULL) - m_freem(control); - if (linux_cmsg != NULL) - free(linux_cmsg, M_TEMP); + m_freem(control); + free(linux_cmsg, M_TEMP); return (error); } Modified: user/attilio/vmcontention/sys/conf/NOTES ============================================================================== --- user/attilio/vmcontention/sys/conf/NOTES Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/conf/NOTES Mon Mar 4 13:14:59 2013 (r247789) @@ -259,6 +259,8 @@ options SX_NOINLINE # SMP Debugging Options: # +# CALLOUT_PROFILING enables rudimentary profiling of the callwheel data +# structure used as backend in callout(9). # PREEMPTION allows the threads that are in the kernel to be preempted by # higher priority [interrupt] threads. It helps with interactivity # and allows interrupt threads to run sooner rather than waiting. @@ -297,6 +299,9 @@ options LOCK_PROFILING options MPROF_BUFFERS="1536" options MPROF_HASH_SIZE="1543" +# Profiling for the callout(9) backend. +options CALLOUT_PROFILING + # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING Modified: user/attilio/vmcontention/sys/conf/options ============================================================================== --- user/attilio/vmcontention/sys/conf/options Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/conf/options Mon Mar 4 13:14:59 2013 (r247789) @@ -68,6 +68,7 @@ TEXTDUMP_VERBOSE opt_ddb.h ADAPTIVE_LOCKMGRS ALQ AUDIT opt_global.h +CALLOUT_PROFILING CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h COMPAT_43 opt_compat.h Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ah.h Mon Mar 4 13:14:59 2013 (r247789) @@ -1527,11 +1527,13 @@ struct ath_hal { struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); - void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nVirtMoreFrag)(struct ath_hal *, + struct ath_desc *, u_int); + HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *, HAL_SURVEY_SAMPLE *); Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 13:14:59 2013 (r247789) @@ -409,8 +409,9 @@ extern void ar5416Set11nAggrFirst(struct u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); - extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, + struct ath_desc *ds, u_int vmf); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 13:14:59 2013 (r247789) @@ -194,6 +194,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; + ah->ah_set11nVirtMoreFrag = ar5416Set11nVirtualMoreFrag; /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 13:14:59 2013 (r247789) @@ -825,6 +825,17 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +void +ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, struct ath_desc *ds, + u_int vmf) +{ + struct ar5416_desc *ads = AR5416DESC(ds); + if (vmf) + ads->ds_ctl0 |= AR_VirtMoreFrag; + else + ads->ds_ctl0 &= ~AR_VirtMoreFrag; +} + /* * Program the burst duration, with the included BA delta if it's * applicable. Modified: user/attilio/vmcontention/sys/dev/ath/if_athvar.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/if_athvar.h Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/dev/ath/if_athvar.h Mon Mar 4 13:14:59 2013 (r247789) @@ -1297,6 +1297,8 @@ void ath_intr(void *); ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_set11n_virtmorefrag(_ah, _ds, _v) \ + ((*(_ah)->ah_set11nVirtMoreFrag)((_ah), (_ds), (_v))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) Modified: user/attilio/vmcontention/sys/kern/kern_clock.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_clock.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/kern/kern_clock.c Mon Mar 4 13:14:59 2013 (r247789) @@ -460,7 +460,7 @@ hardclock_cpu(int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); + callout_process(sbinuptime()); } /* @@ -550,7 +550,6 @@ hardclock_cnt(int cnt, int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); /* We are in charge to handle this tick duty. */ if (newticks > 0) { /* Dangerous and no need to call these things concurrently. */ Modified: user/attilio/vmcontention/sys/kern/kern_clocksource.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_clocksource.c Mon Mar 4 13:10:59 2013 (r247788) +++ user/attilio/vmcontention/sys/kern/kern_clocksource.c Mon Mar 4 13:14:59 2013 (r247789) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2012 Alexander Motin + * Copyright (c) 2010-2013 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,17 +64,14 @@ int cpu_can_deep_sleep = 0; /* C3 stat int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ static void setuptimer(void); -static void loadtimer(struct bintime *now, int first); +static void loadtimer(sbintime_t now, int first); static int doconfigtimer(void); static void configtimer(int start); static int round_freq(struct eventtimer *et, int freq); -static void getnextcpuevent(struct bintime *event, int idle); -static void getnextevent(struct bintime *event); -static int handleevents(struct bintime *now, int fake); -#ifdef SMP -static void cpu_new_callout(int cpu, int ticks); -#endif +static sbintime_t getnextcpuevent(int idle); +static sbintime_t getnextevent(void); +static int handleevents(sbintime_t now, int fake); static struct mtx et_hw_mtx; @@ -94,13 +92,11 @@ static struct mtx et_hw_mtx; } static struct eventtimer *timer = NULL; -static struct bintime timerperiod; /* Timer period for periodic mode. */ -static struct bintime hardperiod; /* hardclock() events period. */ -static struct bintime statperiod; /* statclock() events period. */ -static struct bintime profperiod; /* profclock() events period. */ -static struct bintime nexttick; /* Next global timer tick time. */ -static struct bintime nexthard; /* Next global hardlock() event. */ -static u_int busy = 0; /* Reconfiguration is in progress. */ +static sbintime_t timerperiod; /* Timer period for periodic mode. */ +static sbintime_t statperiod; /* statclock() events period. */ +static sbintime_t profperiod; /* profclock() events period. */ +static sbintime_t nexttick; /* Next global timer tick time. */ +static u_int busy = 1; /* Reconfiguration is in progress. */ static int profiling = 0; /* Profiling events enabled. */ static char timername[32]; /* Wanted timer. */ @@ -116,11 +112,6 @@ TUNABLE_INT("kern.eventtimer.idletick", SYSCTL_UINT(_kern_eventtimer, OID_AUTO, idletick, CTLFLAG_RW, &idletick, 0, "Run periodic events when idle"); -static u_int activetick = 1; /* Run all periodic events when active. */ -TUNABLE_INT("kern.eventtimer.activetick", &activetick); -SYSCTL_UINT(_kern_eventtimer, OID_AUTO, activetick, CTLFLAG_RW, &activetick, - 0, "Run all periodic events when active"); - static int periodic = 0; /* Periodic or one-shot mode. */ static int want_periodic = 0; /* What mode to prefer. */ TUNABLE_INT("kern.eventtimer.periodic", &want_periodic); @@ -129,31 +120,23 @@ struct pcpu_state { struct mtx et_hw_mtx; /* Per-CPU timer mutex. */ u_int action; /* Reconfiguration requests. */ u_int handle; /* Immediate handle resuests. */ - struct bintime now; /* Last tick time. */ - struct bintime nextevent; /* Next scheduled event on this CPU. */ - struct bintime nexttick; /* Next timer tick time. */ - struct bintime nexthard; /* Next hardlock() event. */ - struct bintime nextstat; /* Next statclock() event. */ - struct bintime nextprof; /* Next profclock() event. */ + sbintime_t now; /* Last tick time. */ + sbintime_t nextevent; /* Next scheduled event on this CPU. */ + sbintime_t nexttick; /* Next timer tick time. */ + sbintime_t nexthard; /* Next hardlock() event. */ + sbintime_t nextstat; /* Next statclock() event. */ + sbintime_t nextprof; /* Next profclock() event. */ + sbintime_t nextcall; /* Next callout event. */ + sbintime_t nextcallopt; /* Next optional callout event. */ #ifdef KDTRACE_HOOKS - struct bintime nextcyc; /* Next OpenSolaris cyclics event. */ + sbintime_t nextcyc; /* Next OpenSolaris cyclics event. */ #endif int ipi; /* This CPU needs IPI. */ int idle; /* This CPU is in idle mode. */ }; static DPCPU_DEFINE(struct pcpu_state, timerstate); - -#define FREQ2BT(freq, bt) \ -{ \ - (bt)->sec = 0; \ - (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ -} -#define BT2FREQ(bt) \ - (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ - ((bt)->frac >> 1)) - -#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) +DPCPU_DEFINE(sbintime_t, hardclocktime); /* * Timer broadcast IPI handler. @@ -161,7 +144,7 @@ static DPCPU_DEFINE(struct pcpu_state, t int hardclockintr(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; int done; @@ -169,10 +152,9 @@ hardclockintr(void) return (FILTER_HANDLED); state = DPCPU_PTR(timerstate); now = state->now; - CTR4(KTR_SPARE2, "ipi at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - done = handleevents(&now, 0); + CTR3(KTR_SPARE2, "ipi at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + done = handleevents(now, 0); return (done ? FILTER_HANDLED : FILTER_STRAY); } @@ -180,48 +162,43 @@ hardclockintr(void) * Handle all events for specified time on this CPU */ static int -handleevents(struct bintime *now, int fake) +handleevents(sbintime_t now, int fake) { - struct bintime t; + sbintime_t t, *hct; struct trapframe *frame; struct pcpu_state *state; - uintfptr_t pc; int usermode; int done, runs; - CTR4(KTR_SPARE2, "handle at %d: now %d.%08x%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - (u_int)(now->frac & 0xffffffff)); + CTR3(KTR_SPARE2, "handle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); done = 0; if (fake) { frame = NULL; usermode = 0; - pc = 0; } else { frame = curthread->td_intr_frame; usermode = TRAPF_USERMODE(frame); - pc = TRAPF_PC(frame); } state = DPCPU_PTR(timerstate); runs = 0; - while (bintime_cmp(now, &state->nexthard, >=)) { - bintime_addx(&state->nexthard, hardperiod.frac); + while (now >= state->nexthard) { + state->nexthard += tick_sbt; runs++; } if (runs) { - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 && - bintime_cmp(&state->nexthard, &nexthard, >)) - nexthard = state->nexthard; + hct = DPCPU_PTR(hardclocktime); + *hct = state->nexthard - tick_sbt; if (fake < 2) { hardclock_cnt(runs, usermode); done = 1; } } runs = 0; - while (bintime_cmp(now, &state->nextstat, >=)) { - bintime_addx(&state->nextstat, statperiod.frac); + while (now >= state->nextstat) { + state->nextstat += statperiod; runs++; } if (runs && fake < 2) { @@ -230,31 +207,29 @@ handleevents(struct bintime *now, int fa } if (profiling) { runs = 0; - while (bintime_cmp(now, &state->nextprof, >=)) { - bintime_addx(&state->nextprof, profperiod.frac); + while (now >= state->nextprof) { + state->nextprof += profperiod; runs++; } if (runs && !fake) { - profclock_cnt(runs, usermode, pc); + profclock_cnt(runs, usermode, TRAPF_PC(frame)); done = 1; } } else state->nextprof = state->nextstat; + if (now >= state->nextcallopt) { + state->nextcall = state->nextcallopt = INT64_MAX; + callout_process(now); + } #ifdef KDTRACE_HOOKS - if (fake == 0 && cyclic_clock_func != NULL && - state->nextcyc.sec != -1 && - bintime_cmp(now, &state->nextcyc, >=)) { - state->nextcyc.sec = -1; + if (fake == 0 && now >= state->nextcyc && cyclic_clock_func != NULL) { + state->nextcyc = INT64_MAX; (*cyclic_clock_func)(frame); } #endif - getnextcpuevent(&t, 0); - if (fake == 2) { - state->nextevent = t; - return (done); - } + t = getnextcpuevent(0); ET_HW_LOCK(state); if (!busy) { state->idle = 0; @@ -268,84 +243,81 @@ handleevents(struct bintime *now, int fa /* * Schedule binuptime of the next event on current CPU. */ -static void -getnextcpuevent(struct bintime *event, int idle) +static sbintime_t +getnextcpuevent(int idle) { - struct bintime tmp; + sbintime_t event; struct pcpu_state *state; - int skip; + u_int hardfreq; state = DPCPU_PTR(timerstate); - /* Handle hardclock() events. */ - *event = state->nexthard; - if (idle || (!activetick && !profiling && - (timer->et_flags & ET_FLAGS_PERCPU) == 0)) { - skip = idle ? 4 : (stathz / 2); - if (curcpu == CPU_FIRST() && tc_min_ticktock_freq > skip) - skip = tc_min_ticktock_freq; - skip = callout_tickstofirst(hz / skip) - 1; - CTR2(KTR_SPARE2, "skip at %d: %d", curcpu, skip); - tmp = hardperiod; - bintime_mul(&tmp, skip); - bintime_add(event, &tmp); - } + /* Handle hardclock() events, skipping some if CPU is idle. */ + event = state->nexthard; + if (idle) { + hardfreq = (u_int)hz / 2; + if (tc_min_ticktock_freq > 2 +#ifdef SMP + && curcpu == CPU_FIRST() +#endif + ) + hardfreq = hz / tc_min_ticktock_freq; + if (hardfreq > 1) + event += tick_sbt * (hardfreq - 1); + } + /* Handle callout events. */ + if (event > state->nextcall) + event = state->nextcall; if (!idle) { /* If CPU is active - handle other types of events. */ - if (bintime_cmp(event, &state->nextstat, >)) - *event = state->nextstat; - if (profiling && bintime_cmp(event, &state->nextprof, >)) - *event = state->nextprof; + if (event > state->nextstat) + event = state->nextstat; + if (profiling && event > state->nextprof) + event = state->nextprof; } #ifdef KDTRACE_HOOKS - if (state->nextcyc.sec != -1 && bintime_cmp(event, &state->nextcyc, >)) - *event = state->nextcyc; + if (event > state->nextcyc) + event = state->nextcyc; #endif + return (event); } /* * Schedule binuptime of the next event on all CPUs. */ -static void -getnextevent(struct bintime *event) +static sbintime_t +getnextevent(void) { struct pcpu_state *state; + sbintime_t event; #ifdef SMP int cpu; #endif - int c, nonidle; + int c; state = DPCPU_PTR(timerstate); - *event = state->nextevent; - c = curcpu; - nonidle = !state->idle; - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + event = state->nextevent; + c = -1; #ifdef SMP - if (smp_started) { - CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; - state = DPCPU_ID_PTR(cpu, timerstate); - nonidle += !state->idle; - if (bintime_cmp(event, &state->nextevent, >)) { - *event = state->nextevent; - c = cpu; - } + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + CPU_FOREACH(cpu) { + state = DPCPU_ID_PTR(cpu, timerstate); + if (event > state->nextevent) { + event = state->nextevent; + c = cpu; } } -#endif - if (nonidle != 0 && bintime_cmp(event, &nexthard, >)) - *event = nexthard; } - CTR5(KTR_SPARE2, "next at %d: next %d.%08x%08x by %d", - curcpu, event->sec, (u_int)(event->frac >> 32), - (u_int)(event->frac & 0xffffffff), c); +#endif + CTR4(KTR_SPARE2, "next at %d: next %d.%08x by %d", + curcpu, (int)(event >> 32), (u_int)(event & 0xffffffff), c); + return (event); } /* Hardware timer callback function. */ static void timercb(struct eventtimer *et, void *arg) { - struct bintime now; - struct bintime *next; + sbintime_t now; + sbintime_t *next; struct pcpu_state *state; #ifdef SMP int cpu, bcast; @@ -360,16 +332,14 @@ timercb(struct eventtimer *et, void *arg next = &state->nexttick; } else next = &nexttick; - binuptime(&now); - if (periodic) { - *next = now; - bintime_addx(next, timerperiod.frac); /* Next tick in 1 period. */ - } else - next->sec = -1; /* Next tick is not scheduled yet. */ + now = sbinuptime(); + if (periodic) + *next = now + timerperiod; + else + *next = -1; /* Next tick is not scheduled yet. */ state->now = now; - CTR4(KTR_SPARE2, "intr at %d: now %d.%08x%08x", - curcpu, (int)(now.sec), (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); + CTR3(KTR_SPARE2, "intr at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); #ifdef SMP /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ @@ -379,8 +349,8 @@ timercb(struct eventtimer *et, void *arg state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); state->now = now; - if (bintime_cmp(&now, &state->nextevent, >=)) { - state->nextevent.sec++; + if (now >= state->nextevent) { + state->nextevent += SBT_1S; if (curcpu != cpu) { state->ipi = 1; bcast = 1; @@ -392,7 +362,7 @@ timercb(struct eventtimer *et, void *arg #endif /* Handle events for this time on this CPU. */ - handleevents(&now, 0); + handleevents(now, 0); #ifdef SMP /* Broadcast interrupt to other CPUs for non-per-CPU timers. */ @@ -414,11 +384,11 @@ timercb(struct eventtimer *et, void *arg * Load new value into hardware timer. */ static void -loadtimer(struct bintime *now, int start) +loadtimer(sbintime_t now, int start) { struct pcpu_state *state; - struct bintime new; - struct bintime *next; + sbintime_t new; + sbintime_t *next; uint64_t tmp; int eq; @@ -433,30 +403,24 @@ loadtimer(struct bintime *now, int start * Try to start all periodic timers aligned * to period to make events synchronous. */ - tmp = ((uint64_t)now->sec << 36) + (now->frac >> 28); - tmp = (tmp % (timerperiod.frac >> 28)) << 28; - new.sec = 0; - new.frac = timerperiod.frac - tmp; - if (new.frac < tmp) /* Left less then passed. */ - bintime_addx(&new, timerperiod.frac); + tmp = now % timerperiod; + new = timerperiod - tmp; + if (new < tmp) /* Left less then passed. */ + new += timerperiod; CTR5(KTR_SPARE2, "load p at %d: now %d.%08x first in %d.%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - new.sec, (u_int)(new.frac >> 32)); - *next = new; - bintime_add(next, now); - et_start(timer, bttosbt(new), bttosbt(timerperiod)); + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff), + (int)(new >> 32), (u_int)(new & 0xffffffff)); + *next = new + now; + et_start(timer, new, timerperiod); } } else { - getnextevent(&new); - eq = bintime_cmp(&new, next, ==); - CTR5(KTR_SPARE2, "load at %d: next %d.%08x%08x eq %d", - curcpu, new.sec, (u_int)(new.frac >> 32), - (u_int)(new.frac & 0xffffffff), - eq); + new = getnextevent(); + eq = (new == *next); + CTR4(KTR_SPARE2, "load at %d: next %d.%08x eq %d", + curcpu, (int)(new >> 32), (u_int)(new & 0xffffffff), eq); if (!eq) { *next = new; - bintime_sub(&new, now); - et_start(timer, bttosbt(new), 0); + et_start(timer, new - now, 0); } } } @@ -478,7 +442,7 @@ setuptimer(void) while (freq < (profiling ? profhz : stathz)) freq += hz; freq = round_freq(timer, freq); - FREQ2BT(freq, &timerperiod); + timerperiod = SBT_1S / freq; } /* @@ -487,15 +451,15 @@ setuptimer(void) static int doconfigtimer(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; state = DPCPU_PTR(timerstate); switch (atomic_load_acq_int(&state->action)) { case 1: - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); - loadtimer(&now, 1); + loadtimer(now, 1); ET_HW_UNLOCK(state); state->handle = 0; atomic_store_rel_int(&state->action, 0); @@ -509,8 +473,8 @@ doconfigtimer(void) return (1); } if (atomic_readandclear_int(&state->handle) && !busy) { - binuptime(&now); - handleevents(&now, 0); + now = sbinuptime(); + handleevents(now, 0); return (1); } return (0); @@ -523,40 +487,45 @@ doconfigtimer(void) static void configtimer(int start) { - struct bintime now, next; + sbintime_t now, next; struct pcpu_state *state; int cpu; if (start) { setuptimer(); - binuptime(&now); - } + now = sbinuptime(); + } else + now = 0; critical_enter(); ET_HW_LOCK(DPCPU_PTR(timerstate)); if (start) { /* Initialize time machine parameters. */ - next = now; - bintime_addx(&next, timerperiod.frac); + next = now + timerperiod; if (periodic) nexttick = next; else - nexttick.sec = -1; + nexttick = -1; CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); state->now = now; - state->nextevent = next; + if (!smp_started && cpu != CPU_FIRST()) + state->nextevent = INT64_MAX; + else + state->nextevent = next; if (periodic) state->nexttick = next; else - state->nexttick.sec = -1; + state->nexttick = -1; state->nexthard = next; state->nextstat = next; state->nextprof = next; + state->nextcall = next; + state->nextcallopt = next; hardclock_sync(cpu); } busy = 0; /* Start global timer or per-CPU timer of this CPU. */ - loadtimer(&now, 1); + loadtimer(now, 1); } else { busy = 1; /* Stop global timer or per-CPU timer of this CPU. */ @@ -629,12 +598,11 @@ cpu_initclocks_bsp(void) state = DPCPU_ID_PTR(cpu, timerstate); mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN); #ifdef KDTRACE_HOOKS - state->nextcyc.sec = -1; + state->nextcyc = INT64_MAX; #endif + state->nextcall = INT64_MAX; + state->nextcallopt = INT64_MAX; } -#ifdef SMP - callout_new_inserted = cpu_new_callout; -#endif periodic = want_periodic; /* Grab requested timer or the best of present. */ if (timername[0]) @@ -698,9 +666,10 @@ cpu_initclocks_bsp(void) profhz = round_freq(timer, stathz * 64); } tick = 1000000 / hz; - FREQ2BT(hz, &hardperiod); - FREQ2BT(stathz, &statperiod); - FREQ2BT(profhz, &profperiod); + tick_sbt = SBT_1S / hz; + tick_bt = sbttobt(tick_sbt); + statperiod = SBT_1S / stathz; + profperiod = SBT_1S / profhz; ET_LOCK(); configtimer(1); ET_UNLOCK(); @@ -712,18 +681,22 @@ cpu_initclocks_bsp(void) void cpu_initclocks_ap(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; + struct thread *td; state = DPCPU_PTR(timerstate); - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); state->now = now; hardclock_sync(curcpu); - handleevents(&state->now, 2); - if (timer->et_flags & ET_FLAGS_PERCPU) - loadtimer(&now, 1); + spinlock_enter(); ET_HW_UNLOCK(state); + td = curthread; + td->td_intr_nesting_level++; + handleevents(state->now, 2); + td->td_intr_nesting_level--; + spinlock_exit(); } /* @@ -772,7 +745,7 @@ cpu_stopprofclock(void) sbintime_t cpu_idleclock(void) { - struct bintime now, t; + sbintime_t now, t; struct pcpu_state *state; if (idletick || busy || @@ -786,19 +759,17 @@ cpu_idleclock(void) if (periodic) now = state->now; else - binuptime(&now); - CTR4(KTR_SPARE2, "idle at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - getnextcpuevent(&t, 1); + now = sbinuptime(); + CTR3(KTR_SPARE2, "idle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + t = getnextcpuevent(1); ET_HW_LOCK(state); state->idle = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Mar 4 13:17:56 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 952AD9B7; Mon, 4 Mar 2013 13:17:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A74317D5; Mon, 4 Mar 2013 13:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24DHuH2062253; Mon, 4 Mar 2013 13:17:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24DHrOK062224; Mon, 4 Mar 2013 13:17:53 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303041317.r24DHrOK062224@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 13:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247790 - in user/attilio/vmc-playground: contrib/libyaml lib lib/libyaml sbin/devd share/mk sys/arm/arm sys/compat/linprocfs sys/compat/linux sys/conf sys/dev/ath sys/dev/ath/ath_hal s... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 13:17:56 -0000 Author: attilio Date: Mon Mar 4 13:17:52 2013 New Revision: 247790 URL: http://svnweb.freebsd.org/changeset/base/247790 Log: Merge from vmcontention Added: user/attilio/vmc-playground/contrib/libyaml/ - copied from r247789, user/attilio/vmcontention/contrib/libyaml/ user/attilio/vmc-playground/lib/libyaml/ - copied from r247789, user/attilio/vmcontention/lib/libyaml/ Modified: user/attilio/vmc-playground/lib/Makefile user/attilio/vmc-playground/sbin/devd/devd.cc user/attilio/vmc-playground/sbin/devd/devd.hh user/attilio/vmc-playground/share/mk/bsd.libnames.mk user/attilio/vmc-playground/sys/arm/arm/busdma_machdep-v6.c user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c user/attilio/vmc-playground/sys/compat/linux/linux_file.c user/attilio/vmc-playground/sys/compat/linux/linux_socket.c user/attilio/vmc-playground/sys/conf/NOTES user/attilio/vmc-playground/sys/conf/options user/attilio/vmc-playground/sys/dev/ath/ath_hal/ah.h user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416.h user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/attilio/vmc-playground/sys/dev/ath/if_athvar.h user/attilio/vmc-playground/sys/kern/kern_clock.c user/attilio/vmc-playground/sys/kern/kern_clocksource.c user/attilio/vmc-playground/sys/kern/kern_condvar.c user/attilio/vmc-playground/sys/kern/kern_intr.c user/attilio/vmc-playground/sys/kern/kern_synch.c user/attilio/vmc-playground/sys/kern/kern_tc.c user/attilio/vmc-playground/sys/kern/kern_timeout.c user/attilio/vmc-playground/sys/kern/subr_param.c user/attilio/vmc-playground/sys/kern/subr_sleepqueue.c user/attilio/vmc-playground/sys/netinet/tcp_timer.c user/attilio/vmc-playground/sys/sys/_callout.h user/attilio/vmc-playground/sys/sys/callout.h user/attilio/vmc-playground/sys/sys/condvar.h user/attilio/vmc-playground/sys/sys/mutex.h user/attilio/vmc-playground/sys/sys/rwlock.h user/attilio/vmc-playground/sys/sys/sleepqueue.h user/attilio/vmc-playground/sys/sys/sx.h user/attilio/vmc-playground/sys/sys/systm.h user/attilio/vmc-playground/sys/sys/time.h user/attilio/vmc-playground/tools/make_libdeps.sh user/attilio/vmc-playground/usr.bin/calendar/calendars/calendar.birthday user/attilio/vmc-playground/usr.bin/hexdump/conv.c user/attilio/vmc-playground/usr.sbin/tzsetup/tzsetup.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/sbin/ (props changed) user/attilio/vmc-playground/sys/ (props changed) user/attilio/vmc-playground/sys/conf/ (props changed) user/attilio/vmc-playground/usr.bin/calendar/ (props changed) Modified: user/attilio/vmc-playground/lib/Makefile ============================================================================== --- user/attilio/vmc-playground/lib/Makefile Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/lib/Makefile Mon Mar 4 13:17:52 2013 (r247790) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Modified: user/attilio/vmc-playground/sbin/devd/devd.cc ============================================================================== --- user/attilio/vmc-playground/sbin/devd/devd.cc Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sbin/devd/devd.cc Mon Mar 4 13:17:52 2013 (r247790) @@ -116,7 +116,7 @@ static struct pidfh *pfh; int Dflag; int dflag; int nflag; -int romeo_must_die = 0; +static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; @@ -319,7 +319,7 @@ media::do_match(config &c) // the name of interest, first try device-name and fall back // to subsystem if none exists. value = c.get_variable("device-name"); - if (value.length() == 0) + if (value.empty()) value = c.get_variable("subsystem"); if (Dflag) fprintf(stderr, "Testing media type of %s against 0x%x\n", @@ -460,7 +460,7 @@ config::open_pidfile() { pid_t otherpid; - if (_pidfile == "") + if (_pidfile.empty()) return; pfh = pidfile_open(_pidfile.c_str(), 0600, &otherpid); if (pfh == NULL) { @@ -528,7 +528,7 @@ config::add_notify(int prio, event_proc void config::set_pidfile(const char *fn) { - _pidfile = string(fn); + _pidfile = fn; } void @@ -585,7 +585,7 @@ config::expand_one(const char *&src, str src++; // $$ -> $ if (*src == '$') { - dst.append(src++, 1); + dst += *src++; return; } @@ -593,7 +593,7 @@ config::expand_one(const char *&src, str // Not sure if I want to support this or not, so for now we just pass // it through. if (*src == '(') { - dst.append("$"); + dst += '$'; count = 1; /* If the string ends before ) is matched , return. */ while (count > 0 && *src) { @@ -601,23 +601,23 @@ config::expand_one(const char *&src, str count--; else if (*src == '(') count++; - dst.append(src++, 1); + dst += *src++; } return; } - // ${^A-Za-z] -> $\1 + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { - dst.append("$"); - dst.append(src++, 1); + dst += '$'; + dst += *src++; return; } // $var -> replace with value do { - buffer.append(src++, 1); + buffer += *src++; } while (is_id_char(*src)); - dst.append(get_variable(buffer.c_str())); + dst.append(get_variable(buffer)); } const string @@ -653,7 +653,7 @@ config::expand_string(const char *src, c } bool -config::chop_var(char *&buffer, char *&lhs, char *&rhs) +config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; @@ -912,9 +912,7 @@ event_loop(void) server_fd = create_socket(PIPE); accepting = 1; max_fd = max(fd, server_fd) + 1; - while (1) { - if (romeo_must_die) - break; + while (!romeo_must_die) { if (!once && !dflag && !nflag) { // Check to see if we have any events pending. tv.tv_sec = 0; @@ -1076,8 +1074,7 @@ set_variable(const char *var, const char static void gensighand(int) { - romeo_must_die++; - _exit(0); + romeo_must_die = 1; } static void Modified: user/attilio/vmc-playground/sbin/devd/devd.hh ============================================================================== --- user/attilio/vmc-playground/sbin/devd/devd.hh Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sbin/devd/devd.hh Mon Mar 4 13:17:52 2013 (r247790) @@ -41,8 +41,6 @@ class config; class var_list { public: - var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -68,7 +66,6 @@ private: struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ @@ -144,7 +141,7 @@ private: class config { public: - config() : _pidfile("") { push_var_table(); } + config() { push_var_table(); } virtual ~config() { reset(); } void add_attach(int, event_proc *); void add_detach(int, event_proc *); @@ -172,7 +169,7 @@ protected: void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); bool is_id_char(char) const; - bool chop_var(char *&buffer, char *&lhs, char *&rhs); + bool chop_var(char *&buffer, char *&lhs, char *&rhs) const; private: std::vector _dir_list; std::string _pidfile; Modified: user/attilio/vmc-playground/share/mk/bsd.libnames.mk ============================================================================== --- user/attilio/vmc-playground/share/mk/bsd.libnames.mk Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/share/mk/bsd.libnames.mk Mon Mar 4 13:17:52 2013 (r247790) @@ -25,6 +25,7 @@ LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9. .endif LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a +LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a Modified: user/attilio/vmc-playground/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- user/attilio/vmc-playground/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/arm/arm/busdma_machdep-v6.c Mon Mar 4 13:17:52 2013 (r247790) @@ -1007,6 +1007,9 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm } else { sl = &map->slist[map->sync_count - 1]; if (map->sync_count == 0 || +#ifdef ARM_L2_PIPT + curaddr != sl->busaddr + sl->datacount || +#endif vaddr != sl->vaddr + sl->datacount) { if (++map->sync_count > dmat->nsegments) goto cleanup; Modified: user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c Mon Mar 4 13:17:52 2013 (r247790) @@ -386,8 +386,7 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } mtx_unlock(&mountlist_mtx); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } @@ -447,8 +446,7 @@ linprocfs_dopartitions(PFS_FILL_ARGS) } g_topology_unlock(); - if (flep != NULL) - free(flep, M_TEMP); + free(flep, M_TEMP); return (error); } Modified: user/attilio/vmc-playground/sys/compat/linux/linux_file.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/linux/linux_file.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/compat/linux/linux_file.c Mon Mar 4 13:17:52 2013 (r247790) @@ -517,8 +517,7 @@ eof: td->td_retval[0] = nbytes - resid; out: - if (cookies) - free(cookies, M_TEMP); + free(cookies, M_TEMP); VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); Modified: user/attilio/vmc-playground/sys/compat/linux/linux_socket.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/linux/linux_socket.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/compat/linux/linux_socket.c Mon Mar 4 13:17:52 2013 (r247790) @@ -1443,10 +1443,8 @@ out: bad: free(iov, M_IOV); - if (control != NULL) - m_freem(control); - if (linux_cmsg != NULL) - free(linux_cmsg, M_TEMP); + m_freem(control); + free(linux_cmsg, M_TEMP); return (error); } Modified: user/attilio/vmc-playground/sys/conf/NOTES ============================================================================== --- user/attilio/vmc-playground/sys/conf/NOTES Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/conf/NOTES Mon Mar 4 13:17:52 2013 (r247790) @@ -259,6 +259,8 @@ options SX_NOINLINE # SMP Debugging Options: # +# CALLOUT_PROFILING enables rudimentary profiling of the callwheel data +# structure used as backend in callout(9). # PREEMPTION allows the threads that are in the kernel to be preempted by # higher priority [interrupt] threads. It helps with interactivity # and allows interrupt threads to run sooner rather than waiting. @@ -297,6 +299,9 @@ options LOCK_PROFILING options MPROF_BUFFERS="1536" options MPROF_HASH_SIZE="1543" +# Profiling for the callout(9) backend. +options CALLOUT_PROFILING + # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING Modified: user/attilio/vmc-playground/sys/conf/options ============================================================================== --- user/attilio/vmc-playground/sys/conf/options Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/conf/options Mon Mar 4 13:17:52 2013 (r247790) @@ -68,6 +68,7 @@ TEXTDUMP_VERBOSE opt_ddb.h ADAPTIVE_LOCKMGRS ALQ AUDIT opt_global.h +CALLOUT_PROFILING CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h COMPAT_43 opt_compat.h Modified: user/attilio/vmc-playground/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/ath_hal/ah.h Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/dev/ath/ath_hal/ah.h Mon Mar 4 13:17:52 2013 (r247790) @@ -1527,11 +1527,13 @@ struct ath_hal { struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); - void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nVirtMoreFrag)(struct ath_hal *, + struct ath_desc *, u_int); + HAL_BOOL __ahdecl(*ah_getMibCycleCounts) (struct ath_hal *, HAL_SURVEY_SAMPLE *); Modified: user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Mar 4 13:17:52 2013 (r247790) @@ -409,8 +409,9 @@ extern void ar5416Set11nAggrFirst(struct u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); - extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, + struct ath_desc *ds, u_int vmf); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 4 13:17:52 2013 (r247790) @@ -194,6 +194,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; + ah->ah_set11nVirtMoreFrag = ar5416Set11nVirtualMoreFrag; /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Mon Mar 4 13:17:52 2013 (r247790) @@ -825,6 +825,17 @@ ar5416Clr11nAggr(struct ath_hal *ah, str ads->ds_ctl6 &= ~AR_AggrLen; } +void +ar5416Set11nVirtualMoreFrag(struct ath_hal *ah, struct ath_desc *ds, + u_int vmf) +{ + struct ar5416_desc *ads = AR5416DESC(ds); + if (vmf) + ads->ds_ctl0 |= AR_VirtMoreFrag; + else + ads->ds_ctl0 &= ~AR_VirtMoreFrag; +} + /* * Program the burst duration, with the included BA delta if it's * applicable. Modified: user/attilio/vmc-playground/sys/dev/ath/if_athvar.h ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/if_athvar.h Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/dev/ath/if_athvar.h Mon Mar 4 13:17:52 2013 (r247790) @@ -1297,6 +1297,8 @@ void ath_intr(void *); ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_set11n_virtmorefrag(_ah, _ds, _v) \ + ((*(_ah)->ah_set11nVirtMoreFrag)((_ah), (_ds), (_v))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) Modified: user/attilio/vmc-playground/sys/kern/kern_clock.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_clock.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/kern/kern_clock.c Mon Mar 4 13:17:52 2013 (r247790) @@ -460,7 +460,7 @@ hardclock_cpu(int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); + callout_process(sbinuptime()); } /* @@ -550,7 +550,6 @@ hardclock_cnt(int cnt, int usermode) if (td->td_intr_frame != NULL) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif - callout_tick(); /* We are in charge to handle this tick duty. */ if (newticks > 0) { /* Dangerous and no need to call these things concurrently. */ Modified: user/attilio/vmc-playground/sys/kern/kern_clocksource.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_clocksource.c Mon Mar 4 13:14:59 2013 (r247789) +++ user/attilio/vmc-playground/sys/kern/kern_clocksource.c Mon Mar 4 13:17:52 2013 (r247790) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2012 Alexander Motin + * Copyright (c) 2010-2013 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -63,17 +64,14 @@ int cpu_can_deep_sleep = 0; /* C3 stat int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ static void setuptimer(void); -static void loadtimer(struct bintime *now, int first); +static void loadtimer(sbintime_t now, int first); static int doconfigtimer(void); static void configtimer(int start); static int round_freq(struct eventtimer *et, int freq); -static void getnextcpuevent(struct bintime *event, int idle); -static void getnextevent(struct bintime *event); -static int handleevents(struct bintime *now, int fake); -#ifdef SMP -static void cpu_new_callout(int cpu, int ticks); -#endif +static sbintime_t getnextcpuevent(int idle); +static sbintime_t getnextevent(void); +static int handleevents(sbintime_t now, int fake); static struct mtx et_hw_mtx; @@ -94,13 +92,11 @@ static struct mtx et_hw_mtx; } static struct eventtimer *timer = NULL; -static struct bintime timerperiod; /* Timer period for periodic mode. */ -static struct bintime hardperiod; /* hardclock() events period. */ -static struct bintime statperiod; /* statclock() events period. */ -static struct bintime profperiod; /* profclock() events period. */ -static struct bintime nexttick; /* Next global timer tick time. */ -static struct bintime nexthard; /* Next global hardlock() event. */ -static u_int busy = 0; /* Reconfiguration is in progress. */ +static sbintime_t timerperiod; /* Timer period for periodic mode. */ +static sbintime_t statperiod; /* statclock() events period. */ +static sbintime_t profperiod; /* profclock() events period. */ +static sbintime_t nexttick; /* Next global timer tick time. */ +static u_int busy = 1; /* Reconfiguration is in progress. */ static int profiling = 0; /* Profiling events enabled. */ static char timername[32]; /* Wanted timer. */ @@ -116,11 +112,6 @@ TUNABLE_INT("kern.eventtimer.idletick", SYSCTL_UINT(_kern_eventtimer, OID_AUTO, idletick, CTLFLAG_RW, &idletick, 0, "Run periodic events when idle"); -static u_int activetick = 1; /* Run all periodic events when active. */ -TUNABLE_INT("kern.eventtimer.activetick", &activetick); -SYSCTL_UINT(_kern_eventtimer, OID_AUTO, activetick, CTLFLAG_RW, &activetick, - 0, "Run all periodic events when active"); - static int periodic = 0; /* Periodic or one-shot mode. */ static int want_periodic = 0; /* What mode to prefer. */ TUNABLE_INT("kern.eventtimer.periodic", &want_periodic); @@ -129,31 +120,23 @@ struct pcpu_state { struct mtx et_hw_mtx; /* Per-CPU timer mutex. */ u_int action; /* Reconfiguration requests. */ u_int handle; /* Immediate handle resuests. */ - struct bintime now; /* Last tick time. */ - struct bintime nextevent; /* Next scheduled event on this CPU. */ - struct bintime nexttick; /* Next timer tick time. */ - struct bintime nexthard; /* Next hardlock() event. */ - struct bintime nextstat; /* Next statclock() event. */ - struct bintime nextprof; /* Next profclock() event. */ + sbintime_t now; /* Last tick time. */ + sbintime_t nextevent; /* Next scheduled event on this CPU. */ + sbintime_t nexttick; /* Next timer tick time. */ + sbintime_t nexthard; /* Next hardlock() event. */ + sbintime_t nextstat; /* Next statclock() event. */ + sbintime_t nextprof; /* Next profclock() event. */ + sbintime_t nextcall; /* Next callout event. */ + sbintime_t nextcallopt; /* Next optional callout event. */ #ifdef KDTRACE_HOOKS - struct bintime nextcyc; /* Next OpenSolaris cyclics event. */ + sbintime_t nextcyc; /* Next OpenSolaris cyclics event. */ #endif int ipi; /* This CPU needs IPI. */ int idle; /* This CPU is in idle mode. */ }; static DPCPU_DEFINE(struct pcpu_state, timerstate); - -#define FREQ2BT(freq, bt) \ -{ \ - (bt)->sec = 0; \ - (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ -} -#define BT2FREQ(bt) \ - (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ - ((bt)->frac >> 1)) - -#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt)) +DPCPU_DEFINE(sbintime_t, hardclocktime); /* * Timer broadcast IPI handler. @@ -161,7 +144,7 @@ static DPCPU_DEFINE(struct pcpu_state, t int hardclockintr(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; int done; @@ -169,10 +152,9 @@ hardclockintr(void) return (FILTER_HANDLED); state = DPCPU_PTR(timerstate); now = state->now; - CTR4(KTR_SPARE2, "ipi at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - done = handleevents(&now, 0); + CTR3(KTR_SPARE2, "ipi at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + done = handleevents(now, 0); return (done ? FILTER_HANDLED : FILTER_STRAY); } @@ -180,48 +162,43 @@ hardclockintr(void) * Handle all events for specified time on this CPU */ static int -handleevents(struct bintime *now, int fake) +handleevents(sbintime_t now, int fake) { - struct bintime t; + sbintime_t t, *hct; struct trapframe *frame; struct pcpu_state *state; - uintfptr_t pc; int usermode; int done, runs; - CTR4(KTR_SPARE2, "handle at %d: now %d.%08x%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - (u_int)(now->frac & 0xffffffff)); + CTR3(KTR_SPARE2, "handle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); done = 0; if (fake) { frame = NULL; usermode = 0; - pc = 0; } else { frame = curthread->td_intr_frame; usermode = TRAPF_USERMODE(frame); - pc = TRAPF_PC(frame); } state = DPCPU_PTR(timerstate); runs = 0; - while (bintime_cmp(now, &state->nexthard, >=)) { - bintime_addx(&state->nexthard, hardperiod.frac); + while (now >= state->nexthard) { + state->nexthard += tick_sbt; runs++; } if (runs) { - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 && - bintime_cmp(&state->nexthard, &nexthard, >)) - nexthard = state->nexthard; + hct = DPCPU_PTR(hardclocktime); + *hct = state->nexthard - tick_sbt; if (fake < 2) { hardclock_cnt(runs, usermode); done = 1; } } runs = 0; - while (bintime_cmp(now, &state->nextstat, >=)) { - bintime_addx(&state->nextstat, statperiod.frac); + while (now >= state->nextstat) { + state->nextstat += statperiod; runs++; } if (runs && fake < 2) { @@ -230,31 +207,29 @@ handleevents(struct bintime *now, int fa } if (profiling) { runs = 0; - while (bintime_cmp(now, &state->nextprof, >=)) { - bintime_addx(&state->nextprof, profperiod.frac); + while (now >= state->nextprof) { + state->nextprof += profperiod; runs++; } if (runs && !fake) { - profclock_cnt(runs, usermode, pc); + profclock_cnt(runs, usermode, TRAPF_PC(frame)); done = 1; } } else state->nextprof = state->nextstat; + if (now >= state->nextcallopt) { + state->nextcall = state->nextcallopt = INT64_MAX; + callout_process(now); + } #ifdef KDTRACE_HOOKS - if (fake == 0 && cyclic_clock_func != NULL && - state->nextcyc.sec != -1 && - bintime_cmp(now, &state->nextcyc, >=)) { - state->nextcyc.sec = -1; + if (fake == 0 && now >= state->nextcyc && cyclic_clock_func != NULL) { + state->nextcyc = INT64_MAX; (*cyclic_clock_func)(frame); } #endif - getnextcpuevent(&t, 0); - if (fake == 2) { - state->nextevent = t; - return (done); - } + t = getnextcpuevent(0); ET_HW_LOCK(state); if (!busy) { state->idle = 0; @@ -268,84 +243,81 @@ handleevents(struct bintime *now, int fa /* * Schedule binuptime of the next event on current CPU. */ -static void -getnextcpuevent(struct bintime *event, int idle) +static sbintime_t +getnextcpuevent(int idle) { - struct bintime tmp; + sbintime_t event; struct pcpu_state *state; - int skip; + u_int hardfreq; state = DPCPU_PTR(timerstate); - /* Handle hardclock() events. */ - *event = state->nexthard; - if (idle || (!activetick && !profiling && - (timer->et_flags & ET_FLAGS_PERCPU) == 0)) { - skip = idle ? 4 : (stathz / 2); - if (curcpu == CPU_FIRST() && tc_min_ticktock_freq > skip) - skip = tc_min_ticktock_freq; - skip = callout_tickstofirst(hz / skip) - 1; - CTR2(KTR_SPARE2, "skip at %d: %d", curcpu, skip); - tmp = hardperiod; - bintime_mul(&tmp, skip); - bintime_add(event, &tmp); - } + /* Handle hardclock() events, skipping some if CPU is idle. */ + event = state->nexthard; + if (idle) { + hardfreq = (u_int)hz / 2; + if (tc_min_ticktock_freq > 2 +#ifdef SMP + && curcpu == CPU_FIRST() +#endif + ) + hardfreq = hz / tc_min_ticktock_freq; + if (hardfreq > 1) + event += tick_sbt * (hardfreq - 1); + } + /* Handle callout events. */ + if (event > state->nextcall) + event = state->nextcall; if (!idle) { /* If CPU is active - handle other types of events. */ - if (bintime_cmp(event, &state->nextstat, >)) - *event = state->nextstat; - if (profiling && bintime_cmp(event, &state->nextprof, >)) - *event = state->nextprof; + if (event > state->nextstat) + event = state->nextstat; + if (profiling && event > state->nextprof) + event = state->nextprof; } #ifdef KDTRACE_HOOKS - if (state->nextcyc.sec != -1 && bintime_cmp(event, &state->nextcyc, >)) - *event = state->nextcyc; + if (event > state->nextcyc) + event = state->nextcyc; #endif + return (event); } /* * Schedule binuptime of the next event on all CPUs. */ -static void -getnextevent(struct bintime *event) +static sbintime_t +getnextevent(void) { struct pcpu_state *state; + sbintime_t event; #ifdef SMP int cpu; #endif - int c, nonidle; + int c; state = DPCPU_PTR(timerstate); - *event = state->nextevent; - c = curcpu; - nonidle = !state->idle; - if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + event = state->nextevent; + c = -1; #ifdef SMP - if (smp_started) { - CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; - state = DPCPU_ID_PTR(cpu, timerstate); - nonidle += !state->idle; - if (bintime_cmp(event, &state->nextevent, >)) { - *event = state->nextevent; - c = cpu; - } + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { + CPU_FOREACH(cpu) { + state = DPCPU_ID_PTR(cpu, timerstate); + if (event > state->nextevent) { + event = state->nextevent; + c = cpu; } } -#endif - if (nonidle != 0 && bintime_cmp(event, &nexthard, >)) - *event = nexthard; } - CTR5(KTR_SPARE2, "next at %d: next %d.%08x%08x by %d", - curcpu, event->sec, (u_int)(event->frac >> 32), - (u_int)(event->frac & 0xffffffff), c); +#endif + CTR4(KTR_SPARE2, "next at %d: next %d.%08x by %d", + curcpu, (int)(event >> 32), (u_int)(event & 0xffffffff), c); + return (event); } /* Hardware timer callback function. */ static void timercb(struct eventtimer *et, void *arg) { - struct bintime now; - struct bintime *next; + sbintime_t now; + sbintime_t *next; struct pcpu_state *state; #ifdef SMP int cpu, bcast; @@ -360,16 +332,14 @@ timercb(struct eventtimer *et, void *arg next = &state->nexttick; } else next = &nexttick; - binuptime(&now); - if (periodic) { - *next = now; - bintime_addx(next, timerperiod.frac); /* Next tick in 1 period. */ - } else - next->sec = -1; /* Next tick is not scheduled yet. */ + now = sbinuptime(); + if (periodic) + *next = now + timerperiod; + else + *next = -1; /* Next tick is not scheduled yet. */ state->now = now; - CTR4(KTR_SPARE2, "intr at %d: now %d.%08x%08x", - curcpu, (int)(now.sec), (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); + CTR3(KTR_SPARE2, "intr at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); #ifdef SMP /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ @@ -379,8 +349,8 @@ timercb(struct eventtimer *et, void *arg state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); state->now = now; - if (bintime_cmp(&now, &state->nextevent, >=)) { - state->nextevent.sec++; + if (now >= state->nextevent) { + state->nextevent += SBT_1S; if (curcpu != cpu) { state->ipi = 1; bcast = 1; @@ -392,7 +362,7 @@ timercb(struct eventtimer *et, void *arg #endif /* Handle events for this time on this CPU. */ - handleevents(&now, 0); + handleevents(now, 0); #ifdef SMP /* Broadcast interrupt to other CPUs for non-per-CPU timers. */ @@ -414,11 +384,11 @@ timercb(struct eventtimer *et, void *arg * Load new value into hardware timer. */ static void -loadtimer(struct bintime *now, int start) +loadtimer(sbintime_t now, int start) { struct pcpu_state *state; - struct bintime new; - struct bintime *next; + sbintime_t new; + sbintime_t *next; uint64_t tmp; int eq; @@ -433,30 +403,24 @@ loadtimer(struct bintime *now, int start * Try to start all periodic timers aligned * to period to make events synchronous. */ - tmp = ((uint64_t)now->sec << 36) + (now->frac >> 28); - tmp = (tmp % (timerperiod.frac >> 28)) << 28; - new.sec = 0; - new.frac = timerperiod.frac - tmp; - if (new.frac < tmp) /* Left less then passed. */ - bintime_addx(&new, timerperiod.frac); + tmp = now % timerperiod; + new = timerperiod - tmp; + if (new < tmp) /* Left less then passed. */ + new += timerperiod; CTR5(KTR_SPARE2, "load p at %d: now %d.%08x first in %d.%08x", - curcpu, now->sec, (u_int)(now->frac >> 32), - new.sec, (u_int)(new.frac >> 32)); - *next = new; - bintime_add(next, now); - et_start(timer, bttosbt(new), bttosbt(timerperiod)); + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff), + (int)(new >> 32), (u_int)(new & 0xffffffff)); + *next = new + now; + et_start(timer, new, timerperiod); } } else { - getnextevent(&new); - eq = bintime_cmp(&new, next, ==); - CTR5(KTR_SPARE2, "load at %d: next %d.%08x%08x eq %d", - curcpu, new.sec, (u_int)(new.frac >> 32), - (u_int)(new.frac & 0xffffffff), - eq); + new = getnextevent(); + eq = (new == *next); + CTR4(KTR_SPARE2, "load at %d: next %d.%08x eq %d", + curcpu, (int)(new >> 32), (u_int)(new & 0xffffffff), eq); if (!eq) { *next = new; - bintime_sub(&new, now); - et_start(timer, bttosbt(new), 0); + et_start(timer, new - now, 0); } } } @@ -478,7 +442,7 @@ setuptimer(void) while (freq < (profiling ? profhz : stathz)) freq += hz; freq = round_freq(timer, freq); - FREQ2BT(freq, &timerperiod); + timerperiod = SBT_1S / freq; } /* @@ -487,15 +451,15 @@ setuptimer(void) static int doconfigtimer(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; state = DPCPU_PTR(timerstate); switch (atomic_load_acq_int(&state->action)) { case 1: - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); - loadtimer(&now, 1); + loadtimer(now, 1); ET_HW_UNLOCK(state); state->handle = 0; atomic_store_rel_int(&state->action, 0); @@ -509,8 +473,8 @@ doconfigtimer(void) return (1); } if (atomic_readandclear_int(&state->handle) && !busy) { - binuptime(&now); - handleevents(&now, 0); + now = sbinuptime(); + handleevents(now, 0); return (1); } return (0); @@ -523,40 +487,45 @@ doconfigtimer(void) static void configtimer(int start) { - struct bintime now, next; + sbintime_t now, next; struct pcpu_state *state; int cpu; if (start) { setuptimer(); - binuptime(&now); - } + now = sbinuptime(); + } else + now = 0; critical_enter(); ET_HW_LOCK(DPCPU_PTR(timerstate)); if (start) { /* Initialize time machine parameters. */ - next = now; - bintime_addx(&next, timerperiod.frac); + next = now + timerperiod; if (periodic) nexttick = next; else - nexttick.sec = -1; + nexttick = -1; CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); state->now = now; - state->nextevent = next; + if (!smp_started && cpu != CPU_FIRST()) + state->nextevent = INT64_MAX; + else + state->nextevent = next; if (periodic) state->nexttick = next; else - state->nexttick.sec = -1; + state->nexttick = -1; state->nexthard = next; state->nextstat = next; state->nextprof = next; + state->nextcall = next; + state->nextcallopt = next; hardclock_sync(cpu); } busy = 0; /* Start global timer or per-CPU timer of this CPU. */ - loadtimer(&now, 1); + loadtimer(now, 1); } else { busy = 1; /* Stop global timer or per-CPU timer of this CPU. */ @@ -629,12 +598,11 @@ cpu_initclocks_bsp(void) state = DPCPU_ID_PTR(cpu, timerstate); mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN); #ifdef KDTRACE_HOOKS - state->nextcyc.sec = -1; + state->nextcyc = INT64_MAX; #endif + state->nextcall = INT64_MAX; + state->nextcallopt = INT64_MAX; } -#ifdef SMP - callout_new_inserted = cpu_new_callout; -#endif periodic = want_periodic; /* Grab requested timer or the best of present. */ if (timername[0]) @@ -698,9 +666,10 @@ cpu_initclocks_bsp(void) profhz = round_freq(timer, stathz * 64); } tick = 1000000 / hz; - FREQ2BT(hz, &hardperiod); - FREQ2BT(stathz, &statperiod); - FREQ2BT(profhz, &profperiod); + tick_sbt = SBT_1S / hz; + tick_bt = sbttobt(tick_sbt); + statperiod = SBT_1S / stathz; + profperiod = SBT_1S / profhz; ET_LOCK(); configtimer(1); ET_UNLOCK(); @@ -712,18 +681,22 @@ cpu_initclocks_bsp(void) void cpu_initclocks_ap(void) { - struct bintime now; + sbintime_t now; struct pcpu_state *state; + struct thread *td; state = DPCPU_PTR(timerstate); - binuptime(&now); + now = sbinuptime(); ET_HW_LOCK(state); state->now = now; hardclock_sync(curcpu); - handleevents(&state->now, 2); - if (timer->et_flags & ET_FLAGS_PERCPU) - loadtimer(&now, 1); + spinlock_enter(); ET_HW_UNLOCK(state); + td = curthread; + td->td_intr_nesting_level++; + handleevents(state->now, 2); + td->td_intr_nesting_level--; + spinlock_exit(); } /* @@ -772,7 +745,7 @@ cpu_stopprofclock(void) sbintime_t cpu_idleclock(void) { - struct bintime now, t; + sbintime_t now, t; struct pcpu_state *state; if (idletick || busy || @@ -786,19 +759,17 @@ cpu_idleclock(void) if (periodic) now = state->now; else - binuptime(&now); - CTR4(KTR_SPARE2, "idle at %d: now %d.%08x%08x", - curcpu, now.sec, (u_int)(now.frac >> 32), - (u_int)(now.frac & 0xffffffff)); - getnextcpuevent(&t, 1); + now = sbinuptime(); + CTR3(KTR_SPARE2, "idle at %d: now %d.%08x", + curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); + t = getnextcpuevent(1); ET_HW_LOCK(state); state->idle = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Tue Mar 5 00:52:24 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C0B3323; Tue, 5 Mar 2013 00:52:24 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0DBF6AA; Tue, 5 Mar 2013 00:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r250qNXH060171; Tue, 5 Mar 2013 00:52:23 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r250qEkk060105; Tue, 5 Mar 2013 00:52:14 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201303050052.r250qEkk060105@svn.freebsd.org> From: Colin Percival Date: Tue, 5 Mar 2013 00:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247826 - in user/cperciva: freebsd-update-build freebsd-update-build/patches freebsd-update-build/patches/5.5-RELEASE freebsd-update-build/patches/6.0-RELEASE freebsd-update-build/patc... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 00:52:24 -0000 Author: cperciva Date: Tue Mar 5 00:52:14 2013 New Revision: 247826 URL: http://svnweb.freebsd.org/changeset/base/247826 Log: Add FreeBSD Update build and mirroring code (formerly in the now-defunct CVS projects repository). Added: user/cperciva/freebsd-update-build/ user/cperciva/freebsd-update-build/README user/cperciva/freebsd-update-build/USAGE user/cperciva/freebsd-update-build/build-upgrade-patches.sh (contents, props changed) user/cperciva/freebsd-update-build/patches/ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-mail0.nr user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-ms.diffs user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-newvers.sh (contents, props changed) user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-pxin0.n user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-vi.ref user/cperciva/freebsd-update-build/patches/6.0-RELEASE/ user/cperciva/freebsd-update-build/patches/6.0-RELEASE/0-cm.4 (contents, props changed) user/cperciva/freebsd-update-build/patches/6.1-RELEASE/ user/cperciva/freebsd-update-build/patches/6.2-RELEASE/ user/cperciva/freebsd-update-build/patches/6.3-RELEASE/ user/cperciva/freebsd-update-build/patches/6.4-RELEASE/ user/cperciva/freebsd-update-build/patches/7.0-RELEASE/ user/cperciva/freebsd-update-build/patches/7.1-RELEASE/ user/cperciva/freebsd-update-build/patches/7.2-RELEASE/ user/cperciva/freebsd-update-build/patches/7.3-RELEASE/ user/cperciva/freebsd-update-build/patches/7.4-RELEASE/ user/cperciva/freebsd-update-build/patches/8.0-RELEASE/ user/cperciva/freebsd-update-build/patches/8.1-RELEASE/ user/cperciva/freebsd-update-build/patches/8.2-RELEASE/ user/cperciva/freebsd-update-build/patches/8.3-RELEASE/ user/cperciva/freebsd-update-build/patches/9.0-RELEASE/ user/cperciva/freebsd-update-build/patches/9.0-RELEASE/0-clang.patch user/cperciva/freebsd-update-build/patches/9.1-RELEASE/ user/cperciva/freebsd-update-build/scripts/ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/ user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/ user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/ user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/ user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/ user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/ user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/ user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/ user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/ user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/ user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/ user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/ user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/amd64/ user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/amd64/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/build.subr user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/i386/ user/cperciva/freebsd-update-build/scripts/9.1-RELEASE/i386/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/approve.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/build.conf (contents, props changed) user/cperciva/freebsd-update-build/scripts/build.subr user/cperciva/freebsd-update-build/scripts/diff.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/encryptkey.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/init.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/make.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/mountkey.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/multi.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/restage.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/umountkey.sh (contents, props changed) user/cperciva/freebsd-update-build/scripts/upload.sh (contents, props changed) user/cperciva/freebsd-update-build/src/ user/cperciva/freebsd-update-build/src/Makefile (contents, props changed) user/cperciva/freebsd-update-build/src/findstamps.c (contents, props changed) user/cperciva/freebsd-update-build/src/unstamp.c (contents, props changed) user/cperciva/freebsd-update-build/tools/ user/cperciva/freebsd-update-build/tools/build-upgrade-patches.sh (contents, props changed) user/cperciva/freebsd-update-mirror/ user/cperciva/freebsd-update-mirror/umirror-init.sh (contents, props changed) user/cperciva/freebsd-update-mirror/umirror-package.sh (contents, props changed) user/cperciva/freebsd-update-mirror/umirror-release.sh (contents, props changed) user/cperciva/freebsd-update-mirror/umirror.sh (contents, props changed) Added: user/cperciva/freebsd-update-build/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/README Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,39 @@ +$FreeBSD$ + +This directory contains FreeBSD Update build code. + +File Description +---- ----------- +scripts/build.subr The routines which do all the work. + +scripts/build.conf Configuration settings. + +scripts/*.sh User-accessible scripts. + +scripts/X.Y-Z/bar/build.conf Configuration for FreeBSD/bar X.Y-Z + +scripts/X.Y-Z/build.subr and These files, if present, can override +scripts/X.Y-Z/bar/build.subr the routines defined in scripts/build.subr + in order to provide special treatment for + a particular release or platform. + +src/findstamp.c Utility for comparing two binaries which + were built from the same source code and + printing out the locations where they + differ due to timestamps. + +src/unstamp.c Utility for erasing timestamps found by + findstamp.c. + +patches/X.Y-Z/0-* Patches to FreeBSD X.Y-Z which we pretend + were part of the release. In FreeBSD 5.5 + and FreeBSD 6.0 some of these are necessary + in order to get rid of some problematic + timestamps. + +patches/X.Y-Z/W-* Patches to FreeBSD X.Y-Z. These are applied + in order of increasing W (assuming it is an + integer), so a naming convention of setting + W equal to the FreeBSD patch level (e.g., 9 + for FreeBSD 6.0-RELEASE-p9) is strongly + recommended. Added: user/cperciva/freebsd-update-build/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/USAGE Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,86 @@ +$FreeBSD$ + +How to use the FreeBSD Update build code +======================================== + +0. Extract the files in this directory and the src, scripts, and +patches subdirectories somewhere; /usr/freebsd-update-server/ is a +good option. + +1. Edit scripts/build.conf as appropriate. + +2. Run `scripts/make.sh'. This will build some binaries, create some +directories, and generate an RSA signing key. You will be prompted to +enter a passphrase with which to encrypt the signing key. + +3. Run `scripts/init.sh ${ARCHITECTURE} ${RELEASE}' for each pair +(architecture, release) for which you want to be able to build updates. +Note that as of 6.1-RELEASE, cross-building releases doesn't work (some +files don't cross-build correctly); but once those problems are fixed +it will be possible to cross build updates. + +4. Read the output of each `init.sh' run, and check that everything +looks right. Problem signs to watch out for include: + * Files which are listed as "built but not released". + * Files which are listed as "released but not build". + * Files listed are "differ by more than contents" (this would include +files which have incorrect permissions or file flags). + * A very long list of files listed as "differ between release and build". + * A list of build stamps which includes any non-text characters. + +5. Run `scripts/mountkey.sh' to prepare the signing key for use. + +6. Run `scripts/approve.sh ${ARCHITECTURE} ${RELEASE}' for each +architecture / release pair. This signs the build, prepares it for +uploading, and "commits" various internal bookkeeping changes (e.g., +the list of locations of build stamps) in order to prepare for the +next build. + +7. Run `scripts/umountkey.sh' to remove the unencrypted signing key +from memory. + +8. Run `scripts/upload.sh ${ARCHITECTURE} ${RELEASE}' to upload the +files to your server. + +9. For each security / errata update, copy the patch distributed by the +security team into the appropriate `patches/${RELEASE}' directory(s), +and run `scripts/diff.sh ${ARCHITECTURE} ${RELEASE} ${PATCHNUM}', where +${PATCHNUM} is the patch number (e.g., 9 for 6.0-RELEASE-p9). + +10. Assuming the output from `diff.sh' looks ok, repeat steps 5-8 to +sign and upload the binary updates built. + +Tips +---- + +* If you want to allow two different users to sign updates, have the +person who ran `make.sh' run `mountkey.sh' to mount the key, then have +the other(s) run `encryptkey.sh' to save a copy of the key encrypted +with their own passphrase. (Obviously, everybody involved must use +su or sudo to become root in order to do this.) + +* If you want to distribute and update a customized version of FreeBSD, +there are two options: + + 1. Building a custom release. If you have a custom release and the + source code in your custom-build ISO matches the binaries you are + distributing, everything will Just Work once you edit the appropriate + build.conf files to reflect the location and SHA256 hash of the custom + release ISO. + + 2. Treating local customizations as a patch. Construct a patch file + via `cd /usr/src && cvs diff' (note that the patches MUST be relative + to /usr/src), and place it into the appropriate patches directory. + Run `diff.sh' specifying a patch number of zero; then install the + original FreeBSD release onto systems and use the FreeBSD Update + client to download "updates"; they will end up with your customized + release. + +* If something goes wrong in the `diff' run and you need to modify the +build by hand, BE VERY CAREFUL and modify the files in newworld/R/trees +and the build manifest newworld-index. Then run `restage.sh' before +running `approve.sh'. + +* If you're building updates for multiple releases, the `multi.sh' script +can be very helpful. It will run the same operation (e.g., "diff") on a +number of architectures and releases, and log the output of each. Added: user/cperciva/freebsd-update-build/build-upgrade-patches.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/build-upgrade-patches.sh Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,52 @@ +#!/bin/sh + +if [ $# -lt 3 ]; then + echo "usage: $0 ARCH TARGETREL OLDRELS" + exit 1 +fi + +BASEDIR=/usr/freebsd-update-server +ARCH=$1 +TARGETREL=$2 +OLDRELS=$3 + +WWWDIR=${BASEDIR}/pub + +mkdir -p ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/ +for V in ${OLDRELS}; do + zcat ${WWWDIR}/${V}/${ARCH}/m/* | + cut -f 3,4,9 -d '|' | + fgrep '|f|' | + cut -f 1,3 -d '|' | + sort -u | + grep -E '\|[0-9a-f]{64}' | + lam -s "${V}|" - +done | + sort -k 2,2 -t '|' > hashtab + +zcat ${WWWDIR}/${TARGETREL}/${ARCH}/m/* | + cut -f 3,4,9 -d '|' | + fgrep '|f|' | + cut -f 1,3 -d '|' | + sort -u | + grep -E '\|[0-9a-f]{64}' | + lam -s "${TARGETREL}|" - | + sort -k 2,2 -t '|' | + join -1 2 -2 2 -t '|' hashtab - | + cut -f 2- -d '|' | + sort -k 2,2 -t '|' | + tr '|' ' ' | + while read OR OH NR NH; do + if [ -f ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/${OH}-${NH} ]; then + continue + fi + if [ ${OH} = ${NH} ]; then + continue + fi + gunzip < ${WWWDIR}/${OR}/${ARCH}/f/${OH}.gz > ${OH} + gunzip < ${WWWDIR}/${NR}/${ARCH}/f/${NH}.gz > ${NH} + bsdiff ${OH} ${NH} ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/${OH}-${NH} + rm ${OH} ${NH} + done + +rm hashtab Added: user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-mail0.nr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-mail0.nr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,15 @@ +Index: usr.bin/mail/USD.doc/mail0.nr +=================================================================== +RCS file: /home/ncvs/src/usr.bin/mail/USD.doc/mail0.nr,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -u -I__FBSDID -r1.1 -r1.2 +--- usr.bin/mail/USD.doc/mail0.nr 27 May 1994 12:32:07 -0000 1.1 ++++ usr.bin/mail/USD.doc/mail0.nr 17 Aug 2005 15:56:04 -0000 1.2 +@@ -66,6 +66,5 @@ + Version 5.5 + + +-\*(td + .)l + .pn 2 Added: user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-ms.diffs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-ms.diffs Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,13 @@ +Index: share/doc/usd/18.msdiffs/ms.diffs +=================================================================== +RCS file: /home/ncvs/src/share/doc/usd/18.msdiffs/ms.diffs,v +retrieving revision 1.2 +retrieving revision 1.3 +diff -u -I__FBSDID -r1.2 -r1.3 +--- share/doc/usd/18.msdiffs/ms.diffs 1 Jan 2003 18:48:47 -0000 1.2 ++++ share/doc/usd/18.msdiffs/ms.diffs 1 Aug 2005 12:10:14 -0000 1.3 +@@ -286,4 +286,3 @@ + The code for the \*ms package lives in /usr/lib/tmac/tmac.s, + and sourced files reside in the directory /usr/ucb/lib/ms. + .sp +-.tl '''\*(DY' Added: user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-newvers.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-newvers.sh Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,31 @@ +Index: sys/conf/newvers.sh +--- sys/conf/newvers.sh 23 May 2006 04:09:11 -0000 ++++ sys/conf/newvers.sh 27 Aug 2006 01:55:22 -0000 +@@ -33,6 +33,9 @@ + TYPE="FreeBSD" + REVISION="5.5" + BRANCH="RELEASE" ++if [ "X${BRANCH_OVERRIDE}" != "X" ]; then ++ BRANCH=${BRANCH_OVERRIDE} ++fi + RELEASE=5.5-RELEASE + VERSION="${TYPE} ${RELEASE}" + +@@ -85,10 +88,14 @@ + i=`${MAKE:-make} -V KERN_IDENT` + cat << EOF > vers.c + $COPYRIGHT +-char sccs[] = "@(#)${VERSION} #${v}: ${t}"; +-char version[] = "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n"; ++#define SCCSSTR "@(#)${VERSION} #${v}: ${t}" ++#define VERSTR "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n" ++#define RELSTR "${RELEASE}" ++ ++char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; ++char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; + char ostype[] = "${TYPE}"; +-char osrelease[] = "${RELEASE}"; ++char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; + int osreldate = ${RELDATE}; + char kern_ident[] = "${i}"; + EOF Added: user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-pxin0.n ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-pxin0.n Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,15 @@ +Index: share/doc/papers/px/pxin0.n +=================================================================== +RCS file: /home/ncvs/src/share/doc/papers/px/Attic/pxin0.n,v +retrieving revision 1.2 +diff -u -I__FBSDID -r1.2 pxin0.n +--- share/doc/papers/px/pxin0.n 30 Nov 2000 17:06:28 -0000 1.2 ++++ share/doc/papers/px/pxin0.n 16 Jul 2006 00:19:53 -0000 +@@ -32,6 +32,7 @@ + .\" @(#)pxin0.n 5.2 (Berkeley) 4/17/91 + .\" $FreeBSD: src/share/doc/papers/px/pxin0.n,v 1.2 2000/11/30 17:06:28 ru Exp $ + .\" ++.ND 17 Apr 1991 + .RP + .TL + Berkeley Pascal Added: user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-vi.ref ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/5.5-RELEASE/0-vi.ref Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,16 @@ +Index: contrib/nvi/docs/USD.doc/vi.ref/vi.ref +=================================================================== +RCS file: /home/ncvs/src/contrib/nvi/docs/USD.doc/vi.ref/vi.ref,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -u -I__FBSDID -r1.1 -r1.2 +--- contrib/nvi/docs/USD.doc/vi.ref/vi.ref 1 Nov 1996 06:45:34 -0000 1.1 ++++ contrib/nvi/docs/USD.doc/vi.ref/vi.ref 17 Aug 2005 15:56:04 -0000 1.2 +@@ -27,7 +27,6 @@ + University of California, Berkeley + Berkeley, California 94720 + .sp 1 +-\*(td + .)l + .sp 3 + .(l C Added: user/cperciva/freebsd-update-build/patches/6.0-RELEASE/0-cm.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/6.0-RELEASE/0-cm.4 Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,17 @@ +Index: share/man/man4/cm.4 +=================================================================== +RCS file: /home/ncvs/src/share/man/man4/cm.4,v +retrieving revision 1.6.2.1 +retrieving revision 1.6.2.2 +diff -u -I__FBSDID -r1.6.2.1 -r1.6.2.2 +--- share/man/man4/cm.4 24 Sep 2005 01:59:37 -0000 1.6.2.1 ++++ share/man/man4/cm.4 2 Feb 2006 07:50:00 -0000 1.6.2.2 +@@ -25,7 +25,7 @@ + .\" + .\" $FreeBSD$ + .\" +-.Dd July 16,2005 ++.Dd July 16, 2005 + .Dt CM 4 + .Os + .Sh NAME Added: user/cperciva/freebsd-update-build/patches/9.0-RELEASE/0-clang.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/patches/9.0-RELEASE/0-clang.patch Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,11 @@ +Index: lib/clang/clang.build.mk +--- lib/clang/clang.build.mk 2011-10-20 05:42:19.000000000 -0700 ++++ lib/clang/clang.build.mk 2011-10-20 05:42:54.000000000 -0700 +@@ -6,6 +6,7 @@ + -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ + -I${LLVM_SRCS}/../../lib/clang/include \ + -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ ++ -frandom-seed=RepeatabilityConsideredGood \ + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG + + # Correct for gcc miscompilation when compiling on PPC with -O2 Added: user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=f71eedf18ab24d973c938b473ca127018eb87ab1d1b4c96a5d8d1e9cd8f261d3 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="" + +# EOL date +export EOL=1212303600 + Added: user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/5.5-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,13 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=40d41ec7b567e7952d0f85729f340d409911368808256dae123ff1b97155c1ae + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs \ + compat1x compat20 compat21 compat22 compat3x compat4x" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="" + +# EOL date +export EOL=1212303600 Added: user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=449b08c98acc73508219e2a19de0787334fd9237123346b2c7949c3009540170 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="" + +# EOL date +export EOL=1164960000 + Added: user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.0-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,13 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=0ad601dae704e941beb7d4617bf96b04055849a24835275c716f518eee7a12f1 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="" + +# EOL date +export EOL=1164960000 + Added: user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=99f596f65f7860f2f7d1be7b926faab7c3a3561d8659527127ca39760afb0e00 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1212303600 + Added: user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.1-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,13 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=cbc6f9389c85f3130baff5270316ece18d5e324e82f8aa167c61ab49174dd4d1 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1212303600 + Added: user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=60d2d13a23c0e6ecac5547c5e83c53c378c37ae40a04ef4f5f0964c79955cc6f + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1212303600 Added: user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.2-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=2099715d561df721833322bc56a4fa8b02c2b77713a1e0bc17fc4b2dded20212 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1212303600 Added: user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=6ee1c2f00f8a1bc9d38b04b058b0549df9904ded52ddd19bae9dad070a5868e3 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1264982400 Added: user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.3-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=15081a56d184a18c7cc3a5c3cd0d7d5b7d9304c9cc1d5fc40d875b0fd3047721 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1264982400 Added: user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=6e8f24e153d78518268129db62e5efd3cd7b75e428a3c22bddf89eb901efa79e + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1291161600 Added: user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/6.4-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=c4f688013a27632e97caefc71296f59c9597abdb4e724385130d72dbd9abd218 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5 \ + lib libexec release rescue sbin secure share sys tools \ + ubin usbin" +export KERNELPARTS="generic smp" + +# EOL date +export EOL=1291161600 Added: user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=d3b206eb74df7559041dd9054de7352b9a67d4f350e75f433c7fb001bf4b5c6f + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl compat contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1241136000 Added: user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.0-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=7480c74dda9a78805ab0d647b23eb71cac43f4afce83ff65ad9f2019423583af + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl compat contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1241136000 Added: user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=4f7deebbd5e3211d144c6e630b808e918fcbb901ff4689b64087ed4c2d6e781d + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1296518400 Added: user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.1-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=58e588c26d06b84d8c3c01d8507b2ffe2e237b167f72604c82d34011dc850a46 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1296518400 Added: user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=1ea1f6f652d7c5f5eab7ef9f8edbed50cb664b08ed761850f95f48e86cc71ef5 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1277942400 Added: user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.2-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=bf4d00102215b07f5a4c8acac80b9d9bd9bf8bd93ac554fe09b21302f0b41380 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1277942400 Added: user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=7f5970e095774c0cdf802e9a15b4419d0166fa7641c2b65f1a1431429105b98b + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1333238400 Added: user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.3-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=e1623209b45df700e624ed37d8526b298fddc48af14e40fbe8a62c0b3801819b + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1333238400 Added: user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=c6d560a010808929570818c6e5947ff4e488085de690dd2d8489d393cf59ddd2 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1362096000 Added: user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/7.4-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=3a4437fbd10a516f365d169457f9413fe1e8cbc28792935edd83145bd4d20f9d + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1362096000 Added: user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=7d4583c20c651093b208170a7fd4ed5f38ee5af0cbe19fb742f67175a9fee10f + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1291161600 Added: user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/build.subr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,6 @@ +# Add extra docs to ${WORKDIR}/$1 +addextradocs () { + log "Extracting extra docs" + + # 8.0 doesn't have any extra docs +} Added: user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.0-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=d7ef47a76a20a716c006a635b476ed3515830b8442ded2702ed015f0bde32bcf + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1291161600 Added: user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=2b87563d876cfe6095d1a7fef164d0eb0d63a6a889320b4bb91f138dc29e01e1 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1343779200 Added: user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/build.subr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,6 @@ +# Add extra docs to ${WORKDIR}/$1 +addextradocs () { + log "Extracting extra docs" + + # 8.0 doesn't have any extra docs +} Added: user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.1-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=7b80c34ad0cb49ace8def6261561ab22ab9346c58b69e79a82c148682a62bdc1 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1343779200 Added: user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=009938b49e9b989277fe93aae474b054918acaca5f5919fbabdfcb0b04cd8c60 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1343779200 Added: user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/build.subr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,6 @@ +# Add extra docs to ${WORKDIR}/$1 +addextradocs () { + log "Extracting extra docs" + + # 8.0 doesn't have any extra docs +} Added: user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.2-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,12 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=fbfc3950674b3845a6cf0b74bd175b9ba19475b97bdc8bef23b50344bc33866c + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1343779200 Added: user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +# SHA256 hash of RELEASE disc1.iso image. +export RELH=26d4870f3a310a95e488ed14dd8e36eb52e857878f2b238b3b91e65c101eee93 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info lib32 manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1398902400 Added: user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/build.subr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,6 @@ +# Add extra docs to ${WORKDIR}/$1 +addextradocs () { + log "Extracting extra docs" + + # 8.0 doesn't have any extra docs +} Added: user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/i386/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/8.3-RELEASE/i386/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,13 @@ +# SHA256 hash of RELEASE disc1.iso image. +export RELH=a83919b5104d8ec4e905693a6bd6b90b88b1c30923029146d1dab62b62a038e9 + +# Components of the world, source, and kernels +export WORLDPARTS="base catpages dict doc games info manpages proflibs" +export SOURCEPARTS="base bin cddl contrib crypto etc games gnu \ + include krb5 lib libexec release rescue sbin secure \ + share sys tools ubin usbin" +export KERNELPARTS="generic" + +# EOL date +export EOL=1398902400 + Added: user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/amd64/build.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/amd64/build.conf Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,11 @@ +# SHA256 hash of dvd1.iso image. +export RELH=bcc69320cd2f227411d55967113abc8ffa5ede0a6526090ca3fb5ab776fead9d + +# Components of the world, source, and kernels +export WORLDPARTS="base doc games lib32" +export SOURCEPARTS="src" +export KERNELPARTS="kernel" + +# EOL date +# Mon 1 Apr 2013 00:00:00 UTC +export EOL=1364774400 Added: user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/build.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/cperciva/freebsd-update-build/scripts/9.0-RELEASE/build.subr Tue Mar 5 00:52:14 2013 (r247826) @@ -0,0 +1,199 @@ +# Overrides to FreeBSD Update build subroutines for FreeBSD 9.0. + +# Download and verify a release ISO image. +fetchiso () { + log "Starting fetch" + + # Figure out where the disc1 ISO image is + RELNUM=${REL%-*} +# ISO=${FTP}/${TARGET}/ISO-IMAGES/${RELNUM}/${REL}-${TARGET}-disc1.iso + ISO=${FTP}/FreeBSD-${REL}-${TARGET}-disc1.iso + + # Fetch the ISO image. We consider the ISO image to be + # the One True Release and don't look at the files used + # for FTP installs. The FreeBSD 4.7-RELEASE ISO and FTP + # files were not identical, but this should never happen + # again. + fetch -o ${WORKDIR}/iso.img -rR ${ISO} 2>&1 + + log "Verifying dvd1 hash" + + # Check that the downloaded ISO has the correct hash. + if ! [ "`sha256 -q ${WORKDIR}/iso.img`" = "${RELH}" ]; then + echo "FreeBSD ${REL}-${TARGET}-dvd1.iso has incorrect hash." + rm ${WORKDIR}/iso.img + return 1 + fi +} + +# Extract the released trees and, if appropriate, construct a world (base +# plus source code) in which to perform builds. +extractiso () { + # Create and mount a md(4) attached to the ISO image. + ISOMD=`mdconfig -a -t vnode -f ${WORKDIR}/iso.img -n` + mkdir -p ${WORKDIR}/iso + mount -t cd9660 -o ro,nosuid /dev/md${ISOMD} ${WORKDIR}/iso + + # Extract the various components into different directories + log "Extracting components" + for C in ${WORLDPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/world/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/world/${C} + done + for C in ${KERNELPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/kernel/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/kernel/${C} + done + for C in ${SOURCEPARTS}; do + mkdir -p ${WORKDIR}/release/R/trees/src/${C} + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/release/R/trees/src/${C} + done + + # If the release ISO we're handling belongs to the platform + # we're running right now, create a world image for future use. + if [ ${TARGET} = ${HOSTPLATFORM} ]; then + log "Constructing world+src image" + + # Create directory for world + mkdir ${WORKDIR}/world/ + + # Extract world and source distributions + for C in ${WORLDPARTS}; do + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/world/ + done + for C in ${SOURCEPARTS}; do + cat ${WORKDIR}/iso/usr/freebsd-dist/${C}.txz | + tar -xpzf - -C ${WORKDIR}/world/ + done + + # build a single tarball of them. + tar -czf ${WORKDIR}/../world.tgz -C ${WORKDIR}/world . + + # clean up + nuke world + fi + + # Unmount and detach the ISO image md(4). + umount ${WORKDIR}/iso + rmdir ${WORKDIR}/iso + mdconfig -d -u ${ISOMD} +} + +# Perform a build in ${WORKDIR}/$1 with BRANCH_OVERRIDE set to $2 +buildworld () { + # We need a devfs inside the jail. Note that we are using a + # jail here in order to keep the environment as "clean" as + # possible, not for security reasons; we assume that the + # original source code plus patches we add personally will + # not do anything evil. + mount -t devfs devfs ${WORKDIR}/$1/dev + + # We need to be able to set file flags + sysctl security.jail.chflags_allowed=1 >/dev/null + + # Build stuff. + jail ${WORKDIR}/$1 ${BUILDHOSTNAME} 127.1.2.3 \ + /usr/bin/env -i PATH=${PATH} RELP=${RELP} \ + BRANCH_OVERRIDE=$2 JFLAG=${JFLAG} \ + TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ + /bin/sh -e <<-"EOF" 2>&1 >${WORKDIR}/$1-build.log + # Function for logging what we're doing + log () { + echo "`date` $1 for FreeBSD/${TARGET} ${RELP}" 1>&2 + } + + # Build the world + log "Building world" + cd /usr/src && + make buildworld ${JFLAG} 2>&1 + + # Build and kernel + log "Building kernel" + cd /usr/src && + make buildkernel ${JFLAG} 2>&1 + + # Build and install release images + log "Building release" + cd /usr/src/release && + make release 2>&1 && + make install DESTDIR=/R 2>&1 + EOF + + # Put all the components into the right places. + log "Moving components into staging area" + jail ${WORKDIR}/$1 ${BUILDHOSTNAME} 127.1.2.3 \ + /usr/bin/env -i PATH=${PATH} \ + WORLDPARTS="${WORLDPARTS}" \ + KERNELPARTS="${KERNELPARTS}" \ + SOURCEPARTS="${SOURCEPARTS}" \ + /bin/sh -e <<-"EOF" 2>&1 >>${WORKDIR}/$1-build.log + # Create area for uncompressed components + mkdir -p /R/trees *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Mar 7 23:37:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAAEAFD4; Thu, 7 Mar 2013 23:37:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB055ABB; Thu, 7 Mar 2013 23:37:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NbAmC055522; Thu, 7 Mar 2013 23:37:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NbAqn055520; Thu, 7 Mar 2013 23:37:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303072337.r27NbAqn055520@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Mar 2013 23:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247969 - user/attilio/vmc-playground/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:37:11 -0000 Author: attilio Date: Thu Mar 7 23:37:10 2013 New Revision: 247969 URL: http://svnweb.freebsd.org/changeset/base/247969 Log: Improve comments. Sponsored by: EMC / Isilon storage division Submitted by: mdf Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c Modified: user/attilio/vmc-playground/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmc-playground/sys/vm/vm_radix.c Thu Mar 7 23:35:06 2013 (r247968) +++ user/attilio/vmc-playground/sys/vm/vm_radix.c Thu Mar 7 23:37:10 2013 (r247969) @@ -35,10 +35,10 @@ * of this code must achieve highest possible performance. * * The implementation takes into account the following rationale: - * - Size of the nodes might be as small as possible. + * - Size of the nodes should be as small as possible. * - There is no bias toward lookup operations over inserts or removes, * and vice-versa. - * - In average there are not many complete levels, than level + * - On average not many nodes are expected to be full, hence level * compression may just complicate things. */ @@ -222,7 +222,7 @@ vm_radix_keydiff(vm_pindex_t index1, vm_ for (clev = 0; clev <= VM_RADIX_LIMIT ; clev++) if (vm_radix_slot(index1, clev)) return (clev); - panic("%s: it might have not reached this point", __func__); + panic("%s: cannot reach this point", __func__); return (0); } @@ -508,9 +508,9 @@ restart: * available bisection node, or to the smaller value * in the current domain (if the owner is bigger than the * search key). - * The search for a valid bisection node is helped through - * the use of maplevels array which should bring immediately - * a lower useful level, skipping holes. + * The maplevels array records any node has been seen + * at a given level. This aids the search for a valid + * bisection node. */ if (vm_radix_keybarr(rnode, index)) { difflev = vm_radix_keydiff(index, rnode->rn_owner); @@ -597,9 +597,9 @@ restart: * available bisection node, or to the higher value * in the current domain (if the owner is smaller than the * search key). - * The search for a valid bisection node is helped through - * the use of maplevels array which should bring immediately - * a lower useful level, skipping holes. + * The maplevels array records any node has been seen + * at a given level. This aids the search for a valid + * bisection node. */ if (vm_radix_keybarr(rnode, index)) { difflev = vm_radix_keydiff(index, rnode->rn_owner); From owner-svn-src-user@FreeBSD.ORG Thu Mar 7 23:43:09 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42B1371C; Thu, 7 Mar 2013 23:43:09 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25EF0AFC; Thu, 7 Mar 2013 23:43:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27Nh9OE058087; Thu, 7 Mar 2013 23:43:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27Nh4ra058057; Thu, 7 Mar 2013 23:43:04 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303072343.r27Nh4ra058057@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Mar 2013 23:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247973 - in user/attilio/vmcontention: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/tools/ctf/cvt contrib/openpam/doc/man contrib/openpam/lib crypto/openssh etc lib/libc... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:43:09 -0000 Author: attilio Date: Thu Mar 7 23:43:03 2013 New Revision: 247973 URL: http://svnweb.freebsd.org/changeset/base/247973 Log: MFC Added: user/attilio/vmcontention/lib/libyaml/libbsdyml.3 - copied unchanged from r247970, head/lib/libyaml/libbsdyml.3 user/attilio/vmcontention/sys/dev/drm2/drm_global.c - copied unchanged from r247970, head/sys/dev/drm2/drm_global.c user/attilio/vmcontention/sys/dev/drm2/drm_global.h - copied unchanged from r247970, head/sys/dev/drm2/drm_global.h user/attilio/vmcontention/sys/dev/drm2/ttm/ - copied from r247970, head/sys/dev/drm2/ttm/ user/attilio/vmcontention/usr.sbin/pkg/config.c - copied unchanged from r247970, head/usr.sbin/pkg/config.c user/attilio/vmcontention/usr.sbin/pkg/config.h - copied unchanged from r247970, head/usr.sbin/pkg/config.h Deleted: user/attilio/vmcontention/sbin/mount_ext2fs/ user/attilio/vmcontention/sbin/mount_reiserfs/ user/attilio/vmcontention/sbin/mount_std/ Modified: user/attilio/vmcontention/UPDATING user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zdb/zdb.c user/attilio/vmcontention/cddl/contrib/opensolaris/tools/ctf/cvt/output.c user/attilio/vmcontention/contrib/openpam/doc/man/openpam_straddch.3 user/attilio/vmcontention/contrib/openpam/lib/openpam_readline.c user/attilio/vmcontention/contrib/openpam/lib/openpam_readword.c user/attilio/vmcontention/crypto/openssh/FREEBSD-upgrade user/attilio/vmcontention/crypto/openssh/config.h user/attilio/vmcontention/etc/portsnap.conf user/attilio/vmcontention/lib/libc/string/Makefile.inc user/attilio/vmcontention/lib/libstand/Makefile user/attilio/vmcontention/lib/libutil/gr_util.c user/attilio/vmcontention/lib/libutil/libutil.h user/attilio/vmcontention/lib/libyaml/Makefile user/attilio/vmcontention/sbin/ipfw/ipfw2.c user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.8 user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.c user/attilio/vmcontention/sbin/mount_msdosfs/mount_msdosfs.c user/attilio/vmcontention/sbin/mount_nfs/mount_nfs.c user/attilio/vmcontention/sbin/mount_nullfs/mount_nullfs.c user/attilio/vmcontention/sbin/mount_udf/Makefile user/attilio/vmcontention/sbin/mount_udf/mount_udf.c user/attilio/vmcontention/sbin/mount_unionfs/mount_unionfs.c user/attilio/vmcontention/share/man/man4/eventtimers.4 user/attilio/vmcontention/share/man/man4/zyd.4 user/attilio/vmcontention/share/man/man7/development.7 user/attilio/vmcontention/share/man/man7/ports.7 user/attilio/vmcontention/share/man/man9/Makefile user/attilio/vmcontention/share/man/man9/condvar.9 user/attilio/vmcontention/share/man/man9/sleep.9 user/attilio/vmcontention/share/man/man9/sleepqueue.9 user/attilio/vmcontention/share/man/man9/timeout.9 user/attilio/vmcontention/sys/amd64/conf/GENERIC user/attilio/vmcontention/sys/amd64/conf/NOTES user/attilio/vmcontention/sys/arm/arm/swtch.S user/attilio/vmcontention/sys/arm/arm/vm_machdep.c user/attilio/vmcontention/sys/arm/broadcom/bcm2835/bcm2835_dma.c user/attilio/vmcontention/sys/arm/include/frame.h user/attilio/vmcontention/sys/cam/ctl/ctl.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c user/attilio/vmcontention/sys/conf/files.amd64 user/attilio/vmcontention/sys/conf/files.i386 user/attilio/vmcontention/sys/conf/options user/attilio/vmcontention/sys/contrib/altq/altq/altq_hfsc.c user/attilio/vmcontention/sys/contrib/altq/altq/altq_hfsc.h user/attilio/vmcontention/sys/dev/drm2/drmP.h user/attilio/vmcontention/sys/dev/drm2/drm_drv.c user/attilio/vmcontention/sys/dev/drm2/drm_gem.c user/attilio/vmcontention/sys/dev/drm2/drm_mm.c user/attilio/vmcontention/sys/dev/drm2/drm_mm.h user/attilio/vmcontention/sys/dev/hwpmc/hwpmc_soft.c user/attilio/vmcontention/sys/dev/ixgbe/LICENSE user/attilio/vmcontention/sys/dev/ixgbe/ixgbe.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_82598.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_82599.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_82599.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_api.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_api.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_common.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_common.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_mbx.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_osdep.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_phy.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_phy.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_type.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_vf.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_vf.h user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_x540.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe_x540.h user/attilio/vmcontention/sys/dev/ixgbe/ixv.c user/attilio/vmcontention/sys/dev/nvme/nvme.c user/attilio/vmcontention/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmcontention/sys/dev/oce/oce_hw.c user/attilio/vmcontention/sys/dev/oce/oce_hw.h user/attilio/vmcontention/sys/dev/oce/oce_if.c user/attilio/vmcontention/sys/dev/oce/oce_if.h user/attilio/vmcontention/sys/dev/oce/oce_mbox.c user/attilio/vmcontention/sys/dev/oce/oce_queue.c user/attilio/vmcontention/sys/dev/oce/oce_sysctl.c user/attilio/vmcontention/sys/dev/oce/oce_util.c user/attilio/vmcontention/sys/dev/random/randomdev_soft.c user/attilio/vmcontention/sys/dev/sound/pci/hda/hdaa_patches.c user/attilio/vmcontention/sys/dev/sound/pci/hda/hdac.h user/attilio/vmcontention/sys/dev/sound/pci/hda/hdacc.c user/attilio/vmcontention/sys/dev/syscons/syscons.c user/attilio/vmcontention/sys/dev/syscons/syscons.h user/attilio/vmcontention/sys/dev/virtio/block/virtio_blk.c user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c user/attilio/vmcontention/sys/geom/part/g_part.c user/attilio/vmcontention/sys/geom/part/g_part.h user/attilio/vmcontention/sys/geom/part/g_part_mbr.c user/attilio/vmcontention/sys/geom/raid/md_ddf.c user/attilio/vmcontention/sys/i386/conf/GENERIC user/attilio/vmcontention/sys/i386/conf/NOTES user/attilio/vmcontention/sys/kern/kern_clock.c user/attilio/vmcontention/sys/kern/kern_event.c user/attilio/vmcontention/sys/kern/kern_resource.c user/attilio/vmcontention/sys/kern/kern_time.c user/attilio/vmcontention/sys/kern/kern_timeout.c user/attilio/vmcontention/sys/kern/subr_log.c user/attilio/vmcontention/sys/kern/sys_generic.c user/attilio/vmcontention/sys/modules/drm2/drm2/Makefile user/attilio/vmcontention/sys/modules/uart/Makefile user/attilio/vmcontention/sys/net/route.c user/attilio/vmcontention/sys/netinet/siftr.c user/attilio/vmcontention/sys/sparc64/pci/psycho.c user/attilio/vmcontention/sys/sys/diskmbr.h user/attilio/vmcontention/sys/sys/param.h user/attilio/vmcontention/sys/sys/pmckern.h user/attilio/vmcontention/tools/tools/cxgbetool/cxgbetool.c user/attilio/vmcontention/usr.bin/c89/c89.c user/attilio/vmcontention/usr.bin/c99/c99.c user/attilio/vmcontention/usr.sbin/bhyve/acpi.c user/attilio/vmcontention/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmcontention/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmcontention/usr.sbin/pkg/Makefile user/attilio/vmcontention/usr.sbin/pkg/pkg.c user/attilio/vmcontention/usr.sbin/rtadvd/rtadvd.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/openpam/ (props changed) user/attilio/vmcontention/crypto/openssh/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/usr.sbin/bhyve/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvd/ (props changed) Modified: user/attilio/vmcontention/UPDATING ============================================================================== --- user/attilio/vmcontention/UPDATING Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/UPDATING Thu Mar 7 23:43:03 2013 (r247973) @@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130304: + Recent commits to callout(9) changed the size of struct callout, + so the KBI is probably heavily disturbed. Also, some functions + in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced + by macros. Every kernel module using it won't load, so rebuild + is requested. + + The ctl device has been re-enabled in GENERIC for i386 and amd64, + but does not initialize by default (because of the new CTL_DISABLE + option) to save memory. To re-enable it, remove the CTL_DISABLE + option from the kernel config file or set kern.cam.ctl.disable=0 + in /boot/loader.conf. + 20130301: The ctl device has been disabled in GENERIC for i386 and amd64. This was done due to the extra memory being allocated at system Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 7 23:43:03 2013 (r247973) @@ -1189,7 +1189,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1199,31 +1199,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1242,14 +1267,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1272,7 +1307,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2529,10 +2564,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- user/attilio/vmcontention/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 23:43:03 2013 (r247973) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,7 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: - match.iim_file = match.iim_name; + bname = strrchr(match.iim_name, '/'); + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts; Modified: user/attilio/vmcontention/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- user/attilio/vmcontention/contrib/openpam/doc/man/openpam_straddch.3 Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/contrib/openpam/doc/man/openpam_straddch.3 Thu Mar 7 23:43:03 2013 (r247973) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: user/attilio/vmcontention/contrib/openpam/lib/openpam_readline.c ============================================================================== --- user/attilio/vmcontention/contrib/openpam/lib/openpam_readline.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/contrib/openpam/lib/openpam_readline.c Thu Mar 7 23:43:03 2013 (r247973) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: user/attilio/vmcontention/contrib/openpam/lib/openpam_readword.c ============================================================================== --- user/attilio/vmcontention/contrib/openpam/lib/openpam_readword.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/contrib/openpam/lib/openpam_readword.c Thu Mar 7 23:43:03 2013 (r247973) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; Modified: user/attilio/vmcontention/crypto/openssh/FREEBSD-upgrade ============================================================================== --- user/attilio/vmcontention/crypto/openssh/FREEBSD-upgrade Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/crypto/openssh/FREEBSD-upgrade Thu Mar 7 23:43:03 2013 (r247973) @@ -43,6 +43,7 @@ 7) Run configure with the appropriate arguments: $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --disable-lastlog --disable-utmp --disable-wtmp \ --with-pam --with-tcp-wrappers --with-libedit \ --with-ssl-engine Modified: user/attilio/vmcontention/crypto/openssh/config.h ============================================================================== --- user/attilio/vmcontention/crypto/openssh/config.h Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/crypto/openssh/config.h Thu Mar 7 23:43:03 2013 (r247973) @@ -17,6 +17,9 @@ /* Define if your resolver libs need this for getrrsetbyname */ /* #undef BIND_8_COMPAT */ +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + /* Define if cmsg_type is not passed correctly */ /* #undef BROKEN_CMSG_TYPE */ @@ -97,7 +100,7 @@ /* #undef DISABLE_FD_PASSING */ /* Define if you don't want to use lastlog */ -/* #undef DISABLE_LASTLOG */ +#define DISABLE_LASTLOG 1 /* Define if you don't want to use your system's login() call */ /* #undef DISABLE_LOGIN */ @@ -307,7 +310,7 @@ #define HAVE_DECL__GETSHORT 0 /* Define if you have /dev/ptmx */ -#define HAVE_DEV_PTMX 1 +/* #undef HAVE_DEV_PTMX */ /* Define if you have /dev/ptc */ /* #undef HAVE_DEV_PTS_AND_PTC */ @@ -316,7 +319,7 @@ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the `dirfd' function. */ -/* #undef HAVE_DIRFD */ +#define HAVE_DIRFD 1 /* Define to 1 if you have the `dirname' function. */ #define HAVE_DIRNAME 1 @@ -501,6 +504,9 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 +/* Define to 1 if you have the `HMAC_CTX_init' function. */ +#define HAVE_HMAC_CTX_INIT 1 + /* Define if you have ut_host in utmp.h */ /* #undef HAVE_HOST_IN_UTMP */ @@ -552,6 +558,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LASTLOG_H */ +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ @@ -594,10 +603,19 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_IF_TUN_H */ -/* Define if your libraries define login() */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* Define to 1 if you have the `login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ @@ -805,6 +823,9 @@ /* Define to 1 if you have the `setgroups' function. */ #define HAVE_SETGROUPS 1 +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + /* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 @@ -931,6 +952,9 @@ /* Define to 1 if you have the `strmode' function. */ #define HAVE_STRMODE 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strnvis' function. */ /* #undef HAVE_STRNVIS */ @@ -1172,7 +1196,7 @@ /* #undef HAVE_VHANGUP */ /* Define to 1 if you have the header file. */ -#define HAVE_VIS_H 1 +/* #undef HAVE_VIS_H */ /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 @@ -1351,15 +1375,21 @@ /* Sandbox using setrlimit(2) */ #define SANDBOX_RLIMIT 1 +/* Sandbox using seccomp filter */ +/* #undef SANDBOX_SECCOMP_FILTER */ + +/* setrlimit RLIMIT_FSIZE works */ +/* #undef SANDBOX_SKIP_RLIMIT_FSIZE */ + /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ +/* Specify the system call convention in use */ +/* #undef SECCOMP_AUDIT_ARCH */ + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ -/* The size of `char', as computed by sizeof. */ -#define SIZEOF_CHAR 1 - /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -1500,6 +1530,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ Modified: user/attilio/vmcontention/etc/portsnap.conf ============================================================================== --- user/attilio/vmcontention/etc/portsnap.conf Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/etc/portsnap.conf Thu Mar 7 23:43:03 2013 (r247973) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 Modified: user/attilio/vmcontention/lib/libc/string/Makefile.inc ============================================================================== --- user/attilio/vmcontention/lib/libc/string/Makefile.inc Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/lib/libc/string/Makefile.inc Thu Mar 7 23:43:03 2013 (r247973) @@ -46,7 +46,8 @@ MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 -MLINKS+=strchr.3 strrchr.3 +MLINKS+=strchr.3 strrchr.3 \ + strchr.3 strchrnul.3 MLINKS+=strcmp.3 strncmp.3 MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ Modified: user/attilio/vmcontention/lib/libstand/Makefile ============================================================================== --- user/attilio/vmcontention/lib/libstand/Makefile Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/lib/libstand/Makefile Thu Mar 7 23:43:03 2013 (r247973) @@ -67,6 +67,9 @@ SRCS+= divsi3.S .else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c Modified: user/attilio/vmcontention/lib/libutil/gr_util.c ============================================================================== --- user/attilio/vmcontention/lib/libutil/gr_util.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/lib/libutil/gr_util.c Thu Mar 7 23:43:03 2013 (r247973) @@ -49,6 +49,8 @@ static char group_dir[PATH_MAX]; static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; +static size_t grmemlen(const struct group *, const char *, int *); +static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); /* * Initialize statics @@ -429,90 +431,121 @@ gr_make(const struct group *gr) struct group * gr_dup(const struct group *gr) { + return (gr_add(gr, NULL)); +} +/* + * Add a new member name to a struct group. + */ +struct group * +gr_add(const struct group *gr, const char *newmember) +{ struct group *newgr; - char *dst; size_t len; - int ndx; int num_mem; - /* Calculate size of the group. */ - len = sizeof(*newgr); - if (gr->gr_name != NULL) - len += strlen(gr->gr_name) + 1; - if (gr->gr_passwd != NULL) - len += strlen(gr->gr_passwd) + 1; - if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) - len += strlen(gr->gr_mem[num_mem]) + 1; - len += (num_mem + 1) * sizeof(*gr->gr_mem); - } else - num_mem = -1; + num_mem = 0; + len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ if ((newgr = malloc(len)) == NULL) return (NULL); - /* point new gr_mem to end of struct + 1 */ - if (gr->gr_mem != NULL) + return (grcopy(gr, newgr, newmember, num_mem)); +} + +/* It is safer to walk the pointers given at gr_mem since there is no + * guarantee the gr_mem + strings are continguous in the given struct group + * but compact the new group into the following form. + * + * The new struct is laid out like this in memory. The example given is + * for a group with two members only. + * + * { + * (char *name) + * (char *passwd) + * (int gid) + * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area + * gr_mem area + * (member1 *) + * (member2 *) + * (NULL) + * (name string) + * (passwd string) + * (member1 string) + * (member2 string) + * } + */ +/* + * Copy the guts of a group plus given name to a preallocated group struct + */ +static struct group * +grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +{ + char *dst; + int i; + + if (name != NULL) + ndx++; + /* point new gr_mem to end of struct + 1 if there are names */ + if (ndx != 0) newgr->gr_mem = (char **)(newgr + 1); else newgr->gr_mem = NULL; /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[num_mem + 1]; + dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; - } else { + } else newgr->gr_name = NULL; - } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; - } else { + } else newgr->gr_passwd = NULL; - } newgr->gr_gid = gr->gr_gid; - if (gr->gr_mem != NULL) { - for (ndx = 0; ndx < num_mem; ndx++) { - newgr->gr_mem[ndx] = dst; - dst = stpcpy(dst, gr->gr_mem[ndx]) + 1; + if (ndx != 0) { + for (i = 0; gr->gr_mem[i] != NULL; i++) { + newgr->gr_mem[i] = dst; + dst = stpcpy(dst, gr->gr_mem[i]) + 1; + } + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; } - newgr->gr_mem[ndx] = NULL; + newgr->gr_mem[i] = NULL; } return (newgr); } /* - * Add a new member name to a struct group. + * Calculate length of a struct group + given name */ -struct group * -gr_add(struct group *gr, char *newmember) +static size_t +grmemlen(const struct group *gr, const char *name, int *num_mem) { - size_t mlen; - int num_mem=0; - char **members; - struct group *newgr; - - if (newmember == NULL) - return(gr_dup(gr)); + size_t len; + int i; + if (gr == NULL) + return (0); + /* Calculate size of the group. */ + len = sizeof(*gr); + if (gr->gr_name != NULL) + len += strlen(gr->gr_name) + 1; + if (gr->gr_passwd != NULL) + len += strlen(gr->gr_passwd) + 1; if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) { - if (strcmp(gr->gr_mem[num_mem], newmember) == 0) { - errno = EEXIST; - return (NULL); - } + for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + len += strlen(gr->gr_mem[i]) + 1; + len += sizeof(*gr->gr_mem); } + *num_mem = i; } - /* Allocate enough for current pointers + 1 more and NULL marker */ - mlen = (num_mem + 2) * sizeof(*gr->gr_mem); - if ((members = malloc(mlen)) == NULL) - return (NULL); - memcpy(members, gr->gr_mem, num_mem * sizeof(*gr->gr_mem)); - members[num_mem++] = newmember; - members[num_mem] = NULL; - gr->gr_mem = members; - newgr = gr_dup(gr); - free(members); - return (newgr); + if (name != NULL) { + len += strlen(name) + 1; + if (gr->gr_mem == NULL) + len += sizeof(*gr->gr_mem); + } + return(len); } /* Modified: user/attilio/vmcontention/lib/libutil/libutil.h ============================================================================== --- user/attilio/vmcontention/lib/libutil/libutil.h Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/lib/libutil/libutil.h Thu Mar 7 23:43:03 2013 (r247973) @@ -167,7 +167,7 @@ int gr_copy(int __ffd, int _tfd, const struct group * gr_dup(const struct group *_gr); struct group * - gr_add(struct group *_gr, char *_newmember); + gr_add(const struct group *_gr, const char *_newmember); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); Modified: user/attilio/vmcontention/lib/libyaml/Makefile ============================================================================== --- user/attilio/vmcontention/lib/libyaml/Makefile Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/lib/libyaml/Makefile Thu Mar 7 23:43:03 2013 (r247973) @@ -7,6 +7,7 @@ SHLIB_MAJOR= 0 INCS= bsdyml.h SRCS= api.c dumper.c emitter.c loader.c \ parser.c reader.c scanner.c writer.c +MAN= libbsdyml.3 .PATH: ${LIBYAML}/src ${LIBYAML}/include CLEANFILES= bsdyml.h Copied: user/attilio/vmcontention/lib/libyaml/libbsdyml.3 (from r247970, head/lib/libyaml/libbsdyml.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/lib/libyaml/libbsdyml.3 Thu Mar 7 23:43:03 2013 (r247973, copy of r247970, head/lib/libyaml/libbsdyml.3) @@ -0,0 +1,61 @@ +.\" Copyright (c) 2013 Baptiste Daroussin +.\" 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 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$ +.\" +.Dd March 05, 2013 +.Dt LIBBSDYML 3 +.Os +.Sh NAME +.Nm libbsdyml +.Nd LibYAML library for parsing and emitting YAML +.Sh SYNOPSIS +.In bsdyml.h +.Sh DESCRIPTION +The +.Nm +library is a verbatim copy of the LibYAML version 0.1.4 +.Pp +The +.Nm +library is intended to be used within the +.Fx +base system only. +Use of the +.Nm +library for other purposes is not supported and discouraged. +.Pp +To avoid version and autoconfiguration issues, the library has been +renamed to +.Nm +rather than retain the original LibYAML library and include file names +to prevent confusion and autoconfiguration issues for 3rd party +software. +.Sh SEE ALSO +For full documentation, please see the LibYAML webpage at +.Pa http://pyyaml.org/wiki/LibYAML . +.Sh AUTHORS +.An -nosplit +The original LibYAML was written by +.An Kirill Simonov Aq xi@resolvent.net . Modified: user/attilio/vmcontention/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmcontention/sbin/ipfw/ipfw2.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/ipfw/ipfw2.c Thu Mar 7 23:43:03 2013 (r247973) @@ -3083,9 +3083,14 @@ chkarg: } else { len = sizeof(c->max_log); if (sysctlbyname("net.inet.ip.fw.verbose_limit", - &c->max_log, &len, NULL, 0) == -1) + &c->max_log, &len, NULL, 0) == -1) { + if (co.test_only) { + c->max_log = 0; + break; + } errx(1, "sysctlbyname(\"%s\")", "net.inet.ip.fw.verbose_limit"); + } } } break; @@ -3986,9 +3991,13 @@ ipfw_table_handler(int ac, char *av[]) mask = 0; // XXX uninitialized ? len = sizeof(tables_max); if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, - NULL, 0) == -1) - errx(1, "Can't determine maximum number of ipfw tables. " - "Perhaps you forgot to load ipfw module?"); + NULL, 0) == -1) { + if (co.test_only) + tables_max = 128; /* Old conservative default */ + else + errx(1, "Can't determine maximum number of ipfw tables." + " Perhaps you forgot to load ipfw module?"); + } memset(&xent, 0, sizeof(xent)); Modified: user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.8 Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.8 Thu Mar 7 23:43:03 2013 (r247973) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd October 3, 2005 +.Dd March 5, 2013 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -80,7 +80,7 @@ See the man page for possible options and their meanings. The following cd9660 specific options are available: .Pp -.Bl -tag -width "nostrictjoliet" -compact +.Bl -tag -width "brokenjoliet" -compact .It Cm extatt Same as .Fl e . @@ -93,7 +93,7 @@ Same as .It Cm norrip Same as .Fl r . -.It Cm nostrictjoliet +.It Cm brokenjoliet Same as .Fl b . .El Modified: user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_cd9660/mount_cd9660.c Thu Mar 7 23:43:03 2013 (r247973) @@ -83,7 +83,7 @@ main(int argc, char **argv) { struct iovec *iov; int iovlen; - int ch, mntflags, opts; + int ch, mntflags; char *dev, *dir, *p, *val, mntpath[MAXPATHLEN]; int verbose; int ssector; /* starting sector, 0 for 1st session */ @@ -91,7 +91,7 @@ main(int argc, char **argv) iov = NULL; iovlen = 0; - mntflags = opts = verbose = 0; + mntflags = verbose = 0; ssector = -1; while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) @@ -109,7 +109,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); p = strchr(optarg, '='); val = NULL; if (p != NULL) { Modified: user/attilio/vmcontention/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_msdosfs/mount_msdosfs.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_msdosfs/mount_msdosfs.c Thu Mar 7 23:43:03 2013 (r247973) @@ -69,7 +69,7 @@ main(int argc, char **argv) struct iovec *iov = NULL; int iovlen = 0; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; + int c, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; char errmsg[255] = {0}; @@ -78,9 +78,8 @@ main(int argc, char **argv) mode_t mask = 0, dirmask = 0; uid_t uid = 0; gid_t gid = 0; - getmnt_silent = 1; - mntflags = set_gid = set_uid = set_mask = set_dirmask = 0; + set_gid = set_uid = set_mask = set_dirmask = 0; while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) { switch (c) { @@ -219,7 +218,7 @@ main(int argc, char **argv) build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0]) err(1, "%s: %s", dev, errmsg); else Modified: user/attilio/vmcontention/sbin/mount_nfs/mount_nfs.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_nfs/mount_nfs.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_nfs/mount_nfs.c Thu Mar 7 23:43:03 2013 (r247973) @@ -130,7 +130,7 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +static int fallback_mount(struct iovec *iov, int iovlen); static int sec_name_to_num(char *sec); static char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); @@ -149,13 +149,12 @@ main(int argc, char *argv[]) { int c; struct iovec *iov; - int mntflags, num, iovlen; + int num, iovlen; int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; - mntflags = 0; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -427,10 +426,10 @@ main(int argc, char *argv[]) */ osversion = getosreldate(); if (osversion >= 702100) { - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(1, "%s, %s", mntpath, errmsg); } else { - if (fallback_mount(iov, iovlen, mntflags)) + if (fallback_mount(iov, iovlen)) err(1, "%s, %s", mntpath, errmsg); } @@ -473,7 +472,7 @@ copyopt(struct iovec **newiov, int *newi * parameters. It should be eventually be removed. */ static int -fallback_mount(struct iovec *iov, int iovlen, int mntflags) +fallback_mount(struct iovec *iov, int iovlen) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - return nmount(newiov, newiovlen, mntflags); + return nmount(newiov, newiovlen, 0); } static int Modified: user/attilio/vmcontention/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_nullfs/mount_nullfs.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_nullfs/mount_nullfs.c Thu Mar 7 23:43:03 2013 (r247973) @@ -68,12 +68,11 @@ main(int argc, char *argv[]) char source[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; - int ch, mntflags, iovlen; + int ch, iovlen; char nullfs[] = "nullfs"; iov = NULL; iovlen = 0; - mntflags = 0; errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { @@ -111,7 +110,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); else Modified: user/attilio/vmcontention/sbin/mount_udf/Makefile ============================================================================== --- user/attilio/vmcontention/sbin/mount_udf/Makefile Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_udf/Makefile Thu Mar 7 23:43:03 2013 (r247973) @@ -9,7 +9,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys .PATH: ${MOUNT} -WARNS?= 1 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: user/attilio/vmcontention/sbin/mount_udf/mount_udf.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_udf/mount_udf.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_udf/mount_udf.c Thu Mar 7 23:43:03 2013 (r247973) @@ -73,18 +73,19 @@ void usage(void); int main(int argc, char **argv) { - struct iovec iov[12]; - int ch, i, mntflags, opts, udf_flags; - char *dev, *dir, mntpath[MAXPATHLEN]; - char *cs_disk, *cs_local; - int verbose; + char mntpath[MAXPATHLEN]; + char fstype[] = "udf"; + struct iovec *iov; + char *cs_disk, *cs_local, *dev, *dir; + int ch, i, iovlen, mntflags, udf_flags, verbose; - i = mntflags = opts = udf_flags = verbose = 0; + i = iovlen = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; + iov = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); break; case 'v': verbose++; @@ -120,32 +121,13 @@ main(int argc, char **argv) */ mntflags |= MNT_RDONLY; - iov[i].iov_base = "fstype"; - iov[i++].iov_len = sizeof("fstype"); - iov[i].iov_base = "udf"; - iov[i].iov_len = strlen(iov[i].iov_base) + 1; - i++; - iov[i].iov_base = "fspath"; - iov[i++].iov_len = sizeof("fspath"); - iov[i].iov_base = mntpath; - iov[i++].iov_len = strlen(mntpath) + 1; - iov[i].iov_base = "from"; - iov[i++].iov_len = sizeof("from"); - iov[i].iov_base = dev; - iov[i++].iov_len = strlen(dev) + 1; - iov[i].iov_base = "flags"; - iov[i++].iov_len = sizeof("flags"); - iov[i].iov_base = &udf_flags; - iov[i++].iov_len = sizeof(udf_flags); + build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); + build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); + build_iovec(&iov, &iovlen, "flags", &udf_flags, sizeof(udf_flags)); if (udf_flags & UDFMNT_KICONV) { - iov[i].iov_base = "cs_disk"; - iov[i++].iov_len = sizeof("cs_disk"); - iov[i].iov_base = cs_disk; - iov[i++].iov_len = strlen(cs_disk) + 1; - iov[i].iov_base = "cs_local"; - iov[i++].iov_len = sizeof("cs_local"); - iov[i].iov_base = cs_local; - iov[i++].iov_len = strlen(cs_local) + 1; + build_iovec(&iov, &iovlen, "cs_disk", cs_disk, (size_t)-1); + build_iovec(&iov, &iovlen, "cs_local", cs_local, (size_t)-1); } if (nmount(iov, i, mntflags) < 0) err(1, "%s", dev); Modified: user/attilio/vmcontention/sbin/mount_unionfs/mount_unionfs.c ============================================================================== --- user/attilio/vmcontention/sbin/mount_unionfs/mount_unionfs.c Thu Mar 7 23:41:57 2013 (r247972) +++ user/attilio/vmcontention/sbin/mount_unionfs/mount_unionfs.c Thu Mar 7 23:43:03 2013 (r247973) @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { struct iovec *iov; - int ch, mntflags, iovlen; + int ch, iovlen; char source [MAXPATHLEN], target[MAXPATHLEN], errmsg[255]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Mar 7 23:52:20 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ABA32F4C; Thu, 7 Mar 2013 23:52:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E58BB4A; Thu, 7 Mar 2013 23:52:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r27NqKPr061236; Thu, 7 Mar 2013 23:52:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r27NqFu0061205; Thu, 7 Mar 2013 23:52:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303072352.r27NqFu0061205@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Mar 2013 23:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247979 - in user/attilio/vmc-playground: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/tools/ctf/cvt contrib/openpam/doc/man contrib/openpam/lib crypto/openssh etc lib/li... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 23:52:20 -0000 Author: attilio Date: Thu Mar 7 23:52:15 2013 New Revision: 247979 URL: http://svnweb.freebsd.org/changeset/base/247979 Log: Merge from vmcontention Added: user/attilio/vmc-playground/lib/libyaml/libbsdyml.3 - copied unchanged from r247975, user/attilio/vmcontention/lib/libyaml/libbsdyml.3 user/attilio/vmc-playground/sys/dev/drm2/drm_global.c - copied unchanged from r247975, user/attilio/vmcontention/sys/dev/drm2/drm_global.c user/attilio/vmc-playground/sys/dev/drm2/drm_global.h - copied unchanged from r247975, user/attilio/vmcontention/sys/dev/drm2/drm_global.h user/attilio/vmc-playground/sys/dev/drm2/ttm/ - copied from r247975, user/attilio/vmcontention/sys/dev/drm2/ttm/ user/attilio/vmc-playground/usr.sbin/pkg/config.c - copied unchanged from r247975, user/attilio/vmcontention/usr.sbin/pkg/config.c user/attilio/vmc-playground/usr.sbin/pkg/config.h - copied unchanged from r247975, user/attilio/vmcontention/usr.sbin/pkg/config.h Deleted: user/attilio/vmc-playground/sbin/mount_ext2fs/ user/attilio/vmc-playground/sbin/mount_reiserfs/ user/attilio/vmc-playground/sbin/mount_std/ Modified: user/attilio/vmc-playground/UPDATING user/attilio/vmc-playground/cddl/contrib/opensolaris/cmd/zdb/zdb.c user/attilio/vmc-playground/cddl/contrib/opensolaris/tools/ctf/cvt/output.c user/attilio/vmc-playground/contrib/openpam/doc/man/openpam_straddch.3 user/attilio/vmc-playground/contrib/openpam/lib/openpam_readline.c user/attilio/vmc-playground/contrib/openpam/lib/openpam_readword.c user/attilio/vmc-playground/crypto/openssh/FREEBSD-upgrade user/attilio/vmc-playground/crypto/openssh/config.h user/attilio/vmc-playground/etc/portsnap.conf user/attilio/vmc-playground/lib/libc/string/Makefile.inc user/attilio/vmc-playground/lib/libstand/Makefile user/attilio/vmc-playground/lib/libutil/gr_util.c user/attilio/vmc-playground/lib/libutil/libutil.h user/attilio/vmc-playground/lib/libyaml/Makefile user/attilio/vmc-playground/sbin/ipfw/ipfw2.c user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.8 user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.c user/attilio/vmc-playground/sbin/mount_msdosfs/mount_msdosfs.c user/attilio/vmc-playground/sbin/mount_nfs/mount_nfs.c user/attilio/vmc-playground/sbin/mount_nullfs/mount_nullfs.c user/attilio/vmc-playground/sbin/mount_udf/Makefile user/attilio/vmc-playground/sbin/mount_udf/mount_udf.c user/attilio/vmc-playground/sbin/mount_unionfs/mount_unionfs.c user/attilio/vmc-playground/share/man/man4/eventtimers.4 user/attilio/vmc-playground/share/man/man4/zyd.4 user/attilio/vmc-playground/share/man/man7/development.7 user/attilio/vmc-playground/share/man/man7/ports.7 user/attilio/vmc-playground/share/man/man9/Makefile user/attilio/vmc-playground/share/man/man9/condvar.9 user/attilio/vmc-playground/share/man/man9/sleep.9 user/attilio/vmc-playground/share/man/man9/sleepqueue.9 user/attilio/vmc-playground/share/man/man9/timeout.9 user/attilio/vmc-playground/sys/amd64/conf/GENERIC user/attilio/vmc-playground/sys/amd64/conf/NOTES user/attilio/vmc-playground/sys/arm/arm/swtch.S user/attilio/vmc-playground/sys/arm/arm/vm_machdep.c user/attilio/vmc-playground/sys/arm/broadcom/bcm2835/bcm2835_dma.c user/attilio/vmc-playground/sys/arm/include/frame.h user/attilio/vmc-playground/sys/cam/ctl/ctl.c user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c user/attilio/vmc-playground/sys/conf/files.amd64 user/attilio/vmc-playground/sys/conf/files.i386 user/attilio/vmc-playground/sys/conf/options user/attilio/vmc-playground/sys/contrib/altq/altq/altq_hfsc.c user/attilio/vmc-playground/sys/contrib/altq/altq/altq_hfsc.h user/attilio/vmc-playground/sys/dev/drm2/drmP.h user/attilio/vmc-playground/sys/dev/drm2/drm_drv.c user/attilio/vmc-playground/sys/dev/drm2/drm_gem.c user/attilio/vmc-playground/sys/dev/drm2/drm_mm.c user/attilio/vmc-playground/sys/dev/drm2/drm_mm.h user/attilio/vmc-playground/sys/dev/hwpmc/hwpmc_soft.c user/attilio/vmc-playground/sys/dev/ixgbe/LICENSE user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_82598.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_82599.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_82599.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_api.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_api.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_common.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_common.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_mbx.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_osdep.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_phy.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_phy.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_type.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_vf.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_vf.h user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_x540.c user/attilio/vmc-playground/sys/dev/ixgbe/ixgbe_x540.h user/attilio/vmc-playground/sys/dev/ixgbe/ixv.c user/attilio/vmc-playground/sys/dev/nvme/nvme.c user/attilio/vmc-playground/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmc-playground/sys/dev/oce/oce_hw.c user/attilio/vmc-playground/sys/dev/oce/oce_hw.h user/attilio/vmc-playground/sys/dev/oce/oce_if.c user/attilio/vmc-playground/sys/dev/oce/oce_if.h user/attilio/vmc-playground/sys/dev/oce/oce_mbox.c user/attilio/vmc-playground/sys/dev/oce/oce_queue.c user/attilio/vmc-playground/sys/dev/oce/oce_sysctl.c user/attilio/vmc-playground/sys/dev/oce/oce_util.c user/attilio/vmc-playground/sys/dev/random/randomdev_soft.c user/attilio/vmc-playground/sys/dev/sound/pci/hda/hdaa_patches.c user/attilio/vmc-playground/sys/dev/sound/pci/hda/hdac.h user/attilio/vmc-playground/sys/dev/sound/pci/hda/hdacc.c user/attilio/vmc-playground/sys/dev/syscons/syscons.c user/attilio/vmc-playground/sys/dev/syscons/syscons.h user/attilio/vmc-playground/sys/dev/virtio/block/virtio_blk.c user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c user/attilio/vmc-playground/sys/geom/part/g_part.c user/attilio/vmc-playground/sys/geom/part/g_part.h user/attilio/vmc-playground/sys/geom/part/g_part_mbr.c user/attilio/vmc-playground/sys/geom/raid/md_ddf.c user/attilio/vmc-playground/sys/i386/conf/GENERIC user/attilio/vmc-playground/sys/i386/conf/NOTES user/attilio/vmc-playground/sys/kern/kern_clock.c user/attilio/vmc-playground/sys/kern/kern_event.c user/attilio/vmc-playground/sys/kern/kern_resource.c user/attilio/vmc-playground/sys/kern/kern_time.c user/attilio/vmc-playground/sys/kern/kern_timeout.c user/attilio/vmc-playground/sys/kern/subr_log.c user/attilio/vmc-playground/sys/kern/sys_generic.c user/attilio/vmc-playground/sys/modules/drm2/drm2/Makefile user/attilio/vmc-playground/sys/modules/uart/Makefile user/attilio/vmc-playground/sys/net/route.c user/attilio/vmc-playground/sys/netinet/siftr.c user/attilio/vmc-playground/sys/sparc64/pci/psycho.c user/attilio/vmc-playground/sys/sys/diskmbr.h user/attilio/vmc-playground/sys/sys/param.h user/attilio/vmc-playground/sys/sys/pmckern.h user/attilio/vmc-playground/tools/tools/cxgbetool/cxgbetool.c user/attilio/vmc-playground/usr.bin/c89/c89.c user/attilio/vmc-playground/usr.bin/c99/c99.c user/attilio/vmc-playground/usr.sbin/bhyve/acpi.c user/attilio/vmc-playground/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmc-playground/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmc-playground/usr.sbin/pkg/Makefile user/attilio/vmc-playground/usr.sbin/pkg/pkg.c user/attilio/vmc-playground/usr.sbin/rtadvd/rtadvd.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/cddl/contrib/opensolaris/ (props changed) user/attilio/vmc-playground/contrib/openpam/ (props changed) user/attilio/vmc-playground/crypto/openssh/ (props changed) user/attilio/vmc-playground/lib/libc/ (props changed) user/attilio/vmc-playground/lib/libutil/ (props changed) user/attilio/vmc-playground/sbin/ (props changed) user/attilio/vmc-playground/sbin/ipfw/ (props changed) user/attilio/vmc-playground/share/man/man4/ (props changed) user/attilio/vmc-playground/sys/ (props changed) user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmc-playground/sys/conf/ (props changed) user/attilio/vmc-playground/usr.sbin/bhyve/ (props changed) user/attilio/vmc-playground/usr.sbin/rtadvd/ (props changed) Modified: user/attilio/vmc-playground/UPDATING ============================================================================== --- user/attilio/vmc-playground/UPDATING Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/UPDATING Thu Mar 7 23:52:15 2013 (r247979) @@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130304: + Recent commits to callout(9) changed the size of struct callout, + so the KBI is probably heavily disturbed. Also, some functions + in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced + by macros. Every kernel module using it won't load, so rebuild + is requested. + + The ctl device has been re-enabled in GENERIC for i386 and amd64, + but does not initialize by default (because of the new CTL_DISABLE + option) to save memory. To re-enable it, remove the CTL_DISABLE + option from the kernel config file or set kern.cam.ctl.disable=0 + in /boot/loader.conf. + 20130301: The ctl device has been disabled in GENERIC for i386 and amd64. This was done due to the extra memory being allocated at system Modified: user/attilio/vmc-playground/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- user/attilio/vmc-playground/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 7 23:52:15 2013 (r247979) @@ -1189,7 +1189,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1199,31 +1199,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1242,14 +1267,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1272,7 +1307,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2529,10 +2564,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: user/attilio/vmc-playground/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- user/attilio/vmc-playground/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 23:52:15 2013 (r247979) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,7 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: - match.iim_file = match.iim_name; + bname = strrchr(match.iim_name, '/'); + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts; Modified: user/attilio/vmc-playground/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- user/attilio/vmc-playground/contrib/openpam/doc/man/openpam_straddch.3 Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/contrib/openpam/doc/man/openpam_straddch.3 Thu Mar 7 23:52:15 2013 (r247979) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: user/attilio/vmc-playground/contrib/openpam/lib/openpam_readline.c ============================================================================== --- user/attilio/vmc-playground/contrib/openpam/lib/openpam_readline.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/contrib/openpam/lib/openpam_readline.c Thu Mar 7 23:52:15 2013 (r247979) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: user/attilio/vmc-playground/contrib/openpam/lib/openpam_readword.c ============================================================================== --- user/attilio/vmc-playground/contrib/openpam/lib/openpam_readword.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/contrib/openpam/lib/openpam_readword.c Thu Mar 7 23:52:15 2013 (r247979) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; Modified: user/attilio/vmc-playground/crypto/openssh/FREEBSD-upgrade ============================================================================== --- user/attilio/vmc-playground/crypto/openssh/FREEBSD-upgrade Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/crypto/openssh/FREEBSD-upgrade Thu Mar 7 23:52:15 2013 (r247979) @@ -43,6 +43,7 @@ 7) Run configure with the appropriate arguments: $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --disable-lastlog --disable-utmp --disable-wtmp \ --with-pam --with-tcp-wrappers --with-libedit \ --with-ssl-engine Modified: user/attilio/vmc-playground/crypto/openssh/config.h ============================================================================== --- user/attilio/vmc-playground/crypto/openssh/config.h Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/crypto/openssh/config.h Thu Mar 7 23:52:15 2013 (r247979) @@ -17,6 +17,9 @@ /* Define if your resolver libs need this for getrrsetbyname */ /* #undef BIND_8_COMPAT */ +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + /* Define if cmsg_type is not passed correctly */ /* #undef BROKEN_CMSG_TYPE */ @@ -97,7 +100,7 @@ /* #undef DISABLE_FD_PASSING */ /* Define if you don't want to use lastlog */ -/* #undef DISABLE_LASTLOG */ +#define DISABLE_LASTLOG 1 /* Define if you don't want to use your system's login() call */ /* #undef DISABLE_LOGIN */ @@ -307,7 +310,7 @@ #define HAVE_DECL__GETSHORT 0 /* Define if you have /dev/ptmx */ -#define HAVE_DEV_PTMX 1 +/* #undef HAVE_DEV_PTMX */ /* Define if you have /dev/ptc */ /* #undef HAVE_DEV_PTS_AND_PTC */ @@ -316,7 +319,7 @@ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the `dirfd' function. */ -/* #undef HAVE_DIRFD */ +#define HAVE_DIRFD 1 /* Define to 1 if you have the `dirname' function. */ #define HAVE_DIRNAME 1 @@ -501,6 +504,9 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 +/* Define to 1 if you have the `HMAC_CTX_init' function. */ +#define HAVE_HMAC_CTX_INIT 1 + /* Define if you have ut_host in utmp.h */ /* #undef HAVE_HOST_IN_UTMP */ @@ -552,6 +558,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LASTLOG_H */ +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ @@ -594,10 +603,19 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_IF_TUN_H */ -/* Define if your libraries define login() */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* Define to 1 if you have the `login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ @@ -805,6 +823,9 @@ /* Define to 1 if you have the `setgroups' function. */ #define HAVE_SETGROUPS 1 +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + /* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 @@ -931,6 +952,9 @@ /* Define to 1 if you have the `strmode' function. */ #define HAVE_STRMODE 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strnvis' function. */ /* #undef HAVE_STRNVIS */ @@ -1172,7 +1196,7 @@ /* #undef HAVE_VHANGUP */ /* Define to 1 if you have the header file. */ -#define HAVE_VIS_H 1 +/* #undef HAVE_VIS_H */ /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 @@ -1351,15 +1375,21 @@ /* Sandbox using setrlimit(2) */ #define SANDBOX_RLIMIT 1 +/* Sandbox using seccomp filter */ +/* #undef SANDBOX_SECCOMP_FILTER */ + +/* setrlimit RLIMIT_FSIZE works */ +/* #undef SANDBOX_SKIP_RLIMIT_FSIZE */ + /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ +/* Specify the system call convention in use */ +/* #undef SECCOMP_AUDIT_ARCH */ + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ -/* The size of `char', as computed by sizeof. */ -#define SIZEOF_CHAR 1 - /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -1500,6 +1530,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ Modified: user/attilio/vmc-playground/etc/portsnap.conf ============================================================================== --- user/attilio/vmc-playground/etc/portsnap.conf Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/etc/portsnap.conf Thu Mar 7 23:52:15 2013 (r247979) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 Modified: user/attilio/vmc-playground/lib/libc/string/Makefile.inc ============================================================================== --- user/attilio/vmc-playground/lib/libc/string/Makefile.inc Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/lib/libc/string/Makefile.inc Thu Mar 7 23:52:15 2013 (r247979) @@ -46,7 +46,8 @@ MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 -MLINKS+=strchr.3 strrchr.3 +MLINKS+=strchr.3 strrchr.3 \ + strchr.3 strchrnul.3 MLINKS+=strcmp.3 strncmp.3 MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ Modified: user/attilio/vmc-playground/lib/libstand/Makefile ============================================================================== --- user/attilio/vmc-playground/lib/libstand/Makefile Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/lib/libstand/Makefile Thu Mar 7 23:52:15 2013 (r247979) @@ -67,6 +67,9 @@ SRCS+= divsi3.S .else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c Modified: user/attilio/vmc-playground/lib/libutil/gr_util.c ============================================================================== --- user/attilio/vmc-playground/lib/libutil/gr_util.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/lib/libutil/gr_util.c Thu Mar 7 23:52:15 2013 (r247979) @@ -49,6 +49,8 @@ static char group_dir[PATH_MAX]; static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; +static size_t grmemlen(const struct group *, const char *, int *); +static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); /* * Initialize statics @@ -429,90 +431,121 @@ gr_make(const struct group *gr) struct group * gr_dup(const struct group *gr) { + return (gr_add(gr, NULL)); +} +/* + * Add a new member name to a struct group. + */ +struct group * +gr_add(const struct group *gr, const char *newmember) +{ struct group *newgr; - char *dst; size_t len; - int ndx; int num_mem; - /* Calculate size of the group. */ - len = sizeof(*newgr); - if (gr->gr_name != NULL) - len += strlen(gr->gr_name) + 1; - if (gr->gr_passwd != NULL) - len += strlen(gr->gr_passwd) + 1; - if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) - len += strlen(gr->gr_mem[num_mem]) + 1; - len += (num_mem + 1) * sizeof(*gr->gr_mem); - } else - num_mem = -1; + num_mem = 0; + len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ if ((newgr = malloc(len)) == NULL) return (NULL); - /* point new gr_mem to end of struct + 1 */ - if (gr->gr_mem != NULL) + return (grcopy(gr, newgr, newmember, num_mem)); +} + +/* It is safer to walk the pointers given at gr_mem since there is no + * guarantee the gr_mem + strings are continguous in the given struct group + * but compact the new group into the following form. + * + * The new struct is laid out like this in memory. The example given is + * for a group with two members only. + * + * { + * (char *name) + * (char *passwd) + * (int gid) + * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area + * gr_mem area + * (member1 *) + * (member2 *) + * (NULL) + * (name string) + * (passwd string) + * (member1 string) + * (member2 string) + * } + */ +/* + * Copy the guts of a group plus given name to a preallocated group struct + */ +static struct group * +grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +{ + char *dst; + int i; + + if (name != NULL) + ndx++; + /* point new gr_mem to end of struct + 1 if there are names */ + if (ndx != 0) newgr->gr_mem = (char **)(newgr + 1); else newgr->gr_mem = NULL; /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[num_mem + 1]; + dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; - } else { + } else newgr->gr_name = NULL; - } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; - } else { + } else newgr->gr_passwd = NULL; - } newgr->gr_gid = gr->gr_gid; - if (gr->gr_mem != NULL) { - for (ndx = 0; ndx < num_mem; ndx++) { - newgr->gr_mem[ndx] = dst; - dst = stpcpy(dst, gr->gr_mem[ndx]) + 1; + if (ndx != 0) { + for (i = 0; gr->gr_mem[i] != NULL; i++) { + newgr->gr_mem[i] = dst; + dst = stpcpy(dst, gr->gr_mem[i]) + 1; + } + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; } - newgr->gr_mem[ndx] = NULL; + newgr->gr_mem[i] = NULL; } return (newgr); } /* - * Add a new member name to a struct group. + * Calculate length of a struct group + given name */ -struct group * -gr_add(struct group *gr, char *newmember) +static size_t +grmemlen(const struct group *gr, const char *name, int *num_mem) { - size_t mlen; - int num_mem=0; - char **members; - struct group *newgr; - - if (newmember == NULL) - return(gr_dup(gr)); + size_t len; + int i; + if (gr == NULL) + return (0); + /* Calculate size of the group. */ + len = sizeof(*gr); + if (gr->gr_name != NULL) + len += strlen(gr->gr_name) + 1; + if (gr->gr_passwd != NULL) + len += strlen(gr->gr_passwd) + 1; if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) { - if (strcmp(gr->gr_mem[num_mem], newmember) == 0) { - errno = EEXIST; - return (NULL); - } + for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + len += strlen(gr->gr_mem[i]) + 1; + len += sizeof(*gr->gr_mem); } + *num_mem = i; } - /* Allocate enough for current pointers + 1 more and NULL marker */ - mlen = (num_mem + 2) * sizeof(*gr->gr_mem); - if ((members = malloc(mlen)) == NULL) - return (NULL); - memcpy(members, gr->gr_mem, num_mem * sizeof(*gr->gr_mem)); - members[num_mem++] = newmember; - members[num_mem] = NULL; - gr->gr_mem = members; - newgr = gr_dup(gr); - free(members); - return (newgr); + if (name != NULL) { + len += strlen(name) + 1; + if (gr->gr_mem == NULL) + len += sizeof(*gr->gr_mem); + } + return(len); } /* Modified: user/attilio/vmc-playground/lib/libutil/libutil.h ============================================================================== --- user/attilio/vmc-playground/lib/libutil/libutil.h Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/lib/libutil/libutil.h Thu Mar 7 23:52:15 2013 (r247979) @@ -167,7 +167,7 @@ int gr_copy(int __ffd, int _tfd, const struct group * gr_dup(const struct group *_gr); struct group * - gr_add(struct group *_gr, char *_newmember); + gr_add(const struct group *_gr, const char *_newmember); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); Modified: user/attilio/vmc-playground/lib/libyaml/Makefile ============================================================================== --- user/attilio/vmc-playground/lib/libyaml/Makefile Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/lib/libyaml/Makefile Thu Mar 7 23:52:15 2013 (r247979) @@ -7,6 +7,7 @@ SHLIB_MAJOR= 0 INCS= bsdyml.h SRCS= api.c dumper.c emitter.c loader.c \ parser.c reader.c scanner.c writer.c +MAN= libbsdyml.3 .PATH: ${LIBYAML}/src ${LIBYAML}/include CLEANFILES= bsdyml.h Copied: user/attilio/vmc-playground/lib/libyaml/libbsdyml.3 (from r247975, user/attilio/vmcontention/lib/libyaml/libbsdyml.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/lib/libyaml/libbsdyml.3 Thu Mar 7 23:52:15 2013 (r247979, copy of r247975, user/attilio/vmcontention/lib/libyaml/libbsdyml.3) @@ -0,0 +1,61 @@ +.\" Copyright (c) 2013 Baptiste Daroussin +.\" 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 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$ +.\" +.Dd March 05, 2013 +.Dt LIBBSDYML 3 +.Os +.Sh NAME +.Nm libbsdyml +.Nd LibYAML library for parsing and emitting YAML +.Sh SYNOPSIS +.In bsdyml.h +.Sh DESCRIPTION +The +.Nm +library is a verbatim copy of the LibYAML version 0.1.4 +.Pp +The +.Nm +library is intended to be used within the +.Fx +base system only. +Use of the +.Nm +library for other purposes is not supported and discouraged. +.Pp +To avoid version and autoconfiguration issues, the library has been +renamed to +.Nm +rather than retain the original LibYAML library and include file names +to prevent confusion and autoconfiguration issues for 3rd party +software. +.Sh SEE ALSO +For full documentation, please see the LibYAML webpage at +.Pa http://pyyaml.org/wiki/LibYAML . +.Sh AUTHORS +.An -nosplit +The original LibYAML was written by +.An Kirill Simonov Aq xi@resolvent.net . Modified: user/attilio/vmc-playground/sbin/ipfw/ipfw2.c ============================================================================== --- user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/ipfw/ipfw2.c Thu Mar 7 23:52:15 2013 (r247979) @@ -3083,9 +3083,14 @@ chkarg: } else { len = sizeof(c->max_log); if (sysctlbyname("net.inet.ip.fw.verbose_limit", - &c->max_log, &len, NULL, 0) == -1) + &c->max_log, &len, NULL, 0) == -1) { + if (co.test_only) { + c->max_log = 0; + break; + } errx(1, "sysctlbyname(\"%s\")", "net.inet.ip.fw.verbose_limit"); + } } } break; @@ -3986,9 +3991,13 @@ ipfw_table_handler(int ac, char *av[]) mask = 0; // XXX uninitialized ? len = sizeof(tables_max); if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len, - NULL, 0) == -1) - errx(1, "Can't determine maximum number of ipfw tables. " - "Perhaps you forgot to load ipfw module?"); + NULL, 0) == -1) { + if (co.test_only) + tables_max = 128; /* Old conservative default */ + else + errx(1, "Can't determine maximum number of ipfw tables." + " Perhaps you forgot to load ipfw module?"); + } memset(&xent, 0, sizeof(xent)); Modified: user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.8 Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.8 Thu Mar 7 23:52:15 2013 (r247979) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd October 3, 2005 +.Dd March 5, 2013 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -80,7 +80,7 @@ See the man page for possible options and their meanings. The following cd9660 specific options are available: .Pp -.Bl -tag -width "nostrictjoliet" -compact +.Bl -tag -width "brokenjoliet" -compact .It Cm extatt Same as .Fl e . @@ -93,7 +93,7 @@ Same as .It Cm norrip Same as .Fl r . -.It Cm nostrictjoliet +.It Cm brokenjoliet Same as .Fl b . .El Modified: user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_cd9660/mount_cd9660.c Thu Mar 7 23:52:15 2013 (r247979) @@ -83,7 +83,7 @@ main(int argc, char **argv) { struct iovec *iov; int iovlen; - int ch, mntflags, opts; + int ch, mntflags; char *dev, *dir, *p, *val, mntpath[MAXPATHLEN]; int verbose; int ssector; /* starting sector, 0 for 1st session */ @@ -91,7 +91,7 @@ main(int argc, char **argv) iov = NULL; iovlen = 0; - mntflags = opts = verbose = 0; + mntflags = verbose = 0; ssector = -1; while ((ch = getopt(argc, argv, "begjo:rs:vC:")) != -1) @@ -109,7 +109,7 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "nojoliet", NULL, (size_t)-1); break; case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); p = strchr(optarg, '='); val = NULL; if (p != NULL) { Modified: user/attilio/vmc-playground/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_msdosfs/mount_msdosfs.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_msdosfs/mount_msdosfs.c Thu Mar 7 23:52:15 2013 (r247979) @@ -69,7 +69,7 @@ main(int argc, char **argv) struct iovec *iov = NULL; int iovlen = 0; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask, set_dirmask; + int c, set_gid, set_uid, set_mask, set_dirmask; char *dev, *dir, mntpath[MAXPATHLEN], *csp; char fstype[] = "msdosfs"; char errmsg[255] = {0}; @@ -78,9 +78,8 @@ main(int argc, char **argv) mode_t mask = 0, dirmask = 0; uid_t uid = 0; gid_t gid = 0; - getmnt_silent = 1; - mntflags = set_gid = set_uid = set_mask = set_dirmask = 0; + set_gid = set_uid = set_mask = set_dirmask = 0; while ((c = getopt(argc, argv, "sl9u:g:m:M:o:L:D:W:")) != -1) { switch (c) { @@ -219,7 +218,7 @@ main(int argc, char **argv) build_iovec_argf(&iov, &iovlen, "mask", "%u", mask); build_iovec_argf(&iov, &iovlen, "dirmask", "%u", dirmask); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0]) err(1, "%s: %s", dev, errmsg); else Modified: user/attilio/vmc-playground/sbin/mount_nfs/mount_nfs.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_nfs/mount_nfs.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_nfs/mount_nfs.c Thu Mar 7 23:52:15 2013 (r247979) @@ -130,7 +130,7 @@ enum tryret { TRYRET_LOCALERR /* Local failure. */ }; -static int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +static int fallback_mount(struct iovec *iov, int iovlen); static int sec_name_to_num(char *sec); static char *sec_num_to_name(int num); static int getnfsargs(char *, struct iovec **iov, int *iovlen); @@ -149,13 +149,12 @@ main(int argc, char *argv[]) { int c; struct iovec *iov; - int mntflags, num, iovlen; + int num, iovlen; int osversion; char *name, *p, *spec, *fstype; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50]; - mntflags = 0; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -427,10 +426,10 @@ main(int argc, char *argv[]) */ osversion = getosreldate(); if (osversion >= 702100) { - if (nmount(iov, iovlen, mntflags)) + if (nmount(iov, iovlen, 0)) err(1, "%s, %s", mntpath, errmsg); } else { - if (fallback_mount(iov, iovlen, mntflags)) + if (fallback_mount(iov, iovlen)) err(1, "%s, %s", mntpath, errmsg); } @@ -473,7 +472,7 @@ copyopt(struct iovec **newiov, int *newi * parameters. It should be eventually be removed. */ static int -fallback_mount(struct iovec *iov, int iovlen, int mntflags) +fallback_mount(struct iovec *iov, int iovlen) { struct nfs_args args = { .version = NFS_ARGSVERSION, @@ -663,7 +662,7 @@ fallback_mount(struct iovec *iov, int io copyopt(&newiov, &newiovlen, iov, iovlen, "fspath"); copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg"); - return nmount(newiov, newiovlen, mntflags); + return nmount(newiov, newiovlen, 0); } static int Modified: user/attilio/vmc-playground/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_nullfs/mount_nullfs.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_nullfs/mount_nullfs.c Thu Mar 7 23:52:15 2013 (r247979) @@ -68,12 +68,11 @@ main(int argc, char *argv[]) char source[MAXPATHLEN]; char target[MAXPATHLEN]; char errmsg[255]; - int ch, mntflags, iovlen; + int ch, iovlen; char nullfs[] = "nullfs"; iov = NULL; iovlen = 0; - mntflags = 0; errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { @@ -111,7 +110,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); build_iovec(&iov, &iovlen, "target", target, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - if (nmount(iov, iovlen, mntflags) < 0) { + if (nmount(iov, iovlen, 0) < 0) { if (errmsg[0] != 0) err(1, "%s: %s", source, errmsg); else Modified: user/attilio/vmc-playground/sbin/mount_udf/Makefile ============================================================================== --- user/attilio/vmc-playground/sbin/mount_udf/Makefile Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_udf/Makefile Thu Mar 7 23:52:15 2013 (r247979) @@ -9,7 +9,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys .PATH: ${MOUNT} -WARNS?= 1 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: user/attilio/vmc-playground/sbin/mount_udf/mount_udf.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_udf/mount_udf.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_udf/mount_udf.c Thu Mar 7 23:52:15 2013 (r247979) @@ -73,18 +73,19 @@ void usage(void); int main(int argc, char **argv) { - struct iovec iov[12]; - int ch, i, mntflags, opts, udf_flags; - char *dev, *dir, mntpath[MAXPATHLEN]; - char *cs_disk, *cs_local; - int verbose; + char mntpath[MAXPATHLEN]; + char fstype[] = "udf"; + struct iovec *iov; + char *cs_disk, *cs_local, *dev, *dir; + int ch, i, iovlen, mntflags, udf_flags, verbose; - i = mntflags = opts = udf_flags = verbose = 0; + i = iovlen = mntflags = udf_flags = verbose = 0; cs_disk = cs_local = NULL; + iov = NULL; while ((ch = getopt(argc, argv, "o:vC:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, &opts); + getmntopts(optarg, mopts, &mntflags, NULL); break; case 'v': verbose++; @@ -120,32 +121,13 @@ main(int argc, char **argv) */ mntflags |= MNT_RDONLY; - iov[i].iov_base = "fstype"; - iov[i++].iov_len = sizeof("fstype"); - iov[i].iov_base = "udf"; - iov[i].iov_len = strlen(iov[i].iov_base) + 1; - i++; - iov[i].iov_base = "fspath"; - iov[i++].iov_len = sizeof("fspath"); - iov[i].iov_base = mntpath; - iov[i++].iov_len = strlen(mntpath) + 1; - iov[i].iov_base = "from"; - iov[i++].iov_len = sizeof("from"); - iov[i].iov_base = dev; - iov[i++].iov_len = strlen(dev) + 1; - iov[i].iov_base = "flags"; - iov[i++].iov_len = sizeof("flags"); - iov[i].iov_base = &udf_flags; - iov[i++].iov_len = sizeof(udf_flags); + build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); + build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); + build_iovec(&iov, &iovlen, "flags", &udf_flags, sizeof(udf_flags)); if (udf_flags & UDFMNT_KICONV) { - iov[i].iov_base = "cs_disk"; - iov[i++].iov_len = sizeof("cs_disk"); - iov[i].iov_base = cs_disk; - iov[i++].iov_len = strlen(cs_disk) + 1; - iov[i].iov_base = "cs_local"; - iov[i++].iov_len = sizeof("cs_local"); - iov[i].iov_base = cs_local; - iov[i++].iov_len = strlen(cs_local) + 1; + build_iovec(&iov, &iovlen, "cs_disk", cs_disk, (size_t)-1); + build_iovec(&iov, &iovlen, "cs_local", cs_local, (size_t)-1); } if (nmount(iov, i, mntflags) < 0) err(1, "%s", dev); Modified: user/attilio/vmc-playground/sbin/mount_unionfs/mount_unionfs.c ============================================================================== --- user/attilio/vmc-playground/sbin/mount_unionfs/mount_unionfs.c Thu Mar 7 23:51:07 2013 (r247978) +++ user/attilio/vmc-playground/sbin/mount_unionfs/mount_unionfs.c Thu Mar 7 23:52:15 2013 (r247979) @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) { struct iovec *iov; - int ch, mntflags, iovlen; + int ch, iovlen; char source [MAXPATHLEN], target[MAXPATHLEN], errmsg[255]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Mar 8 00:03:13 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 181858B0; Fri, 8 Mar 2013 00:03:13 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF30FBFE; Fri, 8 Mar 2013 00:03:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2803CBt064827; Fri, 8 Mar 2013 00:03:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28038uo064797; Fri, 8 Mar 2013 00:03:08 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303080003.r28038uo064797@svn.freebsd.org> From: Attilio Rao Date: Fri, 8 Mar 2013 00:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247985 - in user/attilio/vmobj-rwlock: . bin/sh cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/tools/ctf/cvt contrib/libyaml contrib/openbsm/etc contrib/openpam/doc/man cont... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 00:03:13 -0000 Author: attilio Date: Fri Mar 8 00:03:07 2013 New Revision: 247985 URL: http://svnweb.freebsd.org/changeset/base/247985 Log: MFC Added: user/attilio/vmobj-rwlock/contrib/libyaml/ - copied from r247980, head/contrib/libyaml/ user/attilio/vmobj-rwlock/lib/libc/sys/bindat.2 - copied unchanged from r247980, head/lib/libc/sys/bindat.2 user/attilio/vmobj-rwlock/lib/libc/sys/connectat.2 - copied unchanged from r247980, head/lib/libc/sys/connectat.2 user/attilio/vmobj-rwlock/lib/libyaml/ - copied from r247980, head/lib/libyaml/ user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.c - copied unchanged from r247980, head/sys/dev/drm2/drm_global.c user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.h - copied unchanged from r247980, head/sys/dev/drm2/drm_global.h user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ - copied from r247980, head/sys/dev/drm2/ttm/ user/attilio/vmobj-rwlock/tools/regression/bin/sh/builtins/trap12.0 - copied unchanged from r247980, head/tools/regression/bin/sh/builtins/trap12.0 user/attilio/vmobj-rwlock/usr.bin/truss/arm-fbsd.c - copied unchanged from r247980, head/usr.bin/truss/arm-fbsd.c user/attilio/vmobj-rwlock/usr.sbin/pkg/config.c - copied unchanged from r247980, head/usr.sbin/pkg/config.c user/attilio/vmobj-rwlock/usr.sbin/pkg/config.h - copied unchanged from r247980, head/usr.sbin/pkg/config.h Deleted: user/attilio/vmobj-rwlock/lib/libprocstat/ntfs.c user/attilio/vmobj-rwlock/sbin/mount_ext2fs/ user/attilio/vmobj-rwlock/sbin/mount_hpfs/ user/attilio/vmobj-rwlock/sbin/mount_ntfs/ user/attilio/vmobj-rwlock/sbin/mount_reiserfs/ user/attilio/vmobj-rwlock/sbin/mount_std/ user/attilio/vmobj-rwlock/share/examples/portal/ user/attilio/vmobj-rwlock/share/man/man4/coda.4 user/attilio/vmobj-rwlock/share/man/man5/xfs.5 user/attilio/vmobj-rwlock/sys/fs/coda/ user/attilio/vmobj-rwlock/sys/fs/hpfs/ user/attilio/vmobj-rwlock/sys/fs/ntfs/ user/attilio/vmobj-rwlock/sys/fs/portalfs/ user/attilio/vmobj-rwlock/sys/gnu/fs/xfs/ user/attilio/vmobj-rwlock/sys/modules/coda/ user/attilio/vmobj-rwlock/sys/modules/coda5/ user/attilio/vmobj-rwlock/sys/modules/hpfs/ user/attilio/vmobj-rwlock/sys/modules/ntfs/ user/attilio/vmobj-rwlock/sys/modules/ntfs_iconv/ user/attilio/vmobj-rwlock/sys/modules/portalfs/ user/attilio/vmobj-rwlock/sys/modules/xfs/ user/attilio/vmobj-rwlock/usr.sbin/mount_portalfs/ Modified: user/attilio/vmobj-rwlock/MAINTAINERS (contents, props changed) user/attilio/vmobj-rwlock/ObsoleteFiles.inc user/attilio/vmobj-rwlock/UPDATING user/attilio/vmobj-rwlock/bin/sh/trap.c user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/tools/ctf/cvt/output.c user/attilio/vmobj-rwlock/contrib/openbsm/etc/audit_event user/attilio/vmobj-rwlock/contrib/openpam/doc/man/openpam_straddch.3 user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readline.c user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readword.c user/attilio/vmobj-rwlock/crypto/openssh/FREEBSD-upgrade user/attilio/vmobj-rwlock/crypto/openssh/config.h user/attilio/vmobj-rwlock/etc/devd.conf user/attilio/vmobj-rwlock/etc/portsnap.conf user/attilio/vmobj-rwlock/lib/Makefile user/attilio/vmobj-rwlock/lib/libc/string/Makefile.inc user/attilio/vmobj-rwlock/lib/libc/sys/Makefile.inc user/attilio/vmobj-rwlock/lib/libc/sys/Symbol.map user/attilio/vmobj-rwlock/lib/libc/sys/cap_rights_limit.2 user/attilio/vmobj-rwlock/lib/libstand/Makefile user/attilio/vmobj-rwlock/lib/libutil/gr_util.c user/attilio/vmobj-rwlock/lib/libutil/libutil.h user/attilio/vmobj-rwlock/sbin/devd/devd.cc user/attilio/vmobj-rwlock/sbin/devd/devd.hh user/attilio/vmobj-rwlock/sbin/ipfw/ipfw2.c user/attilio/vmobj-rwlock/sbin/ipfw/ipfw2.h user/attilio/vmobj-rwlock/sbin/ipfw/ipv6.c user/attilio/vmobj-rwlock/sbin/mount_cd9660/mount_cd9660.8 user/attilio/vmobj-rwlock/sbin/mount_cd9660/mount_cd9660.c user/attilio/vmobj-rwlock/sbin/mount_msdosfs/mount_msdosfs.c user/attilio/vmobj-rwlock/sbin/mount_nfs/mount_nfs.c user/attilio/vmobj-rwlock/sbin/mount_nullfs/mount_nullfs.c user/attilio/vmobj-rwlock/sbin/mount_udf/Makefile user/attilio/vmobj-rwlock/sbin/mount_udf/mount_udf.c user/attilio/vmobj-rwlock/sbin/mount_unionfs/mount_unionfs.c user/attilio/vmobj-rwlock/share/man/man4/eventtimers.4 user/attilio/vmobj-rwlock/share/man/man4/mvs.4 user/attilio/vmobj-rwlock/share/man/man4/zyd.4 user/attilio/vmobj-rwlock/share/man/man7/development.7 user/attilio/vmobj-rwlock/share/man/man7/ports.7 user/attilio/vmobj-rwlock/share/man/man9/Makefile user/attilio/vmobj-rwlock/share/man/man9/condvar.9 user/attilio/vmobj-rwlock/share/man/man9/sleep.9 user/attilio/vmobj-rwlock/share/man/man9/sleepqueue.9 user/attilio/vmobj-rwlock/share/man/man9/timeout.9 user/attilio/vmobj-rwlock/share/mk/bsd.libnames.mk user/attilio/vmobj-rwlock/sys/amd64/conf/GENERIC user/attilio/vmobj-rwlock/sys/amd64/conf/NOTES user/attilio/vmobj-rwlock/sys/arm/arm/busdma_machdep-v6.c user/attilio/vmobj-rwlock/sys/arm/arm/swtch.S user/attilio/vmobj-rwlock/sys/arm/arm/vm_machdep.c user/attilio/vmobj-rwlock/sys/arm/broadcom/bcm2835/bcm2835_dma.c user/attilio/vmobj-rwlock/sys/arm/include/frame.h user/attilio/vmobj-rwlock/sys/bsm/audit_kevents.h user/attilio/vmobj-rwlock/sys/cam/ctl/ctl.c user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/kcondvar.h user/attilio/vmobj-rwlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c user/attilio/vmobj-rwlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c user/attilio/vmobj-rwlock/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c user/attilio/vmobj-rwlock/sys/compat/freebsd32/freebsd32_proto.h user/attilio/vmobj-rwlock/sys/compat/freebsd32/freebsd32_syscall.h user/attilio/vmobj-rwlock/sys/compat/freebsd32/freebsd32_syscalls.c user/attilio/vmobj-rwlock/sys/compat/freebsd32/freebsd32_sysent.c user/attilio/vmobj-rwlock/sys/compat/freebsd32/freebsd32_systrace_args.c user/attilio/vmobj-rwlock/sys/compat/freebsd32/syscalls.master user/attilio/vmobj-rwlock/sys/compat/linprocfs/linprocfs.c user/attilio/vmobj-rwlock/sys/compat/linux/linux_file.c user/attilio/vmobj-rwlock/sys/compat/linux/linux_socket.c user/attilio/vmobj-rwlock/sys/conf/NOTES user/attilio/vmobj-rwlock/sys/conf/files.amd64 user/attilio/vmobj-rwlock/sys/conf/files.i386 user/attilio/vmobj-rwlock/sys/conf/options user/attilio/vmobj-rwlock/sys/contrib/altq/altq/altq_hfsc.c user/attilio/vmobj-rwlock/sys/contrib/altq/altq/altq_hfsc.h user/attilio/vmobj-rwlock/sys/dev/ath/ath_hal/ah.h user/attilio/vmobj-rwlock/sys/dev/ath/ath_hal/ar5416/ar5416.h user/attilio/vmobj-rwlock/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/attilio/vmobj-rwlock/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/attilio/vmobj-rwlock/sys/dev/ath/if_athvar.h user/attilio/vmobj-rwlock/sys/dev/drm2/drmP.h user/attilio/vmobj-rwlock/sys/dev/drm2/drm_drv.c user/attilio/vmobj-rwlock/sys/dev/drm2/drm_gem.c user/attilio/vmobj-rwlock/sys/dev/drm2/drm_mm.c user/attilio/vmobj-rwlock/sys/dev/drm2/drm_mm.h user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_bo_vm.c user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_tt.c user/attilio/vmobj-rwlock/sys/dev/hwpmc/hwpmc_soft.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/LICENSE user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_82598.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_82599.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_82599.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_api.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_api.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_common.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_common.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_mbx.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_osdep.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_phy.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_phy.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_type.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_vf.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_vf.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_x540.c user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixgbe_x540.h user/attilio/vmobj-rwlock/sys/dev/ixgbe/ixv.c user/attilio/vmobj-rwlock/sys/dev/nvme/nvme.c user/attilio/vmobj-rwlock/sys/dev/nvme/nvme_ctrlr.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.h user/attilio/vmobj-rwlock/sys/dev/oce/oce_if.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_if.h user/attilio/vmobj-rwlock/sys/dev/oce/oce_mbox.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_queue.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_sysctl.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_util.c user/attilio/vmobj-rwlock/sys/dev/pci/pci.c user/attilio/vmobj-rwlock/sys/dev/random/randomdev_soft.c user/attilio/vmobj-rwlock/sys/dev/sound/pci/hda/hdaa_patches.c user/attilio/vmobj-rwlock/sys/dev/sound/pci/hda/hdac.h user/attilio/vmobj-rwlock/sys/dev/sound/pci/hda/hdacc.c user/attilio/vmobj-rwlock/sys/dev/syscons/syscons.c user/attilio/vmobj-rwlock/sys/dev/syscons/syscons.h user/attilio/vmobj-rwlock/sys/dev/virtio/block/virtio_blk.c user/attilio/vmobj-rwlock/sys/geom/label/g_label_ntfs.c user/attilio/vmobj-rwlock/sys/geom/part/g_part.c user/attilio/vmobj-rwlock/sys/geom/part/g_part.h user/attilio/vmobj-rwlock/sys/geom/part/g_part_mbr.c user/attilio/vmobj-rwlock/sys/geom/raid/md_ddf.c user/attilio/vmobj-rwlock/sys/i386/conf/GENERIC user/attilio/vmobj-rwlock/sys/i386/conf/NOTES user/attilio/vmobj-rwlock/sys/i386/xen/pmap.c user/attilio/vmobj-rwlock/sys/kern/capabilities.conf user/attilio/vmobj-rwlock/sys/kern/init_sysent.c user/attilio/vmobj-rwlock/sys/kern/kern_clock.c user/attilio/vmobj-rwlock/sys/kern/kern_clocksource.c user/attilio/vmobj-rwlock/sys/kern/kern_condvar.c user/attilio/vmobj-rwlock/sys/kern/kern_descrip.c user/attilio/vmobj-rwlock/sys/kern/kern_event.c user/attilio/vmobj-rwlock/sys/kern/kern_intr.c user/attilio/vmobj-rwlock/sys/kern/kern_resource.c user/attilio/vmobj-rwlock/sys/kern/kern_synch.c user/attilio/vmobj-rwlock/sys/kern/kern_tc.c user/attilio/vmobj-rwlock/sys/kern/kern_time.c user/attilio/vmobj-rwlock/sys/kern/kern_timeout.c user/attilio/vmobj-rwlock/sys/kern/subr_log.c user/attilio/vmobj-rwlock/sys/kern/subr_param.c user/attilio/vmobj-rwlock/sys/kern/subr_sleepqueue.c user/attilio/vmobj-rwlock/sys/kern/sys_generic.c user/attilio/vmobj-rwlock/sys/kern/syscalls.c user/attilio/vmobj-rwlock/sys/kern/syscalls.master user/attilio/vmobj-rwlock/sys/kern/systrace_args.c user/attilio/vmobj-rwlock/sys/kern/uipc_domain.c user/attilio/vmobj-rwlock/sys/kern/uipc_socket.c user/attilio/vmobj-rwlock/sys/kern/uipc_syscalls.c user/attilio/vmobj-rwlock/sys/kern/uipc_usrreq.c user/attilio/vmobj-rwlock/sys/modules/drm2/drm2/Makefile user/attilio/vmobj-rwlock/sys/modules/mqueue/Makefile user/attilio/vmobj-rwlock/sys/modules/uart/Makefile user/attilio/vmobj-rwlock/sys/net/route.c user/attilio/vmobj-rwlock/sys/netinet/siftr.c user/attilio/vmobj-rwlock/sys/netinet/tcp_timer.c user/attilio/vmobj-rwlock/sys/netpfil/ipfw/ip_fw_dynamic.c user/attilio/vmobj-rwlock/sys/ofed/include/linux/timer.h user/attilio/vmobj-rwlock/sys/security/audit/audit.h user/attilio/vmobj-rwlock/sys/security/audit/audit_arg.c user/attilio/vmobj-rwlock/sys/security/audit/audit_bsm.c user/attilio/vmobj-rwlock/sys/sparc64/pci/psycho.c user/attilio/vmobj-rwlock/sys/sys/_callout.h user/attilio/vmobj-rwlock/sys/sys/callout.h user/attilio/vmobj-rwlock/sys/sys/capability.h user/attilio/vmobj-rwlock/sys/sys/condvar.h user/attilio/vmobj-rwlock/sys/sys/diskmbr.h user/attilio/vmobj-rwlock/sys/sys/filedesc.h user/attilio/vmobj-rwlock/sys/sys/mutex.h user/attilio/vmobj-rwlock/sys/sys/param.h user/attilio/vmobj-rwlock/sys/sys/pmckern.h user/attilio/vmobj-rwlock/sys/sys/protosw.h user/attilio/vmobj-rwlock/sys/sys/rwlock.h user/attilio/vmobj-rwlock/sys/sys/sleepqueue.h user/attilio/vmobj-rwlock/sys/sys/socket.h user/attilio/vmobj-rwlock/sys/sys/socketvar.h user/attilio/vmobj-rwlock/sys/sys/sx.h user/attilio/vmobj-rwlock/sys/sys/syscall.h user/attilio/vmobj-rwlock/sys/sys/syscall.mk user/attilio/vmobj-rwlock/sys/sys/sysproto.h user/attilio/vmobj-rwlock/sys/sys/systm.h user/attilio/vmobj-rwlock/sys/sys/time.h user/attilio/vmobj-rwlock/sys/vm/vm_object.c user/attilio/vmobj-rwlock/tools/make_libdeps.sh user/attilio/vmobj-rwlock/tools/regression/capsicum/syscalls/cap_ioctls_limit.c user/attilio/vmobj-rwlock/tools/regression/pjdfstest/Makefile user/attilio/vmobj-rwlock/tools/regression/pjdfstest/pjdfstest.c user/attilio/vmobj-rwlock/tools/tools/cxgbetool/cxgbetool.c user/attilio/vmobj-rwlock/usr.bin/Makefile.arm user/attilio/vmobj-rwlock/usr.bin/c89/c89.c user/attilio/vmobj-rwlock/usr.bin/c99/c99.c user/attilio/vmobj-rwlock/usr.bin/calendar/calendars/calendar.birthday user/attilio/vmobj-rwlock/usr.bin/find/extern.h user/attilio/vmobj-rwlock/usr.bin/find/find.1 user/attilio/vmobj-rwlock/usr.bin/find/function.c user/attilio/vmobj-rwlock/usr.bin/find/option.c user/attilio/vmobj-rwlock/usr.bin/hexdump/conv.c user/attilio/vmobj-rwlock/usr.bin/procstat/procstat_files.c user/attilio/vmobj-rwlock/usr.bin/truss/extern.h user/attilio/vmobj-rwlock/usr.bin/truss/main.c user/attilio/vmobj-rwlock/usr.sbin/bhyve/acpi.c user/attilio/vmobj-rwlock/usr.sbin/bhyve/pci_virtio_block.c user/attilio/vmobj-rwlock/usr.sbin/bhyve/pci_virtio_net.c user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-disk.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-newfs.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-packages.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions-parse.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/functions.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/backend/parseconfig.sh user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf user/attilio/vmobj-rwlock/usr.sbin/pc-sysinstall/examples/README user/attilio/vmobj-rwlock/usr.sbin/pkg/Makefile user/attilio/vmobj-rwlock/usr.sbin/pkg/pkg.c user/attilio/vmobj-rwlock/usr.sbin/rtadvd/rtadvd.c user/attilio/vmobj-rwlock/usr.sbin/tzsetup/tzsetup.c Directory Properties: user/attilio/vmobj-rwlock/ (props changed) user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-rwlock/contrib/openbsm/ (props changed) user/attilio/vmobj-rwlock/contrib/openpam/ (props changed) user/attilio/vmobj-rwlock/crypto/openssh/ (props changed) user/attilio/vmobj-rwlock/lib/libc/ (props changed) user/attilio/vmobj-rwlock/lib/libutil/ (props changed) user/attilio/vmobj-rwlock/sbin/ (props changed) user/attilio/vmobj-rwlock/sbin/ipfw/ (props changed) user/attilio/vmobj-rwlock/share/man/man4/ (props changed) user/attilio/vmobj-rwlock/sys/ (props changed) user/attilio/vmobj-rwlock/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmobj-rwlock/sys/conf/ (props changed) user/attilio/vmobj-rwlock/usr.bin/calendar/ (props changed) user/attilio/vmobj-rwlock/usr.bin/procstat/ (props changed) user/attilio/vmobj-rwlock/usr.sbin/bhyve/ (props changed) user/attilio/vmobj-rwlock/usr.sbin/rtadvd/ (props changed) Modified: user/attilio/vmobj-rwlock/MAINTAINERS ============================================================================== --- user/attilio/vmobj-rwlock/MAINTAINERS Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/MAINTAINERS Fri Mar 8 00:03:07 2013 (r247985) @@ -124,3 +124,6 @@ isci(4) jimharris Pre-commit review req cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. Modified: user/attilio/vmobj-rwlock/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmobj-rwlock/ObsoleteFiles.inc Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/ObsoleteFiles.inc Fri Mar 8 00:03:07 2013 (r247985) @@ -38,6 +38,30 @@ # xargs -n1 | sort | uniq -d; # done +# 20130302: NTFS support removed +OLD_FILES+=rescue/mount_ntfs +OLD_FILES+=sbin/mount_ntfs +OLD_FILES+=usr/include/fs/ntfs/ntfs.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_compr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_ihash.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_inode.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_subr.h +OLD_FILES+=usr/include/fs/ntfs/ntfs_vfsops.h +OLD_FILES+=usr/include/fs/ntfs/ntfsmount.h +OLD_DIRS+=usr/include/fs/ntfs +OLD_FILES+=usr/share/man/man8/mount_ntfs.8.gz +# 20130302: PORTALFS support removed +OLD_FILES+=usr/include/fs/portalfs/portal.h +OLD_DIRS+=usr/include/fs/portalfs +OLD_FILES+=usr/sbin/mount_portalfs +OLD_FILES+=usr/share/examples/portal/README +OLD_FILES+=usr/share/examples/portal/portal.conf +OLD_DIRS+=usr/share/examples/portal +OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz +# 20130302: CODAFS support removed +OLD_FILES+=usr/share/man/man4/coda.4.gz +# 20130302: XFS support removed +OLD_FILES+=usr/share/man/man5/xfs.5.gz # 20130116: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout @@ -58,9 +82,10 @@ OLD_DIRS+=var/remote # 20121114: zpool-features manual page moved from section 5 to 7 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz # 20121022: remove harp, hfa and idt man page -OLD_FILES+=share/man/man4/harp.4 -OLD_FILES+=share/man/man4/hfa.4 -OLD_FILES+=share/man/man4/idt.4 +OLD_FILES+=usr/share/man/man4/harp.4.gz +OLD_FILES+=usr/share/man/man4/hfa.4.gz +OLD_FILES+=usr/share/man/man4/idt.4.gz +OLD_FILES+=usr/share/man/man4/if_idt.4.gz # 20121022: VFS_LOCK_GIANT elimination OLD_FILES+=usr/share/man/man9/VFS_LOCK_GIANT.9.gz OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz Modified: user/attilio/vmobj-rwlock/UPDATING ============================================================================== --- user/attilio/vmobj-rwlock/UPDATING Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/UPDATING Fri Mar 8 00:03:07 2013 (r247985) @@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130304: + Recent commits to callout(9) changed the size of struct callout, + so the KBI is probably heavily disturbed. Also, some functions + in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced + by macros. Every kernel module using it won't load, so rebuild + is requested. + + The ctl device has been re-enabled in GENERIC for i386 and amd64, + but does not initialize by default (because of the new CTL_DISABLE + option) to save memory. To re-enable it, remove the CTL_DISABLE + option from the kernel config file or set kern.cam.ctl.disable=0 + in /boot/loader.conf. + 20130301: The ctl device has been disabled in GENERIC for i386 and amd64. This was done due to the extra memory being allocated at system Modified: user/attilio/vmobj-rwlock/bin/sh/trap.c ============================================================================== --- user/attilio/vmobj-rwlock/bin/sh/trap.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/bin/sh/trap.c Fri Mar 8 00:03:07 2013 (r247985) @@ -455,7 +455,6 @@ dotrap(void) last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); - exitstatus = savestatus; /* * If such a command was not @@ -464,9 +463,11 @@ dotrap(void) * trap action to have an effect * outside of it. */ - if (prev_evalskip != 0) { + if (evalskip == 0 || + prev_evalskip != 0) { evalskip = prev_evalskip; skipcount = prev_skipcount; + exitstatus = savestatus; } if (i == SIGCHLD) Modified: user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Mar 8 00:03:07 2013 (r247985) @@ -1189,7 +1189,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1199,31 +1199,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1242,14 +1267,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1272,7 +1307,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2529,10 +2564,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Fri Mar 8 00:03:07 2013 (r247985) @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, for (i = 0; i < nent; i++) { GElf_Sym sym; + char *bname; iidesc_t **tolist; GElf_Sym ssym; iidesc_match_t smatch; @@ -377,7 +378,8 @@ sort_iidescs(Elf *elf, const char *file, switch (GELF_ST_TYPE(sym.st_info)) { case STT_FILE: - match.iim_file = match.iim_name; + bname = strrchr(match.iim_name, '/'); + match.iim_file = bname == NULL ? match.iim_name : bname + 1; continue; case STT_OBJECT: tolist = iiburst->iib_objts; Modified: user/attilio/vmobj-rwlock/contrib/openbsm/etc/audit_event ============================================================================== --- user/attilio/vmobj-rwlock/contrib/openbsm/etc/audit_event Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/contrib/openbsm/etc/audit_event Fri Mar 8 00:03:07 2013 (r247985) @@ -568,6 +568,8 @@ 43204:AUE_CAP_IOCTLS_GET:cap_ioctls_get(2):fm 43205:AUE_CAP_FCNTLS_LIMIT:cap_fcntls_limit(2):fm 43206:AUE_CAP_FCNTLS_GET:cap_fcntls_get(2):fm +43207:AUE_BINDAT:bindat(2):nt +43208:AUE_CONNECTAT:connectat(2):nt # # Solaris userspace events. # Modified: user/attilio/vmobj-rwlock/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- user/attilio/vmobj-rwlock/contrib/openpam/doc/man/openpam_straddch.3 Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/contrib/openpam/doc/man/openpam_straddch.3 Fri Mar 8 00:03:07 2013 (r247985) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readline.c ============================================================================== --- user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readline.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readline.c Fri Mar 8 00:03:07 2013 (r247985) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readword.c ============================================================================== --- user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readword.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/contrib/openpam/lib/openpam_readword.c Fri Mar 8 00:03:07 2013 (r247985) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; Modified: user/attilio/vmobj-rwlock/crypto/openssh/FREEBSD-upgrade ============================================================================== --- user/attilio/vmobj-rwlock/crypto/openssh/FREEBSD-upgrade Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/crypto/openssh/FREEBSD-upgrade Fri Mar 8 00:03:07 2013 (r247985) @@ -43,6 +43,7 @@ 7) Run configure with the appropriate arguments: $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ + --disable-lastlog --disable-utmp --disable-wtmp \ --with-pam --with-tcp-wrappers --with-libedit \ --with-ssl-engine Modified: user/attilio/vmobj-rwlock/crypto/openssh/config.h ============================================================================== --- user/attilio/vmobj-rwlock/crypto/openssh/config.h Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/crypto/openssh/config.h Fri Mar 8 00:03:07 2013 (r247985) @@ -17,6 +17,9 @@ /* Define if your resolver libs need this for getrrsetbyname */ /* #undef BIND_8_COMPAT */ +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + /* Define if cmsg_type is not passed correctly */ /* #undef BROKEN_CMSG_TYPE */ @@ -97,7 +100,7 @@ /* #undef DISABLE_FD_PASSING */ /* Define if you don't want to use lastlog */ -/* #undef DISABLE_LASTLOG */ +#define DISABLE_LASTLOG 1 /* Define if you don't want to use your system's login() call */ /* #undef DISABLE_LOGIN */ @@ -307,7 +310,7 @@ #define HAVE_DECL__GETSHORT 0 /* Define if you have /dev/ptmx */ -#define HAVE_DEV_PTMX 1 +/* #undef HAVE_DEV_PTMX */ /* Define if you have /dev/ptc */ /* #undef HAVE_DEV_PTS_AND_PTC */ @@ -316,7 +319,7 @@ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the `dirfd' function. */ -/* #undef HAVE_DIRFD */ +#define HAVE_DIRFD 1 /* Define to 1 if you have the `dirname' function. */ #define HAVE_DIRNAME 1 @@ -501,6 +504,9 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 +/* Define to 1 if you have the `HMAC_CTX_init' function. */ +#define HAVE_HMAC_CTX_INIT 1 + /* Define if you have ut_host in utmp.h */ /* #undef HAVE_HOST_IN_UTMP */ @@ -552,6 +558,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LASTLOG_H */ +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ @@ -594,10 +603,19 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_IF_TUN_H */ -/* Define if your libraries define login() */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* Define to 1 if you have the `login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ @@ -805,6 +823,9 @@ /* Define to 1 if you have the `setgroups' function. */ #define HAVE_SETGROUPS 1 +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + /* Define to 1 if you have the `setlogin' function. */ #define HAVE_SETLOGIN 1 @@ -931,6 +952,9 @@ /* Define to 1 if you have the `strmode' function. */ #define HAVE_STRMODE 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strnvis' function. */ /* #undef HAVE_STRNVIS */ @@ -1172,7 +1196,7 @@ /* #undef HAVE_VHANGUP */ /* Define to 1 if you have the header file. */ -#define HAVE_VIS_H 1 +/* #undef HAVE_VIS_H */ /* Define to 1 if you have the `vsnprintf' function. */ #define HAVE_VSNPRINTF 1 @@ -1351,15 +1375,21 @@ /* Sandbox using setrlimit(2) */ #define SANDBOX_RLIMIT 1 +/* Sandbox using seccomp filter */ +/* #undef SANDBOX_SECCOMP_FILTER */ + +/* setrlimit RLIMIT_FSIZE works */ +/* #undef SANDBOX_SKIP_RLIMIT_FSIZE */ + /* Sandbox using systrace(4) */ /* #undef SANDBOX_SYSTRACE */ +/* Specify the system call convention in use */ +/* #undef SECCOMP_AUDIT_ARCH */ + /* Define if your platform breaks doing a seteuid before a setuid */ /* #undef SETEUID_BREAKS_SETUID */ -/* The size of `char', as computed by sizeof. */ -#define SIZEOF_CHAR 1 - /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -1500,6 +1530,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ Modified: user/attilio/vmobj-rwlock/etc/devd.conf ============================================================================== --- user/attilio/vmobj-rwlock/etc/devd.conf Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/etc/devd.conf Fri Mar 8 00:03:07 2013 (r247985) @@ -34,7 +34,7 @@ options { # NB: DETACH events are ignored; the kernel should handle all cleanup # (routes, arp cache). Beware of races against immediate create # of a device with the same name; e.g. -# ifconfig bridge0 destroy; ifconfig bridge0 create +# ifconfig bridge0 destroy; ifconfig bridge0 create # notify 0 { match "system" "IFNET"; @@ -165,7 +165,7 @@ notify 100 { }; # -# Rescan scsi device-names on attach, but not detach. However, it is +# Rescan SCSI device-names on attach, but not detach. However, it is # disabled by default due to reports of problems. # attach 0 { @@ -305,13 +305,13 @@ detach 10 { # events. See the ACPI specification for more information about # notifies. Here is the information returned for each subsystem: # -# ACAD: AC line state (0 is offline, 1 is online) -# Button: Button pressed (0 for power, 1 for sleep) -# CMBAT: ACPI battery events -# Lid: Lid state (0 is closed, 1 is open) -# RCTL: Resource limits +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification -# Thermal: ACPI thermal zone events +# Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the # notify value as the first argument. If the state is 0x00, it might Modified: user/attilio/vmobj-rwlock/etc/portsnap.conf ============================================================================== --- user/attilio/vmobj-rwlock/etc/portsnap.conf Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/etc/portsnap.conf Fri Mar 8 00:03:07 2013 (r247985) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 Modified: user/attilio/vmobj-rwlock/lib/Makefile ============================================================================== --- user/attilio/vmobj-rwlock/lib/Makefile Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/Makefile Fri Mar 8 00:03:07 2013 (r247985) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ + libyaml \ libz \ ${_atf} \ ${_bind} \ Modified: user/attilio/vmobj-rwlock/lib/libc/string/Makefile.inc ============================================================================== --- user/attilio/vmobj-rwlock/lib/libc/string/Makefile.inc Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libc/string/Makefile.inc Fri Mar 8 00:03:07 2013 (r247985) @@ -46,7 +46,8 @@ MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ strcasecmp.3 strncasecmp_l.3 MLINKS+=strcat.3 strncat.3 -MLINKS+=strchr.3 strrchr.3 +MLINKS+=strchr.3 strrchr.3 \ + strchr.3 strchrnul.3 MLINKS+=strcmp.3 strncmp.3 MLINKS+=strcoll.3 strcoll_l.3 MLINKS+=strcpy.3 stpcpy.3 \ Modified: user/attilio/vmobj-rwlock/lib/libc/sys/Makefile.inc ============================================================================== --- user/attilio/vmobj-rwlock/lib/libc/sys/Makefile.inc Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libc/sys/Makefile.inc Fri Mar 8 00:03:07 2013 (r247985) @@ -91,6 +91,7 @@ MAN+= abort2.2 \ aio_waitcomplete.2 \ aio_write.2 \ bind.2 \ + bindat.2 \ brk.2 \ cap_enter.2 \ cap_fcntls_limit.2 \ @@ -105,6 +106,7 @@ MAN+= abort2.2 \ close.2 \ closefrom.2 \ connect.2 \ + connectat.2 \ cpuset.2 \ cpuset_getaffinity.2 \ dup.2 \ Modified: user/attilio/vmobj-rwlock/lib/libc/sys/Symbol.map ============================================================================== --- user/attilio/vmobj-rwlock/lib/libc/sys/Symbol.map Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libc/sys/Symbol.map Fri Mar 8 00:03:07 2013 (r247985) @@ -378,6 +378,7 @@ FBSD_1.2 { }; FBSD_1.3 { + bindat; cap_fcntls_get; cap_fcntls_limit; cap_ioctls_get; @@ -386,6 +387,7 @@ FBSD_1.3 { cap_rights_limit; cap_sandboxed; clock_getcpuclockid2; + connectat; ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; Copied: user/attilio/vmobj-rwlock/lib/libc/sys/bindat.2 (from r247980, head/lib/libc/sys/bindat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmobj-rwlock/lib/libc/sys/bindat.2 Fri Mar 8 00:03:07 2013 (r247985, copy of r247980, head/lib/libc/sys/bindat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt BINDAT 2 +.Os +.Sh NAME +.Nm bindat +.Nd assign a local protocol address to a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn bindat "int fd" "int s" "const struct sockaddr *addr" "socklen_t addrlen" +.Sh DESCRIPTION +The +.Fn bindat +system call assigns the local protocol address to a socket. +It works just like the +.Xr bind 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn bindat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr bind 2 . +.El +.Sh RETURN VALUES +.Rv -std bindat +.Sh ERRORS +The +.Fn bindat +system call may fail with the same errors as the +.Xr bind 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bind 2 , +.Xr connectat 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmobj-rwlock/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- user/attilio/vmobj-rwlock/lib/libc/sys/cap_rights_limit.2 Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libc/sys/cap_rights_limit.2 Fri Mar 8 00:03:07 2013 (r247985) @@ -104,12 +104,20 @@ or and that socket options set with .Xr setsockopt 2 may also affect binding behavior. +.It Dv CAP_BINDAT +Permit +.Xr bindat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CONNECT Permit .Xr connect 2 ; also required for .Xr sendto 2 with a non-NULL destination address. +.It Dv CAP_CONNECTAT +Permit +.Xr connectat 2 . +This right has to be present on the directory descriptor. .It Dv CAP_CREATE Permit .Xr openat 2 @@ -511,11 +519,13 @@ argument points at an invalid address. .Xr aio_read 2 , .Xr aio_write 2 , .Xr bind 2 , +.Xr bindat 2 , .Xr cap_enter 2 , .Xr cap_fcntls_limit 2 , .Xr cap_ioctls_limit 2 , .Xr cap_rights_limit 2 , .Xr connect 2 , +.Xr connectat 2 , .Xr dup 2 , .Xr dup2 2 , .Xr extattr_delete_fd 2 , Copied: user/attilio/vmobj-rwlock/lib/libc/sys/connectat.2 (from r247980, head/lib/libc/sys/connectat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmobj-rwlock/lib/libc/sys/connectat.2 Fri Mar 8 00:03:07 2013 (r247985, copy of r247980, head/lib/libc/sys/connectat.2) @@ -0,0 +1,109 @@ +.\" Copyright (c) 2013 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This documentation was written 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$ +.\" +.Dd February 13, 2013 +.Dt CONNECTAT 2 +.Os +.Sh NAME +.Nm connectat +.Nd initiate a connection on a socket +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.Pp +.In fcntl.h +.Ft int +.Fn connectat "int fd" "int s" "const struct sockaddr *name" "socklen_t namelen" +.Sh DESCRIPTION +The +.Fn connectat +system call initiates a connection on a socket. +It works just like the +.Xr connect 2 +system call with two exceptions: +.Pp +.Bl -enum -offset indent -compact +.It +It is limited to sockets in the PF_LOCAL domain. +.Pp +.It +If the file path stored in the +.Fa sun_path +field of the sockaddr_un structure is a relative path, it is located relative +to the directory associated with the file descriptor +.Fa fd . +If +.Fn connectat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used and the behavior is identical +to a call to +.Xr connect 2 . +.El +.Sh RETURN VALUES +.Rv -std connectat +.Sh ERRORS +The +.Fn connectat +system call may fail with the same errors as the +.Xr connect 2 +system call for a UNIX domain socket or with the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa sun_path +field does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er ENOTDIR +The +.Fa sun_path +field is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.El +.Sh SEE ALSO +.Xr bindat 2 , +.Xr connect 2 , +.Xr socket 2 , +.Xr unix 4 +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. Modified: user/attilio/vmobj-rwlock/lib/libstand/Makefile ============================================================================== --- user/attilio/vmobj-rwlock/lib/libstand/Makefile Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libstand/Makefile Fri Mar 8 00:03:07 2013 (r247985) @@ -67,6 +67,9 @@ SRCS+= divsi3.S .else # Compiler support functions .PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c Modified: user/attilio/vmobj-rwlock/lib/libutil/gr_util.c ============================================================================== --- user/attilio/vmobj-rwlock/lib/libutil/gr_util.c Fri Mar 8 00:01:38 2013 (r247984) +++ user/attilio/vmobj-rwlock/lib/libutil/gr_util.c Fri Mar 8 00:03:07 2013 (r247985) @@ -49,6 +49,8 @@ static char group_dir[PATH_MAX]; static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; +static size_t grmemlen(const struct group *, const char *, int *); +static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); /* * Initialize statics @@ -429,90 +431,121 @@ gr_make(const struct group *gr) struct group * gr_dup(const struct group *gr) { + return (gr_add(gr, NULL)); +} +/* + * Add a new member name to a struct group. + */ +struct group * +gr_add(const struct group *gr, const char *newmember) +{ struct group *newgr; - char *dst; size_t len; - int ndx; int num_mem; - /* Calculate size of the group. */ - len = sizeof(*newgr); - if (gr->gr_name != NULL) - len += strlen(gr->gr_name) + 1; - if (gr->gr_passwd != NULL) - len += strlen(gr->gr_passwd) + 1; - if (gr->gr_mem != NULL) { - for (num_mem = 0; gr->gr_mem[num_mem] != NULL; num_mem++) - len += strlen(gr->gr_mem[num_mem]) + 1; - len += (num_mem + 1) * sizeof(*gr->gr_mem); - } else - num_mem = -1; + num_mem = 0; + len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ if ((newgr = malloc(len)) == NULL) return (NULL); - /* point new gr_mem to end of struct + 1 */ - if (gr->gr_mem != NULL) + return (grcopy(gr, newgr, newmember, num_mem)); +} + +/* It is safer to walk the pointers given at gr_mem since there is no + * guarantee the gr_mem + strings are continguous in the given struct group + * but compact the new group into the following form. + * + * The new struct is laid out like this in memory. The example given is + * for a group with two members only. + * + * { + * (char *name) + * (char *passwd) + * (int gid) + * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area + * gr_mem area + * (member1 *) + * (member2 *) + * (NULL) + * (name string) + * (passwd string) + * (member1 string) + * (member2 string) + * } + */ +/* + * Copy the guts of a group plus given name to a preallocated group struct + */ +static struct group * +grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +{ + char *dst; + int i; + + if (name != NULL) + ndx++; + /* point new gr_mem to end of struct + 1 if there are names */ + if (ndx != 0) newgr->gr_mem = (char **)(newgr + 1); else newgr->gr_mem = NULL; /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[num_mem + 1]; + dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; - } else { + } else newgr->gr_name = NULL; - } if (gr->gr_passwd != NULL) { newgr->gr_passwd = dst; dst = stpcpy(dst, gr->gr_passwd) + 1; - } else { + } else newgr->gr_passwd = NULL; - } newgr->gr_gid = gr->gr_gid; - if (gr->gr_mem != NULL) { - for (ndx = 0; ndx < num_mem; ndx++) { - newgr->gr_mem[ndx] = dst; - dst = stpcpy(dst, gr->gr_mem[ndx]) + 1; + if (ndx != 0) { + for (i = 0; gr->gr_mem[i] != NULL; i++) { + newgr->gr_mem[i] = dst; + dst = stpcpy(dst, gr->gr_mem[i]) + 1; + } + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; } - newgr->gr_mem[ndx] = NULL; + newgr->gr_mem[i] = NULL; } return (newgr); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Mar 8 19:16:25 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2350CEBB; Fri, 8 Mar 2013 19:16:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15DBA730; Fri, 8 Mar 2013 19:16:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r28JGOZB031422; Fri, 8 Mar 2013 19:16:24 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r28JGObS031421; Fri, 8 Mar 2013 19:16:24 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201303081916.r28JGObS031421@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 8 Mar 2013 19:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248065 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2013 19:16:25 -0000 Author: dchagin Date: Fri Mar 8 19:16:24 2013 New Revision: 248065 URL: http://svnweb.freebsd.org/changeset/base/248065 Log: User can specify the NULL value for the sigmask parameter. Modified: user/dchagin/lemul/sys/compat/linux/linux_misc.c Modified: user/dchagin/lemul/sys/compat/linux/linux_misc.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_misc.c Fri Mar 8 19:02:45 2013 (r248064) +++ user/dchagin/lemul/sys/compat/linux/linux_misc.c Fri Mar 8 19:16:24 2013 (r248065) @@ -2089,19 +2089,22 @@ linux_pselect6(struct thread *td, struct sigset_t ss; int error; + ssp = NULL; if (args->sig) { error = copyin(args->sig, &lpse6, sizeof(lpse6)); if (error) return (error); if (lpse6.ss_len != sizeof(l_ss)) return (EINVAL); - error = copyin(PTRIN(lpse6.ss), &l_ss, sizeof(l_ss)); - if (error) - return (error); - linux_to_bsd_sigset(&l_ss, &ss); - ssp = &ss; - } else - ssp = NULL; + if (lpse6.ss != 0) { + error = copyin(PTRIN(lpse6.ss), &l_ss, + sizeof(l_ss)); + if (error) + return (error); + linux_to_bsd_sigset(&l_ss, &ss); + ssp = &ss; + } + } /* * Currently glibc changes nanosecond number to microsecond. From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 01:39:48 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CCE27BC; Sat, 9 Mar 2013 01:39:48 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2014E365; Sat, 9 Mar 2013 01:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r291dmBj049792; Sat, 9 Mar 2013 01:39:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r291dhG7049757; Sat, 9 Mar 2013 01:39:43 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090139.r291dhG7049757@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 01:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248080 - in user/attilio/vmobj-rwlock: . sbin/geom/class/raid sys/arm/arm sys/dev/drm2 sys/dev/drm2/ttm sys/dev/oce sys/geom/label sys/geom/raid sys/kern sys/modules/ath sys/net sys/ne... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 01:39:48 -0000 Author: attilio Date: Sat Mar 9 01:39:42 2013 New Revision: 248080 URL: http://svnweb.freebsd.org/changeset/base/248080 Log: MFC Modified: user/attilio/vmobj-rwlock/UPDATING user/attilio/vmobj-rwlock/sbin/geom/class/raid/graid.8 user/attilio/vmobj-rwlock/sys/arm/arm/cpufunc_asm_arm11x6.S user/attilio/vmobj-rwlock/sys/dev/drm2/drm_fb_helper.c user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.c user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_bo.c user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_memory.c user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.h user/attilio/vmobj-rwlock/sys/dev/oce/oce_sysctl.c user/attilio/vmobj-rwlock/sys/geom/label/g_label_ntfs.c user/attilio/vmobj-rwlock/sys/geom/raid/g_raid.c user/attilio/vmobj-rwlock/sys/kern/kern_timeout.c user/attilio/vmobj-rwlock/sys/kern/subr_param.c user/attilio/vmobj-rwlock/sys/modules/ath/Makefile user/attilio/vmobj-rwlock/sys/net/if.c user/attilio/vmobj-rwlock/sys/net/route.c user/attilio/vmobj-rwlock/sys/net/route.h user/attilio/vmobj-rwlock/sys/net80211/ieee80211.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.h user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hostap.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_ht.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hwmp.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_mesh.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_output.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_power.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_proto.h user/attilio/vmobj-rwlock/sys/net80211/ieee80211_superg.c user/attilio/vmobj-rwlock/sys/net80211/ieee80211_var.h user/attilio/vmobj-rwlock/sys/net80211/ieee80211_wds.c user/attilio/vmobj-rwlock/sys/sparc64/conf/GENERIC user/attilio/vmobj-rwlock/sys/sys/callout.h user/attilio/vmobj-rwlock/sys/sys/systm.h user/attilio/vmobj-rwlock/sys/vm/vm_init.c user/attilio/vmobj-rwlock/usr.sbin/pkg/pkg.c Directory Properties: user/attilio/vmobj-rwlock/ (props changed) user/attilio/vmobj-rwlock/sbin/ (props changed) user/attilio/vmobj-rwlock/sys/ (props changed) Modified: user/attilio/vmobj-rwlock/UPDATING ============================================================================== --- user/attilio/vmobj-rwlock/UPDATING Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/UPDATING Sat Mar 9 01:39:42 2013 (r248080) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130308: + CTL_DISABLE has also been added to the sparc64 GENERIC (for further + information, see the respective 20130304 entry). + 20130304: Recent commits to callout(9) changed the size of struct callout, so the KBI is probably heavily disturbed. Also, some functions Modified: user/attilio/vmobj-rwlock/sbin/geom/class/raid/graid.8 ============================================================================== --- user/attilio/vmobj-rwlock/sbin/geom/class/raid/graid.8 Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sbin/geom/class/raid/graid.8 Sat Mar 9 01:39:42 2013 (r248080) @@ -305,6 +305,9 @@ Write errors are always considered as di Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of /dev/ar%d devices from ataraid(4) +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: user/attilio/vmobj-rwlock/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- user/attilio/vmobj-rwlock/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 01:39:42 2013 (r248080) @@ -62,6 +62,8 @@ #include __FBSDID("$FreeBSD$"); + .cpu arm1136js + #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ mcr p15, 0, Rtmp1, c7, c5, 0 /* Invalidate Entire I cache */ Modified: user/attilio/vmobj-rwlock/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 01:39:42 2013 (r248080) @@ -555,8 +555,11 @@ static void drm_fb_helper_crtc_free(stru for (i = 0; i < helper->connector_count; i++) free(helper->connector_info[i], DRM_MEM_KMS); free(helper->connector_info, DRM_MEM_KMS); - for (i = 0; i < helper->crtc_count; i++) + for (i = 0; i < helper->crtc_count; i++) { free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); + if (helper->crtc_info[i].mode_set.mode) + drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); + } free(helper->crtc_info, DRM_MEM_KMS); } Modified: user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/drm2/drm_global.c Sat Mar 9 01:39:42 2013 (r248080) @@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_gl MPASS(ref->object == item->object); if (--item->refcount == 0) { ref->release(ref); + free(item->object, M_DRM_GLOBAL); item->object = NULL; } sx_xunlock(&item->mutex); Modified: user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 01:39:42 2013 (r248080) @@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(s ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink); vm_page_free(glob->dummy_read_page); - free(glob, M_DRM_GLOBAL); } void ttm_bo_global_release(struct drm_global_reference *ref) Modified: user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_memory.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_memory.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/drm2/ttm/ttm_memory.c Sat Mar 9 01:39:42 2013 (r248080) @@ -125,8 +125,6 @@ static ssize_t ttm_mem_zone_store(struct static void ttm_mem_global_kobj_release(struct ttm_mem_global *glob) { - - free(glob, M_TTM_ZONE); } static bool ttm_zones_above_swap_target(struct ttm_mem_global *glob, Modified: user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.h ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.h Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/oce/oce_hw.h Sat Mar 9 01:39:42 2013 (r248080) @@ -38,8 +38,6 @@ /* $FreeBSD$ */ -/* $FreeBSD$ */ - #include #undef _BIG_ENDIAN /* TODO */ Modified: user/attilio/vmobj-rwlock/sys/dev/oce/oce_sysctl.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/dev/oce/oce_sysctl.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/dev/oce/oce_sysctl.c Sat Mar 9 01:39:42 2013 (r248080) @@ -38,8 +38,6 @@ /* $FreeBSD$ */ -/* $FreeBSD$ */ - #include "oce_if.h" Modified: user/attilio/vmobj-rwlock/sys/geom/label/g_label_ntfs.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/geom/label/g_label_ntfs.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/geom/label/g_label_ntfs.c Sat Mar 9 01:39:42 2013 (r248080) @@ -115,7 +115,7 @@ g_label_ntfs_taste(struct g_consumer *cp mftrecsz = (char)bf->bf_mftrecsz; recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); - if (recsize % pp->sectorsize != 0) + if (recsize == 0 || recsize % pp->sectorsize != 0) goto done; voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + Modified: user/attilio/vmobj-rwlock/sys/geom/raid/g_raid.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/geom/raid/g_raid.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/geom/raid/g_raid.c Sat Mar 9 01:39:42 2013 (r248080) @@ -92,6 +92,11 @@ TUNABLE_INT("kern.geom.raid.idle_thresho SYSCTL_UINT(_kern_geom_raid, OID_AUTO, idle_threshold, CTLFLAG_RW, &g_raid_idle_threshold, 1000000, "Time in microseconds to consider a volume idle."); +static u_int ar_legacy_aliases = 1; +SYSCTL_INT(_kern_geom_raid, OID_AUTO, legacy_aliases, CTLFLAG_RW, + &ar_legacy_aliases, 0, "Create aliases named as the legacy ataraid style."); +TUNABLE_INT("kern.geom_raid.legacy_aliases", &ar_legacy_aliases); + #define MSLEEP(rv, ident, mtx, priority, wmesg, timeout) do { \ G_RAID_DEBUG(4, "%s: Sleeping %p.", __func__, (ident)); \ @@ -1637,6 +1642,7 @@ g_raid_launch_provider(struct g_raid_vol struct g_raid_softc *sc; struct g_provider *pp; char name[G_RAID_MAX_VOLUMENAME]; + char announce_buf[80], buf1[32]; off_t off; sc = vol->v_softc; @@ -1650,6 +1656,22 @@ g_raid_launch_provider(struct g_raid_vol /* Otherwise use sequential volume number. */ snprintf(name, sizeof(name), "raid/r%d", vol->v_global_id); } + + /* + * Create a /dev/ar%d that the old ataraid(4) stack once + * created as an alias for /dev/raid/r%d if requested. + * This helps going from stable/7 ataraid devices to newer + * FreeBSD releases. sbruno 07 MAY 2013 + */ + + if (ar_legacy_aliases) { + snprintf(announce_buf, sizeof(announce_buf), + "kern.devalias.%s", name); + snprintf(buf1, sizeof(buf1), + "ar%d", vol->v_global_id); + setenv(announce_buf, buf1); + } + pp = g_new_providerf(sc->sc_geom, "%s", name); pp->private = vol; pp->mediasize = vol->v_mediasize; Modified: user/attilio/vmobj-rwlock/sys/kern/kern_timeout.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/kern/kern_timeout.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/kern/kern_timeout.c Sat Mar 9 01:39:42 2013 (r248080) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -101,6 +102,11 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca 0, "Average number of MP direct callouts made per callout_process call. " "Units = 1/1000"); #endif + +static int ncallout; +SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, + "Number of entries in callwheel and size of timeout() preallocation"); + /* * TODO: * allocate more timeout table slots when table overflows. @@ -181,6 +187,7 @@ struct callout_cpu cc_cpu; static int timeout_cpu; +static void callout_cpu_init(struct callout_cpu *cc); static void softclock_call_cc(struct callout *c, struct callout_cpu *cc, #ifdef CALLOUT_PROFILING int *mpcalls, int *lockcalls, int *gcalls, @@ -240,18 +247,21 @@ cc_cce_migrating(struct callout_cpu *cc, } /* - * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization - * - * This code is called very early in the kernel initialization sequence, - * and may be called more then once. + * Kernel low level callwheel initialization + * called on cpu0 during kernel startup. */ -caddr_t -kern_timeout_callwheel_alloc(caddr_t v) +static void +callout_callwheel_init(void *dummy) { struct callout_cpu *cc; - timeout_cpu = PCPU_GET(cpuid); - cc = CC_CPU(timeout_cpu); + /* + * Calculate the size of the callout wheel and the preallocated + * timeout() structures. + */ + ncallout = imin(16 + maxproc + maxfiles, 18508); + TUNABLE_INT_FETCH("kern.ncallout", &ncallout); + /* * Calculate callout wheel size, should be next power of two higher * than 'ncallout'. @@ -259,13 +269,23 @@ kern_timeout_callwheel_alloc(caddr_t v) callwheelsize = 1 << fls(ncallout); callwheelmask = callwheelsize - 1; - cc->cc_callout = (struct callout *)v; - v = (caddr_t)(cc->cc_callout + ncallout); - cc->cc_callwheel = (struct callout_list *)v; - v = (caddr_t)(cc->cc_callwheel + callwheelsize); - return(v); + /* + * Only cpu0 handles timeout(9) and receives a preallocation. + * + * XXX: Once all timeout(9) consumers are converted this can + * be removed. + */ + timeout_cpu = PCPU_GET(cpuid); + cc = CC_CPU(timeout_cpu); + cc->cc_callout = malloc(ncallout * sizeof(struct callout), + M_CALLOUT, M_WAITOK); + callout_cpu_init(cc); } +SYSINIT(callwheel_init, SI_SUB_CPU, SI_ORDER_ANY, callout_callwheel_init, NULL); +/* + * Initialize the per-cpu callout structures. + */ static void callout_cpu_init(struct callout_cpu *cc) { @@ -274,13 +294,15 @@ callout_cpu_init(struct callout_cpu *cc) mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); + cc->cc_callwheel = malloc(sizeof(struct callout_tailq) * callwheelsize, + M_CALLOUT, M_WAITOK); for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); TAILQ_INIT(&cc->cc_expireq); cc->cc_firstevent = INT64_MAX; for (i = 0; i < 2; i++) cc_cce_cleanup(cc, i); - if (cc->cc_callout == NULL) + if (cc->cc_callout == NULL) /* Only cpu0 handles timeout(9) */ return; for (i = 0; i < ncallout; i++) { c = &cc->cc_callout[i]; @@ -321,19 +343,6 @@ callout_cpu_switch(struct callout *c, st #endif /* - * kern_timeout_callwheel_init() - initialize previously reserved callwheel - * space. - * - * This code is called just once, after the space reserved for the - * callout wheel has been finalized. - */ -void -kern_timeout_callwheel_init(void) -{ - callout_cpu_init(CC_CPU(timeout_cpu)); -} - -/* * Start standard softclock thread. */ static void @@ -353,18 +362,14 @@ start_softclock(void *dummy) if (cpu == timeout_cpu) continue; cc = CC_CPU(cpu); + cc->cc_callout = NULL; /* Only cpu0 handles timeout(9). */ + callout_cpu_init(cc); if (swi_add(NULL, "clock", softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) panic("died while creating standard software ithreads"); - cc->cc_callout = NULL; /* Only cpu0 handles timeout(). */ - cc->cc_callwheel = malloc( - sizeof(struct callout_list) * callwheelsize, M_CALLOUT, - M_WAITOK); - callout_cpu_init(cc); } #endif } - SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL); #define CC_HASH_SHIFT 8 Modified: user/attilio/vmobj-rwlock/sys/kern/subr_param.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/kern/subr_param.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/kern/subr_param.c Sat Mar 9 01:39:42 2013 (r248080) @@ -91,7 +91,6 @@ int maxprocperuid; /* max # of procs p int maxfiles; /* sys. wide open files limit */ int maxfilesperproc; /* per-proc open files limit */ int msgbufsize; /* size of kernel message buffer */ -int ncallout; /* maximum # of timer events */ int nbuf; int ngroups_max; /* max # groups per process */ int nswbuf; @@ -109,8 +108,6 @@ u_long sgrowsiz; /* amount to grow sta SYSCTL_INT(_kern, OID_AUTO, hz, CTLFLAG_RDTUN, &hz, 0, "Number of clock ticks per second"); -SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, - "Number of pre-allocated timer events"); SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0, "Number of buffers in the buffer cache"); SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0, @@ -327,15 +324,6 @@ init_param2(long physpages) TUNABLE_INT_FETCH("kern.nbuf", &nbuf); /* - * XXX: Does the callout wheel have to be so big? - * - * Clip callout to result of previous function of maxusers maximum - * 384. This is still huge, but acceptable. - */ - ncallout = imin(16 + maxproc + maxfiles, 18508); - TUNABLE_INT_FETCH("kern.ncallout", &ncallout); - - /* * The default for maxpipekva is min(1/64 of the kernel address space, * max(1/64 of main memory, 512KB)). See sys_pipe.c for more details. */ Modified: user/attilio/vmobj-rwlock/sys/modules/ath/Makefile ============================================================================== --- user/attilio/vmobj-rwlock/sys/modules/ath/Makefile Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/modules/ath/Makefile Sat Mar 9 01:39:42 2013 (r248080) @@ -123,6 +123,15 @@ SRCS+= ah_eeprom_9287.c .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002 SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c +# + AR9300 HAL +# .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9003 +#SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c +#SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c +#SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c +#SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c +#SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c +#SRCS+= ar9300_power.c ar9300_timer.c + # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" .PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample Modified: user/attilio/vmobj-rwlock/sys/net/if.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net/if.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net/if.c Sat Mar 9 01:39:42 2013 (r248080) @@ -1357,7 +1357,8 @@ if_rtdel(struct radix_node *rn, void *ar return (0); err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), rt->rt_flags|RTF_RNH_LOCKED, + rt_mask(rt), + rt->rt_flags|RTF_RNH_LOCKED|RTF_PINNED, (struct rtentry **) NULL, rt->rt_fibnum); if (err) { log(LOG_WARNING, "if_rtdel: error %d\n", err); Modified: user/attilio/vmobj-rwlock/sys/net/route.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net/route.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net/route.c Sat Mar 9 01:39:42 2013 (r248080) @@ -1112,6 +1112,14 @@ rtrequest1_fib(int req, struct rt_addrin error = 0; } #endif + if ((flags & RTF_PINNED) == 0) { + /* Check if target route can be deleted */ + rt = (struct rtentry *)rnh->rnh_lookup(dst, + netmask, rnh); + if ((rt != NULL) && (rt->rt_flags & RTF_PINNED)) + senderr(EADDRINUSE); + } + /* * Remove the item from the tree and return it. * Complain if it is not there and do no more processing. @@ -1430,6 +1438,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int int didwork = 0; int a_failure = 0; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + struct radix_node_head *rnh; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1488,7 +1497,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ for ( fibnum = startfib; fibnum <= endfib; fibnum++) { if (cmd == RTM_DELETE) { - struct radix_node_head *rnh; struct radix_node *rn; /* * Look up an rtentry that is in the routing tree and @@ -1538,7 +1546,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ bzero((caddr_t)&info, sizeof(info)); info.rti_ifa = ifa; - info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); + info.rti_flags = flags | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; info.rti_info[RTAX_DST] = dst; /* * doing this for compatibility reasons @@ -1550,6 +1559,33 @@ rtinit1(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; error = rtrequest1_fib(cmd, &info, &rt, fibnum); + + if ((error == EEXIST) && (cmd == RTM_ADD)) { + /* + * Interface route addition failed. + * Atomically delete current prefix generating + * RTM_DELETE message, and retry adding + * interface prefix. + */ + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + RADIX_NODE_HEAD_LOCK(rnh); + + /* Delete old prefix */ + info.rti_ifa = NULL; + info.rti_flags = RTF_RNH_LOCKED; + + error = rtrequest1_fib(RTM_DELETE, &info, &rt, fibnum); + if (error == 0) { + info.rti_ifa = ifa; + info.rti_flags = flags | RTF_RNH_LOCKED | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; + error = rtrequest1_fib(cmd, &info, &rt, fibnum); + } + + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change Modified: user/attilio/vmobj-rwlock/sys/net/route.h ============================================================================== --- user/attilio/vmobj-rwlock/sys/net/route.h Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net/route.h Sat Mar 9 01:39:42 2013 (r248080) @@ -176,7 +176,7 @@ struct ortentry { /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ -#define RTF_PINNED 0x100000 /* future use */ +#define RTF_PINNED 0x100000 /* route is immutable */ #define RTF_LOCAL 0x200000 /* route represents a local address */ #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211.c Sat Mar 9 01:39:42 2013 (r248080) @@ -278,6 +278,7 @@ ieee80211_ifattach(struct ieee80211com * KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type)); IEEE80211_LOCK_INIT(ic, ifp->if_xname); + IEEE80211_TX_LOCK_INIT(ic, ifp->if_xname); TAILQ_INIT(&ic->ic_vaps); /* Create a taskqueue for all state changes */ @@ -385,6 +386,7 @@ ieee80211_ifdetach(struct ieee80211com * ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); + IEEE80211_TX_LOCK_DESTROY(ic); IEEE80211_LOCK_DESTROY(ic); } Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.c Sat Mar 9 01:39:42 2013 (r248080) @@ -504,6 +504,44 @@ ieee80211_process_callback(struct ieee80 } } +/* + * Transmit a frame to the parent interface. + * + * TODO: if the transmission fails, make sure the parent node is freed + * (the callers will first need modifying.) + */ +int +ieee80211_parent_transmit(struct ieee80211com *ic, + struct mbuf *m) +{ + struct ifnet *parent = ic->ic_ifp; + /* + * Assert the IC TX lock is held - this enforces the + * processing -> queuing order is maintained + */ + IEEE80211_TX_LOCK_ASSERT(ic); + + return (parent->if_transmit(parent, m)); +} + +/* + * Transmit a frame to the VAP interface. + */ +int +ieee80211_vap_transmit(struct ieee80211vap *vap, struct mbuf *m) +{ + struct ifnet *ifp = vap->iv_ifp; + + /* + * When transmitting via the VAP, we shouldn't hold + * any IC TX lock as the VAP TX path will acquire it. + */ + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); + + return (ifp->if_transmit(ifp, m)); + +} + #include void Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.h ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.h Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_freebsd.h Sat Mar 9 01:39:42 2013 (r248080) @@ -57,6 +57,30 @@ typedef struct { mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED) /* + * Transmit lock. + * + * This is a (mostly) temporary lock designed to serialise all of the + * transmission operations throughout the stack. + */ +typedef struct { + char name[16]; /* e.g. "ath0_com_lock" */ + struct mtx mtx; +} ieee80211_tx_lock_t; +#define IEEE80211_TX_LOCK_INIT(_ic, _name) do { \ + ieee80211_tx_lock_t *cl = &(_ic)->ic_txlock; \ + snprintf(cl->name, sizeof(cl->name), "%s_tx_lock", _name); \ + mtx_init(&cl->mtx, cl->name, NULL, MTX_DEF); \ +} while (0) +#define IEEE80211_TX_LOCK_OBJ(_ic) (&(_ic)->ic_txlock.mtx) +#define IEEE80211_TX_LOCK_DESTROY(_ic) mtx_destroy(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_LOCK(_ic) mtx_lock(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_UNLOCK(_ic) mtx_unlock(IEEE80211_TX_LOCK_OBJ(_ic)) +#define IEEE80211_TX_LOCK_ASSERT(_ic) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_OWNED) +#define IEEE80211_TX_UNLOCK_ASSERT(_ic) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_NOTOWNED) + +/* * Node locking definitions. */ typedef struct { @@ -272,9 +296,11 @@ int ieee80211_add_callback(struct mbuf * void (*func)(struct ieee80211_node *, void *, int), void *arg); void ieee80211_process_callback(struct ieee80211_node *, struct mbuf *, int); -void get_random_bytes(void *, size_t); - struct ieee80211com; +int ieee80211_parent_transmit(struct ieee80211com *, struct mbuf *); +int ieee80211_vap_transmit(struct ieee80211vap *, struct mbuf *); + +void get_random_bytes(void *, size_t); void ieee80211_sysctl_attach(struct ieee80211com *); void ieee80211_sysctl_detach(struct ieee80211com *); Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hostap.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hostap.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hostap.c Sat Mar 9 01:39:42 2013 (r248080) @@ -412,7 +412,7 @@ hostap_deliver_data(struct ieee80211vap if (mcopy != NULL) { int len, err; len = mcopy->m_pkthdr.len; - err = ifp->if_transmit(ifp, mcopy); + err = ieee80211_vap_transmit(vap, mcopy); if (err) { /* NB: IFQ_HANDOFF reclaims mcopy */ } else { @@ -2255,8 +2255,8 @@ void ieee80211_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = vap->iv_ic; struct ieee80211_frame_min *wh; - struct ifnet *ifp; struct mbuf *m; uint16_t aid; int qlen; @@ -2320,23 +2320,15 @@ ieee80211_recv_pspoll(struct ieee80211_n } m->m_flags |= M_PWR_SAV; /* bypass PS handling */ - if (m->m_flags & M_ENCAP) - ifp = vap->iv_ic->ic_ifp; - else - ifp = vap->iv_ifp; - /* - * Free any node ref which this mbuf may have. - * - * Much like psq_mfree(), we assume that M_ENCAP nodes have - * node references. + * Do the right thing; if it's an encap'ed frame then + * call ieee80211_parent_transmit() (and free the ref) else + * call ieee80211_vap_transmit(). */ - if (ifp->if_transmit(ifp, m) != 0) { - /* - * XXX m is invalid (freed) at this point, determine M_ENCAP - * an alternate way. - */ - if (ifp == vap->iv_ic->ic_ifp) + if (m->m_flags & M_ENCAP) { + if (ieee80211_parent_transmit(ic, m) != 0) ieee80211_free_node(ni); + } else { + (void) ieee80211_vap_transmit(vap, m); } } Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_ht.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_ht.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_ht.c Sat Mar 9 01:39:42 2013 (r248080) @@ -2392,7 +2392,9 @@ ieee80211_send_bar(struct ieee80211_node * ic_raw_xmit will free the node reference * regardless of queue/TX success or failure. */ - ret = ic->ic_raw_xmit(ni, m, NULL); + IEEE80211_TX_LOCK(ic); + ret = ieee80211_raw_output(vap, ni, m, NULL); + IEEE80211_TX_UNLOCK(ic); if (ret != 0) { IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_11N, ni, "send BAR: failed: (ret = %d)\n", Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hwmp.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hwmp.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_hwmp.c Sat Mar 9 01:39:42 2013 (r248080) @@ -592,6 +592,7 @@ hwmp_send_action(struct ieee80211vap *va struct ieee80211_bpf_params params; struct mbuf *m; uint8_t *frm; + int ret; if (IEEE80211_IS_MULTICAST(da)) { ni = ieee80211_ref_node(vap->iv_bss); @@ -654,6 +655,9 @@ hwmp_send_action(struct ieee80211vap *va vap->iv_stats.is_tx_nobuf++; return ENOMEM; } + + IEEE80211_TX_LOCK(ic); + ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, IEEE80211_NONQOS_TID, vap->iv_myaddr, da, vap->iv_myaddr); @@ -669,7 +673,9 @@ hwmp_send_action(struct ieee80211vap *va else params.ibp_try0 = ni->ni_txparms->maxretry; params.ibp_power = ni->ni_txpower; - return ic->ic_raw_xmit(ni, m, ¶ms); + ret = ieee80211_raw_output(vap, ni, m, ¶ms); + IEEE80211_TX_UNLOCK(ic); + return (ret); } #define ADDSHORT(frm, v) do { \ @@ -1271,12 +1277,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_mesh_route *rtext = NULL; struct ieee80211_hwmp_route *hr; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *ifp = vap->iv_ifp; struct mbuf *m, *next; uint32_t metric = 0; const uint8_t *addr; - int is_encap; - struct ieee80211_node *ni_encap; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":", @@ -1450,22 +1453,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, m = ieee80211_ageq_remove(&ic->ic_stageq, (struct ieee80211_node *)(uintptr_t) ieee80211_mac_hash(ic, addr)); /* either dest or ext_dest */ + + /* + * All frames in the stageq here should be non-M_ENCAP; or things + * will get very unhappy. + */ for (; m != NULL; m = next) { - is_encap = !! (m->m_flags & M_ENCAP); - ni_encap = (struct ieee80211_node *) m->m_pkthdr.rcvif; next = m->m_nextpkt; m->m_nextpkt = NULL; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "flush queued frame %p len %d", m, m->m_pkthdr.len); - /* * If the mbuf has M_ENCAP set, ensure we free it. * Note that after if_transmit() is called, m is invalid. */ - if (ifp->if_transmit(ifp, m) != 0) { - if (is_encap) - ieee80211_free_node(ni_encap); - } + (void) ieee80211_vap_transmit(vap, m); } #undef IS_PROXY #undef PROXIED_BY_US Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_mesh.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_mesh.c Sat Mar 9 01:39:42 2013 (r248080) @@ -1041,11 +1041,12 @@ mesh_transmit_to_gate(struct ieee80211va { struct ifnet *ifp = vap->iv_ifp; struct ieee80211com *ic = vap->iv_ic; - struct ifnet *parent = ic->ic_ifp; struct ieee80211_node *ni; struct ether_header *eh; int error; + IEEE80211_TX_UNLOCK_ASSERT(ic); + eh = mtod(m, struct ether_header *); ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); if (ni == NULL) { @@ -1132,6 +1133,8 @@ mesh_transmit_to_gate(struct ieee80211va } } #endif /* IEEE80211_SUPPORT_SUPERG */ + + IEEE80211_TX_LOCK(ic); if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { /* * Encapsulate the packet in prep for transmission. @@ -1143,9 +1146,9 @@ mesh_transmit_to_gate(struct ieee80211va return; } } - error = parent->if_transmit(parent, m); + error = ieee80211_parent_transmit(ic, m); + IEEE80211_TX_UNLOCK(ic); if (error != 0) { - m_freem(m); ieee80211_free_node(ni); } else { ifp->if_opackets++; @@ -1171,6 +1174,8 @@ ieee80211_mesh_forward_to_gates(struct i struct ieee80211_mesh_gate_route *gr = NULL, *gr_next; struct mbuf *m, *mcopy, *next; + IEEE80211_TX_UNLOCK_ASSERT(ic); + KASSERT( rt_dest->rt_flags == IEEE80211_MESHRT_FLAGS_DISCOVER, ("Route is not marked with IEEE80211_MESHRT_FLAGS_DISCOVER")); @@ -1240,7 +1245,6 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211com *ic = vap->iv_ic; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ifnet *ifp = vap->iv_ifp; - struct ifnet *parent = ic->ic_ifp; const struct ieee80211_frame *wh = mtod(m, const struct ieee80211_frame *); struct mbuf *mcopy; @@ -1249,6 +1253,9 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211_node *ni; int err; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + /* * mesh ttl of 1 means we are the last one receving it, * according to amendment we decrement and then check if @@ -1320,7 +1327,20 @@ mesh_forward(struct ieee80211vap *vap, s /* XXX do we know m_nextpkt is NULL? */ mcopy->m_pkthdr.rcvif = (void *) ni; - err = parent->if_transmit(parent, mcopy); + + /* + * XXX this bypasses all of the VAP TX handling; it passes frames + * directly to the parent interface. + * + * Because of this, there's no TX lock being held as there's no + * encaps state being used. + * + * Doing a direct parent transmit may not be the correct thing + * to do here; we'll have to re-think this soon. + */ + IEEE80211_TX_LOCK(ic); + err = ieee80211_parent_transmit(ic, mcopy); + IEEE80211_TX_UNLOCK(ic); if (err != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); @@ -1457,6 +1477,10 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1512,8 +1536,12 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; + struct ieee80211com *ic = vap->iv_ic; int ae; + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1575,6 +1603,10 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211com *ic = vap->iv_ic; + + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); mesh_forward(vap, m, mc); @@ -1621,6 +1653,9 @@ mesh_input(struct ieee80211_node *ni, st need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ + /* This is called from the RX path - don't hold this lock */ + IEEE80211_TX_UNLOCK_ASSERT(ic); + if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, @@ -2743,6 +2778,7 @@ mesh_send_action(struct ieee80211_node * struct ieee80211com *ic = ni->ni_ic; struct ieee80211_bpf_params params; struct ieee80211_frame *wh; + int ret; KASSERT(ni != NULL, ("null node")); @@ -2761,6 +2797,7 @@ mesh_send_action(struct ieee80211_node * return ENOMEM; } + IEEE80211_TX_LOCK(ic); wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, @@ -2778,7 +2815,9 @@ mesh_send_action(struct ieee80211_node * IEEE80211_NODE_STAT(ni, tx_mgmt); - return ic->ic_raw_xmit(ni, m, ¶ms); + ret = ieee80211_raw_output(vap, ni, m, ¶ms); + IEEE80211_TX_UNLOCK(ic); + return (ret); } #define ADDSHORT(frm, v) do { \ Modified: user/attilio/vmobj-rwlock/sys/net80211/ieee80211_output.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/net80211/ieee80211_output.c Sat Mar 9 01:05:36 2013 (r248079) +++ user/attilio/vmobj-rwlock/sys/net80211/ieee80211_output.c Sat Mar 9 01:39:42 2013 (r248080) @@ -110,6 +110,255 @@ doprint(struct ieee80211vap *vap, int su #endif /* + * Send the given mbuf through the given vap. + * + * This consumes the mbuf regardless of whether the transmit + * was successful or not. + * + * This does none of the initial checks that ieee80211_start() + * does (eg CAC timeout, interface wakeup) - the caller must + * do this first. + */ +static int +ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m) +{ +#define IS_DWDS(vap) \ + (vap->iv_opmode == IEEE80211_M_WDS && \ + (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *ifp = vap->iv_ifp; + struct ieee80211_node *ni; + struct ether_header *eh; + int error; + + /* + * Cancel any background scan. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + ieee80211_cancel_anyscan(vap); + /* + * Find the node for the destination so we can do + * things like power save and fast frames aggregation. + * + * NB: past this point various code assumes the first + * mbuf has the 802.3 header present (and contiguous). + */ + ni = NULL; + if (m->m_len < sizeof(struct ether_header) && + (m = m_pullup(m, sizeof(struct ether_header))) == NULL) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + "discard frame, %s\n", "m_pullup failed"); + vap->iv_stats.is_tx_nobuf++; /* XXX */ + ifp->if_oerrors++; + return (ENOBUFS); + } + eh = mtod(m, struct ether_header *); + if (ETHER_IS_MULTICAST(eh->ether_dhost)) { + if (IS_DWDS(vap)) { + /* + * Only unicast frames from the above go out + * DWDS vaps; multicast frames are handled by + * dispatching the frame as it comes through + * the AP vap (see below). + */ + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_WDS, + eh->ether_dhost, "mcast", "%s", "on DWDS"); + vap->iv_stats.is_dwds_mcast++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + /* + * Spam DWDS vap's w/ multicast traffic. + */ + /* XXX only if dwds in use? */ + ieee80211_dwds_mcast(vap, m); + } + } +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode != IEEE80211_M_MBSS) { +#endif + ni = ieee80211_find_txnode(vap, eh->ether_dhost); + if (ni == NULL) { + /* NB: ieee80211_find_txnode does stat+msg */ + ifp->if_oerrors++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + if (ni->ni_associd == 0 && + (ni->ni_flags & IEEE80211_NODE_ASSOCID)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + eh->ether_dhost, NULL, + "sta not associated (type 0x%04x)", + htons(eh->ether_type)); + vap->iv_stats.is_tx_notassoc++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + /* XXX better status? */ + return (ENOBUFS); + } +#ifdef IEEE80211_SUPPORT_MESH + } else { + if (!IEEE80211_ADDR_EQ(eh->ether_shost, vap->iv_myaddr)) { + /* + * Proxy station only if configured. + */ + if (!ieee80211_mesh_isproxyena(vap)) { + IEEE80211_DISCARD_MAC(vap, + IEEE80211_MSG_OUTPUT | + IEEE80211_MSG_MESH, + eh->ether_dhost, NULL, + "%s", "proxy not enabled"); + vap->iv_stats.is_mesh_notproxy++; + ifp->if_oerrors++; + m_freem(m); + /* XXX better status? */ + return (ENOBUFS); + } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, + "forward frame from DS SA(%6D), DA(%6D)\n", + eh->ether_shost, ":", + eh->ether_dhost, ":"); + ieee80211_mesh_proxy_check(vap, eh->ether_shost); + } + ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); + if (ni == NULL) { + /* + * NB: ieee80211_mesh_discover holds/disposes + * frame (e.g. queueing on path discovery). + */ + ifp->if_oerrors++; + /* XXX better status? */ + return (ENOBUFS); + } + } +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 01:54:27 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 819C7BCD; Sat, 9 Mar 2013 01:54:27 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 748D2403; Sat, 9 Mar 2013 01:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r291sRGW054865; Sat, 9 Mar 2013 01:54:27 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r291sRlH054864; Sat, 9 Mar 2013 01:54:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090154.r291sRlH054864@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 01:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248081 - user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 01:54:27 -0000 Author: attilio Date: Sat Mar 9 01:54:26 2013 New Revision: 248081 URL: http://svnweb.freebsd.org/changeset/base/248081 Log: Add missing FBSDID() tag for new file. Sponsored by: EMC / Isilon storage division Modified: user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Modified: user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Sat Mar 9 01:39:42 2013 (r248080) +++ user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Sat Mar 9 01:54:26 2013 (r248081) @@ -25,6 +25,7 @@ */ #include +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 02:13:26 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2F6FB7C; Sat, 9 Mar 2013 02:13:26 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 093E768B; Sat, 9 Mar 2013 02:13:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r292DPe7061336; Sat, 9 Mar 2013 02:13:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r292DPli061332; Sat, 9 Mar 2013 02:13:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090213.r292DPli061332@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 02:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248083 - in user/attilio/vmobj-rwlock/sys: cddl/compat/opensolaris/sys vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:13:26 -0000 Author: attilio Date: Sat Mar 9 02:13:24 2013 New Revision: 248083 URL: http://svnweb.freebsd.org/changeset/base/248083 Log: MFC Modified: user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vnode.h user/attilio/vmobj-rwlock/sys/vm/vm_object.c user/attilio/vmobj-rwlock/sys/vm/vm_object.h user/attilio/vmobj-rwlock/sys/vm/vm_page.c Directory Properties: user/attilio/vmobj-rwlock/ (props changed) user/attilio/vmobj-rwlock/sys/ (props changed) Modified: user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 02:05:29 2013 (r248082) +++ user/attilio/vmobj-rwlock/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 02:13:24 2013 (r248083) @@ -76,7 +76,7 @@ vn_is_readonly(vnode_t *vp) #define vn_has_cached_data(vp) \ ((vp)->v_object != NULL && \ ((vp)->v_object->resident_page_count > 0 || \ - (vp)->v_object->cache != NULL)) + !vm_object_cache_is_empty((vp)->v_object))) #define vn_exists(vp) do { } while (0) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) Modified: user/attilio/vmobj-rwlock/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/vm/vm_object.c Sat Mar 9 02:05:29 2013 (r248082) +++ user/attilio/vmobj-rwlock/sys/vm/vm_object.c Sat Mar 9 02:13:24 2013 (r248083) @@ -174,7 +174,7 @@ vm_object_zdtor(void *mem, int size, voi ("object %p has reservations", object)); #endif - KASSERT(object->cache == NULL, + KASSERT(vm_object_cache_is_empty(object), ("object %p has cached pages", object)); KASSERT(object->paging_in_progress == 0, @@ -753,7 +753,7 @@ vm_object_terminate(vm_object_t object) if (__predict_false(!LIST_EMPTY(&object->rvq))) vm_reserv_break_all(object); #endif - if (__predict_false(object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, 0, 0); /* @@ -1378,7 +1378,7 @@ retry: * should still be OBJT_DEFAULT and orig_object should not * contain any cached pages within the specified range. */ - if (__predict_false(orig_object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(orig_object))) vm_page_cache_transfer(orig_object, offidxstart, new_object); } @@ -1727,7 +1727,8 @@ vm_object_collapse(vm_object_t object) /* * Free any cached pages from backing_object. */ - if (__predict_false(backing_object->cache != NULL)) + if (__predict_false( + !vm_object_cache_is_empty(backing_object))) vm_page_cache_free(backing_object, 0, 0); } /* @@ -1921,7 +1922,7 @@ again: } vm_object_pip_wakeup(object); skipmemq: - if (__predict_false(object->cache != NULL)) + if (__predict_false(!vm_object_cache_is_empty(object))) vm_page_cache_free(object, start, end); } Modified: user/attilio/vmobj-rwlock/sys/vm/vm_object.h ============================================================================== --- user/attilio/vmobj-rwlock/sys/vm/vm_object.h Sat Mar 9 02:05:29 2013 (r248082) +++ user/attilio/vmobj-rwlock/sys/vm/vm_object.h Sat Mar 9 02:13:24 2013 (r248083) @@ -242,6 +242,13 @@ void vm_object_pip_wakeup(vm_object_t ob void vm_object_pip_wakeupn(vm_object_t object, short i); void vm_object_pip_wait(vm_object_t object, char *waitid); +static __inline boolean_t +vm_object_cache_is_empty(vm_object_t object) +{ + + return (object->cache == NULL); +} + vm_object_t vm_object_allocate (objtype_t, vm_pindex_t); boolean_t vm_object_coalesce(vm_object_t, vm_ooffset_t, vm_size_t, vm_size_t, boolean_t); Modified: user/attilio/vmobj-rwlock/sys/vm/vm_page.c ============================================================================== --- user/attilio/vmobj-rwlock/sys/vm/vm_page.c Sat Mar 9 02:05:29 2013 (r248082) +++ user/attilio/vmobj-rwlock/sys/vm/vm_page.c Sat Mar 9 02:13:24 2013 (r248083) @@ -1130,7 +1130,7 @@ vm_page_cache_free(vm_object_t object, v boolean_t empty; mtx_lock(&vm_page_queue_free_mtx); - if (__predict_false(object->cache == NULL)) { + if (__predict_false(vm_object_cache_is_empty(object))) { mtx_unlock(&vm_page_queue_free_mtx); return; } @@ -1174,7 +1174,7 @@ vm_page_cache_free(vm_object_t object, v cnt.v_cache_count--; cnt.v_free_count++; } - empty = object->cache == NULL; + empty = vm_object_cache_is_empty(object); mtx_unlock(&vm_page_queue_free_mtx); if (object->type == OBJT_VNODE && empty) vdrop(object->handle); @@ -1258,7 +1258,7 @@ vm_page_cache_transfer(vm_object_t orig_ * not. */ VM_OBJECT_ASSERT_WLOCKED(new_object); - KASSERT(new_object->cache == NULL, + KASSERT(vm_object_cache_is_empty(new_object), ("vm_page_cache_transfer: object %p has cached pages", new_object)); mtx_lock(&vm_page_queue_free_mtx); @@ -1301,7 +1301,7 @@ vm_page_cache_transfer(vm_object_t orig_ m_next->left = m; new_object->cache = m_next; } - KASSERT(new_object->cache == NULL || + KASSERT(vm_object_cache_is_empty(new_object) || new_object->type == OBJT_SWAP, ("vm_page_cache_transfer: object %p's type is incompatible" " with cached pages", new_object)); @@ -1328,7 +1328,7 @@ vm_page_is_cached(vm_object_t object, vm * exist. */ VM_OBJECT_ASSERT_WLOCKED(object); - if (__predict_true(object->cache == NULL)) + if (__predict_true(vm_object_cache_is_empty(object))) return (FALSE); mtx_lock(&vm_page_queue_free_mtx); m = vm_page_cache_lookup(object, pindex); @@ -1466,7 +1466,8 @@ vm_page_alloc(vm_object_t object, vm_pin m->valid = 0; m_object = m->object; vm_page_cache_remove(m); - if (m_object->type == OBJT_VNODE && m_object->cache == NULL) + if (m_object->type == OBJT_VNODE && + vm_object_cache_is_empty(m_object)) vp = m_object->handle; } else { KASSERT(VM_PAGE_IS_FREE(m), @@ -1723,7 +1724,8 @@ vm_page_alloc_init(vm_page_t m) m->valid = 0; m_object = m->object; vm_page_cache_remove(m); - if (m_object->type == OBJT_VNODE && m_object->cache == NULL) + if (m_object->type == OBJT_VNODE && + vm_object_cache_is_empty(m_object)) drop = m_object->handle; } else { KASSERT(VM_PAGE_IS_FREE(m), From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 02:42:53 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DD046EF; Sat, 9 Mar 2013 02:42:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E605D747; Sat, 9 Mar 2013 02:42:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r292gqBJ070436; Sat, 9 Mar 2013 02:42:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r292gq7E070435; Sat, 9 Mar 2013 02:42:52 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090242.r292gq7E070435@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 02:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248086 - in user/attilio/vmobj-rwlock: . sys sys/conf X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:42:53 -0000 Author: attilio Date: Sat Mar 9 02:42:52 2013 New Revision: 248086 URL: http://svnweb.freebsd.org/changeset/base/248086 Log: MFC Modified: Directory Properties: user/attilio/vmobj-rwlock/ (props changed) user/attilio/vmobj-rwlock/sys/ (props changed) user/attilio/vmobj-rwlock/sys/conf/ (props changed) From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 02:51:57 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 000D5891; Sat, 9 Mar 2013 02:51:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E27CE796; Sat, 9 Mar 2013 02:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r292puTr073471; Sat, 9 Mar 2013 02:51:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r292ppiF073438; Sat, 9 Mar 2013 02:51:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090251.r292ppiF073438@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 02:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248087 - in user/attilio/vmcontention: . sbin/geom/class/raid sys/amd64/amd64 sys/arm/arm sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 02:51:57 -0000 Author: attilio Date: Sat Mar 9 02:51:51 2013 New Revision: 248087 URL: http://svnweb.freebsd.org/changeset/base/248087 Log: MFC Added: user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c - copied unchanged from r248086, head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h - copied unchanged from r248086, head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h - copied unchanged from r248086, head/sys/cddl/compat/opensolaris/sys/vm.h user/attilio/vmcontention/usr.bin/truss/arm-fbsd.c - copied unchanged from r248086, head/usr.bin/truss/arm-fbsd.c Modified: user/attilio/vmcontention/UPDATING user/attilio/vmcontention/sbin/geom/class/raid/graid.8 user/attilio/vmcontention/sys/amd64/amd64/machdep.c user/attilio/vmcontention/sys/amd64/amd64/pmap.c user/attilio/vmcontention/sys/arm/arm/cpufunc_asm_arm11x6.S user/attilio/vmcontention/sys/arm/arm/machdep.c user/attilio/vmcontention/sys/arm/arm/pmap-v6.c user/attilio/vmcontention/sys/arm/arm/pmap.c user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vnode.h user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c user/attilio/vmcontention/sys/conf/files user/attilio/vmcontention/sys/dev/agp/agp.c user/attilio/vmcontention/sys/dev/agp/agp_i810.c user/attilio/vmcontention/sys/dev/drm/drmP.h user/attilio/vmcontention/sys/dev/drm2/drmP.h user/attilio/vmcontention/sys/dev/drm2/drm_fb_helper.c user/attilio/vmcontention/sys/dev/drm2/drm_global.c user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo_vm.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_memory.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_tt.c user/attilio/vmcontention/sys/dev/hwpmc/hwpmc_mod.c user/attilio/vmcontention/sys/dev/md/md.c user/attilio/vmcontention/sys/dev/netmap/netmap.c user/attilio/vmcontention/sys/dev/oce/oce_hw.h user/attilio/vmcontention/sys/dev/oce/oce_sysctl.c user/attilio/vmcontention/sys/dev/sound/pcm/dsp.c user/attilio/vmcontention/sys/fs/fuse/fuse_io.c user/attilio/vmcontention/sys/fs/fuse/fuse_vnops.c user/attilio/vmcontention/sys/fs/nfsclient/nfs_clbio.c user/attilio/vmcontention/sys/fs/nfsclient/nfs_clnode.c user/attilio/vmcontention/sys/fs/nfsclient/nfs_clvnops.c user/attilio/vmcontention/sys/fs/nfsserver/nfs_nfsdport.c user/attilio/vmcontention/sys/fs/procfs/procfs_map.c user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_subr.c user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c user/attilio/vmcontention/sys/geom/label/g_label_ntfs.c user/attilio/vmcontention/sys/geom/raid/g_raid.c user/attilio/vmcontention/sys/i386/i386/machdep.c user/attilio/vmcontention/sys/i386/i386/pmap.c user/attilio/vmcontention/sys/i386/xen/pmap.c user/attilio/vmcontention/sys/ia64/ia64/machdep.c user/attilio/vmcontention/sys/ia64/ia64/pmap.c user/attilio/vmcontention/sys/kern/imgact_elf.c user/attilio/vmcontention/sys/kern/kern_exec.c user/attilio/vmcontention/sys/kern/kern_proc.c user/attilio/vmcontention/sys/kern/kern_sharedpage.c user/attilio/vmcontention/sys/kern/kern_shutdown.c user/attilio/vmcontention/sys/kern/kern_timeout.c user/attilio/vmcontention/sys/kern/subr_param.c user/attilio/vmcontention/sys/kern/subr_uio.c user/attilio/vmcontention/sys/kern/sys_process.c user/attilio/vmcontention/sys/kern/sysv_shm.c user/attilio/vmcontention/sys/kern/uipc_shm.c user/attilio/vmcontention/sys/kern/uipc_syscalls.c user/attilio/vmcontention/sys/kern/vfs_aio.c user/attilio/vmcontention/sys/kern/vfs_bio.c user/attilio/vmcontention/sys/kern/vfs_cluster.c user/attilio/vmcontention/sys/kern/vfs_default.c user/attilio/vmcontention/sys/kern/vfs_subr.c user/attilio/vmcontention/sys/kern/vfs_syscalls.c user/attilio/vmcontention/sys/kern/vfs_vnops.c user/attilio/vmcontention/sys/mips/mips/machdep.c user/attilio/vmcontention/sys/mips/mips/pmap.c user/attilio/vmcontention/sys/modules/ath/Makefile user/attilio/vmcontention/sys/modules/zfs/Makefile user/attilio/vmcontention/sys/net/if.c user/attilio/vmcontention/sys/net/route.c user/attilio/vmcontention/sys/net/route.h user/attilio/vmcontention/sys/net80211/ieee80211.c user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.h user/attilio/vmcontention/sys/net80211/ieee80211_hostap.c user/attilio/vmcontention/sys/net80211/ieee80211_ht.c user/attilio/vmcontention/sys/net80211/ieee80211_hwmp.c user/attilio/vmcontention/sys/net80211/ieee80211_mesh.c user/attilio/vmcontention/sys/net80211/ieee80211_output.c user/attilio/vmcontention/sys/net80211/ieee80211_power.c user/attilio/vmcontention/sys/net80211/ieee80211_proto.h user/attilio/vmcontention/sys/net80211/ieee80211_superg.c user/attilio/vmcontention/sys/net80211/ieee80211_var.h user/attilio/vmcontention/sys/net80211/ieee80211_wds.c user/attilio/vmcontention/sys/nfsclient/nfs_bio.c user/attilio/vmcontention/sys/nfsclient/nfs_vnops.c user/attilio/vmcontention/sys/nfsserver/nfs_serv.c user/attilio/vmcontention/sys/ofed/drivers/infiniband/core/umem.c user/attilio/vmcontention/sys/ofed/include/linux/linux_compat.c user/attilio/vmcontention/sys/pc98/pc98/machdep.c user/attilio/vmcontention/sys/powerpc/aim/machdep.c user/attilio/vmcontention/sys/powerpc/aim/mmu_oea.c user/attilio/vmcontention/sys/powerpc/aim/mmu_oea64.c user/attilio/vmcontention/sys/powerpc/booke/machdep.c user/attilio/vmcontention/sys/powerpc/booke/pmap.c user/attilio/vmcontention/sys/security/mac/mac_process.c user/attilio/vmcontention/sys/sparc64/conf/GENERIC user/attilio/vmcontention/sys/sparc64/sparc64/machdep.c user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c user/attilio/vmcontention/sys/sys/callout.h user/attilio/vmcontention/sys/sys/systm.h user/attilio/vmcontention/sys/ufs/ffs/ffs_rawread.c user/attilio/vmcontention/sys/ufs/ffs/ffs_vnops.c user/attilio/vmcontention/sys/vm/default_pager.c user/attilio/vmcontention/sys/vm/device_pager.c user/attilio/vmcontention/sys/vm/phys_pager.c user/attilio/vmcontention/sys/vm/sg_pager.c user/attilio/vmcontention/sys/vm/swap_pager.c user/attilio/vmcontention/sys/vm/uma_core.c user/attilio/vmcontention/sys/vm/vm_fault.c user/attilio/vmcontention/sys/vm/vm_glue.c user/attilio/vmcontention/sys/vm/vm_init.c user/attilio/vmcontention/sys/vm/vm_kern.c user/attilio/vmcontention/sys/vm/vm_map.c user/attilio/vmcontention/sys/vm/vm_meter.c user/attilio/vmcontention/sys/vm/vm_mmap.c user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/sys/vm/vm_object.h user/attilio/vmcontention/sys/vm/vm_page.c user/attilio/vmcontention/sys/vm/vm_pageout.c user/attilio/vmcontention/sys/vm/vm_pager.c user/attilio/vmcontention/sys/vm/vm_pager.h user/attilio/vmcontention/sys/vm/vm_reserv.c user/attilio/vmcontention/sys/vm/vnode_pager.c user/attilio/vmcontention/usr.bin/Makefile.arm user/attilio/vmcontention/usr.bin/truss/extern.h user/attilio/vmcontention/usr.bin/truss/main.c user/attilio/vmcontention/usr.sbin/pkg/pkg.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) Modified: user/attilio/vmcontention/UPDATING ============================================================================== --- user/attilio/vmcontention/UPDATING Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/UPDATING Sat Mar 9 02:51:51 2013 (r248087) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130308: + CTL_DISABLE has also been added to the sparc64 GENERIC (for further + information, see the respective 20130304 entry). + 20130304: Recent commits to callout(9) changed the size of struct callout, so the KBI is probably heavily disturbed. Also, some functions Modified: user/attilio/vmcontention/sbin/geom/class/raid/graid.8 ============================================================================== --- user/attilio/vmcontention/sbin/geom/class/raid/graid.8 Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sbin/geom/class/raid/graid.8 Sat Mar 9 02:51:51 2013 (r248087) @@ -305,6 +305,9 @@ Write errors are always considered as di Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of /dev/ar%d devices from ataraid(4) +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: user/attilio/vmcontention/sys/amd64/amd64/machdep.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/machdep.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/amd64/amd64/machdep.c Sat Mar 9 02:51:51 2013 (r248087) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef SMP Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/amd64/amd64/pmap.c Sat Mar 9 02:51:51 2013 (r248087) @@ -3556,7 +3556,7 @@ 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 | VPO_BUSY)) == 0) - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); if ((access & VM_PROT_WRITE) != 0) @@ -3823,7 +3823,7 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_LOCK_ASSERT(m_start->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m_start->object); psize = atop(end - start); mpte = NULL; m = m_start; @@ -4005,7 +4005,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_page_t p, pdpg; int pat_mode; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { @@ -4619,7 +4619,7 @@ pmap_is_modified(vm_page_t m) * concurrently set while the object is locked. Thus, if PGA_WRITEABLE * is clear, no PTEs can have PG_M set. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); @@ -4750,7 +4750,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; @@ -4894,7 +4894,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); Modified: user/attilio/vmcontention/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 02:51:51 2013 (r248087) @@ -62,6 +62,8 @@ #include __FBSDID("$FreeBSD$"); + .cpu arm1136js + #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ mcr p15, 0, Rtmp1, c7, c5, 0 /* Invalidate Entire I cache */ Modified: user/attilio/vmcontention/sys/arm/arm/machdep.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/machdep.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/arm/arm/machdep.c Sat Mar 9 02:51:51 2013 (r248087) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: user/attilio/vmcontention/sys/arm/arm/pmap-v6.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/pmap-v6.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/arm/arm/pmap-v6.c Sat Mar 9 02:51:51 2013 (r248087) @@ -2212,7 +2212,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -3428,7 +3428,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -3475,7 +3475,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Modified: user/attilio/vmcontention/sys/arm/arm/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/pmap.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/arm/arm/pmap.c Sat Mar 9 02:51:51 2013 (r248087) @@ -3006,7 +3006,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -4461,7 +4461,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -4523,7 +4523,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Copied: user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c (from r248086, head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Sat Mar 9 02:51:51 2013 (r248087, copy of r248086, head/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +const int zfs_vm_pagerret_bad = VM_PAGER_BAD; +const int zfs_vm_pagerret_error = VM_PAGER_ERROR; +const int zfs_vm_pagerret_ok = VM_PAGER_OK; + +void +zfs_vmobject_assert_wlocked(vm_object_t object) +{ + + /* + * This is not ideal because FILE/LINE used by assertions will not + * be too helpful, but it must be an hard function for + * compatibility reasons. + */ + VM_OBJECT_ASSERT_WLOCKED(object); +} + +void +zfs_vmobject_wlock(vm_object_t object) +{ + + VM_OBJECT_WLOCK(object); +} + +void +zfs_vmobject_wunlock(vm_object_t object) +{ + + VM_OBJECT_WUNLOCK(object); +} Copied: user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h (from r248086, head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h Sat Mar 9 02:51:51 2013 (r248087, copy of r248086, head/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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$ + */ + +#ifndef _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ +#define _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ + +#include_next + +#endif Copied: user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h (from r248086, head/sys/cddl/compat/opensolaris/sys/vm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h Sat Mar 9 02:51:51 2013 (r248087, copy of r248086, head/sys/cddl/compat/opensolaris/sys/vm.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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$ + */ + +#ifndef _OPENSOLARIS_SYS_VM_H_ +#define _OPENSOLARIS_SYS_VM_H_ + +#ifdef _KERNEL + +extern const int zfs_vm_pagerret_bad; +extern const int zfs_vm_pagerret_error; +extern const int zfs_vm_pagerret_ok; + +void zfs_vmobject_assert_wlocked(vm_object_t object); +void zfs_vmobject_wlock(vm_object_t object); +void zfs_vmobject_wunlock(vm_object_t object); + +#endif /* _KERNEL */ + +#endif /* _OPENSOLARIS_SYS_VM_H_ */ Modified: user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vnode.h Sat Mar 9 02:51:51 2013 (r248087) @@ -75,7 +75,8 @@ vn_is_readonly(vnode_t *vp) #define vn_mountedvfs(vp) ((vp)->v_mountedhere) #define vn_has_cached_data(vp) \ ((vp)->v_object != NULL && \ - (vp)->v_object->cached_page_count > 0) + ((vp)->v_object->resident_page_count > 0 || \ + !vm_object_cache_is_empty((vp)->v_object))) #define vn_exists(vp) do { } while (0) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 02:51:51 2013 (r248087) @@ -103,7 +103,6 @@ extern "C" { #include #include #include -#include #include #include /* There is clash. vm_map.h defines the two below and vdev_cache.c use them. */ Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 02:51:51 2013 (r248087) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -329,7 +330,7 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -377,7 +378,7 @@ page_hold(vnode_t *vp, int64_t start) vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -450,7 +451,7 @@ update_pages(vnode_t *vp, int64_t start, ASSERT(obj != NULL); off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; int nbytes = imin(PAGESIZE - off, len); @@ -467,23 +468,23 @@ update_pages(vnode_t *vp, int64_t start, ("zfs update_pages: unbusy page in putpages case")); KASSERT(!pmap_page_is_write_mapped(pp), ("zfs update_pages: writable page in putpages case")); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_write(os, oid, start, nbytes, va, tx); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_undirty(pp); } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_read(os, oid, start+off, nbytes, va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unbusy(pp); } len -= nbytes; @@ -491,7 +492,7 @@ update_pages(vnode_t *vp, int64_t start, } if (segflg != UIO_NOCOPY) vm_object_pip_wakeupn(obj, 0); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); } /* @@ -523,7 +524,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u ASSERT(obj != NULL); ASSERT((uio->uio_loffset & PAGEOFFSET) == 0); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start = uio->uio_loffset; len > 0; start += PAGESIZE) { int bytes = MIN(PAGESIZE, len); @@ -531,14 +532,14 @@ mappedread_sf(vnode_t *vp, int nbytes, u VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY); if (pp->valid == 0) { vm_page_io_start(pp); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); if (bytes != PAGESIZE && error == 0) bzero(va + bytes, PAGESIZE - bytes); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_io_finish(pp); vm_page_lock(pp); if (error) { @@ -555,7 +556,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u uio->uio_offset += bytes; len -= bytes; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -587,7 +588,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ start = uio->uio_loffset; off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); @@ -596,23 +597,23 @@ mappedread(vnode_t *vp, int nbytes, uio_ struct sf_buf *sf; caddr_t va; - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unhold(pp); } else { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); } len -= bytes; off = 0; if (error) break; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -5684,7 +5685,7 @@ zfs_getpages(struct vnode *vp, vm_page_t mfirst = m[reqstart]; mlast = m[reqstart + reqsize - 1]; - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = 0; i < reqstart; i++) { vm_page_lock(m[i]); @@ -5700,9 +5701,9 @@ zfs_getpages(struct vnode *vp, vm_page_t if (mreq->valid && reqsize == 1) { if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_OK); + return (zfs_vm_pagerret_ok); } PCPU_INC(cnt.v_vnodein); @@ -5716,16 +5717,16 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_unlock(m[i]); } } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_BAD); + return (zfs_vm_pagerret_bad); } lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { size = PAGE_SIZE; @@ -5741,7 +5742,7 @@ zfs_getpages(struct vnode *vp, vm_page_t break; } - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { if (!error) @@ -5751,11 +5752,11 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_readahead_finish(m[i]); } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - return (error ? VM_PAGER_ERROR : VM_PAGER_OK); + return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); } static int Modified: user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c Sat Mar 9 02:51:51 2013 (r248087) @@ -1031,9 +1031,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { - VM_OBJECT_LOCK(tobj); + VM_OBJECT_WLOCK(tobj); if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); lobj = tobj; } last_timestamp = map->timestamp; @@ -1049,11 +1049,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) else vp = NULL; if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); flags = obj->flags; ref_count = obj->ref_count; shadow_count = obj->shadow_count; - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); if (vp) { vn_fullpath(td, vp, &name, &freename); vn_lock(vp, LK_SHARED | LK_RETRY); Modified: user/attilio/vmcontention/sys/conf/files ============================================================================== --- user/attilio/vmcontention/sys/conf/files Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/conf/files Sat Mar 9 02:51:51 2013 (r248087) @@ -157,6 +157,7 @@ cddl/compat/opensolaris/kern/opensolaris cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_uio.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_vfs.c optional zfs compile-with "${ZFS_C}" +cddl/compat/opensolaris/kern/opensolaris_vm.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" Modified: user/attilio/vmcontention/sys/dev/agp/agp.c ============================================================================== --- user/attilio/vmcontention/sys/dev/agp/agp.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/agp/agp.c Sat Mar 9 02:51:51 2013 (r248087) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -544,7 +545,7 @@ agp_generic_bind_memory(device_t dev, st * because vm_page_grab() may sleep and we can't hold a mutex * while sleeping. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { /* * Find a page from the object and wire it @@ -557,14 +558,14 @@ agp_generic_bind_memory(device_t dev, st VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mtx_lock(&sc->as_lock); if (mem->am_is_bound) { device_printf(dev, "memory already bound\n"); error = EINVAL; - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); i = 0; goto bad; } @@ -573,7 +574,7 @@ agp_generic_bind_memory(device_t dev, st * Bind the individual pages and flush the chipset's * TLB. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i)); @@ -601,7 +602,7 @@ agp_generic_bind_memory(device_t dev, st } vm_page_wakeup(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); /* * Flush the cpu cache since we are providing a new mapping @@ -622,7 +623,7 @@ agp_generic_bind_memory(device_t dev, st return 0; bad: mtx_unlock(&sc->as_lock); - VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(mem->am_obj); for (k = 0; k < mem->am_size; k += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k)); if (k >= i) @@ -631,7 +632,7 @@ bad: vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); return error; } @@ -658,14 +659,14 @@ agp_generic_unbind_memory(device_t dev, */ for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, mem->am_offset + i); - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); agp_flush_cache(); AGP_FLUSH_TLB(dev); Modified: user/attilio/vmcontention/sys/dev/agp/agp_i810.c ============================================================================== --- user/attilio/vmcontention/sys/dev/agp/agp_i810.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/agp/agp_i810.c Sat Mar 9 02:51:51 2013 (r248087) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1967,10 +1968,10 @@ agp_i810_alloc_memory(device_t dev, int * Allocate and wire down the page now so that we can * get its physical address. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mem->am_physical = VM_PAGE_TO_PHYS(m); } else { /* Our allocation is already nicely wired down for us. @@ -2005,12 +2006,12 @@ agp_i810_free_memory(device_t dev, struc /* * Unwire the page which we wired in alloc_memory. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_lookup(mem->am_obj, 0); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); } else { contigfree(sc->argb_cursor, mem->am_size, M_AGP); sc->argb_cursor = NULL; Modified: user/attilio/vmcontention/sys/dev/drm/drmP.h ============================================================================== --- user/attilio/vmcontention/sys/dev/drm/drmP.h Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm/drmP.h Sat Mar 9 02:51:51 2013 (r248087) @@ -59,6 +59,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: user/attilio/vmcontention/sys/dev/drm2/drmP.h ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/drmP.h Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/drmP.h Sat Mar 9 02:51:51 2013 (r248087) @@ -58,6 +58,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: user/attilio/vmcontention/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 02:51:51 2013 (r248087) @@ -555,8 +555,11 @@ static void drm_fb_helper_crtc_free(stru for (i = 0; i < helper->connector_count; i++) free(helper->connector_info[i], DRM_MEM_KMS); free(helper->connector_info, DRM_MEM_KMS); - for (i = 0; i < helper->crtc_count; i++) + for (i = 0; i < helper->crtc_count; i++) { free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); + if (helper->crtc_info[i].mode_set.mode) + drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); + } free(helper->crtc_info, DRM_MEM_KMS); } Modified: user/attilio/vmcontention/sys/dev/drm2/drm_global.c ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/drm_global.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/drm_global.c Sat Mar 9 02:51:51 2013 (r248087) @@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_gl MPASS(ref->object == item->object); if (--item->refcount == 0) { ref->release(ref); + free(item->object, M_DRM_GLOBAL); item->object = NULL; } sx_xunlock(&item->mutex); Modified: user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 02:51:51 2013 (r248087) @@ -990,14 +990,14 @@ i915_gem_swap_io(struct drm_device *dev, vm_obj = obj->base.vm_obj; ret = 0; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_add(vm_obj, 1); while (size > 0) { obj_pi = OFF_TO_IDX(offset); obj_po = offset & PAGE_MASK; m = i915_gem_wire_page(vm_obj, obj_pi); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); @@ -1031,7 +1031,7 @@ i915_gem_swap_io(struct drm_device *dev, } sf_buf_free(sf); sched_unpin(); - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); if (rw == UIO_WRITE) vm_page_dirty(m); vm_page_reference(m); @@ -1044,7 +1044,7 @@ i915_gem_swap_io(struct drm_device *dev, break; } vm_object_pip_wakeup(vm_obj); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); return (ret); } @@ -1357,7 +1357,7 @@ i915_gem_pager_fault(vm_object_t vm_obj, } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); unlocked_vmobj: cause = ret = 0; m = NULL; @@ -1407,7 +1407,7 @@ unlocked_vmobj: list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list); obj->fault_mappable = true; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + offset); if (m == NULL) { @@ -1452,7 +1452,7 @@ out: kern_yield(PRI_USER); goto unlocked_vmobj; } - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_wakeup(vm_obj); return (VM_PAGER_ERROR); } @@ -2208,12 +2208,12 @@ i915_gem_object_get_pages_gtt(struct drm obj->pages = malloc(page_count * sizeof(vm_page_t), DRM_I915_GEM, M_WAITOK); vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); for (i = 0; i < page_count; i++) { if ((obj->pages[i] = i915_gem_wire_page(vm_obj, i)) == NULL) goto failed; } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); if (i915_gem_object_needs_bit17_swizzle(obj)) i915_gem_object_do_bit_17_swizzle(obj); return (0); @@ -2226,7 +2226,7 @@ failed: vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); free(obj->pages, DRM_I915_GEM); obj->pages = NULL; return (-EIO); @@ -2272,7 +2272,7 @@ i915_gem_object_put_pages_gtt(struct drm if (obj->madv == I915_MADV_DONTNEED) obj->dirty = 0; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); #if GEM_PARANOID_CHECK_GTT i915_gem_assert_pages_not_mapped(obj->base.dev, obj->pages, page_count); #endif @@ -2287,7 +2287,7 @@ i915_gem_object_put_pages_gtt(struct drm vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); obj->dirty = 0; free(obj->pages, DRM_I915_GEM); obj->pages = NULL; @@ -2309,7 +2309,7 @@ i915_gem_release_mmap(struct drm_i915_ge if (devobj != NULL) { page_count = OFF_TO_IDX(obj->base.size); - VM_OBJECT_LOCK(devobj); + VM_OBJECT_WLOCK(devobj); retry: for (i = 0; i < page_count; i++) { m = vm_page_lookup(devobj, i); @@ -2319,7 +2319,7 @@ retry: goto retry; cdev_pager_free_page(devobj, m); } - VM_OBJECT_UNLOCK(devobj); + VM_OBJECT_WUNLOCK(devobj); vm_object_deallocate(devobj); } @@ -2437,9 +2437,9 @@ i915_gem_object_truncate(struct drm_i915 vm_object_t vm_obj; vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_page_remove(vm_obj, 0, 0, false); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); obj->madv = I915_MADV_PURGED_INTERNAL; } @@ -2488,7 +2488,7 @@ i915_gem_wire_page(vm_object_t object, v vm_page_t m; int rv; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(object, pindex, NULL, NULL)) { @@ -3567,13 +3567,13 @@ i915_gem_detach_phys_object(struct drm_d vaddr = obj->phys_obj->handle->vaddr; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); if (m == NULL) continue; /* XXX */ - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); if (sf != NULL) { dst = (char *)sf_buf_kva(sf); @@ -3582,7 +3582,7 @@ i915_gem_detach_phys_object(struct drm_d } drm_clflush_pages(&m, 1); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); vm_page_dirty(m); @@ -3590,7 +3590,7 @@ i915_gem_detach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); intel_gtt_chipset_flush(); obj->phys_obj->cur_obj = NULL; @@ -3632,7 +3632,7 @@ i915_gem_attach_phys_object(struct drm_d page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); ret = 0; for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); @@ -3640,14 +3640,14 @@ i915_gem_attach_phys_object(struct drm_d ret = -EIO; break; } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); src = (char *)sf_buf_kva(sf); dst = (char *)obj->phys_obj->handle->vaddr + IDX_TO_OFF(i); memcpy(dst, src, PAGE_SIZE); sf_buf_free(sf); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); @@ -3655,7 +3655,7 @@ i915_gem_attach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); return (0); } Modified: user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 02:51:51 2013 (r248087) @@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(s ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink); vm_page_free(glob->dummy_read_page); - free(glob, M_DRM_GLOBAL); } void ttm_bo_global_release(struct drm_global_reference *ref) Modified: user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 02:42:52 2013 (r248086) +++ user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 02:51:51 2013 (r248087) @@ -118,7 +118,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 03:19:59 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34114C40; Sat, 9 Mar 2013 03:19:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 159598DC; Sat, 9 Mar 2013 03:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r293JxR9081991; Sat, 9 Mar 2013 03:19:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r293Js6x081957; Sat, 9 Mar 2013 03:19:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303090319.r293Js6x081957@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 03:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248088 - in user/attilio/vmc-playground: . sbin/geom/class/raid sys/amd64/amd64 sys/arm/arm sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolari... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 03:19:59 -0000 Author: attilio Date: Sat Mar 9 03:19:53 2013 New Revision: 248088 URL: http://svnweb.freebsd.org/changeset/base/248088 Log: Merge from vmcontention. Added: user/attilio/vmc-playground/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c - copied unchanged from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h - copied unchanged from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/vm.h - copied unchanged from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h user/attilio/vmc-playground/usr.bin/truss/arm-fbsd.c - copied unchanged from r248087, user/attilio/vmcontention/usr.bin/truss/arm-fbsd.c Modified: user/attilio/vmc-playground/UPDATING user/attilio/vmc-playground/sbin/geom/class/raid/graid.8 user/attilio/vmc-playground/sys/amd64/amd64/machdep.c user/attilio/vmc-playground/sys/amd64/amd64/pmap.c user/attilio/vmc-playground/sys/arm/arm/cpufunc_asm_arm11x6.S user/attilio/vmc-playground/sys/arm/arm/machdep.c user/attilio/vmc-playground/sys/arm/arm/pmap-v6.c user/attilio/vmc-playground/sys/arm/arm/pmap.c user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c user/attilio/vmc-playground/sys/conf/files user/attilio/vmc-playground/sys/dev/agp/agp.c user/attilio/vmc-playground/sys/dev/agp/agp_i810.c user/attilio/vmc-playground/sys/dev/drm/drmP.h user/attilio/vmc-playground/sys/dev/drm2/drmP.h user/attilio/vmc-playground/sys/dev/drm2/drm_fb_helper.c user/attilio/vmc-playground/sys/dev/drm2/drm_global.c user/attilio/vmc-playground/sys/dev/drm2/i915/i915_gem.c user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo.c user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo_vm.c user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_memory.c user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_tt.c user/attilio/vmc-playground/sys/dev/hwpmc/hwpmc_mod.c user/attilio/vmc-playground/sys/dev/md/md.c user/attilio/vmc-playground/sys/dev/netmap/netmap.c user/attilio/vmc-playground/sys/dev/oce/oce_hw.h user/attilio/vmc-playground/sys/dev/oce/oce_sysctl.c user/attilio/vmc-playground/sys/dev/sound/pcm/dsp.c user/attilio/vmc-playground/sys/fs/fuse/fuse_io.c user/attilio/vmc-playground/sys/fs/fuse/fuse_vnops.c user/attilio/vmc-playground/sys/fs/nfsclient/nfs_clbio.c user/attilio/vmc-playground/sys/fs/nfsclient/nfs_clnode.c user/attilio/vmc-playground/sys/fs/nfsclient/nfs_clvnops.c user/attilio/vmc-playground/sys/fs/nfsserver/nfs_nfsdport.c user/attilio/vmc-playground/sys/fs/procfs/procfs_map.c user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_subr.c user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_vnops.c user/attilio/vmc-playground/sys/geom/label/g_label_ntfs.c user/attilio/vmc-playground/sys/geom/raid/g_raid.c user/attilio/vmc-playground/sys/i386/i386/machdep.c user/attilio/vmc-playground/sys/i386/i386/pmap.c user/attilio/vmc-playground/sys/i386/xen/pmap.c user/attilio/vmc-playground/sys/ia64/ia64/machdep.c user/attilio/vmc-playground/sys/ia64/ia64/pmap.c user/attilio/vmc-playground/sys/kern/imgact_elf.c user/attilio/vmc-playground/sys/kern/kern_exec.c user/attilio/vmc-playground/sys/kern/kern_proc.c user/attilio/vmc-playground/sys/kern/kern_sharedpage.c user/attilio/vmc-playground/sys/kern/kern_shutdown.c user/attilio/vmc-playground/sys/kern/kern_timeout.c user/attilio/vmc-playground/sys/kern/subr_param.c user/attilio/vmc-playground/sys/kern/subr_uio.c user/attilio/vmc-playground/sys/kern/sys_process.c user/attilio/vmc-playground/sys/kern/sysv_shm.c user/attilio/vmc-playground/sys/kern/uipc_shm.c user/attilio/vmc-playground/sys/kern/uipc_syscalls.c user/attilio/vmc-playground/sys/kern/vfs_aio.c user/attilio/vmc-playground/sys/kern/vfs_bio.c user/attilio/vmc-playground/sys/kern/vfs_cluster.c user/attilio/vmc-playground/sys/kern/vfs_default.c user/attilio/vmc-playground/sys/kern/vfs_subr.c user/attilio/vmc-playground/sys/kern/vfs_syscalls.c user/attilio/vmc-playground/sys/kern/vfs_vnops.c user/attilio/vmc-playground/sys/mips/mips/machdep.c user/attilio/vmc-playground/sys/mips/mips/pmap.c user/attilio/vmc-playground/sys/modules/ath/Makefile user/attilio/vmc-playground/sys/modules/zfs/Makefile user/attilio/vmc-playground/sys/net/if.c user/attilio/vmc-playground/sys/net/route.c user/attilio/vmc-playground/sys/net/route.h user/attilio/vmc-playground/sys/net80211/ieee80211.c user/attilio/vmc-playground/sys/net80211/ieee80211_freebsd.c user/attilio/vmc-playground/sys/net80211/ieee80211_freebsd.h user/attilio/vmc-playground/sys/net80211/ieee80211_hostap.c user/attilio/vmc-playground/sys/net80211/ieee80211_ht.c user/attilio/vmc-playground/sys/net80211/ieee80211_hwmp.c user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c user/attilio/vmc-playground/sys/net80211/ieee80211_output.c user/attilio/vmc-playground/sys/net80211/ieee80211_power.c user/attilio/vmc-playground/sys/net80211/ieee80211_proto.h user/attilio/vmc-playground/sys/net80211/ieee80211_superg.c user/attilio/vmc-playground/sys/net80211/ieee80211_var.h user/attilio/vmc-playground/sys/net80211/ieee80211_wds.c user/attilio/vmc-playground/sys/nfsclient/nfs_bio.c user/attilio/vmc-playground/sys/nfsclient/nfs_vnops.c user/attilio/vmc-playground/sys/nfsserver/nfs_serv.c user/attilio/vmc-playground/sys/ofed/drivers/infiniband/core/umem.c user/attilio/vmc-playground/sys/ofed/include/linux/linux_compat.c user/attilio/vmc-playground/sys/pc98/pc98/machdep.c user/attilio/vmc-playground/sys/powerpc/aim/machdep.c user/attilio/vmc-playground/sys/powerpc/aim/mmu_oea.c user/attilio/vmc-playground/sys/powerpc/aim/mmu_oea64.c user/attilio/vmc-playground/sys/powerpc/booke/machdep.c user/attilio/vmc-playground/sys/powerpc/booke/pmap.c user/attilio/vmc-playground/sys/security/mac/mac_process.c user/attilio/vmc-playground/sys/sparc64/conf/GENERIC user/attilio/vmc-playground/sys/sparc64/sparc64/machdep.c user/attilio/vmc-playground/sys/sparc64/sparc64/pmap.c user/attilio/vmc-playground/sys/sys/callout.h user/attilio/vmc-playground/sys/sys/systm.h user/attilio/vmc-playground/sys/ufs/ffs/ffs_rawread.c user/attilio/vmc-playground/sys/ufs/ffs/ffs_vnops.c user/attilio/vmc-playground/sys/vm/default_pager.c user/attilio/vmc-playground/sys/vm/device_pager.c user/attilio/vmc-playground/sys/vm/phys_pager.c user/attilio/vmc-playground/sys/vm/sg_pager.c user/attilio/vmc-playground/sys/vm/swap_pager.c user/attilio/vmc-playground/sys/vm/uma_core.c user/attilio/vmc-playground/sys/vm/vm_fault.c user/attilio/vmc-playground/sys/vm/vm_glue.c user/attilio/vmc-playground/sys/vm/vm_init.c user/attilio/vmc-playground/sys/vm/vm_kern.c user/attilio/vmc-playground/sys/vm/vm_map.c user/attilio/vmc-playground/sys/vm/vm_meter.c user/attilio/vmc-playground/sys/vm/vm_mmap.c user/attilio/vmc-playground/sys/vm/vm_object.c user/attilio/vmc-playground/sys/vm/vm_object.h user/attilio/vmc-playground/sys/vm/vm_page.c user/attilio/vmc-playground/sys/vm/vm_pageout.c user/attilio/vmc-playground/sys/vm/vm_pager.c user/attilio/vmc-playground/sys/vm/vm_pager.h user/attilio/vmc-playground/sys/vm/vm_reserv.c user/attilio/vmc-playground/sys/vm/vnode_pager.c user/attilio/vmc-playground/usr.bin/Makefile.arm user/attilio/vmc-playground/usr.bin/truss/extern.h user/attilio/vmc-playground/usr.bin/truss/main.c user/attilio/vmc-playground/usr.sbin/pkg/pkg.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/sbin/ (props changed) user/attilio/vmc-playground/sys/ (props changed) user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmc-playground/sys/conf/ (props changed) Modified: user/attilio/vmc-playground/UPDATING ============================================================================== --- user/attilio/vmc-playground/UPDATING Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/UPDATING Sat Mar 9 03:19:53 2013 (r248088) @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130308: + CTL_DISABLE has also been added to the sparc64 GENERIC (for further + information, see the respective 20130304 entry). + 20130304: Recent commits to callout(9) changed the size of struct callout, so the KBI is probably heavily disturbed. Also, some functions Modified: user/attilio/vmc-playground/sbin/geom/class/raid/graid.8 ============================================================================== --- user/attilio/vmc-playground/sbin/geom/class/raid/graid.8 Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sbin/geom/class/raid/graid.8 Sat Mar 9 03:19:53 2013 (r248088) @@ -305,6 +305,9 @@ Write errors are always considered as di Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of /dev/ar%d devices from ataraid(4) +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: user/attilio/vmc-playground/sys/amd64/amd64/machdep.c ============================================================================== --- user/attilio/vmc-playground/sys/amd64/amd64/machdep.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/amd64/amd64/machdep.c Sat Mar 9 03:19:53 2013 (r248088) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef SMP Modified: user/attilio/vmc-playground/sys/amd64/amd64/pmap.c ============================================================================== --- user/attilio/vmc-playground/sys/amd64/amd64/pmap.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/amd64/amd64/pmap.c Sat Mar 9 03:19:53 2013 (r248088) @@ -3556,7 +3556,7 @@ 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 | VPO_BUSY)) == 0) - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); if ((access & VM_PROT_WRITE) != 0) @@ -3823,7 +3823,7 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m, mpte; vm_pindex_t diff, psize; - VM_OBJECT_LOCK_ASSERT(m_start->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m_start->object); psize = atop(end - start); mpte = NULL; m = m_start; @@ -4005,7 +4005,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_page_t p, pdpg; int pat_mode; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { @@ -4619,7 +4619,7 @@ pmap_is_modified(vm_page_t m) * concurrently set while the object is locked. Thus, if PGA_WRITEABLE * is clear, no PTEs can have PG_M set. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); @@ -4750,7 +4750,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; @@ -4894,7 +4894,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); Modified: user/attilio/vmc-playground/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- user/attilio/vmc-playground/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Mar 9 03:19:53 2013 (r248088) @@ -62,6 +62,8 @@ #include __FBSDID("$FreeBSD$"); + .cpu arm1136js + #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ mcr p15, 0, Rtmp1, c7, c5, 0 /* Invalidate Entire I cache */ Modified: user/attilio/vmc-playground/sys/arm/arm/machdep.c ============================================================================== --- user/attilio/vmc-playground/sys/arm/arm/machdep.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/arm/arm/machdep.c Sat Mar 9 03:19:53 2013 (r248088) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: user/attilio/vmc-playground/sys/arm/arm/pmap-v6.c ============================================================================== --- user/attilio/vmc-playground/sys/arm/arm/pmap-v6.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/arm/arm/pmap-v6.c Sat Mar 9 03:19:53 2013 (r248088) @@ -2212,7 +2212,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -3428,7 +3428,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -3475,7 +3475,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Modified: user/attilio/vmc-playground/sys/arm/arm/pmap.c ============================================================================== --- user/attilio/vmc-playground/sys/arm/arm/pmap.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/arm/arm/pmap.c Sat Mar 9 03:19:53 2013 (r248088) @@ -3006,7 +3006,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_pindex_t pindex, vm_size_t size) { - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); } @@ -4461,7 +4461,7 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_BUSY) == 0, ("pmap_clear_modify: page %p is busy", m)); @@ -4523,7 +4523,7 @@ pmap_remove_write(vm_page_t m) * another thread while the object is locked. Thus, if PGA_WRITEABLE * is clear, no page table entries need updating. */ - VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(m->object); if ((m->oflags & VPO_BUSY) != 0 || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); Copied: user/attilio/vmc-playground/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c (from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Sat Mar 9 03:19:53 2013 (r248088, copy of r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +const int zfs_vm_pagerret_bad = VM_PAGER_BAD; +const int zfs_vm_pagerret_error = VM_PAGER_ERROR; +const int zfs_vm_pagerret_ok = VM_PAGER_OK; + +void +zfs_vmobject_assert_wlocked(vm_object_t object) +{ + + /* + * This is not ideal because FILE/LINE used by assertions will not + * be too helpful, but it must be an hard function for + * compatibility reasons. + */ + VM_OBJECT_ASSERT_WLOCKED(object); +} + +void +zfs_vmobject_wlock(vm_object_t object) +{ + + VM_OBJECT_WLOCK(object); +} + +void +zfs_vmobject_wunlock(vm_object_t object) +{ + + VM_OBJECT_WUNLOCK(object); +} Copied: user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h (from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h Sat Mar 9 03:19:53 2013 (r248088, copy of r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/freebsd_rwlock.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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$ + */ + +#ifndef _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ +#define _OPENSOLARIS_SYS_FREEBSD_RWLOCK_H_ + +#include_next + +#endif Copied: user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/vm.h (from r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmc-playground/sys/cddl/compat/opensolaris/sys/vm.h Sat Mar 9 03:19:53 2013 (r248088, copy of r248087, user/attilio/vmcontention/sys/cddl/compat/opensolaris/sys/vm.h) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * 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 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$ + */ + +#ifndef _OPENSOLARIS_SYS_VM_H_ +#define _OPENSOLARIS_SYS_VM_H_ + +#ifdef _KERNEL + +extern const int zfs_vm_pagerret_bad; +extern const int zfs_vm_pagerret_error; +extern const int zfs_vm_pagerret_ok; + +void zfs_vmobject_assert_wlocked(vm_object_t object); +void zfs_vmobject_wlock(vm_object_t object); +void zfs_vmobject_wunlock(vm_object_t object); + +#endif /* _KERNEL */ + +#endif /* _OPENSOLARIS_SYS_VM_H_ */ Modified: user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Sat Mar 9 03:19:53 2013 (r248088) @@ -103,7 +103,6 @@ extern "C" { #include #include #include -#include #include #include /* There is clash. vm_map.h defines the two below and vdev_cache.c use them. */ Modified: user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Mar 9 03:19:53 2013 (r248088) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -329,7 +330,7 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -377,7 +378,7 @@ page_hold(vnode_t *vp, int64_t start) vm_page_t pp; obj = vp->v_object; - VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + zfs_vmobject_assert_wlocked(obj); for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && @@ -450,7 +451,7 @@ update_pages(vnode_t *vp, int64_t start, ASSERT(obj != NULL); off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; int nbytes = imin(PAGESIZE - off, len); @@ -467,23 +468,23 @@ update_pages(vnode_t *vp, int64_t start, ("zfs update_pages: unbusy page in putpages case")); KASSERT(!pmap_page_is_write_mapped(pp), ("zfs update_pages: writable page in putpages case")); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_write(os, oid, start, nbytes, va, tx); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_undirty(pp); } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); (void) dmu_read(os, oid, start+off, nbytes, va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unbusy(pp); } len -= nbytes; @@ -491,7 +492,7 @@ update_pages(vnode_t *vp, int64_t start, } if (segflg != UIO_NOCOPY) vm_object_pip_wakeupn(obj, 0); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); } /* @@ -523,7 +524,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u ASSERT(obj != NULL); ASSERT((uio->uio_loffset & PAGEOFFSET) == 0); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start = uio->uio_loffset; len > 0; start += PAGESIZE) { int bytes = MIN(PAGESIZE, len); @@ -531,14 +532,14 @@ mappedread_sf(vnode_t *vp, int nbytes, u VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY); if (pp->valid == 0) { vm_page_io_start(pp); - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); if (bytes != PAGESIZE && error == 0) bzero(va + bytes, PAGESIZE - bytes); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); vm_page_io_finish(pp); vm_page_lock(pp); if (error) { @@ -555,7 +556,7 @@ mappedread_sf(vnode_t *vp, int nbytes, u uio->uio_offset += bytes; len -= bytes; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -587,7 +588,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ start = uio->uio_loffset; off = start & PAGEOFFSET; - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); @@ -596,23 +597,23 @@ mappedread(vnode_t *vp, int nbytes, uio_ struct sf_buf *sf; caddr_t va; - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); va = zfs_map_page(pp, &sf); error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); page_unhold(pp); } else { - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); - VM_OBJECT_LOCK(obj); + zfs_vmobject_wlock(obj); } len -= bytes; off = 0; if (error) break; } - VM_OBJECT_UNLOCK(obj); + zfs_vmobject_wunlock(obj); return (error); } @@ -5684,7 +5685,7 @@ zfs_getpages(struct vnode *vp, vm_page_t mfirst = m[reqstart]; mlast = m[reqstart + reqsize - 1]; - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = 0; i < reqstart; i++) { vm_page_lock(m[i]); @@ -5700,9 +5701,9 @@ zfs_getpages(struct vnode *vp, vm_page_t if (mreq->valid && reqsize == 1) { if (mreq->valid != VM_PAGE_BITS_ALL) vm_page_zero_invalid(mreq, TRUE); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_OK); + return (zfs_vm_pagerret_ok); } PCPU_INC(cnt.v_vnodein); @@ -5716,16 +5717,16 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_unlock(m[i]); } } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_EXIT(zfsvfs); - return (VM_PAGER_BAD); + return (zfs_vm_pagerret_bad); } lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) lsize = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mlast->pindex); - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { size = PAGE_SIZE; @@ -5741,7 +5742,7 @@ zfs_getpages(struct vnode *vp, vm_page_t break; } - VM_OBJECT_LOCK(object); + zfs_vmobject_wlock(object); for (i = reqstart; i < reqstart + reqsize; i++) { if (!error) @@ -5751,11 +5752,11 @@ zfs_getpages(struct vnode *vp, vm_page_t vm_page_readahead_finish(m[i]); } - VM_OBJECT_UNLOCK(object); + zfs_vmobject_wunlock(object); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); - return (error ? VM_PAGER_ERROR : VM_PAGER_OK); + return (error ? zfs_vm_pagerret_error : zfs_vm_pagerret_ok); } static int Modified: user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/compat/linprocfs/linprocfs.c Sat Mar 9 03:19:53 2013 (r248088) @@ -1031,9 +1031,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { - VM_OBJECT_LOCK(tobj); + VM_OBJECT_WLOCK(tobj); if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); lobj = tobj; } last_timestamp = map->timestamp; @@ -1049,11 +1049,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) else vp = NULL; if (lobj != obj) - VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_WUNLOCK(lobj); flags = obj->flags; ref_count = obj->ref_count; shadow_count = obj->shadow_count; - VM_OBJECT_UNLOCK(obj); + VM_OBJECT_WUNLOCK(obj); if (vp) { vn_fullpath(td, vp, &name, &freename); vn_lock(vp, LK_SHARED | LK_RETRY); Modified: user/attilio/vmc-playground/sys/conf/files ============================================================================== --- user/attilio/vmc-playground/sys/conf/files Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/conf/files Sat Mar 9 03:19:53 2013 (r248088) @@ -157,6 +157,7 @@ cddl/compat/opensolaris/kern/opensolaris cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_uio.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_vfs.c optional zfs compile-with "${ZFS_C}" +cddl/compat/opensolaris/kern/opensolaris_vm.c optional zfs compile-with "${ZFS_C}" cddl/compat/opensolaris/kern/opensolaris_zone.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/acl/acl_common.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/common/avl/avl.c optional zfs compile-with "${ZFS_C}" Modified: user/attilio/vmc-playground/sys/dev/agp/agp.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/agp/agp.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/agp/agp.c Sat Mar 9 03:19:53 2013 (r248088) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -544,7 +545,7 @@ agp_generic_bind_memory(device_t dev, st * because vm_page_grab() may sleep and we can't hold a mutex * while sleeping. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { /* * Find a page from the object and wire it @@ -557,14 +558,14 @@ agp_generic_bind_memory(device_t dev, st VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mtx_lock(&sc->as_lock); if (mem->am_is_bound) { device_printf(dev, "memory already bound\n"); error = EINVAL; - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); i = 0; goto bad; } @@ -573,7 +574,7 @@ agp_generic_bind_memory(device_t dev, st * Bind the individual pages and flush the chipset's * TLB. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i)); @@ -601,7 +602,7 @@ agp_generic_bind_memory(device_t dev, st } vm_page_wakeup(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); /* * Flush the cpu cache since we are providing a new mapping @@ -622,7 +623,7 @@ agp_generic_bind_memory(device_t dev, st return 0; bad: mtx_unlock(&sc->as_lock); - VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(mem->am_obj); for (k = 0; k < mem->am_size; k += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k)); if (k >= i) @@ -631,7 +632,7 @@ bad: vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); return error; } @@ -658,14 +659,14 @@ agp_generic_unbind_memory(device_t dev, */ for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, mem->am_offset + i); - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); } - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); agp_flush_cache(); AGP_FLUSH_TLB(dev); Modified: user/attilio/vmc-playground/sys/dev/agp/agp_i810.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/agp/agp_i810.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/agp/agp_i810.c Sat Mar 9 03:19:53 2013 (r248088) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1967,10 +1968,10 @@ agp_i810_alloc_memory(device_t dev, int * Allocate and wire down the page now so that we can * get its physical address. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); mem->am_physical = VM_PAGE_TO_PHYS(m); } else { /* Our allocation is already nicely wired down for us. @@ -2005,12 +2006,12 @@ agp_i810_free_memory(device_t dev, struc /* * Unwire the page which we wired in alloc_memory. */ - VM_OBJECT_LOCK(mem->am_obj); + VM_OBJECT_WLOCK(mem->am_obj); m = vm_page_lookup(mem->am_obj, 0); vm_page_lock(m); vm_page_unwire(m, 0); vm_page_unlock(m); - VM_OBJECT_UNLOCK(mem->am_obj); + VM_OBJECT_WUNLOCK(mem->am_obj); } else { contigfree(sc->argb_cursor, mem->am_size, M_AGP); sc->argb_cursor = NULL; Modified: user/attilio/vmc-playground/sys/dev/drm/drmP.h ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm/drmP.h Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm/drmP.h Sat Mar 9 03:19:53 2013 (r248088) @@ -59,6 +59,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: user/attilio/vmc-playground/sys/dev/drm2/drmP.h ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/drmP.h Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/drmP.h Sat Mar 9 03:19:53 2013 (r248088) @@ -58,6 +58,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: user/attilio/vmc-playground/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/drm_fb_helper.c Sat Mar 9 03:19:53 2013 (r248088) @@ -555,8 +555,11 @@ static void drm_fb_helper_crtc_free(stru for (i = 0; i < helper->connector_count; i++) free(helper->connector_info[i], DRM_MEM_KMS); free(helper->connector_info, DRM_MEM_KMS); - for (i = 0; i < helper->crtc_count; i++) + for (i = 0; i < helper->crtc_count; i++) { free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); + if (helper->crtc_info[i].mode_set.mode) + drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); + } free(helper->crtc_info, DRM_MEM_KMS); } Modified: user/attilio/vmc-playground/sys/dev/drm2/drm_global.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/drm_global.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/drm_global.c Sat Mar 9 03:19:53 2013 (r248088) @@ -104,6 +104,7 @@ void drm_global_item_unref(struct drm_gl MPASS(ref->object == item->object); if (--item->refcount == 0) { ref->release(ref); + free(item->object, M_DRM_GLOBAL); item->object = NULL; } sx_xunlock(&item->mutex); Modified: user/attilio/vmc-playground/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/i915/i915_gem.c Sat Mar 9 03:19:53 2013 (r248088) @@ -990,14 +990,14 @@ i915_gem_swap_io(struct drm_device *dev, vm_obj = obj->base.vm_obj; ret = 0; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_add(vm_obj, 1); while (size > 0) { obj_pi = OFF_TO_IDX(offset); obj_po = offset & PAGE_MASK; m = i915_gem_wire_page(vm_obj, obj_pi); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); @@ -1031,7 +1031,7 @@ i915_gem_swap_io(struct drm_device *dev, } sf_buf_free(sf); sched_unpin(); - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); if (rw == UIO_WRITE) vm_page_dirty(m); vm_page_reference(m); @@ -1044,7 +1044,7 @@ i915_gem_swap_io(struct drm_device *dev, break; } vm_object_pip_wakeup(vm_obj); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); return (ret); } @@ -1357,7 +1357,7 @@ i915_gem_pager_fault(vm_object_t vm_obj, } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); unlocked_vmobj: cause = ret = 0; m = NULL; @@ -1407,7 +1407,7 @@ unlocked_vmobj: list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list); obj->fault_mappable = true; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + offset); if (m == NULL) { @@ -1452,7 +1452,7 @@ out: kern_yield(PRI_USER); goto unlocked_vmobj; } - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_pip_wakeup(vm_obj); return (VM_PAGER_ERROR); } @@ -2208,12 +2208,12 @@ i915_gem_object_get_pages_gtt(struct drm obj->pages = malloc(page_count * sizeof(vm_page_t), DRM_I915_GEM, M_WAITOK); vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); for (i = 0; i < page_count; i++) { if ((obj->pages[i] = i915_gem_wire_page(vm_obj, i)) == NULL) goto failed; } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); if (i915_gem_object_needs_bit17_swizzle(obj)) i915_gem_object_do_bit_17_swizzle(obj); return (0); @@ -2226,7 +2226,7 @@ failed: vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); free(obj->pages, DRM_I915_GEM); obj->pages = NULL; return (-EIO); @@ -2272,7 +2272,7 @@ i915_gem_object_put_pages_gtt(struct drm if (obj->madv == I915_MADV_DONTNEED) obj->dirty = 0; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); #if GEM_PARANOID_CHECK_GTT i915_gem_assert_pages_not_mapped(obj->base.dev, obj->pages, page_count); #endif @@ -2287,7 +2287,7 @@ i915_gem_object_put_pages_gtt(struct drm vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); obj->dirty = 0; free(obj->pages, DRM_I915_GEM); obj->pages = NULL; @@ -2309,7 +2309,7 @@ i915_gem_release_mmap(struct drm_i915_ge if (devobj != NULL) { page_count = OFF_TO_IDX(obj->base.size); - VM_OBJECT_LOCK(devobj); + VM_OBJECT_WLOCK(devobj); retry: for (i = 0; i < page_count; i++) { m = vm_page_lookup(devobj, i); @@ -2319,7 +2319,7 @@ retry: goto retry; cdev_pager_free_page(devobj, m); } - VM_OBJECT_UNLOCK(devobj); + VM_OBJECT_WUNLOCK(devobj); vm_object_deallocate(devobj); } @@ -2437,9 +2437,9 @@ i915_gem_object_truncate(struct drm_i915 vm_object_t vm_obj; vm_obj = obj->base.vm_obj; - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); vm_object_page_remove(vm_obj, 0, 0, false); - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); obj->madv = I915_MADV_PURGED_INTERNAL; } @@ -2488,7 +2488,7 @@ i915_gem_wire_page(vm_object_t object, v vm_page_t m; int rv; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_ASSERT_WLOCKED(object); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(object, pindex, NULL, NULL)) { @@ -3567,13 +3567,13 @@ i915_gem_detach_phys_object(struct drm_d vaddr = obj->phys_obj->handle->vaddr; page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); if (m == NULL) continue; /* XXX */ - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); if (sf != NULL) { dst = (char *)sf_buf_kva(sf); @@ -3582,7 +3582,7 @@ i915_gem_detach_phys_object(struct drm_d } drm_clflush_pages(&m, 1); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); vm_page_dirty(m); @@ -3590,7 +3590,7 @@ i915_gem_detach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); intel_gtt_chipset_flush(); obj->phys_obj->cur_obj = NULL; @@ -3632,7 +3632,7 @@ i915_gem_attach_phys_object(struct drm_d page_count = obj->base.size / PAGE_SIZE; - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); ret = 0; for (i = 0; i < page_count; i++) { m = i915_gem_wire_page(obj->base.vm_obj, i); @@ -3640,14 +3640,14 @@ i915_gem_attach_phys_object(struct drm_d ret = -EIO; break; } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); sf = sf_buf_alloc(m, 0); src = (char *)sf_buf_kva(sf); dst = (char *)obj->phys_obj->handle->vaddr + IDX_TO_OFF(i); memcpy(dst, src, PAGE_SIZE); sf_buf_free(sf); - VM_OBJECT_LOCK(obj->base.vm_obj); + VM_OBJECT_WLOCK(obj->base.vm_obj); vm_page_reference(m); vm_page_lock(m); @@ -3655,7 +3655,7 @@ i915_gem_attach_phys_object(struct drm_d vm_page_unlock(m); atomic_add_long(&i915_gem_wired_pages_cnt, -1); } - VM_OBJECT_UNLOCK(obj->base.vm_obj); + VM_OBJECT_WUNLOCK(obj->base.vm_obj); return (0); } Modified: user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo.c Sat Mar 9 03:19:53 2013 (r248088) @@ -1400,7 +1400,6 @@ static void ttm_bo_global_kobj_release(s ttm_mem_unregister_shrink(glob->mem_glob, &glob->shrink); vm_page_free(glob->dummy_read_page); - free(glob, M_DRM_GLOBAL); } void ttm_bo_global_release(struct drm_global_reference *ref) Modified: user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 02:51:51 2013 (r248087) +++ user/attilio/vmc-playground/sys/dev/drm2/ttm/ttm_bo_vm.c Sat Mar 9 03:19:53 2013 (r248088) @@ -118,7 +118,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o } else oldm = NULL; retry: - VM_OBJECT_UNLOCK(vm_obj); + VM_OBJECT_WUNLOCK(vm_obj); m = NULL; reserve: @@ -213,7 +213,7 @@ reserve: VM_MEMATTR_WRITE_BACK : ttm_io_prot(bo->mem.placement)); } - VM_OBJECT_LOCK(vm_obj); + VM_OBJECT_WLOCK(vm_obj); if ((m->flags & VPO_BUSY) != 0) { vm_page_sleep(m, "ttmpbs"); ttm_mem_io_unlock(man); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 12:03:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C7AACFB; Sat, 9 Mar 2013 12:03:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB2FC42; Sat, 9 Mar 2013 12:03:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29C3A1x041023; Sat, 9 Mar 2013 12:03:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29C39DN041013; Sat, 9 Mar 2013 12:03:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091203.r29C39DN041013@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 12:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248095 - in user/attilio/vmcontention/sys: dev/ath kern net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 12:03:10 -0000 Author: attilio Date: Sat Mar 9 12:03:08 2013 New Revision: 248095 URL: http://svnweb.freebsd.org/changeset/base/248095 Log: MFC Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c user/attilio/vmcontention/sys/kern/kern_event.c user/attilio/vmcontention/sys/kern/subr_witness.c user/attilio/vmcontention/sys/kern/sys_generic.c user/attilio/vmcontention/sys/net80211/ieee80211_mesh.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sys/ (props changed) Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/if_ath.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/dev/ath/if_ath.c Sat Mar 9 12:03:08 2013 (r248095) @@ -4342,9 +4342,12 @@ ath_tx_stopdma(struct ath_softc *sc, str { struct ath_hal *ah = sc->sc_ah; - DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", - __func__, txq->axq_qnum, + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: tx queue [%u] %p, flags 0x%08x, link %p\n", + __func__, + txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), + txq->axq_flags, txq->axq_link); (void) ath_hal_stoptxdma(ah, txq->axq_qnum); } Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c Sat Mar 9 12:03:08 2013 (r248095) @@ -4340,12 +4340,23 @@ ath_tx_aggr_comp_aggr(struct ath_softc * __func__, tap->txa_start, tx_ok, ts.ts_status, ts.ts_flags, isaggr, seq_st, hasba, ba[0], ba[1]); + /* + * The reference driver doesn't do this; it simply ignores + * this check in its entirety. + * + * I've seen this occur when using iperf to send traffic + * out tid 1 - the aggregate frames are all marked as TID 1, + * but the TXSTATUS has TID=0. So, let's just ignore this + * check. + */ +#if 0 /* Occasionally, the MAC sends a tx status for the wrong TID. */ if (tid != ts.ts_tid) { device_printf(sc->sc_dev, "%s: tid %d != hw tid %d\n", __func__, tid, ts.ts_tid); tx_ok = 0; } +#endif /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { Modified: user/attilio/vmcontention/sys/kern/kern_event.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_event.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/kern/kern_event.c Sat Mar 9 12:03:08 2013 (r248095) @@ -1329,12 +1329,13 @@ kqueue_scan(struct kqueue *kq, int maxev goto done_nl; } if (timespecisset(tsp)) { - if (tsp->tv_sec < INT32_MAX) { + if (tsp->tv_sec <= INT32_MAX) { rsbt = tstosbt(*tsp); if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = 0; rsbt >>= tc_precexp; } else Modified: user/attilio/vmcontention/sys/kern/subr_witness.c ============================================================================== --- user/attilio/vmcontention/sys/kern/subr_witness.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/kern/subr_witness.c Sat Mar 9 12:03:08 2013 (r248095) @@ -602,7 +602,7 @@ static struct witness_order_list_entry o * VM */ { "vm map (user)", &lock_class_sx }, - { "vm object", &lock_class_mtx_sleep }, + { "vm object", &lock_class_rw }, { "vm page", &lock_class_mtx_sleep }, { "vm page queue", &lock_class_mtx_sleep }, { "pmap pv global", &lock_class_rw }, Modified: user/attilio/vmcontention/sys/kern/sys_generic.c ============================================================================== --- user/attilio/vmcontention/sys/kern/sys_generic.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/kern/sys_generic.c Sat Mar 9 12:03:08 2013 (r248095) @@ -1051,16 +1051,17 @@ kern_select(struct thread *td, int nd, f error = EINVAL; goto done; } - if (rtv.tv_sec == 0 && rtv.tv_usec == 0) + if (!timevalisset(&rtv)) asbt = 0; - else if (rtv.tv_sec < INT32_MAX) { + else if (rtv.tv_sec <= INT32_MAX) { rsbt = tvtosbt(rtv); precision = rsbt; precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = -1; } else asbt = -1; Modified: user/attilio/vmcontention/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/attilio/vmcontention/sys/net80211/ieee80211_mesh.c Sat Mar 9 11:57:51 2013 (r248094) +++ user/attilio/vmcontention/sys/net80211/ieee80211_mesh.c Sat Mar 9 12:03:08 2013 (r248095) @@ -1477,10 +1477,9 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1536,11 +1535,10 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; - struct ieee80211com *ic = vap->iv_ic; int ae; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1603,10 +1601,9 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); mesh_forward(vap, m, mc); From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 12:51:40 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1984E4C; Sat, 9 Mar 2013 12:51:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AE93F3E; Sat, 9 Mar 2013 12:51:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29CpeQr056429; Sat, 9 Mar 2013 12:51:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29CpeNX056428; Sat, 9 Mar 2013 12:51:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091251.r29CpeNX056428@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 12:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248098 - in user/attilio/vmcontention: . lib/libncp lib/libprocstat share/examples/nwclient sys/fs/nwfs sys/modules/ncp sys/modules/nwfs sys/netncp usr.bin/ncplist usr.bin/ncplogin usr... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 12:51:40 -0000 Author: attilio Date: Sat Mar 9 12:51:39 2013 New Revision: 248098 URL: http://svnweb.freebsd.org/changeset/base/248098 Log: MFC Deleted: user/attilio/vmcontention/lib/libncp/ user/attilio/vmcontention/lib/libprocstat/nwfs.c user/attilio/vmcontention/share/examples/nwclient/ user/attilio/vmcontention/sys/fs/nwfs/ user/attilio/vmcontention/sys/modules/ncp/ user/attilio/vmcontention/sys/modules/nwfs/ user/attilio/vmcontention/sys/netncp/ user/attilio/vmcontention/usr.bin/ncplist/ user/attilio/vmcontention/usr.bin/ncplogin/ user/attilio/vmcontention/usr.sbin/mount_nwfs/ Modified: user/attilio/vmcontention/ObsoleteFiles.inc Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sys/ (props changed) Modified: user/attilio/vmcontention/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmcontention/ObsoleteFiles.inc Sat Mar 9 12:45:36 2013 (r248097) +++ user/attilio/vmcontention/ObsoleteFiles.inc Sat Mar 9 12:51:39 2013 (r248098) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20130902: NWFS and NCP supports removed +OLD_FILES+=usr/bin/ncplist +OLD_FILES+=usr/bin/ncplogin +OLD_FILES+=usr/bin/ncplogout +OLD_FILES+=usr/include/fs/nwfs/nwfs.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h +OLD_DIRS+=usr/include/fs/nwfs +OLD_FILES+=usr/include/netncp/ncp.h +OLD_FILES+=usr/include/netncp/ncp_cfg.h +OLD_FILES+=usr/include/netncp/ncp_conn.h +OLD_FILES+=usr/include/netncp/ncp_file.h +OLD_FILES+=usr/include/netncp/ncp_lib.h +OLD_FILES+=usr/include/netncp/ncp_ncp.h +OLD_FILES+=usr/include/netncp/ncp_nls.h +OLD_FILES+=usr/include/netncp/ncp_rcfile.h +OLD_FILES+=usr/include/netncp/ncp_rq.h +OLD_FILES+=usr/include/netncp/ncp_sock.h +OLD_FILES+=usr/include/netncp/ncp_subr.h +OLD_FILES+=usr/include/netncp/ncp_user.h +OLD_FILES+=usr/include/netncp/ncpio.h +OLD_FILES+=usr/include/netncp/nwerror.h +OLD_DIRS+=usr/include/netncp +OLD_FILES+=usr/lib/libncp.a +OLD_FILES+=usr/lib/libncp.so +OLD_LIBS+=usr/lib/libncp.so.4 +OLD_FILES+=usr/lib/libncp_p.a +OLD_FILES+=usr/lib32/libncp.a +OLD_FILES+=usr/lib32/libncp.so +OLD_LIBS+=usr/lib32/libncp.so.4 +OLD_FILES+=usr/lib32/libncp_p.a +OLD_FILES+=usr/sbin/mount_nwfs +OLD_FILES+=usr/share/man/man1/ncplist.1.gz +OLD_FILES+=usr/share/man/man1/ncplogin.1.gz +OLD_FILES+=usr/share/man/man1/ncplogout.1.gz +OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz # 20130302: NTFS support removed OLD_FILES+=rescue/mount_ntfs OLD_FILES+=sbin/mount_ntfs From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 13:12:14 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6877F373; Sat, 9 Mar 2013 13:12:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B8B1AE; Sat, 9 Mar 2013 13:12:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29DCEcO062894; Sat, 9 Mar 2013 13:12:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29DCCWK062886; Sat, 9 Mar 2013 13:12:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091312.r29DCCWK062886@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 13:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248100 - in user/attilio/vmc-playground: . lib/libncp lib/libprocstat share/examples/nwclient sys/dev/ath sys/fs/nwfs sys/kern sys/modules/ncp sys/modules/nwfs sys/net80211 sys/netncp ... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 13:12:14 -0000 Author: attilio Date: Sat Mar 9 13:12:12 2013 New Revision: 248100 URL: http://svnweb.freebsd.org/changeset/base/248100 Log: Merge from vmcontention Deleted: user/attilio/vmc-playground/lib/libncp/ user/attilio/vmc-playground/lib/libprocstat/nwfs.c user/attilio/vmc-playground/share/examples/nwclient/ user/attilio/vmc-playground/sys/fs/nwfs/ user/attilio/vmc-playground/sys/modules/ncp/ user/attilio/vmc-playground/sys/modules/nwfs/ user/attilio/vmc-playground/sys/netncp/ user/attilio/vmc-playground/usr.bin/ncplist/ user/attilio/vmc-playground/usr.bin/ncplogin/ user/attilio/vmc-playground/usr.sbin/mount_nwfs/ Modified: user/attilio/vmc-playground/ObsoleteFiles.inc user/attilio/vmc-playground/sys/dev/ath/if_ath.c user/attilio/vmc-playground/sys/dev/ath/if_ath_tx.c user/attilio/vmc-playground/sys/kern/kern_event.c user/attilio/vmc-playground/sys/kern/subr_witness.c user/attilio/vmc-playground/sys/kern/sys_generic.c user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/sys/ (props changed) Modified: user/attilio/vmc-playground/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmc-playground/ObsoleteFiles.inc Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/ObsoleteFiles.inc Sat Mar 9 13:12:12 2013 (r248100) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20130902: NWFS and NCP supports removed +OLD_FILES+=usr/bin/ncplist +OLD_FILES+=usr/bin/ncplogin +OLD_FILES+=usr/bin/ncplogout +OLD_FILES+=usr/include/fs/nwfs/nwfs.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h +OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h +OLD_DIRS+=usr/include/fs/nwfs +OLD_FILES+=usr/include/netncp/ncp.h +OLD_FILES+=usr/include/netncp/ncp_cfg.h +OLD_FILES+=usr/include/netncp/ncp_conn.h +OLD_FILES+=usr/include/netncp/ncp_file.h +OLD_FILES+=usr/include/netncp/ncp_lib.h +OLD_FILES+=usr/include/netncp/ncp_ncp.h +OLD_FILES+=usr/include/netncp/ncp_nls.h +OLD_FILES+=usr/include/netncp/ncp_rcfile.h +OLD_FILES+=usr/include/netncp/ncp_rq.h +OLD_FILES+=usr/include/netncp/ncp_sock.h +OLD_FILES+=usr/include/netncp/ncp_subr.h +OLD_FILES+=usr/include/netncp/ncp_user.h +OLD_FILES+=usr/include/netncp/ncpio.h +OLD_FILES+=usr/include/netncp/nwerror.h +OLD_DIRS+=usr/include/netncp +OLD_FILES+=usr/lib/libncp.a +OLD_FILES+=usr/lib/libncp.so +OLD_LIBS+=usr/lib/libncp.so.4 +OLD_FILES+=usr/lib/libncp_p.a +OLD_FILES+=usr/lib32/libncp.a +OLD_FILES+=usr/lib32/libncp.so +OLD_LIBS+=usr/lib32/libncp.so.4 +OLD_FILES+=usr/lib32/libncp_p.a +OLD_FILES+=usr/sbin/mount_nwfs +OLD_FILES+=usr/share/man/man1/ncplist.1.gz +OLD_FILES+=usr/share/man/man1/ncplogin.1.gz +OLD_FILES+=usr/share/man/man1/ncplogout.1.gz +OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz # 20130302: NTFS support removed OLD_FILES+=rescue/mount_ntfs OLD_FILES+=sbin/mount_ntfs Modified: user/attilio/vmc-playground/sys/dev/ath/if_ath.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/if_ath.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/dev/ath/if_ath.c Sat Mar 9 13:12:12 2013 (r248100) @@ -4342,9 +4342,12 @@ ath_tx_stopdma(struct ath_softc *sc, str { struct ath_hal *ah = sc->sc_ah; - DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", - __func__, txq->axq_qnum, + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: tx queue [%u] %p, flags 0x%08x, link %p\n", + __func__, + txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), + txq->axq_flags, txq->axq_link); (void) ath_hal_stoptxdma(ah, txq->axq_qnum); } Modified: user/attilio/vmc-playground/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/ath/if_ath_tx.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/dev/ath/if_ath_tx.c Sat Mar 9 13:12:12 2013 (r248100) @@ -4340,12 +4340,23 @@ ath_tx_aggr_comp_aggr(struct ath_softc * __func__, tap->txa_start, tx_ok, ts.ts_status, ts.ts_flags, isaggr, seq_st, hasba, ba[0], ba[1]); + /* + * The reference driver doesn't do this; it simply ignores + * this check in its entirety. + * + * I've seen this occur when using iperf to send traffic + * out tid 1 - the aggregate frames are all marked as TID 1, + * but the TXSTATUS has TID=0. So, let's just ignore this + * check. + */ +#if 0 /* Occasionally, the MAC sends a tx status for the wrong TID. */ if (tid != ts.ts_tid) { device_printf(sc->sc_dev, "%s: tid %d != hw tid %d\n", __func__, tid, ts.ts_tid); tx_ok = 0; } +#endif /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { Modified: user/attilio/vmc-playground/sys/kern/kern_event.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_event.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/kern/kern_event.c Sat Mar 9 13:12:12 2013 (r248100) @@ -1329,12 +1329,13 @@ kqueue_scan(struct kqueue *kq, int maxev goto done_nl; } if (timespecisset(tsp)) { - if (tsp->tv_sec < INT32_MAX) { + if (tsp->tv_sec <= INT32_MAX) { rsbt = tstosbt(*tsp); if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = 0; rsbt >>= tc_precexp; } else Modified: user/attilio/vmc-playground/sys/kern/subr_witness.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/subr_witness.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/kern/subr_witness.c Sat Mar 9 13:12:12 2013 (r248100) @@ -602,7 +602,7 @@ static struct witness_order_list_entry o * VM */ { "vm map (user)", &lock_class_sx }, - { "vm object", &lock_class_mtx_sleep }, + { "vm object", &lock_class_rw }, { "vm page", &lock_class_mtx_sleep }, { "vm page queue", &lock_class_mtx_sleep }, { "pmap pv global", &lock_class_rw }, Modified: user/attilio/vmc-playground/sys/kern/sys_generic.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/sys_generic.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/kern/sys_generic.c Sat Mar 9 13:12:12 2013 (r248100) @@ -1051,16 +1051,17 @@ kern_select(struct thread *td, int nd, f error = EINVAL; goto done; } - if (rtv.tv_sec == 0 && rtv.tv_usec == 0) + if (!timevalisset(&rtv)) asbt = 0; - else if (rtv.tv_sec < INT32_MAX) { + else if (rtv.tv_sec <= INT32_MAX) { rsbt = tvtosbt(rtv); precision = rsbt; precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - asbt += rsbt; - if (asbt < rsbt) + if (asbt <= INT64_MAX - rsbt) + asbt += rsbt; + else asbt = -1; } else asbt = -1; Modified: user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Sat Mar 9 13:05:21 2013 (r248099) +++ user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Sat Mar 9 13:12:12 2013 (r248100) @@ -1480,7 +1480,7 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; @@ -1540,7 +1540,7 @@ mesh_recv_indiv_data_to_me(struct ieee80 int ae; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); qwh = (struct ieee80211_qosframe_addr4 *)wh; mc10 = (const struct ieee80211_meshcntl_ae10 *)mc; @@ -1606,7 +1606,7 @@ mesh_recv_group_data(struct ieee80211vap struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ - IEEE80211_TX_UNLOCK_ASSERT(ic); + IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); mesh_forward(vap, m, mc); From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 14:34:54 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79ED8F1E; Sat, 9 Mar 2013 14:34:54 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE0E64A; Sat, 9 Mar 2013 14:34:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29EYsFO087613; Sat, 9 Mar 2013 14:34:54 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29EYsFf087612; Sat, 9 Mar 2013 14:34:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091434.r29EYsFf087612@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 14:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248103 - user/attilio/vmc-playground/sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 14:34:54 -0000 Author: attilio Date: Sat Mar 9 14:34:53 2013 New Revision: 248103 URL: http://svnweb.freebsd.org/changeset/base/248103 Log: Fix mismerge. Modified: user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Modified: user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c ============================================================================== --- user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Sat Mar 9 13:30:06 2013 (r248102) +++ user/attilio/vmc-playground/sys/net80211/ieee80211_mesh.c Sat Mar 9 14:34:53 2013 (r248103) @@ -1477,7 +1477,6 @@ mesh_recv_indiv_data_to_fwrd(struct ieee struct ieee80211_qosframe_addr4 *qwh; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt_meshda, *rt_meshsa; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); @@ -1536,7 +1535,6 @@ mesh_recv_indiv_data_to_me(struct ieee80 const struct ieee80211_meshcntl_ae10 *mc10; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; - struct ieee80211com *ic = vap->iv_ic; int ae; /* This is called from the RX path - don't hold this lock */ @@ -1603,7 +1601,6 @@ mesh_recv_group_data(struct ieee80211vap { #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211com *ic = vap->iv_ic; /* This is called from the RX path - don't hold this lock */ IEEE80211_TX_UNLOCK_ASSERT(vap->iv_ic); From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 15:54:21 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E87B6363; Sat, 9 Mar 2013 15:54:21 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA049A4A; Sat, 9 Mar 2013 15:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29FsLRb011761; Sat, 9 Mar 2013 15:54:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29FsKZO011752; Sat, 9 Mar 2013 15:54:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091554.r29FsKZO011752@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 15:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248107 - in user/attilio/vmcontention: lib/libutil sys/dev/ichwd sys/fs/smbfs sys/kern sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 15:54:22 -0000 Author: attilio Date: Sat Mar 9 15:54:20 2013 New Revision: 248107 URL: http://svnweb.freebsd.org/changeset/base/248107 Log: MFC Modified: user/attilio/vmcontention/lib/libutil/gr_util.c user/attilio/vmcontention/sys/dev/ichwd/ichwd.c user/attilio/vmcontention/sys/fs/smbfs/smbfs_smb.c user/attilio/vmcontention/sys/fs/smbfs/smbfs_vnops.c user/attilio/vmcontention/sys/kern/kern_umtx.c user/attilio/vmcontention/sys/net80211/ieee80211_output.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/sys/ (props changed) Modified: user/attilio/vmcontention/lib/libutil/gr_util.c ============================================================================== --- user/attilio/vmcontention/lib/libutil/gr_util.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/lib/libutil/gr_util.c Sat Mar 9 15:54:20 2013 (r248107) @@ -50,7 +50,7 @@ static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; static size_t grmemlen(const struct group *, const char *, int *); -static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); +static struct group *grcopy(const struct group *gr, char *mem, const char *, int ndx); /* * Initialize statics @@ -361,26 +361,30 @@ gr_equal(const struct group *gr1, const if (gr1->gr_gid != gr2->gr_gid) return (false); - /* Check all members in both groups. */ - if (gr1->gr_mem == NULL || gr2->gr_mem == NULL) { - if (gr1->gr_mem != gr2->gr_mem) - return (false); - } else { - for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) { - for (gr2_ndx = 0;; gr2_ndx++) { - if (gr2->gr_mem[gr2_ndx] == NULL) - return (false); - if (strcmp(gr1->gr_mem[gr1_ndx], - gr2->gr_mem[gr2_ndx]) == 0) { - break; - } - } - } - - /* Check that group2 does not have more members than group1. */ - if (gr2->gr_mem[gr1_ndx] != NULL) - return (false); - } + /* Check all members in both groups. + * getgrnam can return gr_mem with a pointer to NULL. + * gr_dup and gr_add strip out this superfluous NULL, setting + * gr_mem to NULL for no members. + */ + if (gr1->gr_mem != NULL && gr2->gr_mem != NULL) { + int i; + + for (i = 0; gr1->gr_mem[i] != NULL; i++) { + if (strcmp(gr1->gr_mem[i], gr2->gr_mem[i]) != 0) + return (false); + } + } + /* Count number of members in both structs */ + gr2_ndx = 0; + if (gr2->gr_mem != NULL) + for(; gr2->gr_mem[gr2_ndx] != NULL; gr2_ndx++) + /* empty */; + gr1_ndx = 0; + if (gr1->gr_mem != NULL) + for(; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) + /* empty */; + if (gr1_ndx != gr2_ndx) + return (false); return (true); } @@ -439,21 +443,21 @@ gr_dup(const struct group *gr) struct group * gr_add(const struct group *gr, const char *newmember) { - struct group *newgr; + char *mem; size_t len; int num_mem; num_mem = 0; len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ - if ((newgr = malloc(len)) == NULL) + if ((mem = malloc(len)) == NULL) return (NULL); - return (grcopy(gr, newgr, newmember, num_mem)); + return (grcopy(gr, mem, newmember, num_mem)); } /* It is safer to walk the pointers given at gr_mem since there is no - * guarantee the gr_mem + strings are continguous in the given struct group - * but compact the new group into the following form. + * guarantee the gr_mem + strings are contiguous in the given struct group + * but compactify the new group into the following form. * * The new struct is laid out like this in memory. The example given is * for a group with two members only. @@ -474,23 +478,21 @@ gr_add(const struct group *gr, const cha * } */ /* - * Copy the guts of a group plus given name to a preallocated group struct + * Copy the contents of a group plus given name to a preallocated group struct */ static struct group * -grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +grcopy(const struct group *gr, char *dst, const char *name, int ndx) { - char *dst; int i; + struct group *newgr; - if (name != NULL) - ndx++; - /* point new gr_mem to end of struct + 1 if there are names */ - if (ndx != 0) - newgr->gr_mem = (char **)(newgr + 1); - else + newgr = (struct group *)(void *)dst; /* avoid alignment warning */ + dst += sizeof(*newgr); + if (ndx != 0) { + newgr->gr_mem = (char **)(void *)(dst); /* avoid alignment warning */ + dst += (ndx + 1) * sizeof(*newgr->gr_mem); + } else newgr->gr_mem = NULL; - /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; @@ -502,17 +504,23 @@ grcopy(const struct group *gr, struct gr } else newgr->gr_passwd = NULL; newgr->gr_gid = gr->gr_gid; - if (ndx != 0) { - for (i = 0; gr->gr_mem[i] != NULL; i++) { + i = 0; + /* Original group struct might have a NULL gr_mem */ + if (gr->gr_mem != NULL) { + for (; gr->gr_mem[i] != NULL; i++) { newgr->gr_mem[i] = dst; dst = stpcpy(dst, gr->gr_mem[i]) + 1; } - if (name != NULL) { - newgr->gr_mem[i++] = dst; - dst = stpcpy(dst, name) + 1; - } - newgr->gr_mem[i] = NULL; } + /* If name is not NULL, newgr->gr_mem is known to be not NULL */ + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; + } + /* if newgr->gr_mem is not NULL add NULL marker */ + if (newgr->gr_mem != NULL) + newgr->gr_mem[i] = NULL; + return (newgr); } @@ -533,18 +541,22 @@ grmemlen(const struct group *gr, const c len += strlen(gr->gr_name) + 1; if (gr->gr_passwd != NULL) len += strlen(gr->gr_passwd) + 1; + i = 0; if (gr->gr_mem != NULL) { - for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + for (; gr->gr_mem[i] != NULL; i++) { len += strlen(gr->gr_mem[i]) + 1; len += sizeof(*gr->gr_mem); } - *num_mem = i; } if (name != NULL) { + i++; len += strlen(name) + 1; - if (gr->gr_mem == NULL) - len += sizeof(*gr->gr_mem); + len += sizeof(*gr->gr_mem); } + /* Allow for NULL pointer */ + if (i != 0) + len += sizeof(*gr->gr_mem); + *num_mem = i; return(len); } Modified: user/attilio/vmcontention/sys/dev/ichwd/ichwd.c ============================================================================== --- user/attilio/vmcontention/sys/dev/ichwd/ichwd.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/sys/dev/ichwd/ichwd.c Sat Mar 9 15:54:20 2013 (r248107) @@ -323,8 +323,6 @@ ichwd_tmr_reload(struct ichwd_softc *sc) ichwd_write_tco_1(sc, TCO_RLD, 1); else ichwd_write_tco_2(sc, TCO_RLD, 1); - - ichwd_verbose_printf(sc->device, "timer reloaded\n"); } /* Modified: user/attilio/vmcontention/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- user/attilio/vmcontention/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 15:54:20 2013 (r248107) @@ -1455,15 +1455,9 @@ smbfs_smb_lookup(struct smbnode *dnp, co fap->fa_ino = 2; return 0; } - if (nmlen == 1 && name[0] == '.') { - error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); - return error; - } else if (nmlen == 2 && name[0] == '.' && name[1] == '.') { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - printf("%s: knows NOTHING about '..'\n", __func__); - return error; - } + MPASS(!(nmlen == 2 && name[0] == '.' && name[1] == '.')); + MPASS(!(nmlen == 1 && name[0] == '.')); + ASSERT_VOP_ELOCKED(dnp->n_vnode, "smbfs_smb_lookup"); error = smbfs_findopen(dnp, name, nmlen, SMB_FA_SYSTEM | SMB_FA_HIDDEN | SMB_FA_DIR, scred, &ctx); if (error) Modified: user/attilio/vmcontention/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- user/attilio/vmcontention/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 15:54:20 2013 (r248107) @@ -580,6 +580,7 @@ smbfs_rename(ap) u_int16_t flags = 6; int error=0; + scred = NULL; /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -730,7 +731,7 @@ smbfs_mkdir(ap) *ap->a_vpp = vp; out: smbfs_free_scred(scred); - return 0; + return error; } /* @@ -1203,13 +1204,20 @@ smbfs_lookup(ap) smb_makescred(scred, td, cnp->cn_cred); fap = &fattr; if (flags & ISDOTDOT) { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - SMBVDEBUG("result of dotdot lookup: %d\n", error); - } else { - fap = &fattr; + /* + * In the DOTDOT case, don't go over-the-wire + * in order to request attributes. We already + * know it's a directory and subsequent call to + * smbfs_getattr() will restore consistency. + * + */ + SMBVDEBUG("smbfs_smb_lookup: dotdot\n"); + } else if (isdot) { + error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); + SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); + } + else { error = smbfs_smb_lookup(dnp, name, nmlen, fap, scred); -/* if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')*/ SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); } if (error && error != ENOENT) Modified: user/attilio/vmcontention/sys/kern/kern_umtx.c ============================================================================== --- user/attilio/vmcontention/sys/kern/kern_umtx.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/sys/kern/kern_umtx.c Sat Mar 9 15:54:20 2013 (r248107) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,11 @@ __FBSDID("$FreeBSD$"); #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2 +#ifdef UMTX_PROFILING +#define UPROF_PERC_BIGGER(w, f, sw, sf) \ + (((w) > (sw)) || ((w) == (sw) && (f) > (sf))) +#endif + /* Priority inheritance mutex info. */ struct umtx_pi { /* Owner thread */ @@ -157,8 +163,8 @@ struct umtxq_chain { TAILQ_HEAD(,umtx_pi) uc_pi_list; #ifdef UMTX_PROFILING - int length; - int max_length; + u_int length; + u_int max_length; #endif }; @@ -252,6 +258,117 @@ umtx_init_profiling(void) "max_length1", CTLFLAG_RD, &umtxq_chains[1][i].max_length, 0, NULL); } } + +static int +sysctl_debug_umtx_chains_peaks(SYSCTL_HANDLER_ARGS) +{ + char buf[512]; + struct sbuf sb; + struct umtxq_chain *uc; + u_int fract, i, j, tot, whole; + u_int sf0, sf1, sf2, sf3, sf4; + u_int si0, si1, si2, si3, si4; + u_int sw0, sw1, sw2, sw3, sw4; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + for (i = 0; i < 2; i++) { + tot = 0; + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + tot += uc->max_length; + mtx_unlock(&uc->uc_lock); + } + if (tot == 0) + sbuf_printf(&sb, "%u) Empty ", i); + else { + sf0 = sf1 = sf2 = sf3 = sf4 = 0; + si0 = si1 = si2 = si3 = si4 = 0; + sw0 = sw1 = sw2 = sw3 = sw4 = 0; + for (j = 0; j < UMTX_CHAINS; j++) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + whole = uc->max_length * 100; + mtx_unlock(&uc->uc_lock); + fract = (whole % tot) * 100; + if (UPROF_PERC_BIGGER(whole, fract, sw0, sf0)) { + sf0 = fract; + si0 = j; + sw0 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw1, + sf1)) { + sf1 = fract; + si1 = j; + sw1 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw2, + sf2)) { + sf2 = fract; + si2 = j; + sw2 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw3, + sf3)) { + sf3 = fract; + si3 = j; + sw3 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw4, + sf4)) { + sf4 = fract; + si4 = j; + sw4 = whole; + } + } + sbuf_printf(&sb, "queue %u:\n", i); + sbuf_printf(&sb, "1st: %u.%u%% idx: %u\n", sw0 / tot, + sf0 / tot, si0); + sbuf_printf(&sb, "2nd: %u.%u%% idx: %u\n", sw1 / tot, + sf1 / tot, si1); + sbuf_printf(&sb, "3rd: %u.%u%% idx: %u\n", sw2 / tot, + sf2 / tot, si2); + sbuf_printf(&sb, "4th: %u.%u%% idx: %u\n", sw3 / tot, + sf3 / tot, si3); + sbuf_printf(&sb, "5th: %u.%u%% idx: %u\n", sw4 / tot, + sf4 / tot, si4); + } + } + sbuf_trim(&sb); + sbuf_finish(&sb); + sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + return (0); +} + +static int +sysctl_debug_umtx_chains_clear(SYSCTL_HANDLER_ARGS) +{ + struct umtxq_chain *uc; + u_int i, j; + int clear, error; + + clear = 0; + error = sysctl_handle_int(oidp, &clear, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (clear != 0) { + for (i = 0; i < 2; ++i) { + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + uc->length = 0; + uc->max_length = 0; + mtx_unlock(&uc->uc_lock); + } + } + } + return (0); +} + +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_clear, "I", "Clear umtx chains statistics"); +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, peaks, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_peaks, "A", "Highest peaks in chains max length"); #endif static void Modified: user/attilio/vmcontention/sys/net80211/ieee80211_output.c ============================================================================== --- user/attilio/vmcontention/sys/net80211/ieee80211_output.c Sat Mar 9 15:35:31 2013 (r248106) +++ user/attilio/vmcontention/sys/net80211/ieee80211_output.c Sat Mar 9 15:54:20 2013 (r248107) @@ -597,10 +597,9 @@ ieee80211_send_setup( struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_tx_ampdu *tap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); - struct ieee80211com *ic = ni->ni_ic; ieee80211_seq seqno; - IEEE80211_TX_LOCK_ASSERT(ic); + IEEE80211_TX_LOCK_ASSERT(ni->ni_ic); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 16:11:31 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5549ACD0; Sat, 9 Mar 2013 16:11:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47096DE2; Sat, 9 Mar 2013 16:11:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29GBVTa017837; Sat, 9 Mar 2013 16:11:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29GBUax017830; Sat, 9 Mar 2013 16:11:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091611.r29GBUax017830@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 16:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248108 - in user/attilio/vmc-playground: lib/libutil sys/dev/ichwd sys/fs/smbfs sys/kern sys/net80211 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 16:11:31 -0000 Author: attilio Date: Sat Mar 9 16:11:29 2013 New Revision: 248108 URL: http://svnweb.freebsd.org/changeset/base/248108 Log: Merge from vmcontention Modified: user/attilio/vmc-playground/lib/libutil/gr_util.c user/attilio/vmc-playground/sys/dev/ichwd/ichwd.c user/attilio/vmc-playground/sys/fs/smbfs/smbfs_smb.c user/attilio/vmc-playground/sys/fs/smbfs/smbfs_vnops.c user/attilio/vmc-playground/sys/kern/kern_umtx.c user/attilio/vmc-playground/sys/net80211/ieee80211_output.c Directory Properties: user/attilio/vmc-playground/ (props changed) user/attilio/vmc-playground/lib/libutil/ (props changed) user/attilio/vmc-playground/sys/ (props changed) Modified: user/attilio/vmc-playground/lib/libutil/gr_util.c ============================================================================== --- user/attilio/vmc-playground/lib/libutil/gr_util.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/lib/libutil/gr_util.c Sat Mar 9 16:11:29 2013 (r248108) @@ -50,7 +50,7 @@ static char group_file[PATH_MAX]; static char tempname[PATH_MAX]; static int initialized; static size_t grmemlen(const struct group *, const char *, int *); -static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx); +static struct group *grcopy(const struct group *gr, char *mem, const char *, int ndx); /* * Initialize statics @@ -361,26 +361,30 @@ gr_equal(const struct group *gr1, const if (gr1->gr_gid != gr2->gr_gid) return (false); - /* Check all members in both groups. */ - if (gr1->gr_mem == NULL || gr2->gr_mem == NULL) { - if (gr1->gr_mem != gr2->gr_mem) - return (false); - } else { - for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) { - for (gr2_ndx = 0;; gr2_ndx++) { - if (gr2->gr_mem[gr2_ndx] == NULL) - return (false); - if (strcmp(gr1->gr_mem[gr1_ndx], - gr2->gr_mem[gr2_ndx]) == 0) { - break; - } - } - } - - /* Check that group2 does not have more members than group1. */ - if (gr2->gr_mem[gr1_ndx] != NULL) - return (false); - } + /* Check all members in both groups. + * getgrnam can return gr_mem with a pointer to NULL. + * gr_dup and gr_add strip out this superfluous NULL, setting + * gr_mem to NULL for no members. + */ + if (gr1->gr_mem != NULL && gr2->gr_mem != NULL) { + int i; + + for (i = 0; gr1->gr_mem[i] != NULL; i++) { + if (strcmp(gr1->gr_mem[i], gr2->gr_mem[i]) != 0) + return (false); + } + } + /* Count number of members in both structs */ + gr2_ndx = 0; + if (gr2->gr_mem != NULL) + for(; gr2->gr_mem[gr2_ndx] != NULL; gr2_ndx++) + /* empty */; + gr1_ndx = 0; + if (gr1->gr_mem != NULL) + for(; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) + /* empty */; + if (gr1_ndx != gr2_ndx) + return (false); return (true); } @@ -439,21 +443,21 @@ gr_dup(const struct group *gr) struct group * gr_add(const struct group *gr, const char *newmember) { - struct group *newgr; + char *mem; size_t len; int num_mem; num_mem = 0; len = grmemlen(gr, newmember, &num_mem); /* Create new group and copy old group into it. */ - if ((newgr = malloc(len)) == NULL) + if ((mem = malloc(len)) == NULL) return (NULL); - return (grcopy(gr, newgr, newmember, num_mem)); + return (grcopy(gr, mem, newmember, num_mem)); } /* It is safer to walk the pointers given at gr_mem since there is no - * guarantee the gr_mem + strings are continguous in the given struct group - * but compact the new group into the following form. + * guarantee the gr_mem + strings are contiguous in the given struct group + * but compactify the new group into the following form. * * The new struct is laid out like this in memory. The example given is * for a group with two members only. @@ -474,23 +478,21 @@ gr_add(const struct group *gr, const cha * } */ /* - * Copy the guts of a group plus given name to a preallocated group struct + * Copy the contents of a group plus given name to a preallocated group struct */ static struct group * -grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx) +grcopy(const struct group *gr, char *dst, const char *name, int ndx) { - char *dst; int i; + struct group *newgr; - if (name != NULL) - ndx++; - /* point new gr_mem to end of struct + 1 if there are names */ - if (ndx != 0) - newgr->gr_mem = (char **)(newgr + 1); - else + newgr = (struct group *)(void *)dst; /* avoid alignment warning */ + dst += sizeof(*newgr); + if (ndx != 0) { + newgr->gr_mem = (char **)(void *)(dst); /* avoid alignment warning */ + dst += (ndx + 1) * sizeof(*newgr->gr_mem); + } else newgr->gr_mem = NULL; - /* point dst after the end of all the gr_mem pointers in newgr */ - dst = (char *)&newgr->gr_mem[ndx + 1]; if (gr->gr_name != NULL) { newgr->gr_name = dst; dst = stpcpy(dst, gr->gr_name) + 1; @@ -502,17 +504,23 @@ grcopy(const struct group *gr, struct gr } else newgr->gr_passwd = NULL; newgr->gr_gid = gr->gr_gid; - if (ndx != 0) { - for (i = 0; gr->gr_mem[i] != NULL; i++) { + i = 0; + /* Original group struct might have a NULL gr_mem */ + if (gr->gr_mem != NULL) { + for (; gr->gr_mem[i] != NULL; i++) { newgr->gr_mem[i] = dst; dst = stpcpy(dst, gr->gr_mem[i]) + 1; } - if (name != NULL) { - newgr->gr_mem[i++] = dst; - dst = stpcpy(dst, name) + 1; - } - newgr->gr_mem[i] = NULL; } + /* If name is not NULL, newgr->gr_mem is known to be not NULL */ + if (name != NULL) { + newgr->gr_mem[i++] = dst; + dst = stpcpy(dst, name) + 1; + } + /* if newgr->gr_mem is not NULL add NULL marker */ + if (newgr->gr_mem != NULL) + newgr->gr_mem[i] = NULL; + return (newgr); } @@ -533,18 +541,22 @@ grmemlen(const struct group *gr, const c len += strlen(gr->gr_name) + 1; if (gr->gr_passwd != NULL) len += strlen(gr->gr_passwd) + 1; + i = 0; if (gr->gr_mem != NULL) { - for (len = i = 0; gr->gr_mem[i] != NULL; i++) { + for (; gr->gr_mem[i] != NULL; i++) { len += strlen(gr->gr_mem[i]) + 1; len += sizeof(*gr->gr_mem); } - *num_mem = i; } if (name != NULL) { + i++; len += strlen(name) + 1; - if (gr->gr_mem == NULL) - len += sizeof(*gr->gr_mem); + len += sizeof(*gr->gr_mem); } + /* Allow for NULL pointer */ + if (i != 0) + len += sizeof(*gr->gr_mem); + *num_mem = i; return(len); } Modified: user/attilio/vmc-playground/sys/dev/ichwd/ichwd.c ============================================================================== --- user/attilio/vmc-playground/sys/dev/ichwd/ichwd.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/sys/dev/ichwd/ichwd.c Sat Mar 9 16:11:29 2013 (r248108) @@ -323,8 +323,6 @@ ichwd_tmr_reload(struct ichwd_softc *sc) ichwd_write_tco_1(sc, TCO_RLD, 1); else ichwd_write_tco_2(sc, TCO_RLD, 1); - - ichwd_verbose_printf(sc->device, "timer reloaded\n"); } /* Modified: user/attilio/vmc-playground/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- user/attilio/vmc-playground/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/sys/fs/smbfs/smbfs_smb.c Sat Mar 9 16:11:29 2013 (r248108) @@ -1455,15 +1455,9 @@ smbfs_smb_lookup(struct smbnode *dnp, co fap->fa_ino = 2; return 0; } - if (nmlen == 1 && name[0] == '.') { - error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); - return error; - } else if (nmlen == 2 && name[0] == '.' && name[1] == '.') { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - printf("%s: knows NOTHING about '..'\n", __func__); - return error; - } + MPASS(!(nmlen == 2 && name[0] == '.' && name[1] == '.')); + MPASS(!(nmlen == 1 && name[0] == '.')); + ASSERT_VOP_ELOCKED(dnp->n_vnode, "smbfs_smb_lookup"); error = smbfs_findopen(dnp, name, nmlen, SMB_FA_SYSTEM | SMB_FA_HIDDEN | SMB_FA_DIR, scred, &ctx); if (error) Modified: user/attilio/vmc-playground/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- user/attilio/vmc-playground/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/sys/fs/smbfs/smbfs_vnops.c Sat Mar 9 16:11:29 2013 (r248108) @@ -580,6 +580,7 @@ smbfs_rename(ap) u_int16_t flags = 6; int error=0; + scred = NULL; /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -730,7 +731,7 @@ smbfs_mkdir(ap) *ap->a_vpp = vp; out: smbfs_free_scred(scred); - return 0; + return error; } /* @@ -1203,13 +1204,20 @@ smbfs_lookup(ap) smb_makescred(scred, td, cnp->cn_cred); fap = &fattr; if (flags & ISDOTDOT) { - error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap, - scred); - SMBVDEBUG("result of dotdot lookup: %d\n", error); - } else { - fap = &fattr; + /* + * In the DOTDOT case, don't go over-the-wire + * in order to request attributes. We already + * know it's a directory and subsequent call to + * smbfs_getattr() will restore consistency. + * + */ + SMBVDEBUG("smbfs_smb_lookup: dotdot\n"); + } else if (isdot) { + error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred); + SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); + } + else { error = smbfs_smb_lookup(dnp, name, nmlen, fap, scred); -/* if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')*/ SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error); } if (error && error != ENOENT) Modified: user/attilio/vmc-playground/sys/kern/kern_umtx.c ============================================================================== --- user/attilio/vmc-playground/sys/kern/kern_umtx.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/sys/kern/kern_umtx.c Sat Mar 9 16:11:29 2013 (r248108) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,11 @@ __FBSDID("$FreeBSD$"); #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2 +#ifdef UMTX_PROFILING +#define UPROF_PERC_BIGGER(w, f, sw, sf) \ + (((w) > (sw)) || ((w) == (sw) && (f) > (sf))) +#endif + /* Priority inheritance mutex info. */ struct umtx_pi { /* Owner thread */ @@ -157,8 +163,8 @@ struct umtxq_chain { TAILQ_HEAD(,umtx_pi) uc_pi_list; #ifdef UMTX_PROFILING - int length; - int max_length; + u_int length; + u_int max_length; #endif }; @@ -252,6 +258,117 @@ umtx_init_profiling(void) "max_length1", CTLFLAG_RD, &umtxq_chains[1][i].max_length, 0, NULL); } } + +static int +sysctl_debug_umtx_chains_peaks(SYSCTL_HANDLER_ARGS) +{ + char buf[512]; + struct sbuf sb; + struct umtxq_chain *uc; + u_int fract, i, j, tot, whole; + u_int sf0, sf1, sf2, sf3, sf4; + u_int si0, si1, si2, si3, si4; + u_int sw0, sw1, sw2, sw3, sw4; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + for (i = 0; i < 2; i++) { + tot = 0; + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + tot += uc->max_length; + mtx_unlock(&uc->uc_lock); + } + if (tot == 0) + sbuf_printf(&sb, "%u) Empty ", i); + else { + sf0 = sf1 = sf2 = sf3 = sf4 = 0; + si0 = si1 = si2 = si3 = si4 = 0; + sw0 = sw1 = sw2 = sw3 = sw4 = 0; + for (j = 0; j < UMTX_CHAINS; j++) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + whole = uc->max_length * 100; + mtx_unlock(&uc->uc_lock); + fract = (whole % tot) * 100; + if (UPROF_PERC_BIGGER(whole, fract, sw0, sf0)) { + sf0 = fract; + si0 = j; + sw0 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw1, + sf1)) { + sf1 = fract; + si1 = j; + sw1 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw2, + sf2)) { + sf2 = fract; + si2 = j; + sw2 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw3, + sf3)) { + sf3 = fract; + si3 = j; + sw3 = whole; + } else if (UPROF_PERC_BIGGER(whole, fract, sw4, + sf4)) { + sf4 = fract; + si4 = j; + sw4 = whole; + } + } + sbuf_printf(&sb, "queue %u:\n", i); + sbuf_printf(&sb, "1st: %u.%u%% idx: %u\n", sw0 / tot, + sf0 / tot, si0); + sbuf_printf(&sb, "2nd: %u.%u%% idx: %u\n", sw1 / tot, + sf1 / tot, si1); + sbuf_printf(&sb, "3rd: %u.%u%% idx: %u\n", sw2 / tot, + sf2 / tot, si2); + sbuf_printf(&sb, "4th: %u.%u%% idx: %u\n", sw3 / tot, + sf3 / tot, si3); + sbuf_printf(&sb, "5th: %u.%u%% idx: %u\n", sw4 / tot, + sf4 / tot, si4); + } + } + sbuf_trim(&sb); + sbuf_finish(&sb); + sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + return (0); +} + +static int +sysctl_debug_umtx_chains_clear(SYSCTL_HANDLER_ARGS) +{ + struct umtxq_chain *uc; + u_int i, j; + int clear, error; + + clear = 0; + error = sysctl_handle_int(oidp, &clear, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (clear != 0) { + for (i = 0; i < 2; ++i) { + for (j = 0; j < UMTX_CHAINS; ++j) { + uc = &umtxq_chains[i][j]; + mtx_lock(&uc->uc_lock); + uc->length = 0; + uc->max_length = 0; + mtx_unlock(&uc->uc_lock); + } + } + } + return (0); +} + +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_clear, "I", "Clear umtx chains statistics"); +SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, peaks, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_umtx_chains_peaks, "A", "Highest peaks in chains max length"); #endif static void Modified: user/attilio/vmc-playground/sys/net80211/ieee80211_output.c ============================================================================== --- user/attilio/vmc-playground/sys/net80211/ieee80211_output.c Sat Mar 9 15:54:20 2013 (r248107) +++ user/attilio/vmc-playground/sys/net80211/ieee80211_output.c Sat Mar 9 16:11:29 2013 (r248108) @@ -597,10 +597,9 @@ ieee80211_send_setup( struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_tx_ampdu *tap; struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); - struct ieee80211com *ic = ni->ni_ic; ieee80211_seq seqno; - IEEE80211_TX_LOCK_ASSERT(ic); + IEEE80211_TX_LOCK_ASSERT(ni->ni_ic); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type; if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) { From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 17:25:34 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5190DFA4; Sat, 9 Mar 2013 17:25:34 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 404C4175; Sat, 9 Mar 2013 17:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29HPYsv040141; Sat, 9 Mar 2013 17:25:34 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29HPV4h040120; Sat, 9 Mar 2013 17:25:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091725.r29HPV4h040120@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 17:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248110 - in user/attilio/vmcontention/sys: conf fs/tmpfs i386/xen kern vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 17:25:34 -0000 Author: attilio Date: Sat Mar 9 17:25:31 2013 New Revision: 248110 URL: http://svnweb.freebsd.org/changeset/base/248110 Log: Merge back vmc-playground into vmcontention. vm_radix.{c, h} and _vm_radix.h are copied straight from the branch to preserve history. Added: user/attilio/vmcontention/sys/vm/_vm_radix.h - copied unchanged from r248107, user/attilio/vmc-playground/sys/vm/_vm_radix.h Replaced: user/attilio/vmcontention/sys/vm/vm_radix.c - copied unchanged from r248107, user/attilio/vmc-playground/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h - copied unchanged from r248107, user/attilio/vmc-playground/sys/vm/vm_radix.h Modified: user/attilio/vmcontention/sys/conf/files user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_fifoops.c user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c user/attilio/vmcontention/sys/i386/xen/pmap.c user/attilio/vmcontention/sys/kern/subr_uio.c user/attilio/vmcontention/sys/kern/uipc_shm.c user/attilio/vmcontention/sys/vm/device_pager.c user/attilio/vmcontention/sys/vm/sg_pager.c user/attilio/vmcontention/sys/vm/vm_fault.c user/attilio/vmcontention/sys/vm/vm_init.c user/attilio/vmcontention/sys/vm/vm_mmap.c user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/sys/vm/vm_object.h user/attilio/vmcontention/sys/vm/vm_page.c user/attilio/vmcontention/sys/vm/vm_page.h user/attilio/vmcontention/sys/vm/vm_reserv.c user/attilio/vmcontention/sys/vm/vnode_pager.c Modified: user/attilio/vmcontention/sys/conf/files ============================================================================== --- user/attilio/vmcontention/sys/conf/files Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/conf/files Sat Mar 9 17:25:31 2013 (r248110) @@ -3630,7 +3630,7 @@ vm/vm_page.c standard vm/vm_pageout.c standard vm/vm_pager.c standard vm/vm_phys.c standard -vm/vm_radix.c standard +vm/vm_radix.c standard vm/vm_reserv.c standard vm/vm_unix.c standard vm/vm_zeroidle.c standard Modified: user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_fifoops.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_fifoops.c Sat Mar 9 17:25:31 2013 (r248110) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include Modified: user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c Sat Mar 9 17:25:31 2013 (r248110) @@ -638,34 +638,19 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o VM_OBJECT_WLOCK(vobj); lookupvpg: - vpg = vm_radix_lookup(&vobj->rtree, idx, VM_RADIX_ANY); - if (vpg != NULL) { - if (vm_page_is_valid(vpg, offset, tlen)) { - if ((vpg->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_reference(vpg); - vm_page_sleep(vpg, "tmfsmw"); - goto lookupvpg; - } - vm_page_busy(vpg); - vm_page_undirty(vpg); - VM_OBJECT_UNLOCK(vobj); - error = uiomove_fromphys(&vpg, offset, tlen, uio); - } else { - if (vpg->flags & PG_CACHED) { - mtx_lock(&vm_page_queue_free_mtx); - if (vpg->object == vobj) - vm_page_cache_free(vpg); - mtx_unlock(&vm_page_queue_free_mtx); - } - VM_OBJECT_UNLOCK(vobj); - vpg = NULL; + if (((vpg = vm_page_lookup(vobj, idx)) != NULL) && + vm_page_is_valid(vpg, offset, tlen)) { + if ((vpg->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and sleeping so + * that the page daemon is less likely to reclaim it. + */ + vm_page_reference(vpg); + vm_page_sleep(vpg, "tmfsmw"); + goto lookupvpg; } - } else + vm_page_busy(vpg); + vm_page_undirty(vpg); VM_OBJECT_WUNLOCK(vobj); error = uiomove_fromphys(&vpg, offset, tlen, uio); } else { Modified: user/attilio/vmcontention/sys/i386/xen/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/i386/xen/pmap.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/i386/xen/pmap.c Sat Mar 9 17:25:31 2013 (r248110) @@ -1335,7 +1335,8 @@ pmap_free_zero_pages(vm_page_t free) while (free != NULL) { m = free; - free = m->right; + free = (void *)m->object; + m->object = NULL; vm_page_free_zero(m); } } @@ -1393,7 +1394,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t * Put page on a list so that it is released after * *ALL* TLB shootdown is done */ - m->right = *free; + m->object = (void *)*free; *free = m; } @@ -2090,7 +2091,7 @@ out: } if (m_pc == NULL && pv_vafree != 0 && free != NULL) { m_pc = free; - free = m_pc->right; + free = (void *)m_pc->object; /* Recycle a freed page table page. */ m_pc->wire_count = 1; atomic_add_int(&cnt.v_wire_count, 1); Modified: user/attilio/vmcontention/sys/kern/subr_uio.c ============================================================================== --- user/attilio/vmcontention/sys/kern/subr_uio.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/kern/subr_uio.c Sat Mar 9 17:25:31 2013 (r248110) @@ -85,7 +85,6 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t k vm_map_entry_t entry; vm_pindex_t upindex; vm_prot_t prot; - vm_page_bits_t vbits; boolean_t wired; KASSERT((uaddr & PAGE_MASK) == 0, @@ -96,7 +95,6 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t k * unwired in sf_buf_mext(). */ kern_pg = PHYS_TO_VM_PAGE(vtophys(kaddr)); - vbits = kern_pg->valid; kern_pg->valid = VM_PAGE_BITS_ALL; KASSERT(kern_pg->queue == PQ_NONE && kern_pg->wire_count == 1, ("vm_pgmoveco: kern_pg is not correctly wired")); @@ -107,13 +105,6 @@ vm_pgmoveco(vm_map_t mapa, vm_offset_t k return(EFAULT); } VM_OBJECT_WLOCK(uobject); - if (vm_page_insert(kern_pg, uobject, upindex) != 0) { - kern_pg->valid = vbits; - VM_OBJECT_UNLOCK(uobject); - vm_map_lookup_done(map, entry); - return(ENOMEM); - } - vm_page_dirty(kern_pg); retry: if ((user_pg = vm_page_lookup(uobject, upindex)) != NULL) { if (vm_page_sleep_if_busy(user_pg, TRUE, "vm_pgmoveco")) @@ -131,6 +122,8 @@ retry: if (uobject->backing_object != NULL) pmap_remove(map->pmap, uaddr, uaddr + PAGE_SIZE); } + vm_page_insert(kern_pg, uobject, upindex); + vm_page_dirty(kern_pg); VM_OBJECT_WUNLOCK(uobject); vm_map_lookup_done(map, entry); return(KERN_SUCCESS); Modified: user/attilio/vmcontention/sys/kern/uipc_shm.c ============================================================================== --- user/attilio/vmcontention/sys/kern/uipc_shm.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/kern/uipc_shm.c Sat Mar 9 17:25:31 2013 (r248110) @@ -279,8 +279,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ if (base != 0) { idx = OFF_TO_IDX(length); retry: - m = vm_radix_lookup(&object->rtree, idx, - VM_RADIX_BLACK); + m = vm_page_lookup(object, idx); if (m != NULL) { if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) { Copied: user/attilio/vmcontention/sys/vm/_vm_radix.h (from r248107, user/attilio/vmc-playground/sys/vm/_vm_radix.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sys/vm/_vm_radix.h Sat Mar 9 17:25:31 2013 (r248110, copy of r248107, user/attilio/vmc-playground/sys/vm/_vm_radix.h) @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2011 Jeffrey Roberson + * Copyright (c) 2008 Mayur Shardul + * 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 __VM_RADIX_H_ +#define __VM_RADIX_H_ + +/* + * Radix tree root. + */ +struct vm_radix { + uintptr_t rt_root; +}; + +#endif /* !__VM_RADIX_H_ */ Modified: user/attilio/vmcontention/sys/vm/device_pager.c ============================================================================== --- user/attilio/vmcontention/sys/vm/device_pager.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/device_pager.c Sat Mar 9 17:25:31 2013 (r248110) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static void dev_pager_init(void); static vm_object_t dev_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *); @@ -302,7 +300,7 @@ old_dev_pager_fault(vm_object_t object, struct file *fpop; struct thread *td; vm_memattr_t memattr; - int i, ref, ret; + int ref, ret; pidx = OFF_TO_IDX(offset); memattr = object->memattr; @@ -354,10 +352,7 @@ old_dev_pager_fault(vm_object_t object, vm_page_free(*mres); vm_page_unlock(*mres); *mres = page; - while (vm_page_insert(page, object, pidx) != 0) { - for (i = 0; i < 10000000; i++) - cpu_spinwait(); - } + vm_page_insert(page, object, pidx); } page->valid = VM_PAGE_BITS_ALL; return (VM_PAGER_OK); Modified: user/attilio/vmcontention/sys/vm/sg_pager.c ============================================================================== --- user/attilio/vmcontention/sys/vm/sg_pager.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/sg_pager.c Sat Mar 9 17:25:31 2013 (r248110) @@ -182,10 +182,6 @@ sg_pager_getpages(vm_object_t object, vm /* Construct a new fake page. */ page = vm_page_getfake(paddr, memattr); VM_OBJECT_WLOCK(object); - if (vm_page_insert(page, object, offset) != 0) { - vm_page_putfake(page); - return (VM_PAGER_FAIL); - } TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); /* Free the original pages and insert this fake page into the object. */ @@ -194,6 +190,7 @@ sg_pager_getpages(vm_object_t object, vm vm_page_free(m[i]); vm_page_unlock(m[i]); } + vm_page_insert(page, object, offset); m[reqpage] = page; page->valid = VM_PAGE_BITS_ALL; Modified: user/attilio/vmcontention/sys/vm/vm_fault.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_fault.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/vm_fault.c Sat Mar 9 17:25:31 2013 (r248110) @@ -741,7 +741,9 @@ vnode_locked: * process'es object. The page is * automatically made dirty. */ + vm_page_lock(fs.m); vm_page_rename(fs.m, fs.first_object, fs.first_pindex); + vm_page_unlock(fs.m); vm_page_busy(fs.m); fs.first_m = fs.m; fs.m = NULL; Modified: user/attilio/vmcontention/sys/vm/vm_init.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_init.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/vm_init.c Sat Mar 9 17:25:31 2013 (r248110) @@ -82,7 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -124,7 +123,6 @@ vm_mem_init(dummy) vm_object_init(); vm_map_startup(); kmem_init(virtual_avail, virtual_end); - vm_radix_init(); pmap_init(); vm_pager_init(); } Modified: user/attilio/vmcontention/sys/vm/vm_mmap.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_mmap.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/vm_mmap.c Sat Mar 9 17:25:31 2013 (r248110) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef HWPMC_HOOKS @@ -914,15 +913,10 @@ RestartScan: object->type == OBJT_VNODE) { pindex = OFF_TO_IDX(current->offset + (addr - current->start)); - m = vm_radix_lookup(&object->rtree, - pindex, VM_RADIX_ANY); - - /* Lock just for consistency. */ - mtx_lock(&vm_page_queue_free_mtx); - if (m != NULL && - (m->flags & PG_CACHED) != 0) + m = vm_page_lookup(object, pindex); + if (m == NULL && + vm_page_is_cached(object, pindex)) mincoreinfo = MINCORE_INCORE; - mtx_unlock(&vm_page_queue_free_mtx); if (m != NULL && m->valid == 0) m = NULL; if (m != NULL) Modified: user/attilio/vmcontention/sys/vm/vm_object.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_object.c Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/vm_object.c Sat Mar 9 17:25:31 2013 (r248110) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -165,13 +166,10 @@ vm_object_zdtor(void *mem, int size, voi vm_object_t object; object = (vm_object_t)mem; - KASSERT(object->resident_page_count == 0, - ("object %p resident_page_count = %d", - object, object->resident_page_count)); KASSERT(TAILQ_EMPTY(&object->memq), ("object %p has resident pages in its memq", object)); - KASSERT(object->root == NULL, - ("object %p has resident pages in its tree", object)); + KASSERT(object->rtree.rt_root == 0, + ("object %p has resident pages in its trie", object)); #if VM_NRESERVLEVEL > 0 KASSERT(LIST_EMPTY(&object->rvq), ("object %p has reservations", @@ -183,6 +181,9 @@ vm_object_zdtor(void *mem, int size, voi KASSERT(object->paging_in_progress == 0, ("object %p paging_in_progress = %d", object, object->paging_in_progress)); + KASSERT(object->resident_page_count == 0, + ("object %p resident_page_count = %d", + object, object->resident_page_count)); KASSERT(object->shadow_count == 0, ("object %p shadow_count = %d", object, object->shadow_count)); @@ -199,11 +200,11 @@ vm_object_zinit(void *mem, int size, int rw_init_flags(&object->lock, "vm object", RW_DUPOK); /* These are true for any object that has been freed */ - object->root = NULL; + object->rtree.rt_root = 0; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; - object->cache = NULL; + object->cache.rt_root = 0; return (0); } @@ -295,6 +296,8 @@ vm_object_init(void) NULL, #endif vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); + + vm_radix_init(); } void @@ -327,7 +330,7 @@ vm_object_set_memattr(vm_object_t object case OBJT_SG: case OBJT_SWAP: case OBJT_VNODE: - if (object->resident_page_count == 0) + if (!TAILQ_EMPTY(&object->memq)) return (KERN_FAILURE); break; case OBJT_DEAD: @@ -673,11 +676,7 @@ vm_object_destroy(vm_object_t object) void vm_object_terminate(vm_object_t object) { - vm_page_t pa[VM_RADIX_STACK]; - vm_page_t p; - vm_pindex_t start; - u_int exhausted; - int n, i; + vm_page_t p, p_next; VM_OBJECT_ASSERT_WLOCKED(object); @@ -722,73 +721,36 @@ vm_object_terminate(vm_object_t object) * from the object. Rather than incrementally removing each page from * the object, the page and object are reset to any empty state. */ - start = 0; - exhausted = 0; - while (exhausted == 0 && (n = vm_radix_lookupn(&object->rtree, start, - 0, VM_RADIX_ANY, (void **)pa, VM_RADIX_STACK, &start, - &exhausted)) != 0) { - for (i = 0; i < n; i++) { - p = pa[i]; - /* - * Another thread may allocate this cached page from - * the queue before we acquire the page queue free - * mtx. - */ - if (p->flags & PG_CACHED) { - mtx_lock(&vm_page_queue_free_mtx); - if (p->object == object) { - p->object = NULL; - p->valid = 0; - /* Clear PG_CACHED and set PG_FREE. */ - p->flags ^= PG_CACHED | PG_FREE; - cnt.v_cache_count--; - cnt.v_free_count++; - } - mtx_unlock(&vm_page_queue_free_mtx); - continue; - } else if (p->object != object) - continue; - KASSERT(!p->busy && (p->oflags & VPO_BUSY) == 0, - ("vm_object_terminate: freeing busy page %p", p)); - vm_page_lock(p); - /* - * Optimize the page's removal from the object by - * resetting its "object" field. Specifically, if - * the page is not wired, then the effect of this - * assignment is that vm_page_free()'s call to - * vm_page_remove() will return immediately without - * modifying the page or the object. - * Anyway, the radix tree cannot be accessed anymore - * from within the object, thus all the nodes need - * to be reclaimed later on. - */ - p->object = NULL; - if (p->wire_count == 0) { - vm_page_free(p); - PCPU_INC(cnt.v_pfree); - } - vm_page_unlock(p); + TAILQ_FOREACH_SAFE(p, &object->memq, listq, p_next) { + KASSERT(!p->busy && (p->oflags & VPO_BUSY) == 0, + ("vm_object_terminate: freeing busy page %p", p)); + vm_page_lock(p); + /* + * Optimize the page's removal from the object by resetting + * its "object" field. Specifically, if the page is not + * wired, then the effect of this assignment is that + * vm_page_free()'s call to vm_page_remove() will return + * immediately without modifying the page or the object. + */ + p->object = NULL; + if (p->wire_count == 0) { + vm_page_free(p); + PCPU_INC(cnt.v_pfree); } - if (n < VM_RADIX_STACK) - break; + vm_page_unlock(p); } - vm_radix_reclaim_allnodes(&object->rtree); /* * If the object contained any pages, then reset it to an empty state. * None of the object's fields, including "resident_page_count", were * modified by the preceding loop. */ if (object->resident_page_count != 0) { + vm_radix_reclaim_allnodes(&object->rtree); TAILQ_INIT(&object->memq); object->resident_page_count = 0; if (object->type == OBJT_VNODE) vdrop(object->handle); } - if (object->cached_page_count != 0) { - object->cached_page_count = 0; - if (object->type == OBJT_VNODE) - vdrop(object->handle); - } #if VM_NRESERVLEVEL > 0 if (__predict_false(!LIST_EMPTY(&object->rvq))) @@ -1306,13 +1268,10 @@ vm_object_shadow( void vm_object_split(vm_map_entry_t entry) { - vm_page_t ma[VM_RADIX_STACK]; - vm_page_t m; + vm_page_t m, m_next; vm_object_t orig_object, new_object, source; - vm_pindex_t idx, offidxstart, start; + vm_pindex_t idx, offidxstart; vm_size_t size; - u_int exhausted; - int i, n; orig_object = entry->object.vm_object; if (orig_object->type != OBJT_DEFAULT && orig_object->type != OBJT_SWAP) @@ -1365,65 +1324,46 @@ vm_object_split(vm_map_entry_t entry) ("orig_object->charge < 0")); orig_object->charge -= ptoa(size); } - start = offidxstart; retry: - exhausted = 0; - while (exhausted == 0 && (n = vm_radix_lookupn(&orig_object->rtree, - start, offidxstart + size, VM_RADIX_ANY, (void **)ma, - VM_RADIX_STACK, &start, &exhausted)) != 0) { - for (i = 0; i < n; i++) { - m = ma[i]; - idx = m->pindex - offidxstart; - if (m->flags & PG_CACHED) { - mtx_lock(&vm_page_queue_free_mtx); - if (m->object == orig_object) - vm_page_cache_rename(m, new_object, - idx); - mtx_unlock(&vm_page_queue_free_mtx); - continue; - } else if (m->object != orig_object) - continue; - /* - * We must wait for pending I/O to complete before - * we can rename the page. - * - * We do not have to VM_PROT_NONE the page as mappings - * should not be changed by this operation. - */ - if ((m->oflags & VPO_BUSY) || m->busy) { - start = m->pindex; - VM_OBJECT_UNLOCK(new_object); - m->oflags |= VPO_WANTED; - VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt", 0); - VM_OBJECT_LOCK(new_object); - goto retry; - } + m = vm_page_find_least(orig_object, offidxstart); + for (; m != NULL && (idx = m->pindex - offidxstart) < size; + m = m_next) { + m_next = TAILQ_NEXT(m, listq); + + /* + * We must wait for pending I/O to complete before we can + * rename the page. + * + * We do not have to VM_PROT_NONE the page as mappings should + * not be changed by this operation. + */ + if ((m->oflags & VPO_BUSY) || m->busy) { + VM_OBJECT_WUNLOCK(new_object); + m->oflags |= VPO_WANTED; + VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt", 0); + VM_OBJECT_WLOCK(new_object); + goto retry; + } #if VM_NRESERVLEVEL > 0 - /* - * If some of the reservation's allocated pages remain - * with the original object, then transferring the - * reservation to the new object is neither - * particularly beneficial nor particularly harmful as - * compared to leaving the reservation with the - * original object. If, however, all of the - * reservation's allocated pages are transferred to - * the new object, then transferring the reservation - * is typically beneficial. Determining which of - * these two cases applies would be more costly than - * unconditionally renaming the reservation. - */ - vm_reserv_rename(m, new_object, orig_object, - offidxstart); + /* + * If some of the reservation's allocated pages remain with + * the original object, then transferring the reservation to + * the new object is neither particularly beneficial nor + * particularly harmful as compared to leaving the reservation + * with the original object. If, however, all of the + * reservation's allocated pages are transferred to the new + * object, then transferring the reservation is typically + * beneficial. Determining which of these two cases applies + * would be more costly than unconditionally renaming the + * reservation. + */ + vm_reserv_rename(m, new_object, orig_object, offidxstart); #endif - vm_page_rename(m, new_object, idx); - /* - * page automatically made dirty by rename and - * cache handled - */ - vm_page_busy(m); - } - if (n < VM_RADIX_STACK) - break; + vm_page_lock(m); + vm_page_rename(m, new_object, idx); + vm_page_unlock(m); + /* page automatically made dirty by rename and cache handled */ + vm_page_busy(m); } if (orig_object->type == OBJT_SWAP) { /* @@ -1431,6 +1371,19 @@ retry: * and new_object's locks are released and reacquired. */ swap_pager_copy(orig_object, new_object, offidxstart, 0); + + /* + * Transfer any cached pages from orig_object to new_object. + * If swap_pager_copy() found swapped out pages within the + * specified range of orig_object, then it changed + * new_object's type to OBJT_SWAP when it transferred those + * pages to new_object. Otherwise, new_object's type + * should still be OBJT_DEFAULT and orig_object should not + * contain any cached pages within the specified range. + */ + if (__predict_false(!vm_object_cache_is_empty(orig_object))) + vm_page_cache_transfer(orig_object, offidxstart, + new_object); } VM_OBJECT_WUNLOCK(orig_object); TAILQ_FOREACH(m, &new_object->memq, listq) @@ -1449,14 +1402,10 @@ retry: static int vm_object_backing_scan(vm_object_t object, int op) { - vm_page_t pa[VM_RADIX_STACK]; + int r = 1; vm_page_t p; vm_object_t backing_object; - vm_pindex_t backing_offset_index, new_pindex; - vm_pindex_t start; - u_int exhausted; - int color, i, n; - int r = 1; + vm_pindex_t backing_offset_index; VM_OBJECT_ASSERT_WLOCKED(object); VM_OBJECT_ASSERT_WLOCKED(object->backing_object); @@ -1484,41 +1433,15 @@ vm_object_backing_scan(vm_object_t objec if (op & OBSC_COLLAPSE_WAIT) { vm_object_set_flag(backing_object, OBJ_DEAD); } - color = VM_RADIX_BLACK; - if (op & OBSC_COLLAPSE_WAIT) - color |= VM_RADIX_RED; + /* * Our scan */ -restart: - start = 0; - i = n = VM_RADIX_STACK; - exhausted = 0; - for (;;) { - if (i == n) { - if (n < VM_RADIX_STACK) - break; - if (exhausted != 0 || - (n = vm_radix_lookupn(&backing_object->rtree, - start, 0, color, (void **)pa, VM_RADIX_STACK, - &start, &exhausted)) == 0) - break; - i = 0; - } - p = pa[i++]; - /* - * Free cached pages. XXX Why? Emulating old behavior here. - */ - if (p->flags & PG_CACHED) { - mtx_lock(&vm_page_queue_free_mtx); - if (p->object == backing_object) - vm_page_cache_free(p); - mtx_unlock(&vm_page_queue_free_mtx); - continue; - } else if (p->object != backing_object) - continue; + p = TAILQ_FIRST(&backing_object->memq); + while (p) { + vm_page_t next = TAILQ_NEXT(p, listq); + vm_pindex_t new_pindex = p->pindex - backing_offset_index; - new_pindex = p->pindex - backing_offset_index; if (op & OBSC_TEST_ALL_SHADOWED) { vm_page_t pp; @@ -1530,9 +1453,13 @@ restart: * note that we do not busy the backing object's * page. */ - if (p->pindex < backing_offset_index || - new_pindex >= object->size) + if ( + p->pindex < backing_offset_index || + new_pindex >= object->size + ) { + p = next; continue; + } /* * See if the parent has the page or if the parent's @@ -1561,9 +1488,12 @@ restart: vm_page_t pp; if (op & OBSC_COLLAPSE_NOWAIT) { - if ((p->oflags & VPO_BUSY) || !p->valid || - p->busy) + if ((p->oflags & VPO_BUSY) || + !p->valid || + p->busy) { + p = next; continue; + } } else if (op & OBSC_COLLAPSE_WAIT) { if ((p->oflags & VPO_BUSY) || p->busy) { VM_OBJECT_WUNLOCK(object); @@ -1579,7 +1509,8 @@ restart: * should not have changed so we * just restart our scan. */ - goto restart; + p = TAILQ_FIRST(&backing_object->memq); + continue; } } @@ -1615,6 +1546,7 @@ restart: else vm_page_remove(p); vm_page_unlock(p); + p = next; continue; } @@ -1634,6 +1566,7 @@ restart: * page before we can (re)lock the parent. * Hence we can get here. */ + p = next; continue; } if ( @@ -1655,6 +1588,7 @@ restart: else vm_page_remove(p); vm_page_unlock(p); + p = next; continue; } @@ -1673,9 +1607,12 @@ restart: * If the page was mapped to a process, it can remain * mapped through the rename. */ + vm_page_lock(p); vm_page_rename(p, object, new_pindex); + vm_page_unlock(p); /* page automatically made dirty by rename */ } + p = next; } return (r); } @@ -1789,6 +1726,13 @@ vm_object_collapse(vm_object_t object) backing_object, object, OFF_TO_IDX(object->backing_object_offset), TRUE); + + /* + * Free any cached pages from backing_object. + */ + if (__predict_false( + !vm_object_cache_is_empty(backing_object))) + vm_page_cache_free(backing_object, 0, 0); } /* * Object now shadows whatever backing_object did. @@ -1909,112 +1853,80 @@ void vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int options) { - struct vnode *vp; - vm_page_t pa[VM_RADIX_STACK]; - vm_page_t p; - u_int exhausted; - int i, n; + vm_page_t p, next; int wirings; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); - if (object->resident_page_count == 0 && object->cached_page_count == 0) - return; - vp = NULL; + if (object->resident_page_count == 0) + goto skipmemq; vm_object_pip_add(object, 1); -restart: - exhausted = 0; - while (exhausted == 0 && (n = vm_radix_lookupn(&object->rtree, start, - end, VM_RADIX_ANY, (void **)pa, VM_RADIX_STACK, &start, - &exhausted)) != 0) { - for (i = 0; i < n; i++) { - p = pa[i]; - /* - * Another thread may allocate this cached page from - * the queue before we acquire the page queue free - * mtx. - */ - if (p->flags & PG_CACHED) { - mtx_lock(&vm_page_queue_free_mtx); - if (p->object == object) { - vm_page_cache_free(p); - if (object->type == OBJT_VNODE && - object->cached_page_count == 0) - vp = object->handle; - } - mtx_unlock(&vm_page_queue_free_mtx); - continue; - } else if (p->object != object) - continue; - /* - * If the page is wired for any reason besides - * the existence of managed, wired mappings, then - * it cannot be freed. For example, fictitious - * pages, which represent device memory, are - * inherently wired and cannot be freed. They can, - * however, be invalidated if the option - * OBJPR_CLEANONLY is not specified. - */ - vm_page_lock(p); - if ((wirings = p->wire_count) != 0 && - (wirings = pmap_page_wired_mappings(p)) != - p->wire_count) { - if ((options & OBJPR_NOTMAPPED) == 0) { - pmap_remove_all(p); - /* - * Account for removal of wired - * mappings. - */ - if (wirings != 0) - p->wire_count -= wirings; - } - if ((options & OBJPR_CLEANONLY) == 0) { - p->valid = 0; - vm_page_undirty(p); - } - vm_page_unlock(p); - continue; - } - if (vm_page_sleep_if_busy(p, TRUE, "vmopar")) { - start = p->pindex; - goto restart; - } - KASSERT((p->flags & PG_FICTITIOUS) == 0, - ("vm_object_page_remove: page %p is fictitious", - p)); - if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) { - if ((options & OBJPR_NOTMAPPED) == 0) - pmap_remove_write(p); - if (p->dirty) { - vm_page_unlock(p); - continue; - } - } +again: + p = vm_page_find_least(object, start); + + /* + * Here, the variable "p" is either (1) the page with the least pindex + * greater than or equal to the parameter "start" or (2) NULL. + */ + for (; p != NULL && (p->pindex < end || end == 0); p = next) { + next = TAILQ_NEXT(p, listq); + + /* + * If the page is wired for any reason besides the existence + * of managed, wired mappings, then it cannot be freed. For + * example, fictitious pages, which represent device memory, + * are inherently wired and cannot be freed. They can, + * however, be invalidated if the option OBJPR_CLEANONLY is + * not specified. + */ + vm_page_lock(p); + if ((wirings = p->wire_count) != 0 && + (wirings = pmap_page_wired_mappings(p)) != p->wire_count) { if ((options & OBJPR_NOTMAPPED) == 0) { pmap_remove_all(p); /* Account for removal of wired mappings. */ - if (wirings != 0) { - KASSERT(p->wire_count == wirings, - ("inconsistent wire count %d %d %p", - p->wire_count, wirings, p)); - p->wire_count = 0; - atomic_subtract_int(&cnt.v_wire_count, - 1); - } if (wirings != 0) p->wire_count -= wirings; } - vm_page_free(p); + if ((options & OBJPR_CLEANONLY) == 0) { + p->valid = 0; + vm_page_undirty(p); + } vm_page_unlock(p); + continue; } - if (n < VM_RADIX_STACK) - break; + if (vm_page_sleep_if_busy(p, TRUE, "vmopar")) + goto again; + KASSERT((p->flags & PG_FICTITIOUS) == 0, + ("vm_object_page_remove: page %p is fictitious", p)); + if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) { + if ((options & OBJPR_NOTMAPPED) == 0) + pmap_remove_write(p); + if (p->dirty) { + vm_page_unlock(p); + continue; + } + } + if ((options & OBJPR_NOTMAPPED) == 0) { + pmap_remove_all(p); + /* Account for removal of wired mappings. */ + if (wirings != 0) { + KASSERT(p->wire_count == wirings, + ("inconsistent wire count %d %d %p", + p->wire_count, wirings, p)); + p->wire_count = 0; + atomic_subtract_int(&cnt.v_wire_count, 1); + } + } + vm_page_free(p); + vm_page_unlock(p); } vm_object_pip_wakeup(object); - if (vp) - vdrop(vp); +skipmemq: + if (__predict_false(!vm_object_cache_is_empty(object))) + vm_page_cache_free(object, start, end); } /* @@ -2392,9 +2304,8 @@ DB_SHOW_COMMAND(object, vm_object_print_ db_printf(","); count++; - db_printf("(off=0x%jx,page=0x%jx,obj=%p,flags=0x%X)", - (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p), - p->object, p->flags); + db_printf("(off=0x%jx,page=0x%jx)", + (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p)); } if (count != 0) db_printf("\n"); Modified: user/attilio/vmcontention/sys/vm/vm_object.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_object.h Sat Mar 9 16:58:19 2013 (r248109) +++ user/attilio/vmcontention/sys/vm/vm_object.h Sat Mar 9 17:25:31 2013 (r248110) @@ -72,7 +72,7 @@ #include #include -#include +#include /* * Types defined: @@ -81,10 +81,10 @@ * * The root of cached pages pool is protected by both the per-object lock * and the free pages queue mutex. - * On insert in the cache splay tree, the per-object lock is expected + * On insert in the cache radix trie, the per-object lock is expected * to be already held and the free pages queue mutex will be * acquired during the operation too. - * On remove and lookup from the cache splay tree, only the free + * On remove and lookup from the cache radix trie, only the free * pages queue mutex is expected to be locked. * These rules allow for reliably checking for the presence of cached * pages with only the per-object lock held, thereby reducing contention @@ -103,7 +103,7 @@ struct vm_object { LIST_HEAD(, vm_object) shadow_head; /* objects that this is a shadow for */ LIST_ENTRY(vm_object) shadow_list; /* chain of shadow objects */ TAILQ_HEAD(, vm_page) memq; /* list of resident pages */ - struct vm_radix rtree; /* root of the resident page radix index tree */ + struct vm_radix rtree; /* root of the resident page radix trie*/ vm_pindex_t size; /* Object size */ int generation; /* generation ID */ int ref_count; /* How many refs?? */ @@ -114,11 +114,11 @@ struct vm_object { u_short pg_color; /* (c) color of first page in obj */ u_int paging_in_progress; /* Paging (in or out) so don't collapse or destroy */ int resident_page_count; /* number of resident pages */ - int cached_page_count; /* number of cached pages */ struct vm_object *backing_object; /* object that I'm a shadow of */ vm_ooffset_t backing_object_offset;/* Offset in backing object */ TAILQ_ENTRY(vm_object) pager_object_list; /* list of all objects of this pager type */ LIST_HEAD(, vm_reserv) rvq; /* list of reservations */ + struct vm_radix cache; /* (o + f) root of the cache page radix trie */ void *handle; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Mar 9 18:40:38 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA957476; Sat, 9 Mar 2013 18:40:38 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95DE25E7; Sat, 9 Mar 2013 18:40:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r29IechS063905; Sat, 9 Mar 2013 18:40:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r29IecFb063904; Sat, 9 Mar 2013 18:40:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303091840.r29IecFb063904@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Mar 2013 18:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r248111 - user/attilio/vmcontention/sys/netsmb X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Mar 2013 18:40:38 -0000 Author: attilio Date: Sat Mar 9 18:40:37 2013 New Revision: 248111 URL: http://svnweb.freebsd.org/changeset/base/248111 Log: MFC Modified: user/attilio/vmcontention/sys/netsmb/smb_dev.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/sys/ (props changed) Modified: user/attilio/vmcontention/sys/netsmb/smb_dev.c ============================================================================== --- user/attilio/vmcontention/sys/netsmb/smb_dev.c Sat Mar 9 17:25:31 2013 (r248110) +++ user/attilio/vmcontention/sys/netsmb/smb_dev.c Sat Mar 9 18:40:37 2013 (r248111) @@ -107,14 +107,9 @@ nsmb_dev_clone(void *arg, struct ucred * else if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1) return; i = clone_create(&nsmb_clones, &nsmb_cdevsw, &u, dev, 0); - if (i) { - *dev = make_dev(&nsmb_cdevsw, u, UID_ROOT, GID_WHEEL, 0600, - "%s%d", NSMB_NAME, u); - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } - } + if (i) + *dev = make_dev_credf(MAKEDEV_REF, &nsmb_cdevsw, u, cred, + UID_ROOT, GID_WHEEL, 0600, "%s%d", NSMB_NAME, u); } static int