From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 00:11:01 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 181CB106566C; Sun, 15 May 2011 00:11:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02F6D8FC08; Sun, 15 May 2011 00:11:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F0B0d8020220; Sun, 15 May 2011 00:11:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F0B0Ju020206; Sun, 15 May 2011 00:11:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105150011.p4F0B0Ju020206@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 May 2011 00:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221933 - in stable/8/sys: amd64/amd64 conf fs/nfs fs/nfsclient i386/i386 modules/nfscl modules/nfsclient nfs nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 00:11:01 -0000 Author: rmacklem Date: Sun May 15 00:11:00 2011 New Revision: 221933 URL: http://svn.freebsd.org/changeset/base/221933 Log: MFC: r221032,r221040,r221066 Move the files used for a diskless NFS root from sys/nfsclient to sys/nfs in preparation for them to be used by both NFS clients. Also, move the declaration of the three global data structures from sys/nfsclient/nfs_vfsops.c to sys/nfs/nfs_diskless.c so that they are defined when either client uses them. Also, make the changes to the experimental NFS client so that it uses the moved diskless NFS root files and fixes it so that it links for cases where "options NFS_ROOT" is not specified for the kernel config. Added: stable/8/sys/nfs/bootp_subr.c - copied unchanged from r221032, head/sys/nfs/bootp_subr.c stable/8/sys/nfs/krpc.h - copied unchanged from r221032, head/sys/nfs/krpc.h stable/8/sys/nfs/krpc_subr.c - copied unchanged from r221032, head/sys/nfs/krpc_subr.c stable/8/sys/nfs/nfs_diskless.c - copied unchanged from r221032, head/sys/nfs/nfs_diskless.c stable/8/sys/nfs/nfsdiskless.h - copied unchanged from r221032, head/sys/nfs/nfsdiskless.h Deleted: stable/8/sys/fs/nfsclient/nfsdiskless.h stable/8/sys/nfsclient/bootp_subr.c stable/8/sys/nfsclient/krpc.h stable/8/sys/nfsclient/krpc_subr.c stable/8/sys/nfsclient/nfs_diskless.c stable/8/sys/nfsclient/nfsdiskless.h Modified: stable/8/sys/amd64/amd64/genassym.c stable/8/sys/conf/files stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/i386/i386/genassym.c stable/8/sys/modules/nfscl/Makefile stable/8/sys/modules/nfsclient/Makefile stable/8/sys/nfsclient/nfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/genassym.c ============================================================================== --- stable/8/sys/amd64/amd64/genassym.c Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/amd64/amd64/genassym.c Sun May 15 00:11:00 2011 (r221933) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/conf/files Sun May 15 00:11:00 2011 (r221933) @@ -2673,12 +2673,12 @@ netsmb/smb_smb.c optional netsmb netsmb/smb_subr.c optional netsmb netsmb/smb_trantcp.c optional netsmb netsmb/smb_usr.c optional netsmb +nfs/bootp_subr.c optional bootp nfsclient | bootp nfscl +nfs/krpc_subr.c optional bootp nfsclient | bootp nfscl nfs/nfs_common.c optional nfsclient | nfsserver +nfs/nfs_diskless.c optional nfsclient nfs_root | nfscl nfs_root nfs/nfs_lock.c optional nfsclient | nfscl | nfslockd | nfsd -nfsclient/bootp_subr.c optional bootp nfsclient -nfsclient/krpc_subr.c optional bootp nfsclient nfsclient/nfs_bio.c optional nfsclient -nfsclient/nfs_diskless.c optional nfsclient nfs_root nfsclient/nfs_node.c optional nfsclient nfsclient/nfs_krpc.c optional nfsclient nfsclient/nfs_subs.c optional nfsclient Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/fs/nfs/nfs_var.h Sun May 15 00:11:00 2011 (r221933) @@ -41,7 +41,6 @@ struct ucred; struct nfscred; NFSPROC_T; struct buf; -struct nfs_diskless; struct sockaddr_in; struct nfs_dlmount; struct file; Modified: stable/8/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfs.h Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/fs/nfsclient/nfs.h Sun May 15 00:11:00 2011 (r221933) @@ -101,7 +101,6 @@ int ncl_fsinfo(struct nfsmount *, struct struct thread *); int ncl_init(struct vfsconf *); int ncl_uninit(struct vfsconf *); -int ncl_mountroot(struct mount *); void ncl_nfsiodnew(void); void ncl_nfsiodnew_tq(__unused void *, int); Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 00:11:00 2011 (r221933) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include extern int nfscl_ticks; extern struct timeval nfsboottime; @@ -95,6 +95,7 @@ static int nfs_tprintf_delay = NFS_TPRIN SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY, downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, ""); +static int nfs_mountroot(struct mount *); static void nfs_sec_name(char *, int *); static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, const char *, struct ucred *, @@ -134,23 +135,26 @@ VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK MODULE_VERSION(newnfs, 1); /* - * This structure must be filled in by a primary bootstrap or bootstrap - * server for a diskless/dataless machine. It is initialized below just - * to ensure that it is allocated to initialized data (.data not .bss). + * This structure is now defined in sys/nfs/nfs_diskless.c so that it + * can be shared by both NFS clients. It is declared here so that it + * will be defined for kernels built without NFS_ROOT, although it + * isn't used in that case. */ -struct nfs_diskless newnfs_diskless = { { { 0 } } }; -struct nfsv3_diskless newnfsv3_diskless = { { { 0 } } }; -int newnfs_diskless_valid = 0; +#if !defined(NFS_ROOT) && !defined(NFSCLIENT) +struct nfs_diskless nfs_diskless = { { { 0 } } }; +struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; +int nfs_diskless_valid = 0; +#endif SYSCTL_INT(_vfs_newnfs, OID_AUTO, diskless_valid, CTLFLAG_RD, - &newnfs_diskless_valid, 0, + &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); SYSCTL_STRING(_vfs_newnfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, - newnfsv3_diskless.root_hostnam, 0, "Path to nfs root"); + nfsv3_diskless.root_hostnam, 0, "Path to nfs root"); SYSCTL_OPAQUE(_vfs_newnfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, - &newnfsv3_diskless.root_saddr, sizeof newnfsv3_diskless.root_saddr, + &nfsv3_diskless.root_saddr, sizeof(nfsv3_diskless.root_saddr), "%Ssockaddr_in", "Diskless root nfs address"); @@ -228,29 +232,25 @@ static void nfs_convert_diskless(void) { - bcopy(&newnfs_diskless.myif, &newnfsv3_diskless.myif, - sizeof (struct ifaliasreq)); - bcopy(&newnfs_diskless.mygateway, &newnfsv3_diskless.mygateway, - sizeof (struct sockaddr_in)); - nfs_convert_oargs(&newnfsv3_diskless.root_args, - &newnfs_diskless.root_args); - if (newnfsv3_diskless.root_args.flags & NFSMNT_NFSV3) { - newnfsv3_diskless.root_fhsize = NFSX_MYFH; - bcopy(newnfs_diskless.root_fh, newnfsv3_diskless.root_fh, - NFSX_MYFH); + bcopy(&nfs_diskless.myif, &nfsv3_diskless.myif, + sizeof(struct ifaliasreq)); + bcopy(&nfs_diskless.mygateway, &nfsv3_diskless.mygateway, + sizeof(struct sockaddr_in)); + nfs_convert_oargs(&nfsv3_diskless.root_args,&nfs_diskless.root_args); + if (nfsv3_diskless.root_args.flags & NFSMNT_NFSV3) { + nfsv3_diskless.root_fhsize = NFSX_MYFH; + bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_MYFH); } else { - newnfsv3_diskless.root_fhsize = NFSX_V2FH; - bcopy(newnfs_diskless.root_fh, newnfsv3_diskless.root_fh, - NFSX_V2FH); - } - bcopy(&newnfs_diskless.root_saddr,&newnfsv3_diskless.root_saddr, - sizeof(struct sockaddr_in)); - bcopy(newnfs_diskless.root_hostnam, newnfsv3_diskless.root_hostnam, - MNAMELEN); - newnfsv3_diskless.root_time = newnfs_diskless.root_time; - bcopy(newnfs_diskless.my_hostnam, newnfsv3_diskless.my_hostnam, - MAXHOSTNAMELEN); - newnfs_diskless_valid = 3; + nfsv3_diskless.root_fhsize = NFSX_V2FH; + bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_V2FH); + } + bcopy(&nfs_diskless.root_saddr,&nfsv3_diskless.root_saddr, + sizeof(struct sockaddr_in)); + bcopy(nfs_diskless.root_hostnam, nfsv3_diskless.root_hostnam, MNAMELEN); + nfsv3_diskless.root_time = nfs_diskless.root_time; + bcopy(nfs_diskless.my_hostnam, nfsv3_diskless.my_hostnam, + MAXHOSTNAMELEN); + nfs_diskless_valid = 3; } /* @@ -356,12 +356,12 @@ ncl_fsinfo(struct nfsmount *nmp, struct /* * Mount a remote root fs via. nfs. This depends on the info in the - * newnfs_diskless structure that has been filled in properly by some primary + * nfs_diskless structure that has been filled in properly by some primary * bootstrap. * It goes something like this: * - do enough of "ifconfig" by calling ifioctl() so that the system * can talk to the server - * - If newnfs_diskless.mygateway is filled in, use that address as + * - If nfs_diskless.mygateway is filled in, use that address as * a default gateway. * - build the rootfs mount point and call mountnfs() to do the rest. * @@ -370,11 +370,11 @@ ncl_fsinfo(struct nfsmount *nmp, struct * nfs_mountroot() will be called once in the boot before any other NFS * client activity occurs. */ -int -ncl_mountroot(struct mount *mp) +static int +nfs_mountroot(struct mount *mp) { struct thread *td = curthread; - struct nfsv3_diskless *nd = &newnfsv3_diskless; + struct nfsv3_diskless *nd = &nfsv3_diskless; struct socket *so; struct vnode *vp; struct ifreq ir; @@ -389,9 +389,9 @@ ncl_mountroot(struct mount *mp) nfs_setup_diskless(); #endif - if (newnfs_diskless_valid == 0) + if (nfs_diskless_valid == 0) return (-1); - if (newnfs_diskless_valid == 1) + if (nfs_diskless_valid == 1) nfs_convert_diskless(); /* @@ -765,7 +765,7 @@ nfs_mount(struct mount *mp) td = curthread; if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) { - error = ncl_mountroot(mp); + error = nfs_mountroot(mp); goto out; } Modified: stable/8/sys/i386/i386/genassym.c ============================================================================== --- stable/8/sys/i386/i386/genassym.c Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/i386/i386/genassym.c Sun May 15 00:11:00 2011 (r221933) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef DEV_APIC #include #endif Modified: stable/8/sys/modules/nfscl/Makefile ============================================================================== --- stable/8/sys/modules/nfscl/Makefile Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/modules/nfscl/Makefile Sun May 15 00:11:00 2011 (r221933) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../fs/nfsclient +.PATH: ${.CURDIR}/../../fs/nfsclient ${.CURDIR}/../../nfs KMOD= nfscl SRCS= vnode_if.h \ nfs_clrpcops.c \ @@ -22,4 +22,36 @@ SRCS= vnode_if.h \ opt_ufs.h \ opt_kgssapi.h +.if !defined(KERNBUILDDIR) +NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel +NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel +NFS_ROOT?= 1 # 0/1 - requires NFS_ROOT to be configured in kernel + +.if ${NFS_INET} > 0 +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif + +.if ${NFS_INET6} > 0 +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif + +.if ${NFS_ROOT} > 0 +opt_nfsroot.h: + echo "#define NFS_ROOT 1" > ${.TARGET} +.endif +.else +OPT_NFS_ROOT!= cat ${KERNBUILDDIR}/opt_nfsroot.h +.if empty(OPT_NFS_ROOT) +NFS_ROOT= 0 +.else +NFS_ROOT= 1 +.endif +.endif + +.if ${NFS_ROOT} > 0 +SRCS+= nfs_diskless.c +.endif + .include Modified: stable/8/sys/modules/nfsclient/Makefile ============================================================================== --- stable/8/sys/modules/nfsclient/Makefile Sat May 14 23:20:14 2011 (r221932) +++ stable/8/sys/modules/nfsclient/Makefile Sun May 15 00:11:00 2011 (r221933) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../rpc +.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../nfs ${.CURDIR}/../../rpc KMOD= nfsclient SRCS= vnode_if.h \ Copied: stable/8/sys/nfs/bootp_subr.c (from r221032, head/sys/nfs/bootp_subr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/nfs/bootp_subr.c Sun May 15 00:11:00 2011 (r221933, copy of r221032, head/sys/nfs/bootp_subr.c) @@ -0,0 +1,1867 @@ +/*- + * Copyright (c) 1995 Gordon Ross, Adam Glass + * Copyright (c) 1992 Regents of the University of California. + * All rights reserved. + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Lawrence Berkeley Laboratory and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * based on: + * nfs/krpc_subr.c + * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bootp.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */ + +#ifndef BOOTP_SETTLE_DELAY +#define BOOTP_SETTLE_DELAY 3 +#endif + +/* + * What is the longest we will wait before re-sending a request? + * Note this is also the frequency of "RPC timeout" messages. + * The re-send loop count sup linearly to this maximum, so the + * first complaint will happen after (1+2+3+4+5)=15 seconds. + */ +#define MAX_RESEND_DELAY 5 /* seconds */ + +/* Definitions from RFC951 */ +struct bootp_packet { + u_int8_t op; + u_int8_t htype; + u_int8_t hlen; + u_int8_t hops; + u_int32_t xid; + u_int16_t secs; + u_int16_t flags; + struct in_addr ciaddr; + struct in_addr yiaddr; + struct in_addr siaddr; + struct in_addr giaddr; + unsigned char chaddr[16]; + char sname[64]; + char file[128]; + unsigned char vend[1222]; +}; + +struct bootpc_ifcontext { + struct bootpc_ifcontext *next; + struct bootp_packet call; + struct bootp_packet reply; + int replylen; + int overload; + struct socket *so; + struct ifreq ireq; + struct ifnet *ifp; + struct sockaddr_dl *sdl; + struct sockaddr_in myaddr; + struct sockaddr_in netmask; + struct sockaddr_in gw; + struct sockaddr_in broadcast; /* Different for each interface */ + int gotgw; + int gotnetmask; + int gotrootpath; + int outstanding; + int sentmsg; + u_int32_t xid; + enum { + IF_BOOTP_UNRESOLVED, + IF_BOOTP_RESOLVED, + IF_BOOTP_FAILED, + IF_DHCP_UNRESOLVED, + IF_DHCP_OFFERED, + IF_DHCP_RESOLVED, + IF_DHCP_FAILED, + } state; + int dhcpquerytype; /* dhcp type sent */ + struct in_addr dhcpserver; + int gotdhcpserver; +}; + +#define TAG_MAXLEN 1024 +struct bootpc_tagcontext { + char buf[TAG_MAXLEN + 1]; + int overload; + int badopt; + int badtag; + int foundopt; + int taglen; +}; + +struct bootpc_globalcontext { + struct bootpc_ifcontext *interfaces; + struct bootpc_ifcontext *lastinterface; + u_int32_t xid; + int gotrootpath; + int gotgw; + int ifnum; + int secs; + int starttime; + struct bootp_packet reply; + int replylen; + struct bootpc_ifcontext *setrootfs; + struct bootpc_ifcontext *sethostname; + struct bootpc_tagcontext tmptag; + struct bootpc_tagcontext tag; +}; + +#define IPPORT_BOOTPC 68 +#define IPPORT_BOOTPS 67 + +#define BOOTP_REQUEST 1 +#define BOOTP_REPLY 2 + +/* Common tags */ +#define TAG_PAD 0 /* Pad option, implicit length 1 */ +#define TAG_SUBNETMASK 1 /* RFC 950 subnet mask */ +#define TAG_ROUTERS 3 /* Routers (in order of preference) */ +#define TAG_HOSTNAME 12 /* Client host name */ +#define TAG_ROOT 17 /* Root path */ + +/* DHCP specific tags */ +#define TAG_OVERLOAD 52 /* Option Overload */ +#define TAG_MAXMSGSIZE 57 /* Maximum DHCP Message Size */ + +#define TAG_END 255 /* End Option (i.e. no more options) */ + +/* Overload values */ +#define OVERLOAD_FILE 1 +#define OVERLOAD_SNAME 2 + +/* Site specific tags: */ +#define TAG_ROOTOPTS 130 +#define TAG_COOKIE 134 /* ascii info for userland, via sysctl */ + +#define TAG_DHCP_MSGTYPE 53 +#define TAG_DHCP_REQ_ADDR 50 +#define TAG_DHCP_SERVERID 54 +#define TAG_DHCP_LEASETIME 51 + +#define TAG_VENDOR_INDENTIFIER 60 + +#define DHCP_NOMSG 0 +#define DHCP_DISCOVER 1 +#define DHCP_OFFER 2 +#define DHCP_REQUEST 3 +#define DHCP_ACK 5 + +/* NFS read/write block size */ +#ifndef BOOTP_BLOCKSIZE +#define BOOTP_BLOCKSIZE 8192 +#endif + +static char bootp_cookie[128]; +SYSCTL_STRING(_kern, OID_AUTO, bootp_cookie, CTLFLAG_RD, + bootp_cookie, 0, "Cookie (T134) supplied by bootp server"); + +/* mountd RPC */ +static int md_mount(struct sockaddr_in *mdsin, char *path, u_char *fhp, + int *fhsizep, struct nfs_args *args, struct thread *td); +static int setfs(struct sockaddr_in *addr, char *path, char *p, + const struct in_addr *siaddr); +static int getdec(char **ptr); +static int getip(char **ptr, struct in_addr *ip); +static void mountopts(struct nfs_args *args, char *p); +static int xdr_opaque_decode(struct mbuf **ptr, u_char *buf, int len); +static int xdr_int_decode(struct mbuf **ptr, int *iptr); +static void print_in_addr(struct in_addr addr); +static void print_sin_addr(struct sockaddr_in *addr); +static void clear_sinaddr(struct sockaddr_in *sin); +static void allocifctx(struct bootpc_globalcontext *gctx); +static void bootpc_compose_query(struct bootpc_ifcontext *ifctx, + struct bootpc_globalcontext *gctx, struct thread *td); +static unsigned char *bootpc_tag(struct bootpc_tagcontext *tctx, + struct bootp_packet *bp, int len, int tag); +static void bootpc_tag_helper(struct bootpc_tagcontext *tctx, + unsigned char *start, int len, int tag); + +#ifdef BOOTP_DEBUG +void bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma); +void bootpboot_p_rtentry(struct rtentry *rt); +void bootpboot_p_tree(struct radix_node *rn); +void bootpboot_p_rtlist(void); +void bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa); +void bootpboot_p_iflist(void); +#endif + +static int bootpc_call(struct bootpc_globalcontext *gctx, + struct thread *td); + +static int bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, + struct bootpc_globalcontext *gctx, struct thread *td); + +static int bootpc_adjust_interface(struct bootpc_ifcontext *ifctx, + struct bootpc_globalcontext *gctx, struct thread *td); + +static void bootpc_decode_reply(struct nfsv3_diskless *nd, + struct bootpc_ifcontext *ifctx, + struct bootpc_globalcontext *gctx); + +static int bootpc_received(struct bootpc_globalcontext *gctx, + struct bootpc_ifcontext *ifctx); + +static __inline int bootpc_ifctx_isresolved(struct bootpc_ifcontext *ifctx); +static __inline int bootpc_ifctx_isunresolved(struct bootpc_ifcontext *ifctx); +static __inline int bootpc_ifctx_isfailed(struct bootpc_ifcontext *ifctx); + +/* + * In order to have multiple active interfaces with address 0.0.0.0 + * and be able to send data to a selected interface, we perform + * some tricks: + * + * - The 'broadcast' address is different for each interface. + * + * - We temporarily add routing pointing 255.255.255.255 to the + * selected interface broadcast address, thus the packet sent + * goes to that interface. + */ + +#ifdef BOOTP_DEBUG +void +bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma) +{ + + if (sa == NULL) { + printf("(sockaddr *) "); + return; + } + switch (sa->sa_family) { + case AF_INET: + { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *) sa; + printf("inet "); + print_sin_addr(sin); + if (ma != NULL) { + sin = (struct sockaddr_in *) ma; + printf(" mask "); + print_sin_addr(sin); + } + } + break; + case AF_LINK: + { + struct sockaddr_dl *sli; + int i; + + sli = (struct sockaddr_dl *) sa; + printf("link %.*s ", sli->sdl_nlen, sli->sdl_data); + for (i = 0; i < sli->sdl_alen; i++) { + if (i > 0) + printf(":"); + printf("%x", ((unsigned char *) LLADDR(sli))[i]); + } + } + break; + default: + printf("af%d", sa->sa_family); + } +} + +void +bootpboot_p_rtentry(struct rtentry *rt) +{ + + bootpboot_p_sa(rt_key(rt), rt_mask(rt)); + printf(" "); + bootpboot_p_sa(rt->rt_gateway, NULL); + printf(" "); + printf("flags %x", (unsigned short) rt->rt_flags); + printf(" %d", (int) rt->rt_rmx.rmx_expire); + printf(" %s\n", rt->rt_ifp->if_xname); +} + +void +bootpboot_p_tree(struct radix_node *rn) +{ + + while (rn != NULL) { + if (rn->rn_bit < 0) { + if ((rn->rn_flags & RNF_ROOT) != 0) { + } else { + bootpboot_p_rtentry((struct rtentry *) rn); + } + rn = rn->rn_dupedkey; + } else { + bootpboot_p_tree(rn->rn_left); + bootpboot_p_tree(rn->rn_right); + return; + } + } +} + +void +bootpboot_p_rtlist(void) +{ + struct radix_node_head *rnh; + + printf("Routing table:\n"); + rnh = rt_tables_get_rnh(0, AF_INET); + if (rnh == NULL) + return; + RADIX_NODE_HEAD_RLOCK(rnh); /* could sleep XXX */ + bootpboot_p_tree(rnh->rnh_treetop); + RADIX_NODE_HEAD_RUNLOCK(rnh); +} + +void +bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa) +{ + + printf("%s flags %x, addr ", + ifp->if_xname, ifp->if_flags); + print_sin_addr((struct sockaddr_in *) ifa->ifa_addr); + printf(", broadcast "); + print_sin_addr((struct sockaddr_in *) ifa->ifa_dstaddr); + printf(", netmask "); + print_sin_addr((struct sockaddr_in *) ifa->ifa_netmask); + printf("\n"); +} + +void +bootpboot_p_iflist(void) +{ + struct ifnet *ifp; + struct ifaddr *ifa; + + printf("Interface list:\n"); + IFNET_RLOCK(); + for (ifp = TAILQ_FIRST(&V_ifnet); + ifp != NULL; + ifp = TAILQ_NEXT(ifp, if_link)) { + for (ifa = TAILQ_FIRST(&ifp->if_addrhead); + ifa != NULL; + ifa = TAILQ_NEXT(ifa, ifa_link)) + if (ifa->ifa_addr->sa_family == AF_INET) + bootpboot_p_if(ifp, ifa); + } + IFNET_RUNLOCK(); +} +#endif /* defined(BOOTP_DEBUG) */ + +static void +clear_sinaddr(struct sockaddr_in *sin) +{ + + bzero(sin, sizeof(*sin)); + sin->sin_len = sizeof(*sin); + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = INADDR_ANY; /* XXX: htonl(INAADDR_ANY) ? */ + sin->sin_port = 0; +} + +static void +allocifctx(struct bootpc_globalcontext *gctx) +{ + struct bootpc_ifcontext *ifctx; + ifctx = (struct bootpc_ifcontext *) malloc(sizeof(*ifctx), + M_TEMP, M_WAITOK | M_ZERO); + if (ifctx == NULL) + panic("Failed to allocate bootp interface context structure"); + + ifctx->xid = gctx->xid; +#ifdef BOOTP_NO_DHCP + ifctx->state = IF_BOOTP_UNRESOLVED; +#else + ifctx->state = IF_DHCP_UNRESOLVED; +#endif + gctx->xid += 0x100; + if (gctx->interfaces != NULL) + gctx->lastinterface->next = ifctx; + else + gctx->interfaces = ifctx; + gctx->lastinterface = ifctx; +} + +static __inline int +bootpc_ifctx_isresolved(struct bootpc_ifcontext *ifctx) +{ + + if (ifctx->state == IF_BOOTP_RESOLVED || + ifctx->state == IF_DHCP_RESOLVED) + return 1; + return 0; +} + +static __inline int +bootpc_ifctx_isunresolved(struct bootpc_ifcontext *ifctx) +{ + + if (ifctx->state == IF_BOOTP_UNRESOLVED || + ifctx->state == IF_DHCP_UNRESOLVED) + return 1; + return 0; +} + +static __inline int +bootpc_ifctx_isfailed(struct bootpc_ifcontext *ifctx) +{ + + if (ifctx->state == IF_BOOTP_FAILED || + ifctx->state == IF_DHCP_FAILED) + return 1; + return 0; +} + +static int +bootpc_received(struct bootpc_globalcontext *gctx, + struct bootpc_ifcontext *ifctx) +{ + unsigned char dhcpreplytype; + char *p; + + /* + * Need timeout for fallback to less + * desirable alternative. + */ + + /* This call used for the side effect (badopt flag) */ + (void) bootpc_tag(&gctx->tmptag, &gctx->reply, + gctx->replylen, + TAG_END); + + /* If packet is invalid, ignore it */ + if (gctx->tmptag.badopt != 0) + return 0; + + p = bootpc_tag(&gctx->tmptag, &gctx->reply, + gctx->replylen, TAG_DHCP_MSGTYPE); + if (p != NULL) + dhcpreplytype = *p; + else + dhcpreplytype = DHCP_NOMSG; + + switch (ifctx->dhcpquerytype) { + case DHCP_DISCOVER: + if (dhcpreplytype != DHCP_OFFER /* Normal DHCP offer */ +#ifndef BOOTP_FORCE_DHCP + && dhcpreplytype != DHCP_NOMSG /* Fallback to BOOTP */ +#endif + ) + return 0; + break; + case DHCP_REQUEST: + if (dhcpreplytype != DHCP_ACK) + return 0; + case DHCP_NOMSG: + break; + } + + /* Ignore packet unless it gives us a root tag we didn't have */ + + if ((ifctx->state == IF_BOOTP_RESOLVED || + (ifctx->dhcpquerytype == DHCP_DISCOVER && + (ifctx->state == IF_DHCP_OFFERED || + ifctx->state == IF_DHCP_RESOLVED))) && + (bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, + TAG_ROOT) != NULL || + bootpc_tag(&gctx->tmptag, &gctx->reply, + gctx->replylen, + TAG_ROOT) == NULL)) + return 0; + + bcopy(&gctx->reply, &ifctx->reply, gctx->replylen); + ifctx->replylen = gctx->replylen; + + /* XXX: Only reset if 'perfect' response */ + if (ifctx->state == IF_BOOTP_UNRESOLVED) + ifctx->state = IF_BOOTP_RESOLVED; + else if (ifctx->state == IF_DHCP_UNRESOLVED && + ifctx->dhcpquerytype == DHCP_DISCOVER) { + if (dhcpreplytype == DHCP_OFFER) + ifctx->state = IF_DHCP_OFFERED; + else + ifctx->state = IF_BOOTP_RESOLVED; /* Fallback */ + } else if (ifctx->state == IF_DHCP_OFFERED && + ifctx->dhcpquerytype == DHCP_REQUEST) + ifctx->state = IF_DHCP_RESOLVED; + + + if (ifctx->dhcpquerytype == DHCP_DISCOVER && + ifctx->state != IF_BOOTP_RESOLVED) { + p = bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, TAG_DHCP_SERVERID); + if (p != NULL && gctx->tmptag.taglen == 4) { + memcpy(&ifctx->dhcpserver, p, 4); + ifctx->gotdhcpserver = 1; + } else + ifctx->gotdhcpserver = 0; + return 1; + } + + ifctx->gotrootpath = (bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, + TAG_ROOT) != NULL); + ifctx->gotgw = (bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, + TAG_ROUTERS) != NULL); + ifctx->gotnetmask = (bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, + TAG_SUBNETMASK) != NULL); + return 1; +} + +static int +bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) +{ + struct socket *so; + struct sockaddr_in *sin, dst; + struct uio auio; + struct sockopt sopt; + struct iovec aio; + int error, on, rcvflg, timo, len; + time_t atimo; + time_t rtimo; + struct timeval tv; + struct bootpc_ifcontext *ifctx; + int outstanding; + int gotrootpath; + int retry; + const char *s; + + /* + * Create socket and set its recieve timeout. + */ + error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td); + if (error != 0) + goto out0; + + tv.tv_sec = 1; + tv.tv_usec = 0; + bzero(&sopt, sizeof(sopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_RCVTIMEO; + sopt.sopt_val = &tv; + sopt.sopt_valsize = sizeof tv; + + error = sosetopt(so, &sopt); + if (error != 0) + goto out; + + /* + * Enable broadcast. + */ + on = 1; + sopt.sopt_name = SO_BROADCAST; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof on; + + error = sosetopt(so, &sopt); + if (error != 0) + goto out; + + /* + * Disable routing. + */ + + on = 1; + sopt.sopt_name = SO_DONTROUTE; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof on; + + error = sosetopt(so, &sopt); + if (error != 0) + goto out; + + /* + * Bind the local endpoint to a bootp client port. + */ + sin = &dst; + clear_sinaddr(sin); + sin->sin_port = htons(IPPORT_BOOTPC); + error = sobind(so, (struct sockaddr *)sin, td); + if (error != 0) { + printf("bind failed\n"); + goto out; + } + + /* + * Setup socket address for the server. + */ + sin = &dst; + clear_sinaddr(sin); + sin->sin_addr.s_addr = INADDR_BROADCAST; + sin->sin_port = htons(IPPORT_BOOTPS); + + /* + * Send it, repeatedly, until a reply is received, + * but delay each re-send by an increasing amount. + * If the delay hits the maximum, start complaining. + */ + timo = 0; + rtimo = 0; + for (;;) { + + outstanding = 0; + gotrootpath = 0; + + for (ifctx = gctx->interfaces; + ifctx != NULL; + ifctx = ifctx->next) { + if (bootpc_ifctx_isresolved(ifctx) != 0 && + bootpc_tag(&gctx->tmptag, &ifctx->reply, + ifctx->replylen, + TAG_ROOT) != NULL) + gotrootpath = 1; + } + + for (ifctx = gctx->interfaces; + ifctx != NULL; + ifctx = ifctx->next) { + ifctx->outstanding = 0; + if (bootpc_ifctx_isresolved(ifctx) != 0 && + gotrootpath != 0) { + continue; + } + if (bootpc_ifctx_isfailed(ifctx) != 0) + continue; + + outstanding++; + ifctx->outstanding = 1; + + /* Proceed to next step in DHCP negotiation */ + if ((ifctx->state == IF_DHCP_OFFERED && + ifctx->dhcpquerytype != DHCP_REQUEST) || + (ifctx->state == IF_DHCP_UNRESOLVED && + ifctx->dhcpquerytype != DHCP_DISCOVER) || + (ifctx->state == IF_BOOTP_UNRESOLVED && + ifctx->dhcpquerytype != DHCP_NOMSG)) { + ifctx->sentmsg = 0; + bootpc_compose_query(ifctx, gctx, td); + } + + /* Send BOOTP request (or re-send). */ + + if (ifctx->sentmsg == 0) { + switch(ifctx->dhcpquerytype) { + case DHCP_DISCOVER: + s = "DHCP Discover"; + break; + case DHCP_REQUEST: + s = "DHCP Request"; + break; + case DHCP_NOMSG: + default: + s = "BOOTP Query"; + break; + } + printf("Sending %s packet from " + "interface %s (%*D)\n", + s, + ifctx->ireq.ifr_name, + ifctx->sdl->sdl_alen, + (unsigned char *) LLADDR(ifctx->sdl), + ":"); + ifctx->sentmsg = 1; + } + + aio.iov_base = (caddr_t) &ifctx->call; + aio.iov_len = sizeof(ifctx->call); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 00:25:20 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64AB3106566B; Sun, 15 May 2011 00:25:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5362D8FC08; Sun, 15 May 2011 00:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F0PKg6020526; Sun, 15 May 2011 00:25:20 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F0PKCn020521; Sun, 15 May 2011 00:25:20 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105150025.p4F0PKCn020521@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 May 2011 00:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221934 - stable/8/sys/rpc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 00:25:20 -0000 Author: rmacklem Date: Sun May 15 00:25:19 2011 New Revision: 221934 URL: http://svn.freebsd.org/changeset/base/221934 Log: MFC: r221127 This patch is believed to fix a problem in the kernel rpc for non-interruptible NFS mounts, where a kernel thread will seem to be stuck sleeping on "rpccon". The msleep() in clnt_vc_create() that was waiting to a TCP connect to complete would return ERESTART, since PCATCH was specified. Then the tsleep() in clnt_reconnect_call() would sleep for 1 second and then try again and again and... The patch changes the msleep() in clnt_vc_create() so it only sets the PCATCH flag for interruptible cases. Modified: stable/8/sys/rpc/clnt.h stable/8/sys/rpc/clnt_rc.c stable/8/sys/rpc/clnt_vc.c stable/8/sys/rpc/rpcb_clnt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/rpc/clnt.h ============================================================================== --- stable/8/sys/rpc/clnt.h Sun May 15 00:11:00 2011 (r221933) +++ stable/8/sys/rpc/clnt.h Sun May 15 00:25:19 2011 (r221934) @@ -433,10 +433,11 @@ extern CLIENT *clnt_dg_create(struct soc * rpcvers_t vers; -- version number * size_t sendsz; -- buffer recv size * size_t recvsz; -- buffer send size + * int intrflag; -- is it interruptible */ extern CLIENT *clnt_vc_create(struct socket *so, struct sockaddr *svcaddr, rpcprog_t program, rpcvers_t version, - size_t sendsz, size_t recvsz); + size_t sendsz, size_t recvsz, int intrflag); /* * struct netconfig *nconf; -- network type Modified: stable/8/sys/rpc/clnt_rc.c ============================================================================== --- stable/8/sys/rpc/clnt_rc.c Sun May 15 00:11:00 2011 (r221933) +++ stable/8/sys/rpc/clnt_rc.c Sun May 15 00:25:19 2011 (r221934) @@ -195,7 +195,7 @@ clnt_reconnect_connect(CLIENT *cl) else newclient = clnt_vc_create(so, (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers, - rc->rc_sendsz, rc->rc_recvsz); + rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr); td->td_ucred = oldcred; if (!newclient) { Modified: stable/8/sys/rpc/clnt_vc.c ============================================================================== --- stable/8/sys/rpc/clnt_vc.c Sun May 15 00:11:00 2011 (r221933) +++ stable/8/sys/rpc/clnt_vc.c Sun May 15 00:25:19 2011 (r221934) @@ -168,7 +168,8 @@ clnt_vc_create( const rpcprog_t prog, /* program number */ const rpcvers_t vers, /* version number */ size_t sendsz, /* buffer recv size */ - size_t recvsz) /* buffer send size */ + size_t recvsz, /* buffer send size */ + int intrflag) /* interruptible */ { CLIENT *cl; /* client handle */ struct ct_data *ct = NULL; /* client handle */ @@ -177,7 +178,7 @@ clnt_vc_create( static uint32_t disrupt; struct __rpc_sockinfo si; XDR xdrs; - int error, interrupted, one = 1; + int error, interrupted, one = 1, sleep_flag; struct sockopt sopt; if (disrupt == 0) @@ -196,10 +197,13 @@ clnt_vc_create( error = soconnect(so, raddr, curthread); SOCK_LOCK(so); interrupted = 0; + sleep_flag = PSOCK; + if (intrflag != 0) + sleep_flag |= (PCATCH | PBDRY); while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { error = msleep(&so->so_timeo, SOCK_MTX(so), - PSOCK | PCATCH | PBDRY, "connec", 0); + sleep_flag, "connec", 0); if (error) { if (error == EINTR || error == ERESTART) interrupted = 1; Modified: stable/8/sys/rpc/rpcb_clnt.c ============================================================================== --- stable/8/sys/rpc/rpcb_clnt.c Sun May 15 00:11:00 2011 (r221933) +++ stable/8/sys/rpc/rpcb_clnt.c Sun May 15 00:25:19 2011 (r221934) @@ -477,7 +477,7 @@ local_rpcb() tsize = __rpc_get_t_size(AF_LOCAL, 0, 0); client = clnt_vc_create(so, (struct sockaddr *)&sun, (rpcprog_t)RPCBPROG, - (rpcvers_t)RPCBVERS, tsize, tsize); + (rpcvers_t)RPCBVERS, tsize, tsize, 1); if (client != NULL) { /* Mark the socket to be closed in destructor */ From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 00:43:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB29106566B; Sun, 15 May 2011 00:43:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99F568FC28; Sun, 15 May 2011 00:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F0hpSh020896; Sun, 15 May 2011 00:43:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F0hpVv020894; Sun, 15 May 2011 00:43:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105150043.p4F0hpVv020894@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 May 2011 00:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221935 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 00:43:51 -0000 Author: rmacklem Date: Sun May 15 00:43:51 2011 New Revision: 221935 URL: http://svn.freebsd.org/changeset/base/221935 Log: MFC: r221190,r221205 Fix the new NFS client so that it handles the "nfs_args" value in mnt_optnew. This is needed so that the old mount(2) syscall works and that is needed so that amd(8) works. The code was basically just cribbed from sys/nfsclient/nfs_vfsops.c with minor changes. This patch is mainly to fix the new NFS client so that amd(8) works with it. Thanks go to Craig Rodrigues for helping with this. Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 00:25:19 2011 (r221934) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 15 00:43:51 2011 (r221935) @@ -702,7 +702,7 @@ nfs_decode_args(struct mount *mp, struct } } -static const char *nfs_opts[] = { "from", +static const char *nfs_opts[] = { "from", "nfs_args", "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", "noclusterr", "noclusterw", "multilabel", "acls", "force", "update", "async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus", @@ -756,8 +756,10 @@ nfs_mount(struct mount *mp) u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; - int dirlen, krbnamelen, srvkrbnamelen; + int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen; + size_t hstlen; + has_nfs_args_opt = 0; if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -771,6 +773,25 @@ nfs_mount(struct mount *mp) nfscl_init(); + /* + * The old mount_nfs program passed the struct nfs_args + * from userspace to kernel. The new mount_nfs program + * passes string options via nmount() from userspace to kernel + * and we populate the struct nfs_args in the kernel. + */ + if (vfs_getopt(mp->mnt_optnew, "nfs_args", NULL, NULL) == 0) { + error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, + sizeof(args)); + if (error != 0) + goto out; + + if (args.version != NFS_ARGSVERSION) { + error = EPROGMISMATCH; + goto out; + } + has_nfs_args_opt = 1; + } + /* Handle the new style options. */ if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0) args.flags |= NFSMNT_NOCONN; @@ -989,27 +1010,52 @@ nfs_mount(struct mount *mp) if (nfs_ip_paranoia == 0) args.flags |= NFSMNT_NOCONN; - if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh, - &args.fhsize) == 0) { - if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) { + if (has_nfs_args_opt != 0) { + /* + * In the 'nfs_args' case, the pointers in the args + * structure are in userland - we copy them in here. + */ + if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) { vfs_mount_error(mp, "Bad file handle"); error = EINVAL; goto out; } - bcopy(args.fh, nfh, args.fhsize); + error = copyin((caddr_t)args.fh, (caddr_t)nfh, + args.fhsize); + if (error != 0) + goto out; + error = copyinstr(args.hostname, hst, MNAMELEN - 1, &hstlen); + if (error != 0) + goto out; + bzero(&hst[hstlen], MNAMELEN - hstlen); + args.hostname = hst; + /* sockargs() call must be after above copyin() calls */ + error = getsockaddr(&nam, (caddr_t)args.addr, + args.addrlen); + if (error != 0) + goto out; } else { - args.fhsize = 0; - } - - (void) vfs_getopt(mp->mnt_optnew, "hostname", (void **)&args.hostname, - &len); - if (args.hostname == NULL) { - vfs_mount_error(mp, "Invalid hostname"); - error = EINVAL; - goto out; + if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh, + &args.fhsize) == 0) { + if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) { + vfs_mount_error(mp, "Bad file handle"); + error = EINVAL; + goto out; + } + bcopy(args.fh, nfh, args.fhsize); + } else { + args.fhsize = 0; + } + (void) vfs_getopt(mp->mnt_optnew, "hostname", + (void **)&args.hostname, &len); + if (args.hostname == NULL) { + vfs_mount_error(mp, "Invalid hostname"); + error = EINVAL; + goto out; + } + bcopy(args.hostname, hst, MNAMELEN); + hst[MNAMELEN - 1] = '\0'; } - bcopy(args.hostname, hst, MNAMELEN); - hst[MNAMELEN - 1] = '\0'; if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0) strlcpy(srvkrbname, name, sizeof (srvkrbname)); @@ -1029,8 +1075,8 @@ nfs_mount(struct mount *mp) dirpath[0] = '\0'; dirlen = strlen(dirpath); - if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr, - &args.addrlen) == 0) { + if (has_nfs_args_opt == 0 && vfs_getopt(mp->mnt_optnew, "addr", + (void **)&args.addr, &args.addrlen) == 0) { if (args.addrlen > SOCK_MAXADDRLEN) { error = ENAMETOOLONG; goto out; From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 00:47:22 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4278106566C; Sun, 15 May 2011 00:47:22 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26CE8FC08; Sun, 15 May 2011 00:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F0lMAv021069; Sun, 15 May 2011 00:47:22 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F0lMfu021067; Sun, 15 May 2011 00:47:22 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105150047.p4F0lMfu021067@svn.freebsd.org> From: Attilio Rao Date: Sun, 15 May 2011 00:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221937 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 00:47:22 -0000 Author: attilio Date: Sun May 15 00:47:22 2011 New Revision: 221937 URL: http://svn.freebsd.org/changeset/base/221937 Log: MFC r220456: Fix several callout migration races. Tested by: Nicholas Esborn @ DesertNet Modified: stable/8/sys/kern/kern_timeout.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_timeout.c ============================================================================== --- stable/8/sys/kern/kern_timeout.c Sun May 15 00:46:25 2011 (r221936) +++ stable/8/sys/kern/kern_timeout.c Sun May 15 00:47:22 2011 (r221937) @@ -56,6 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SMP +#include +#endif + SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, @@ -83,6 +87,21 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca int callwheelsize, callwheelbits, callwheelmask; /* + * The callout cpu migration entity represents informations necessary for + * describing the migrating callout to the new callout cpu. + * The cached informations are very important for deferring migration when + * the migrating callout is already running. + */ +struct cc_mig_ent { +#ifdef SMP + void (*ce_migration_func)(void *); + void *ce_migration_arg; + int ce_migration_cpu; + int ce_migration_ticks; +#endif +}; + +/* * There is one struct callout_cpu per cpu, holding all relevant * state for the callout processing thread on the individual CPU. * In particular: @@ -100,6 +119,7 @@ int callwheelsize, callwheelbits, callwh * when the callout should be served. */ struct callout_cpu { + struct cc_mig_ent cc_migrating_entity; struct mtx cc_lock; struct callout *cc_callout; struct callout_tailq *cc_callwheel; @@ -114,7 +134,13 @@ struct callout_cpu { }; #ifdef SMP +#define cc_migration_func cc_migrating_entity.ce_migration_func +#define cc_migration_arg cc_migrating_entity.ce_migration_arg +#define cc_migration_cpu cc_migrating_entity.ce_migration_cpu +#define cc_migration_ticks cc_migrating_entity.ce_migration_ticks + struct callout_cpu cc_cpu[MAXCPU]; +#define CPUBLOCK MAXCPU #define CC_CPU(cpu) (&cc_cpu[(cpu)]) #define CC_SELF() CC_CPU(PCPU_GET(cpuid)) #else @@ -124,6 +150,7 @@ struct callout_cpu cc_cpu; #endif #define CC_LOCK(cc) mtx_lock_spin(&(cc)->cc_lock) #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) +#define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) static int timeout_cpu; @@ -147,6 +174,35 @@ MALLOC_DEFINE(M_CALLOUT, "callout", "Cal */ /* + * Resets the migration entity tied to a specific callout cpu. + */ +static void +cc_cme_cleanup(struct callout_cpu *cc) +{ + +#ifdef SMP + cc->cc_migration_cpu = CPUBLOCK; + cc->cc_migration_ticks = 0; + cc->cc_migration_func = NULL; + cc->cc_migration_arg = NULL; +#endif +} + +/* + * Checks if migration is requested by a specific callout cpu. + */ +static int +cc_cme_migrating(struct callout_cpu *cc) +{ + +#ifdef SMP + return (cc->cc_migration_cpu != CPUBLOCK); +#else + return (0); +#endif +} + +/* * kern_timeout_callwheel_alloc() - kernel low level callwheel initialization * * This code is called very early in the kernel initialization sequence, @@ -186,6 +242,7 @@ callout_cpu_init(struct callout_cpu *cc) for (i = 0; i < callwheelsize; i++) { TAILQ_INIT(&cc->cc_callwheel[i]); } + cc_cme_cleanup(cc); if (cc->cc_callout == NULL) return; for (i = 0; i < ncallout; i++) { @@ -196,6 +253,29 @@ callout_cpu_init(struct callout_cpu *cc) } } +#ifdef SMP +/* + * Switches the cpu tied to a specific callout. + * The function expects a locked incoming callout cpu and returns with + * locked outcoming callout cpu. + */ +static struct callout_cpu * +callout_cpu_switch(struct callout *c, struct callout_cpu *cc, int new_cpu) +{ + struct callout_cpu *new_cc; + + MPASS(c != NULL && cc != NULL); + CC_LOCK_ASSERT(cc); + + c->c_cpu = CPUBLOCK; + CC_UNLOCK(cc); + new_cc = CC_CPU(new_cpu); + CC_LOCK(new_cc); + c->c_cpu = new_cpu; + return (new_cc); +} +#endif + /* * kern_timeout_callwheel_init() - initialize previously reserved callwheel * space. @@ -285,6 +365,13 @@ callout_lock(struct callout *c) for (;;) { cpu = c->c_cpu; +#ifdef SMP + if (cpu == CPUBLOCK) { + while (c->c_cpu == CPUBLOCK) + cpu_spinwait(); + continue; + } +#endif cc = CC_CPU(cpu); CC_LOCK(cc); if (cpu == c->c_cpu) @@ -294,6 +381,23 @@ callout_lock(struct callout *c) return (cc); } +static void +callout_cc_add(struct callout *c, struct callout_cpu *cc, int to_ticks, + void (*func)(void *), void *arg, int cpu) +{ + + CC_LOCK_ASSERT(cc); + + if (to_ticks <= 0) + to_ticks = 1; + c->c_arg = arg; + c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_func = func; + c->c_time = cc->cc_ticks + to_ticks; + TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], + c, c_links.tqe); +} + /* * The callout mechanism is based on the work of Adam M. Costello and * George Varghese, published in a technical report entitled "Redesigning @@ -471,14 +575,50 @@ softclock(void *arg) } cc->cc_curr = NULL; if (cc->cc_waiting) { + /* - * There is someone waiting - * for the callout to complete. + * There is someone waiting for the + * callout to complete. + * If the callout was scheduled for + * migration just cancel it. */ + if (cc_cme_migrating(cc)) + cc_cme_cleanup(cc); cc->cc_waiting = 0; CC_UNLOCK(cc); wakeup(&cc->cc_waiting); CC_LOCK(cc); + } else if (cc_cme_migrating(cc)) { +#ifdef SMP + struct callout_cpu *new_cc; + void (*new_func)(void *); + void *new_arg; + int new_cpu, new_ticks; + + /* + * If the callout was scheduled for + * migration just perform it now. + */ + new_cpu = cc->cc_migration_cpu; + new_ticks = cc->cc_migration_ticks; + new_func = cc->cc_migration_func; + new_arg = cc->cc_migration_arg; + cc_cme_cleanup(cc); + + /* + * It should be assert here that the + * callout is not destroyed but that + * is not easy. + */ + new_cc = callout_cpu_switch(c, cc, + new_cpu); + callout_cc_add(c, new_cc, new_ticks, + new_func, new_arg, new_cpu); + CC_UNLOCK(new_cc); + CC_LOCK(cc); +#else + panic("migration should not happen"); +#endif } steps = 0; c = cc->cc_next; @@ -591,7 +731,6 @@ callout_reset_on(struct callout *c, int */ if (c->c_flags & CALLOUT_LOCAL_ALLOC) cpu = c->c_cpu; -retry: cc = callout_lock(c); if (cc->cc_curr == c) { /* @@ -623,25 +762,30 @@ retry: cancelled = 1; c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); } + +#ifdef SMP /* - * If the lock must migrate we have to check the state again as - * we can't hold both the new and old locks simultaneously. + * If the callout must migrate try to perform it immediately. + * If the callout is currently running, just defer the migration + * to a more appropriate moment. */ if (c->c_cpu != cpu) { - c->c_cpu = cpu; - CC_UNLOCK(cc); - goto retry; + if (cc->cc_curr == c) { + cc->cc_migration_cpu = cpu; + cc->cc_migration_ticks = to_ticks; + cc->cc_migration_func = ftn; + cc->cc_migration_arg = arg; + CTR5(KTR_CALLOUT, + "migration of %p func %p arg %p in %d to %u deferred", + c, c->c_func, c->c_arg, to_ticks, cpu); + CC_UNLOCK(cc); + return (cancelled); + } + cc = callout_cpu_switch(c, cc, cpu); } +#endif - if (to_ticks <= 0) - to_ticks = 1; - - c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - c->c_func = ftn; - c->c_time = cc->cc_ticks + to_ticks; - TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], - c, c_links.tqe); + callout_cc_add(c, cc, to_ticks, ftn, arg, cpu); CTR5(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d", cancelled ? "re" : "", c, c->c_func, c->c_arg, to_ticks); CC_UNLOCK(cc); @@ -669,7 +813,7 @@ _callout_stop_safe(c, safe) struct callout *c; int safe; { - struct callout_cpu *cc; + struct callout_cpu *cc, *old_cc; struct lock_class *class; int use_lock, sq_locked; @@ -689,8 +833,27 @@ _callout_stop_safe(c, safe) use_lock = 0; sq_locked = 0; + old_cc = NULL; again: cc = callout_lock(c); + + /* + * If the callout was migrating while the callout cpu lock was + * dropped, just drop the sleepqueue lock and check the states + * again. + */ + if (sq_locked != 0 && cc != old_cc) { +#ifdef SMP + CC_UNLOCK(cc); + sleepq_release(&old_cc->cc_waiting); + sq_locked = 0; + old_cc = NULL; + goto again; +#else + panic("migration should not happen"); +#endif + } + /* * If the callout isn't pending, it's not on the queue, so * don't attempt to remove it from the queue. We can try to @@ -742,8 +905,16 @@ again: CC_UNLOCK(cc); sleepq_lock(&cc->cc_waiting); sq_locked = 1; + old_cc = cc; goto again; } + + /* + * Migration could be cancelled here, but + * as long as it is still not sure when it + * will be packed up, just let softclock() + * take care of it. + */ cc->cc_waiting = 1; DROP_GIANT(); CC_UNLOCK(cc); @@ -752,6 +923,7 @@ again: SLEEPQ_SLEEP, 0); sleepq_wait(&cc->cc_waiting, 0); sq_locked = 0; + old_cc = NULL; /* Reacquire locks previously released. */ PICKUP_GIANT(); @@ -768,6 +940,8 @@ again: cc->cc_cancel = 1; CTR3(KTR_CALLOUT, "cancelled %p func %p arg %p", c, c->c_func, c->c_arg); + KASSERT(!cc_cme_migrating(cc), + ("callout wrongly scheduled for migration")); CC_UNLOCK(cc); KASSERT(!sq_locked, ("sleepqueue chain locked")); return (1); From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 01:08:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91A65106566C; Sun, 15 May 2011 01:08:51 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE0A8FC08; Sun, 15 May 2011 01:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F18pEG021640; Sun, 15 May 2011 01:08:51 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F18pnU021626; Sun, 15 May 2011 01:08:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105150108.p4F18pnU021626@svn.freebsd.org> From: Attilio Rao Date: Sun, 15 May 2011 01:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221939 - in stable/8/sys: amd64/amd64 arm/arm ddb dev/watchdog i386/i386 ia64/ia64 kern mips/mips powerpc/powerpc sys x86/x86 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 01:08:51 -0000 Author: attilio Date: Sun May 15 01:08:51 2011 New Revision: 221939 URL: http://svn.freebsd.org/changeset/base/221939 Log: MFC r221121,221173: - Add the possibility to reuse the already last used timeout when patting the watchdog, via the watchdog(9) interface. - Add the possibility to pat the watchdogs installed via the watchdog(9) interface from the kernel. - Avoid to pass WD_ACTIVE down in the watchdog handlers. All the control bit processing should over to the upper layer functions and not passed down to the handlers at all. - Add the watchdogs patting during the (shutdown time) disk syncing and disk dumping. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/amd64/amd64/minidump_machdep.c stable/8/sys/arm/arm/dump_machdep.c stable/8/sys/arm/arm/minidump_machdep.c stable/8/sys/ddb/db_command.c stable/8/sys/dev/watchdog/watchdog.c stable/8/sys/i386/i386/minidump_machdep.c stable/8/sys/ia64/ia64/dump_machdep.c stable/8/sys/kern/kern_shutdown.c stable/8/sys/kern/vfs_subr.c stable/8/sys/mips/mips/dump_machdep.c stable/8/sys/powerpc/powerpc/dump_machdep.c stable/8/sys/sys/watchdog.h stable/8/sys/x86/x86/dump_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/minidump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/amd64/amd64/minidump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -135,6 +140,9 @@ blk_write(struct dumperinfo *di, char *p printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<24) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/8/sys/arm/arm/dump_machdep.c ============================================================================== --- stable/8/sys/arm/arm/dump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/arm/arm/dump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -189,6 +194,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr cpu_tlb_flushID_SE(0); cpu_cpwait(); } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif error = dump_write(di, (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo, sz); if (error) Modified: stable/8/sys/arm/arm/minidump_machdep.c ============================================================================== --- stable/8/sys/arm/arm/minidump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/arm/arm/minidump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -36,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p counter &= (1<<22) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/8/sys/ddb/db_command.c ============================================================================== --- stable/8/sys/ddb/db_command.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/ddb/db_command.c Sun May 15 01:08:51 2011 (r221939) @@ -724,14 +724,6 @@ db_watchdog(dummy1, dummy2, dummy3, dumm } else if ((tout & WD_INTERVAL) == WD_TO_NEVER) { db_error("Out of range watchdog interval\n"); return; - } else { - - /* - * XXX: Right now we only support WD_ACTIVE, in the future we - * may be possibly needing a more convoluted function for - * dealing with different cases. - */ - tout |= WD_ACTIVE; } EVENTHANDLER_INVOKE(watchdog_list, tout, &i); } Modified: stable/8/sys/dev/watchdog/watchdog.c ============================================================================== --- stable/8/sys/dev/watchdog/watchdog.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/dev/watchdog/watchdog.c Sun May 15 01:08:51 2011 (r221939) @@ -40,35 +40,73 @@ __FBSDID("$FreeBSD$"); #include static struct cdev *wd_dev; +static volatile u_int wd_last_u; + +static int +kern_do_pat(u_int utim) +{ + int error; + + if ((utim & WD_LASTVAL) != 0 && (utim & WD_INTERVAL) > 0) + return (EINVAL); + + if ((utim & WD_LASTVAL) != 0) { + MPASS((wd_last_u & ~WD_INTERVAL) == 0); + utim &= ~WD_LASTVAL; + utim |= wd_last_u; + } else + wd_last_u = (utim & WD_INTERVAL); + if ((utim & WD_INTERVAL) == WD_TO_NEVER) { + utim = 0; + + /* Assume all is well; watchdog signals failure. */ + error = 0; + } else { + /* Assume no watchdog available; watchdog flags success */ + error = EOPNOTSUPP; + } + EVENTHANDLER_INVOKE(watchdog_list, utim, &error); + return (error); +} static int wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags __unused, struct thread *td) { - int error; u_int u; if (cmd != WDIOCPATPAT) return (ENOIOCTL); u = *(u_int *)data; - if (u & ~(WD_ACTIVE | WD_PASSIVE | WD_INTERVAL)) + if (u & ~(WD_ACTIVE | WD_PASSIVE | WD_LASTVAL | WD_INTERVAL)) return (EINVAL); if ((u & (WD_ACTIVE | WD_PASSIVE)) == (WD_ACTIVE | WD_PASSIVE)) return (EINVAL); - if ((u & (WD_ACTIVE | WD_PASSIVE)) == 0 && (u & WD_INTERVAL) > 0) + if ((u & (WD_ACTIVE | WD_PASSIVE)) == 0 && ((u & WD_INTERVAL) > 0 || + (u & WD_LASTVAL) != 0)) return (EINVAL); if (u & WD_PASSIVE) return (ENOSYS); /* XXX Not implemented yet */ - if ((u & WD_INTERVAL) == WD_TO_NEVER) { - u = 0; - /* Assume all is well; watchdog signals failure. */ - error = 0; - } else { - /* Assume no watchdog available; watchdog flags success */ - error = EOPNOTSUPP; - } - EVENTHANDLER_INVOKE(watchdog_list, u, &error); - return (error); + u &= ~(WD_ACTIVE | WD_PASSIVE); + + return (kern_do_pat(u)); +} + +u_int +wdog_kern_last_timeout(void) +{ + + return (wd_last_u); +} + +int +wdog_kern_pat(u_int utim) +{ + + if (utim & ~(WD_LASTVAL | WD_INTERVAL)) + return (EINVAL); + + return (kern_do_pat(utim)); } static struct cdevsw wd_cdevsw = { Modified: stable/8/sys/i386/i386/minidump_machdep.c ============================================================================== --- stable/8/sys/i386/i386/minidump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/i386/i386/minidump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); counter &= (1<<24) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif if (ptr) { error = dump_write(di, ptr, 0, dumplo, len); if (error) Modified: stable/8/sys/ia64/ia64/dump_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/dump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/ia64/ia64/dump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,12 +27,17 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -125,6 +130,9 @@ cb_dumpdata(struct efi_md *mdp, int seqn printf("%c\b", "|/-\\"[twiddle++ & 3]); counter &= (1<<24) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif error = dump_write(di, (void*)pa, 0, dumplo, sz); if (error) break; Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/kern/kern_shutdown.c Sun May 15 01:08:51 2011 (r221939) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_panic.h" #include "opt_show_busybufs.h" #include "opt_sched.h" +#include "opt_watchdog.h" #include #include @@ -65,6 +66,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include @@ -311,6 +315,9 @@ boot(int howto) waittime = 0; +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif sync(curthread, NULL); /* @@ -336,6 +343,9 @@ boot(int howto) if (nbusy < pbusy) iter = 0; pbusy = nbusy; +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif sync(curthread, NULL); #ifdef PREEMPTION Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/kern/vfs_subr.c Sun May 15 01:08:51 2011 (r221939) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_watchdog.h" #include #include @@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include @@ -1842,6 +1846,10 @@ sched_sync(void) LIST_INSERT_HEAD(next, bo, bo_synclist); continue; } +#ifdef SW_WATCHDOG + if (first_printf == 0) + wdog_kern_pat(WD_LASTVAL); +#endif } if (!LIST_EMPTY(gslp)) { mtx_unlock(&sync_mtx); Modified: stable/8/sys/mips/mips/dump_machdep.c ============================================================================== --- stable/8/sys/mips/mips/dump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/mips/mips/dump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -182,6 +187,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr counter &= (1<<24) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_path(WD_LASTVAL); +#endif error = dump_write(di, (void *)(pa),0, dumplo, sz); if (error) break; Modified: stable/8/sys/powerpc/powerpc/dump_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/dump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/powerpc/powerpc/dump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -129,6 +134,9 @@ cb_dumpdata(struct pmap_md *md, int seqn printf("%c\b", "|/-\\"[twiddle++ & 3]); counter &= (1<<24) - 1; } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif error = di->dumper(di->priv, (void*)va, 0, dumplo, sz); pmap_dumpsys_unmap(md, ofs, va); if (error) Modified: stable/8/sys/sys/watchdog.h ============================================================================== --- stable/8/sys/sys/watchdog.h Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/sys/watchdog.h Sun May 15 01:08:51 2011 (r221939) @@ -50,6 +50,12 @@ * right to the kernel. */ +#define WD_LASTVAL 0x0200000 + /* + * Use the already last used timeout value. + * The kernel will use as timeout the last valid timeout provided. + */ + #define WD_INTERVAL 0x00000ff /* * Mask for duration bits. @@ -78,6 +84,9 @@ typedef void (*watchdog_fn)(void *, u_int, int *); EVENTHANDLER_DECLARE(watchdog_list, watchdog_fn); + +u_int wdog_kern_last_timeout(void); +int wdog_kern_pat(u_int utim); #endif #endif /* _SYS_WATCHDOG_H */ Modified: stable/8/sys/x86/x86/dump_machdep.c ============================================================================== --- stable/8/sys/x86/x86/dump_machdep.c Sun May 15 01:01:53 2011 (r221938) +++ stable/8/sys/x86/x86/dump_machdep.c Sun May 15 01:08:51 2011 (r221939) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_watchdog.h" + #include #include #include @@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SW_WATCHDOG +#include +#endif #include #include #include @@ -193,6 +198,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr a = pa + i * PAGE_SIZE; va = pmap_kenter_temporary(trunc_page(a), i); } +#ifdef SW_WATCHDOG + wdog_kern_pat(WD_LASTVAL); +#endif error = dump_write(di, va, 0, dumplo, sz); if (error) break; From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 06:42:33 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0812C106564A; Sun, 15 May 2011 06:42:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBEAF8FC0C; Sun, 15 May 2011 06:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F6gWGA028313; Sun, 15 May 2011 06:42:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F6gWPo028309; Sun, 15 May 2011 06:42:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201105150642.p4F6gWPo028309@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 May 2011 06:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221943 - in stable/8/sys/ufs: ffs ufs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 06:42:33 -0000 Author: kib Date: Sun May 15 06:42:32 2011 New Revision: 221943 URL: http://svn.freebsd.org/changeset/base/221943 Log: MFC r220985: Move some parts of ufs_reclaim() into helper function ufs_prepare_reclaim(), and call the helper from VOP_RECLAIM and ffs_valloc() to properly prepare the ufs vnode for reuse. Modified: stable/8/sys/ufs/ffs/ffs_alloc.c stable/8/sys/ufs/ufs/ufs_extern.h stable/8/sys/ufs/ufs/ufs_inode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_alloc.c Sun May 15 04:03:11 2011 (r221942) +++ stable/8/sys/ufs/ffs/ffs_alloc.c Sun May 15 06:42:32 2011 (r221943) @@ -1014,8 +1014,9 @@ dup_alloc: ip->i_din2->di_birthtime = ts.tv_sec; ip->i_din2->di_birthnsec = ts.tv_nsec; } + ufs_prepare_reclaim(*vpp); ip->i_flag = 0; - vnode_destroy_vobject(*vpp); + (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; if (fs->fs_magic == FS_UFS2_MAGIC) (*vpp)->v_op = &ffs_vnodeops2; Modified: stable/8/sys/ufs/ufs/ufs_extern.h ============================================================================== --- stable/8/sys/ufs/ufs/ufs_extern.h Sun May 15 04:03:11 2011 (r221942) +++ stable/8/sys/ufs/ufs/ufs_extern.h Sun May 15 06:42:32 2011 (r221943) @@ -76,6 +76,7 @@ int ufs_inactive(struct vop_inactive_ar int ufs_init(struct vfsconf *); void ufs_itimes(struct vnode *vp); int ufs_lookup(struct vop_cachedlookup_args *); +void ufs_prepare_reclaim(struct vnode *vp); int ufs_readdir(struct vop_readdir_args *); int ufs_reclaim(struct vop_reclaim_args *); void ffs_snapgone(struct inode *); Modified: stable/8/sys/ufs/ufs/ufs_inode.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_inode.c Sun May 15 04:03:11 2011 (r221942) +++ stable/8/sys/ufs/ufs/ufs_inode.c Sun May 15 06:42:32 2011 (r221943) @@ -168,6 +168,31 @@ out: return (error); } +void +ufs_prepare_reclaim(struct vnode *vp) +{ + struct inode *ip; +#ifdef QUOTA + int i; +#endif + + ip = VTOI(vp); + + vnode_destroy_vobject(vp); +#ifdef QUOTA + for (i = 0; i < MAXQUOTAS; i++) { + if (ip->i_dquot[i] != NODQUOT) { + dqrele(vp, ip->i_dquot[i]); + ip->i_dquot[i] = NODQUOT; + } + } +#endif +#ifdef UFS_DIRHASH + if (ip->i_dirhash != NULL) + ufsdirhash_free(ip); +#endif +} + /* * Reclaim an inode so that it can be used for other purposes. */ @@ -181,14 +206,9 @@ ufs_reclaim(ap) struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct ufsmount *ump = ip->i_ump; -#ifdef QUOTA - int i; -#endif - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); + ufs_prepare_reclaim(vp); + if (ip->i_flag & IN_LAZYMOD) ip->i_flag |= IN_MODIFIED; UFS_UPDATE(vp, 0); @@ -196,21 +216,7 @@ ufs_reclaim(ap) * Remove the inode from its hash chain. */ vfs_hash_remove(vp); - /* - * Purge old data structures associated with the inode. - */ -#ifdef QUOTA - for (i = 0; i < MAXQUOTAS; i++) { - if (ip->i_dquot[i] != NODQUOT) { - dqrele(vp, ip->i_dquot[i]); - ip->i_dquot[i] = NODQUOT; - } - } -#endif -#ifdef UFS_DIRHASH - if (ip->i_dirhash != NULL) - ufsdirhash_free(ip); -#endif + /* * Lock the clearing of v_data so ffs_lock() can inspect it * prior to obtaining the lock. From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 08:15:26 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C04BE106564A; Sun, 15 May 2011 08:15:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 956EE8FC12; Sun, 15 May 2011 08:15:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F8FQTj030128; Sun, 15 May 2011 08:15:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F8FQLa030125; Sun, 15 May 2011 08:15:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105150815.p4F8FQLa030125@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 08:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221946 - in stable/8/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 08:15:26 -0000 Author: avg Date: Sun May 15 08:15:26 2011 New Revision: 221946 URL: http://svn.freebsd.org/changeset/base/221946 Log: MFC r221740: dtrace: remove unused code Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun May 15 08:09:36 2011 (r221945) +++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sun May 15 08:15:26 2011 (r221946) @@ -359,26 +359,6 @@ static uint64_t nsec_scale; #define SCALE_SHIFT 28 static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - -static void dtrace_gethrtime_init_cpu(void *arg) { uintptr_t cpu = (uintptr_t) arg; @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:09:36 2011 (r221945) +++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:15:26 2011 (r221946) @@ -359,26 +359,6 @@ static uint64_t nsec_scale; #define SCALE_SHIFT 28 static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - -static void dtrace_gethrtime_init_cpu(void *arg) { uintptr_t cpu = (uintptr_t) arg; @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 08:17:10 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACDDC1065675; Sun, 15 May 2011 08:17:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C038FC12; Sun, 15 May 2011 08:17:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4F8HAkJ030212; Sun, 15 May 2011 08:17:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4F8HAkh030210; Sun, 15 May 2011 08:17:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105150817.p4F8HAkh030210@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 May 2011 08:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221947 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 08:17:10 -0000 Author: avg Date: Sun May 15 08:17:09 2011 New Revision: 221947 URL: http://svn.freebsd.org/changeset/base/221947 Log: MFC r221741: bitcount32: replace lengthy comment with a reference to SWAR Modified: stable/8/sys/sys/systm.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Sun May 15 08:15:26 2011 (r221946) +++ stable/8/sys/sys/systm.h Sun May 15 08:17:09 2011 (r221947) @@ -365,44 +365,8 @@ int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); /* - * This is about as magic as it gets. fortune(1) has got similar code - * for reversing bits in a word. Who thinks up this stuff?? - * - * Yes, it does appear to be consistently faster than: - * while (i = ffs(m)) { - * m >>= i; - * bits++; - * } - * and - * while (lsb = (m & -m)) { // This is magic too - * m &= ~lsb; // or: m ^= lsb - * bits++; - * } - * Both of these latter forms do some very strange things on gcc-3.1 with - * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2. - * There is probably an SSE or MMX popcnt instruction. - * - * I wonder if this should be in libkern? - * - * XXX Stop the presses! Another one: - * static __inline u_int32_t - * popcnt1(u_int32_t v) - * { - * v -= ((v >> 1) & 0x55555555); - * v = (v & 0x33333333) + ((v >> 2) & 0x33333333); - * v = (v + (v >> 4)) & 0x0F0F0F0F; - * return (v * 0x01010101) >> 24; - * } - * The downside is that it has a multiply. With a pentium3 with - * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use - * an imull, and in that case it is faster. In most other cases - * it appears slightly slower. - * - * Another variant (also from fortune): - * #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) - * #define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - * - (((x)>>2)&0x33333333) \ - * - (((x)>>3)&0x11111111)) + * Population count algorithm using SWAR approach + * - "SIMD Within A Register". */ static __inline uint32_t bitcount32(uint32_t x) From owner-svn-src-stable-8@FreeBSD.ORG Sun May 15 16:40:42 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C411106566B; Sun, 15 May 2011 16:40:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2F58FC14; Sun, 15 May 2011 16:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FGeg0v044922; Sun, 15 May 2011 16:40:42 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4FGegjq044916; Sun, 15 May 2011 16:40:42 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105151640.p4FGegjq044916@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 15 May 2011 16:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221969 - stable/8/sys/geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 16:40:42 -0000 Author: ae Date: Sun May 15 16:40:42 2011 New Revision: 221969 URL: http://svn.freebsd.org/changeset/base/221969 Log: MFC r221644,221645,221652,221656,221658: Limit number of sectors that can be addressed. MFC r221647: Replace UINT_MAX to UINT32_MAX. Modified: stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_ebr.c stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/geom/part/g_part_pc98.c stable/8/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Sun May 15 16:33:13 2011 (r221968) +++ stable/8/sys/geom/part/g_part_bsd.c Sun May 15 16:40:42 2011 (r221969) @@ -203,7 +203,7 @@ g_part_bsd_create(struct g_part_table *b if (BBSIZE % pp->sectorsize) return (ENOTBLK); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; @@ -362,7 +362,7 @@ g_part_bsd_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_bsd_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); table->bbarea = g_read_data(cp, 0, BBSIZE, &error); if (table->bbarea == NULL) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Sun May 15 16:33:13 2011 (r221968) +++ stable/8/sys/geom/part/g_part_ebr.c Sun May 15 16:40:42 2011 (r221969) @@ -280,7 +280,7 @@ g_part_ebr_create(struct g_part_table *b if (strcmp(psn, "MBR")) return (ENXIO); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); msize -= msize % basetable->gpt_sectors; basetable->gpt_first = 0; basetable->gpt_last = msize - 1; @@ -472,7 +472,7 @@ g_part_ebr_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_ebr_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); lba = 0; while (1) { Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Sun May 15 16:33:13 2011 (r221968) +++ stable/8/sys/geom/part/g_part_mbr.c Sun May 15 16:40:42 2011 (r221969) @@ -259,7 +259,7 @@ g_part_mbr_create(struct g_part_table *b if (pp->sectorsize < MBRSIZE) return (ENOSPC); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; @@ -430,7 +430,7 @@ g_part_mbr_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_mbr_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) Modified: stable/8/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/8/sys/geom/part/g_part_pc98.c Sun May 15 16:33:13 2011 (r221968) +++ stable/8/sys/geom/part/g_part_pc98.c Sun May 15 16:40:42 2011 (r221969) @@ -233,7 +233,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); + msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; @@ -417,7 +417,7 @@ g_part_pc98_read(struct g_part_table *ba pp = cp->provider; table = (struct g_part_pc98_table *)basetable; - msize = pp->mediasize / SECSIZE; + msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX); buf = g_read_data(cp, 0L, 2 * SECSIZE, &error); if (buf == NULL) Modified: stable/8/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/8/sys/geom/part/g_part_vtoc8.c Sun May 15 16:33:13 2011 (r221968) +++ stable/8/sys/geom/part/g_part_vtoc8.c Sun May 15 16:40:42 2011 (r221969) @@ -195,9 +195,7 @@ g_part_vtoc8_create(struct g_part_table table = (struct g_part_vtoc8_table *)basetable; - msize = pp->mediasize / pp->sectorsize; - if (msize > 0xffffffffu) - msize = 0xffffffffu; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); table->secpercyl = basetable->gpt_sectors * basetable->gpt_heads; pcyls = msize / table->secpercyl; acyls = 2; @@ -389,8 +387,7 @@ g_part_vtoc8_read(struct g_part_table *b bcopy(buf, &table->vtoc, sizeof(table->vtoc)); g_free(buf); - msize = pp->mediasize / pp->sectorsize; - + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); sectors = be16dec(&table->vtoc.nsecs); if (sectors < 1) goto invalid_label; From owner-svn-src-stable-8@FreeBSD.ORG Mon May 16 07:02:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93D9106566B; Mon, 16 May 2011 07:02:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7D4F8FC08; Mon, 16 May 2011 07:02:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4G72fHp070760; Mon, 16 May 2011 07:02:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4G72f2g070758; Mon, 16 May 2011 07:02:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201105160702.p4G72f2g070758@svn.freebsd.org> From: Dimitry Andric Date: Mon, 16 May 2011 07:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221982 - stable/8/gnu/usr.bin/cc/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 07:02:42 -0000 Author: dim Date: Mon May 16 07:02:41 2011 New Revision: 221982 URL: http://svn.freebsd.org/changeset/base/221982 Log: MFC r220630: In r219639, SSSE3 instruction set support was backported to our gcc. Therefore, we also need to install the new tmmintrin.h header containing the related intrinsic functions, similar to xmmintrin.h, emmintrin.h, etc. Reported by: George Liaskos Modified: stable/8/gnu/usr.bin/cc/include/Makefile Directory Properties: stable/8/gnu/usr.bin/cc/include/ (props changed) Modified: stable/8/gnu/usr.bin/cc/include/Makefile ============================================================================== --- stable/8/gnu/usr.bin/cc/include/Makefile Mon May 16 03:32:40 2011 (r221981) +++ stable/8/gnu/usr.bin/cc/include/Makefile Mon May 16 07:02:41 2011 (r221982) @@ -5,7 +5,7 @@ .PATH: ${GCCDIR}/config/${GCC_CPU} .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" -INCS= emmintrin.h mmintrin.h pmmintrin.h xmmintrin.h mm_malloc.h +INCS= emmintrin.h mmintrin.h pmmintrin.h tmmintrin.h xmmintrin.h mm_malloc.h .elif ${TARGET_ARCH} == "ia64" INCS= ia64intrin.h .elif ${TARGET_ARCH} == "arm" From owner-svn-src-stable-8@FreeBSD.ORG Mon May 16 12:11:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54869106564A; Mon, 16 May 2011 12:11:30 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 434A38FC0A; Mon, 16 May 2011 12:11:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GCBU2U081644; Mon, 16 May 2011 12:11:30 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GCBU4j081642; Mon, 16 May 2011 12:11:30 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201105161211.p4GCBU4j081642@svn.freebsd.org> From: Marko Zec Date: Mon, 16 May 2011 12:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221985 - stable/8/sys/netgraph X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 12:11:30 -0000 Author: zec Date: Mon May 16 12:11:29 2011 New Revision: 221985 URL: http://svn.freebsd.org/changeset/base/221985 Log: MFC r220416: Properly unref ng_hub nodes on shutdown, so that we don't leak them. Modified: stable/8/sys/netgraph/ng_hub.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netgraph/ng_hub.c ============================================================================== --- stable/8/sys/netgraph/ng_hub.c Mon May 16 12:00:32 2011 (r221984) +++ stable/8/sys/netgraph/ng_hub.c Mon May 16 12:11:29 2011 (r221985) @@ -157,6 +157,8 @@ ng_hub_shutdown(node_p node) const priv_p priv = NG_NODE_PRIVATE(node); free(priv, M_NETGRAPH_HUB); + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_UNREF(node); return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Mon May 16 18:12:32 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0AC7106564A; Mon, 16 May 2011 18:12:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF40D8FC19; Mon, 16 May 2011 18:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4GICWe0093621; Mon, 16 May 2011 18:12:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4GICWlx093619; Mon, 16 May 2011 18:12:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105161812.p4GICWlx093619@svn.freebsd.org> From: Xin LI Date: Mon, 16 May 2011 18:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221999 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2011 18:12:32 -0000 Author: delphij Date: Mon May 16 18:12:32 2011 New Revision: 221999 URL: http://svn.freebsd.org/changeset/base/221999 Log: MFC r217588+218386 (trasz): Add MNT_NFS4ACLS to ZFS mount flags and make it impossible to clear the flag by using 'mount -uw'. It's not conditional, since there is no way to disable NFSv4 ACLs in ZFS. This should make it easier for the NFS server to figure out whether the exported filesystem supports ACLs or not. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 16 17:21:22 2011 (r221998) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 16 18:12:32 2011 (r221999) @@ -1203,6 +1203,8 @@ zfs_mount(vfs_t *vfsp) goto out; } + vfsp->vfs_flag |= MNT_NFS4ACLS; + /* * When doing a remount, we simply refresh our temporary properties * according to those options set in the current VFS options. From owner-svn-src-stable-8@FreeBSD.ORG Tue May 17 07:08:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B39C7106564A; Tue, 17 May 2011 07:08:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A21998FC0A; Tue, 17 May 2011 07:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4H78rTT017408; Tue, 17 May 2011 07:08:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4H78r7K017406; Tue, 17 May 2011 07:08:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105170708.p4H78r7K017406@svn.freebsd.org> From: Andriy Gapon Date: Tue, 17 May 2011 07:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222005 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 07:08:53 -0000 Author: avg Date: Tue May 17 07:08:53 2011 New Revision: 222005 URL: http://svn.freebsd.org/changeset/base/222005 Log: MFC r221585: scsi_cd: silence READ_TOC errors in CDIOREADTOCHEADER ioctl Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Tue May 17 06:36:32 2011 (r222004) +++ stable/8/sys/cam/scsi/scsi_cd.c Tue May 17 07:08:53 2011 (r222005) @@ -2125,7 +2125,7 @@ cdioctl(struct disk *dp, u_long cmd, voi ("trying to do CDIOREADTOCHEADER\n")); error = cdreadtoc(periph, 0, 0, (u_int8_t *)th, - sizeof (*th), /*sense_flags*/0); + sizeof (*th), /*sense_flags*/SF_NO_PRINT); if (error) { free(th, M_SCSICD); cam_periph_unlock(periph); From owner-svn-src-stable-8@FreeBSD.ORG Tue May 17 14:50:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8374B10656F0; Tue, 17 May 2011 14:50:23 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 735CD8FC1B; Tue, 17 May 2011 14:50:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HEoNVj035407; Tue, 17 May 2011 14:50:23 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HEoNkm035405; Tue, 17 May 2011 14:50:23 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201105171450.p4HEoNkm035405@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 17 May 2011 14:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222026 - stable/8/cddl/compat/opensolaris/misc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 14:50:23 -0000 Author: jh Date: Tue May 17 14:50:23 2011 New Revision: 222026 URL: http://svn.freebsd.org/changeset/base/222026 Log: MFC r221390: Don't pass empty mount options to nmount(2). Modified: stable/8/cddl/compat/opensolaris/misc/zmount.c Directory Properties: stable/8/cddl/compat/opensolaris/ (props changed) Modified: stable/8/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- stable/8/cddl/compat/opensolaris/misc/zmount.c Tue May 17 14:46:28 2011 (r222025) +++ stable/8/cddl/compat/opensolaris/misc/zmount.c Tue May 17 14:50:23 2011 (r222026) @@ -95,8 +95,10 @@ zmount(const char *spec, const char *dir build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); build_iovec(&iov, &iovlen, "from", __DECONST(char *, spec), (size_t)-1); - for (p = optstr; p != NULL; strsep(&p, ",/ ")) - build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + for (p = optstr; p != NULL; strsep(&p, ",/ ")) { + if (*p != '\0') + build_iovec(&iov, &iovlen, p, NULL, (size_t)-1); + } rv = nmount(iov, iovlen, 0); free(optstr); return (rv); From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 01:14:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30961065675; Wed, 18 May 2011 01:14:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 957808FC12; Wed, 18 May 2011 01:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I1ER5d054676; Wed, 18 May 2011 01:14:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I1ERZK054673; Wed, 18 May 2011 01:14:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180114.p4I1ERZK054673@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 01:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222044 - in stable/8/sys: fs/nfs nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 01:14:27 -0000 Author: rmacklem Date: Wed May 18 01:14:27 2011 New Revision: 222044 URL: http://svn.freebsd.org/changeset/base/222044 Log: MFC: r221439 Add kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATS so that they can be used by nfsstat(1) to implement the "-z" option for the new NFS subsystem. Modified: stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/nfs/nfssvc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Tue May 17 22:36:16 2011 (r222043) +++ stable/8/sys/fs/nfs/nfs_commonport.c Wed May 18 01:14:27 2011 (r222044) @@ -404,6 +404,64 @@ nfssvc_call(struct thread *p, struct nfs } else if (uap->flag & NFSSVC_GETSTATS) { error = copyout(&newnfsstats, CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats)); + if (error == 0) { + if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { + newnfsstats.attrcache_hits = 0; + newnfsstats.attrcache_misses = 0; + newnfsstats.lookupcache_hits = 0; + newnfsstats.lookupcache_misses = 0; + newnfsstats.direofcache_hits = 0; + newnfsstats.direofcache_misses = 0; + newnfsstats.accesscache_hits = 0; + newnfsstats.accesscache_misses = 0; + newnfsstats.biocache_reads = 0; + newnfsstats.read_bios = 0; + newnfsstats.read_physios = 0; + newnfsstats.biocache_writes = 0; + newnfsstats.write_bios = 0; + newnfsstats.write_physios = 0; + newnfsstats.biocache_readlinks = 0; + newnfsstats.readlink_bios = 0; + newnfsstats.biocache_readdirs = 0; + newnfsstats.readdir_bios = 0; + newnfsstats.rpcretries = 0; + newnfsstats.rpcrequests = 0; + newnfsstats.rpctimeouts = 0; + newnfsstats.rpcunexpected = 0; + newnfsstats.rpcinvalid = 0; + bzero(newnfsstats.rpccnt, + sizeof(newnfsstats.rpccnt)); + } + if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) { + newnfsstats.srvrpc_errs = 0; + newnfsstats.srv_errs = 0; + newnfsstats.srvcache_inproghits = 0; + newnfsstats.srvcache_idemdonehits = 0; + newnfsstats.srvcache_nonidemdonehits = 0; + newnfsstats.srvcache_misses = 0; + newnfsstats.srvcache_tcppeak = 0; + newnfsstats.srvcache_size = 0; + newnfsstats.srvclients = 0; + newnfsstats.srvopenowners = 0; + newnfsstats.srvopens = 0; + newnfsstats.srvlockowners = 0; + newnfsstats.srvlocks = 0; + newnfsstats.srvdelegates = 0; + newnfsstats.clopenowners = 0; + newnfsstats.clopens = 0; + newnfsstats.cllockowners = 0; + newnfsstats.cllocks = 0; + newnfsstats.cldelegates = 0; + newnfsstats.cllocalopenowners = 0; + newnfsstats.cllocalopens = 0; + newnfsstats.cllocallockowners = 0; + newnfsstats.cllocallocks = 0; + bzero(newnfsstats.srvrpccnt, + sizeof(newnfsstats.srvrpccnt)); + bzero(newnfsstats.cbrpccnt, + sizeof(newnfsstats.cbrpccnt)); + } + } return (error); } else if (uap->flag & NFSSVC_NFSUSERDPORT) { u_short sockport; Modified: stable/8/sys/nfs/nfssvc.h ============================================================================== --- stable/8/sys/nfs/nfssvc.h Tue May 17 22:36:16 2011 (r222043) +++ stable/8/sys/nfs/nfssvc.h Wed May 18 01:14:27 2011 (r222044) @@ -64,5 +64,7 @@ #define NFSSVC_CBADDSOCK 0x00200000 #define NFSSVC_GETSTATS 0x00400000 #define NFSSVC_BACKUPSTABLE 0x00800000 +#define NFSSVC_ZEROCLTSTATS 0x01000000 /* modifier for GETSTATS */ +#define NFSSVC_ZEROSRVSTATS 0x02000000 /* modifier for GETSTATS */ #endif /* _NFS_NFSSVC_H */ From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 01:26:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 942C31065672; Wed, 18 May 2011 01:26:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E6EA8FC08; Wed, 18 May 2011 01:26:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I1Q8KS055060; Wed, 18 May 2011 01:26:08 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I1Q8UT055058; Wed, 18 May 2011 01:26:08 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180126.p4I1Q8UT055058@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 01:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222045 - stable/8/usr.bin/nfsstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 01:26:08 -0000 Author: rmacklem Date: Wed May 18 01:26:08 2011 New Revision: 222045 URL: http://svn.freebsd.org/changeset/base/222045 Log: MFC: r221440 Fix nfsstat.c so that the "-z" option works for the new NFS subsystem. Modified: stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) Modified: stable/8/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/8/usr.bin/nfsstat/nfsstat.c Wed May 18 01:14:27 2011 (r222044) +++ stable/8/usr.bin/nfsstat/nfsstat.c Wed May 18 01:26:08 2011 (r222045) @@ -164,10 +164,7 @@ main(int argc, char **argv) if (run_v4 != 0 && modfind("nfscommon") < 0) errx(1, "experimental client/server not loaded"); - if (run_v4 != 0) { - if (nfssvc(NFSSVC_GETSTATS, &ext_nfsstats) < 0) - err(1, "Can't get stats"); - } else if (nlistf != NULL || memf != NULL) { + if (run_v4 == 0 && (nlistf != NULL || memf != NULL)) { deadkernel = 1; if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, @@ -549,7 +546,17 @@ sperc2(int ttl, int misses) void exp_intpr(int clientOnly, int serverOnly) { + int nfssvc_flag; + nfssvc_flag = NFSSVC_GETSTATS; + if (zflag != 0) { + if (clientOnly != 0) + nfssvc_flag |= NFSSVC_ZEROCLTSTATS; + if (serverOnly != 0) + nfssvc_flag |= NFSSVC_ZEROSRVSTATS; + } + if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0) + err(1, "Can't get stats"); if (clientOnly != 0) { if (printtitle) { printf("Client Info:\n"); From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 01:36:43 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 195DB106566C; Wed, 18 May 2011 01:36:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06E068FC15; Wed, 18 May 2011 01:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I1agFa055409; Wed, 18 May 2011 01:36:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I1agOr055407; Wed, 18 May 2011 01:36:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180136.p4I1agOr055407@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 01:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222046 - stable/8/usr.bin/nfsstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 01:36:43 -0000 Author: rmacklem Date: Wed May 18 01:36:42 2011 New Revision: 222046 URL: http://svn.freebsd.org/changeset/base/222046 Log: MFC: r221309 Fix nfsstat.1 to indicate that "-z" now works for the new NFS subsystems after r221308. This is a content change. Modified: stable/8/usr.bin/nfsstat/nfsstat.1 Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) Modified: stable/8/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- stable/8/usr.bin/nfsstat/nfsstat.1 Wed May 18 01:26:08 2011 (r222045) +++ stable/8/usr.bin/nfsstat/nfsstat.1 Wed May 18 01:36:42 2011 (r222046) @@ -32,7 +32,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd October 18, 2007 +.Dd May 1, 2011 .Dt NFSSTAT 1 .Os .Sh NAME @@ -82,7 +82,6 @@ activity for both the client and server second intervals. .It Fl z Reset statistics after displaying them. -(Not currently supported by the experimental nfs subsystem.) .It Fl e Gather statistics from the experimental nfs subsystem that includes support for NFSv4 instead of the regular nfs subsystem. From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 01:47:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9721065672; Wed, 18 May 2011 01:47:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881D58FC08; Wed, 18 May 2011 01:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I1lNE1055773; Wed, 18 May 2011 01:47:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I1lN0J055771; Wed, 18 May 2011 01:47:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180147.p4I1lN0J055771@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 01:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222047 - stable/8/usr.bin/nfsstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 01:47:23 -0000 Author: rmacklem Date: Wed May 18 01:47:23 2011 New Revision: 222047 URL: http://svn.freebsd.org/changeset/base/222047 Log: MFC: r221454 Modify nfsstat(1) so that it prints out the buffer cache stats in the same way for the new client as the old one. Modified: stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) Modified: stable/8/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/8/usr.bin/nfsstat/nfsstat.c Wed May 18 01:36:42 2011 (r222046) +++ stable/8/usr.bin/nfsstat/nfsstat.c Wed May 18 01:47:23 2011 (r222047) @@ -654,9 +654,9 @@ exp_intpr(int clientOnly, int serverOnly ext_nfsstats.lookupcache_hits, ext_nfsstats.lookupcache_misses); printf(" %9d %9d %9d %9d\n", - ext_nfsstats.biocache_reads, + ext_nfsstats.biocache_reads - ext_nfsstats.read_bios, ext_nfsstats.read_bios, - ext_nfsstats.biocache_writes, + ext_nfsstats.biocache_writes - ext_nfsstats.write_bios, ext_nfsstats.write_bios); if (printtitle) { printf("%9.9s %9.9s %9.9s %9.9s", @@ -664,9 +664,11 @@ exp_intpr(int clientOnly, int serverOnly printf(" %9.9s %9.9s\n", "DirE Hits", "Misses"); } printf("%9d %9d %9d %9d", - ext_nfsstats.biocache_readlinks, + ext_nfsstats.biocache_readlinks - ext_nfsstats.readlink_bios, - ext_nfsstats.biocache_readdirs, + ext_nfsstats.readlink_bios, + ext_nfsstats.biocache_readdirs - + ext_nfsstats.readdir_bios, ext_nfsstats.readdir_bios); printf(" %9d %9d\n", ext_nfsstats.direofcache_hits, From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 02:14:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 231901065670; Wed, 18 May 2011 02:14:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10F488FC0A; Wed, 18 May 2011 02:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I2EQsS056654; Wed, 18 May 2011 02:14:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I2EQar056652; Wed, 18 May 2011 02:14:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180214.p4I2EQar056652@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 02:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222048 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 02:14:27 -0000 Author: rmacklem Date: Wed May 18 02:14:26 2011 New Revision: 222048 URL: http://svn.freebsd.org/changeset/base/222048 Log: MFC: r221462 Add a comment noting that the NFS code assumes that the values of error numbers in sys/errno.h will be the same as the ones specified by the NFS RFCs and that the code needs to be fixed if error numbers are changed in sys/errno.h. Modified: stable/8/sys/fs/nfs/nfsproto.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/8/sys/fs/nfs/nfsproto.h Wed May 18 01:47:23 2011 (r222047) +++ stable/8/sys/fs/nfs/nfsproto.h Wed May 18 02:14:26 2011 (r222048) @@ -66,6 +66,14 @@ #define NFSV4_SMALLSTR 50 /* Strings small enough for stack */ /* Stat numbers for rpc returns (version 2, 3 and 4) */ +/* + * These numbers are hard-wired in the RFCs, so they can't be changed. + * The code currently assumes that the ones < 10000 are the same as + * sys/errno.h and that sys/errno.h will never go as high as 10000. + * If the value in sys/errno.h of any entry listed below is changed, + * the NFS code must be modified to do the mapping between them. + * (You can ignore NFSERR_WFLUSH, since it is never actually used.) + */ #define NFSERR_OK 0 #define NFSERR_PERM 1 #define NFSERR_NOENT 2 From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 14:02:33 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2628106566B; Wed, 18 May 2011 14:02:33 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23EE8FC0A; Wed, 18 May 2011 14:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IE2Xmp094764; Wed, 18 May 2011 14:02:33 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IE2XSd094762; Wed, 18 May 2011 14:02:33 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105181402.p4IE2XSd094762@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 18 May 2011 14:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222056 - stable/8/sys/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 14:02:33 -0000 Author: ru Date: Wed May 18 14:02:33 2011 New Revision: 222056 URL: http://svn.freebsd.org/changeset/base/222056 Log: r221933 vanished support for "nocto" in boot.nfsroot.options loader tunable; fix it by redoing a merge of r221436. Modified: stable/8/sys/nfs/nfs_diskless.c Modified: stable/8/sys/nfs/nfs_diskless.c ============================================================================== --- stable/8/sys/nfs/nfs_diskless.c Wed May 18 11:38:36 2011 (r222055) +++ stable/8/sys/nfs/nfs_diskless.c Wed May 18 14:02:33 2011 (r222056) @@ -112,6 +112,8 @@ nfs_parse_options(const char *envopts, s nd->flags |= NFSMNT_NOCONN; else if (strcmp(o, "nolockd") == 0) nd->flags |= NFSMNT_NOLOCKD; + else if (strcmp(o, "nocto") == 0) + nd->flags |= NFSMNT_NOCTO; else if (strcmp(o, "nfsv2") == 0) nd->flags &= ~(NFSMNT_NFSV3 | NFSMNT_NFSV4); else if (strcmp(o, "nfsv3") == 0) { From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 16:07:24 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6C9C106566B; Wed, 18 May 2011 16:07:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B67D38FC12; Wed, 18 May 2011 16:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4IG7O4Z098802; Wed, 18 May 2011 16:07:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4IG7O9q098800; Wed, 18 May 2011 16:07:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105181607.p4IG7O9q098800@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 18 May 2011 16:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222064 - stable/8/sys/geom/label X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 16:07:24 -0000 Author: ae Date: Wed May 18 16:07:24 2011 New Revision: 222064 URL: http://svn.freebsd.org/changeset/base/222064 Log: MFC r221433: When checking existence of providers skip those which are orphaned. PR: kern/132273 Modified: stable/8/sys/geom/label/g_label.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/label/g_label.c ============================================================================== --- stable/8/sys/geom/label/g_label.c Wed May 18 16:01:29 2011 (r222063) +++ stable/8/sys/geom/label/g_label.c Wed May 18 16:07:24 2011 (r222064) @@ -162,6 +162,8 @@ g_label_create(struct gctl_req *req, str pp2 = LIST_FIRST(&gp->provider); if (pp2 == NULL) continue; + if ((pp2->flags & G_PF_ORPHAN) != 0) + continue; if (strcmp(pp2->name, name) == 0) { G_LABEL_DEBUG(1, "Label %s(%s) already exists (%s).", label, name, pp->name); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 01:35:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DE77106564A; Thu, 19 May 2011 01:35:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31F188FC13; Thu, 19 May 2011 01:35:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4J1ZrrO016940; Thu, 19 May 2011 01:35:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4J1Zrp4016938; Thu, 19 May 2011 01:35:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105190135.p4J1Zrp4016938@svn.freebsd.org> From: Rick Macklem Date: Thu, 19 May 2011 01:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222088 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 01:35:53 -0000 Author: rmacklem Date: Thu May 19 01:35:52 2011 New Revision: 222088 URL: http://svn.freebsd.org/changeset/base/222088 Log: MFC: r221467 Fix the new NFS client so that it handles the 64bit fields that are now in "struct statfs" for NFSv3 and NFSv4. Since the ffiles value is uint64_t on the wire, I clip the value to INT64_MAX to avoid setting f_ffree negative. Modified: stable/8/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Wed May 18 22:43:56 2011 (r222087) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Thu May 19 01:35:52 2011 (r222088) @@ -838,21 +838,33 @@ void nfscl_loadsbinfo(struct nfsmount *nmp, struct nfsstatfs *sfp, void *statfs) { struct statfs *sbp = (struct statfs *)statfs; - nfsquad_t tquad; if (nmp->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) { sbp->f_bsize = NFS_FABLKSIZE; - tquad.qval = sfp->sf_tbytes; - sbp->f_blocks = (long)(tquad.qval / ((u_quad_t)NFS_FABLKSIZE)); - tquad.qval = sfp->sf_fbytes; - sbp->f_bfree = (long)(tquad.qval / ((u_quad_t)NFS_FABLKSIZE)); - tquad.qval = sfp->sf_abytes; - sbp->f_bavail = (long)(tquad.qval / ((u_quad_t)NFS_FABLKSIZE)); - tquad.qval = sfp->sf_tfiles; - sbp->f_files = (tquad.lval[0] & 0x7fffffff); - tquad.qval = sfp->sf_ffiles; - sbp->f_ffree = (tquad.lval[0] & 0x7fffffff); + sbp->f_blocks = sfp->sf_tbytes / NFS_FABLKSIZE; + sbp->f_bfree = sfp->sf_fbytes / NFS_FABLKSIZE; + /* + * Although sf_abytes is uint64_t and f_bavail is int64_t, + * the value after dividing by NFS_FABLKSIZE is small + * enough that it will fit in 63bits, so it is ok to + * assign it to f_bavail without fear that it will become + * negative. + */ + sbp->f_bavail = sfp->sf_abytes / NFS_FABLKSIZE; + sbp->f_files = sfp->sf_tfiles; + /* Since f_ffree is int64_t, clip it to 63bits. */ + if (sfp->sf_ffiles > INT64_MAX) + sbp->f_ffree = INT64_MAX; + else + sbp->f_ffree = sfp->sf_ffiles; } else if ((nmp->nm_flag & NFSMNT_NFSV4) == 0) { + /* + * The type casts to (int32_t) ensure that this code is + * compatible with the old NFS client, in that it will + * propagate bit31 to the high order bits. This may or may + * not be correct for NFSv2, but since it is a legacy + * environment, I'd rather retain backwards compatibility. + */ sbp->f_bsize = (int32_t)sfp->sf_bsize; sbp->f_blocks = (int32_t)sfp->sf_blocks; sbp->f_bfree = (int32_t)sfp->sf_bfree; From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 01:56:46 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4691106566B; Thu, 19 May 2011 01:56:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D345A8FC1A; Thu, 19 May 2011 01:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4J1ukWs017585; Thu, 19 May 2011 01:56:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4J1uk84017583; Thu, 19 May 2011 01:56:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105190156.p4J1uk84017583@svn.freebsd.org> From: Rick Macklem Date: Thu, 19 May 2011 01:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222089 - stable/8/sys/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 01:56:47 -0000 Author: rmacklem Date: Thu May 19 01:56:46 2011 New Revision: 222089 URL: http://svn.freebsd.org/changeset/base/222089 Log: MFC: r221473 Modify the NFS nfssvc(2) syscall so that it allows anyone to get the statistics for the new NFS subsystem. Modified: stable/8/sys/nfs/nfs_nfssvc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/nfs/nfs_nfssvc.c ============================================================================== --- stable/8/sys/nfs/nfs_nfssvc.c Thu May 19 01:35:52 2011 (r222088) +++ stable/8/sys/nfs/nfs_nfssvc.c Thu May 19 01:56:46 2011 (r222089) @@ -81,9 +81,12 @@ nfssvc(struct thread *td, struct nfssvc_ AUDIT_ARG_CMD(uap->flag); - error = priv_check(td, PRIV_NFS_DAEMON); - if (error) - return (error); + /* Allow anyone to get the stats. */ + if ((uap->flag & ~NFSSVC_GETSTATS) != 0) { + error = priv_check(td, PRIV_NFS_DAEMON); + if (error != 0) + return (error); + } error = EINVAL; if ((uap->flag & (NFSSVC_ADDSOCK | NFSSVC_OLDNFSD | NFSSVC_NFSD)) && nfsd_call_nfsserver != NULL) From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 07:39:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 568E21065670; Thu, 19 May 2011 07:39:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53E1C8FC1C; Thu, 19 May 2011 07:39:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4J73gg0026932; Thu, 19 May 2011 07:03:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4J73gPN026930; Thu, 19 May 2011 07:03:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105190703.p4J73gPN026930@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 May 2011 07:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222091 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 07:39:27 -0000 Author: avg Date: Thu May 19 07:03:42 2011 New Revision: 222091 URL: http://svn.freebsd.org/changeset/base/222091 Log: MFC r221803,221809: dsp/pcm: allow to mmap both read and write buffers Modified: stable/8/sys/dev/sound/pcm/dsp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/8/sys/dev/sound/pcm/dsp.c Thu May 19 05:13:25 2011 (r222090) +++ stable/8/sys/dev/sound/pcm/dsp.c Thu May 19 07:03:42 2011 (r222091) @@ -34,6 +34,11 @@ #include #include +#include +#include +#include +#include + SND_DECLARE_FILE("$FreeBSD$"); static int dsp_mmap_allow_prot_exec = 0; @@ -67,6 +72,7 @@ static d_write_t dsp_write; static d_ioctl_t dsp_ioctl; static d_poll_t dsp_poll; static d_mmap_t dsp_mmap; +static d_mmap_single_t dsp_mmap_single; struct cdevsw dsp_cdevsw = { .d_version = D_VERSION, @@ -77,6 +83,7 @@ struct cdevsw dsp_cdevsw = { .d_ioctl = dsp_ioctl, .d_poll = dsp_poll, .d_mmap = dsp_mmap, + .d_mmap_single = dsp_mmap_single, .d_name = "dsp", }; @@ -2186,6 +2193,16 @@ dsp_poll(struct cdev *i_dev, int events, static int dsp_mmap(struct cdev *i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { + + /* XXX memattr is not honored */ + *paddr = vtophys(offset); + return (0); +} + +static int +dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot) +{ struct snddev_info *d; struct pcm_channel *wrch, *rdch, *c; @@ -2204,51 +2221,48 @@ dsp_mmap(struct cdev *i_dev, vm_offset_t #else if ((nprot & PROT_EXEC) && dsp_mmap_allow_prot_exec < 1) #endif - return (-1); + return (EINVAL); + + /* + * PROT_READ (alone) selects the input buffer. + * PROT_WRITE (alone) selects the output buffer. + * PROT_WRITE|PROT_READ together select the output buffer. + */ + if ((nprot & (PROT_READ | PROT_WRITE)) == 0) + return (EINVAL); d = dsp_get_info(i_dev); if (!DSP_REGISTERED(d, i_dev)) - return (-1); + return (EINVAL); PCM_GIANT_ENTER(d); getchns(i_dev, &rdch, &wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); - /* - * XXX The linux api uses the nprot to select read/write buffer - * our vm system doesn't allow this, so force write buffer. - * - * This is just a quack to fool full-duplex mmap, so that at - * least playback _or_ recording works. If you really got the - * urge to make _both_ work at the same time, avoid O_RDWR. - * Just open each direction separately and mmap() it. - * - * Failure is not an option due to INVARIANTS check within - * device_pager.c, which means, we have to give up one over - * another. - */ - c = (wrch != NULL) ? wrch : rdch; - + c = ((nprot & PROT_WRITE) != 0) ? wrch : rdch; if (c == NULL || (c->flags & CHN_F_MMAP_INVALID) || - offset >= sndbuf_getsize(c->bufsoft) || + (*offset + size) > sndbuf_getsize(c->bufsoft) || (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_EXIT(d); - return (-1); + return (EINVAL); } - /* XXX full-duplex quack. */ if (wrch != NULL) wrch->flags |= CHN_F_MMAP; if (rdch != NULL) rdch->flags |= CHN_F_MMAP; - *paddr = vtophys(sndbuf_getbufofs(c->bufsoft, offset)); + *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); + *object = vm_pager_allocate(OBJT_DEVICE, i_dev, + size, nprot, *offset, curthread->td_ucred); PCM_GIANT_LEAVE(d); + if (*object == NULL) + return (EINVAL); return (0); } From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 17:18:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE5AF106566C; Thu, 19 May 2011 17:18:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C31DA8FC14; Thu, 19 May 2011 17:18:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JHID75046369; Thu, 19 May 2011 17:18:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JHIDgT046367; Thu, 19 May 2011 17:18:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105191718.p4JHIDgT046367@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 May 2011 17:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222098 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 17:18:14 -0000 Author: yongari Date: Thu May 19 17:18:13 2011 New Revision: 222098 URL: http://svn.freebsd.org/changeset/base/222098 Log: MFC r221817: Explicitly clear 1000baseT control register for F1 PHY used in AR8132 FastEthernet controller. The PHY has no ability to establish a gigabit link. Previously only link parters which support down-shifting was able to establish link. This change should fix a long standing link establishment issue of AR8132. PR: kern/156935 Modified: stable/8/sys/dev/mii/atphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Thu May 19 15:18:35 2011 (r222097) +++ stable/8/sys/dev/mii/atphy.c Thu May 19 17:18:13 2011 (r222098) @@ -384,6 +384,7 @@ atphy_anar(struct ifmedia_entry *ife) static int atphy_setmedia(struct mii_softc *sc, int media) { + struct atphy_softc *asc; uint16_t anar; anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; @@ -396,6 +397,20 @@ atphy_setmedia(struct mii_softc *sc, int (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); + else { + /* + * AR8132 has 10/100 PHY and the PHY uses the same + * model number of F1 gigabit PHY. The PHY has no + * ability to establish gigabit link so explicitly + * disable 1000baseT configuration for the PHY. + * Otherwise, there is a case that atphy(4) could + * not establish a link against gigabit link partner + * unless the link partner supports down-shifting. + */ + asc = (struct atphy_softc *)sc; + if (asc->mii_model == MII_MODEL_ATHEROS_F1) + PHY_WRITE(sc, MII_100T2CR, 0); + } PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); return (EJUSTRETURN); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 17:24:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DF5B1065675; Thu, 19 May 2011 17:24:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3BE8FC21; Thu, 19 May 2011 17:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4JHOs5q046710; Thu, 19 May 2011 17:24:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4JHOsmg046708; Thu, 19 May 2011 17:24:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105191724.p4JHOsmg046708@svn.freebsd.org> From: Xin LI Date: Thu, 19 May 2011 17:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222101 - stable/8/sys/dev/coretemp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 17:24:54 -0000 Author: delphij Date: Thu May 19 17:24:53 2011 New Revision: 222101 URL: http://svn.freebsd.org/changeset/base/222101 Log: MFC r221509: Detect and set Atom's Tj(max) to 90 if it's not the 45nm D400/D500/N400 series. Modified: stable/8/sys/dev/coretemp/coretemp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/coretemp/coretemp.c ============================================================================== --- stable/8/sys/dev/coretemp/coretemp.c Thu May 19 17:22:48 2011 (r222100) +++ stable/8/sys/dev/coretemp/coretemp.c Thu May 19 17:24:53 2011 (r222101) @@ -197,6 +197,15 @@ coretemp_attach(device_t dev) default: /* Unknown stepping */ break; } + } else if (cpu_model == 0x1c) { + switch (cpu_stepping) { + case 0xa: /* 45nm Atom D400, N400 and D500 series */ + sc->sc_tjmax = 100; + break; + default: + sc->sc_tjmax = 90; + break; + } } else { /* * Attempt to get Tj(max) from MSR IA32_TEMPERATURE_TARGET. From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 20:59:16 2011 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 182CC106566C; Thu, 19 May 2011 20:59:16 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 990C48FC12; Thu, 19 May 2011 20:59:15 +0000 (UTC) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p4JItx1G019379; Fri, 20 May 2011 04:55:59 +1000 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p4JIttFB025074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 May 2011 04:55:56 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p4JIttRw075134; Fri, 20 May 2011 04:55:55 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p4JItsVr075133; Fri, 20 May 2011 04:55:54 +1000 (EST) (envelope-from peter) Date: Fri, 20 May 2011 04:55:54 +1000 From: Peter Jeremy To: Rick Macklem Message-ID: <20110519185554.GA75039@server.vk2pj.dyndns.org> References: <201105180214.p4I2EQar056652@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <201105180214.p4I2EQar056652@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r222048 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 20:59:16 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-May-18 02:14:26 +0000, Rick Macklem wrote: >Author: rmacklem >Date: Wed May 18 02:14:26 2011 >New Revision: 222048 >URL: http://svn.freebsd.org/changeset/base/222048 > >Log: > MFC: r221462 > Add a comment noting that the NFS code assumes that the > values of error numbers in sys/errno.h will be the same > as the ones specified by the NFS RFCs and that the code > needs to be fixed if error numbers are changed in sys/errno.h. > >Modified: > stable/8/sys/fs/nfs/nfsproto.h >Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) Picking a commit at random, I notice that lots of -stable commits include property changes to apparently unrelated parts of the tree. Is this intentional? ViewVC doesn't seem to let me view the actual properties. --=20 Peter Jeremy --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk3VZ7oACgkQ/opHv/APuIcZJQCgu3cI+g4TLrY3VLOBcqIfOUXy RHoAn1ydt9/2+Xo30h7UmTn9CfpLk4Xr =FeVl -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e-- From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 21:05:12 2011 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 72D7F1065690; Thu, 19 May 2011 21:05:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 7DF1D162BEA; Thu, 19 May 2011 21:04:48 +0000 (UTC) Message-ID: <4DD585EF.1090704@FreeBSD.org> Date: Thu, 19 May 2011 14:04:47 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Peter Jeremy References: <201105180214.p4I2EQar056652@svn.freebsd.org> <20110519185554.GA75039@server.vk2pj.dyndns.org> In-Reply-To: <20110519185554.GA75039@server.vk2pj.dyndns.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn commit: r222048 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 21:05:12 -0000 On 5/19/2011 11:55 AM, Peter Jeremy wrote: > On 2011-May-18 02:14:26 +0000, Rick Macklem wrote: >> Author: rmacklem >> Date: Wed May 18 02:14:26 2011 >> New Revision: 222048 >> URL: http://svn.freebsd.org/changeset/base/222048 >> >> Log: >> MFC: r221462 >> Add a comment noting that the NFS code assumes that the >> values of error numbers in sys/errno.h will be the same >> as the ones specified by the NFS RFCs and that the code >> needs to be fixed if error numbers are changed in sys/errno.h. >> >> Modified: >> stable/8/sys/fs/nfs/nfsproto.h >> Directory Properties: >> stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) >> stable/8/sys/contrib/pf/ (props changed) > > Picking a commit at random, I notice that lots of -stable commits > include property changes to apparently unrelated parts of the tree. > Is this intentional? ViewVC doesn't seem to let me view the actual > properties. This happens because people do merges at improper locations in the tree, then when people come along and do it right (as Rick seems to have done here) svn helpfully updates the mergeinfo on files/directories that have it below where it is supposed to be. Some of us periodically go through and fix this, but it would be very helpful if people would stop breaking it. :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-stable-8@FreeBSD.ORG Thu May 19 21:30:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4D491065670; Thu, 19 May 2011 21:30:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4D48FC1D; Thu, 19 May 2011 21:30:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 15DA946B09; Thu, 19 May 2011 17:30:03 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9CC178A050; Thu, 19 May 2011 17:30:02 -0400 (EDT) From: John Baldwin To: Doug Barton Date: Thu, 19 May 2011 17:30:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201105180214.p4I2EQar056652@svn.freebsd.org> <20110519185554.GA75039@server.vk2pj.dyndns.org> <4DD585EF.1090704@FreeBSD.org> In-Reply-To: <4DD585EF.1090704@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105191730.02157.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 19 May 2011 17:30:02 -0400 (EDT) Cc: src-committers@freebsd.org, Peter Jeremy , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org, Rick Macklem Subject: Re: svn commit: r222048 - stable/8/sys/fs/nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 21:30:04 -0000 On Thursday, May 19, 2011 5:04:47 pm Doug Barton wrote: > On 5/19/2011 11:55 AM, Peter Jeremy wrote: > > On 2011-May-18 02:14:26 +0000, Rick Macklem wrote: > >> Author: rmacklem > >> Date: Wed May 18 02:14:26 2011 > >> New Revision: 222048 > >> URL: http://svn.freebsd.org/changeset/base/222048 > >> > >> Log: > >> MFC: r221462 > >> Add a comment noting that the NFS code assumes that the > >> values of error numbers in sys/errno.h will be the same > >> as the ones specified by the NFS RFCs and that the code > >> needs to be fixed if error numbers are changed in sys/errno.h. > >> > >> Modified: > >> stable/8/sys/fs/nfs/nfsproto.h > >> Directory Properties: > >> stable/8/sys/ (props changed) > >> stable/8/sys/amd64/include/xen/ (props changed) > >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) > >> stable/8/sys/contrib/dev/acpica/ (props changed) > >> stable/8/sys/contrib/pf/ (props changed) > > > > Picking a commit at random, I notice that lots of -stable commits > > include property changes to apparently unrelated parts of the tree. > > Is this intentional? ViewVC doesn't seem to let me view the actual > > properties. > > This happens because people do merges at improper locations in the tree, > then when people come along and do it right (as Rick seems to have done > here) svn helpfully updates the mergeinfo on files/directories that have > it below where it is supposed to be. > > Some of us periodically go through and fix this, but it would be very > helpful if people would stop breaking it. :) No, these are all legitimate (or mostly so). The opensolaris, acpica, and pf nodes all have mergeinfo due to merges from the vendor area. amd64/include/xen is possibly dubious. If we are never going to do a future merge from i386/include/xen to amd64/include/xen then we can just remove that mergeinfo. -- John Baldwin From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 00:51:52 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 841CA106566B; Fri, 20 May 2011 00:51:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 729FA8FC15; Fri, 20 May 2011 00:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4K0pqUr060104; Fri, 20 May 2011 00:51:52 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4K0pqxg060102; Fri, 20 May 2011 00:51:52 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105200051.p4K0pqxg060102@svn.freebsd.org> From: Rick Macklem Date: Fri, 20 May 2011 00:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222109 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 00:51:52 -0000 Author: rmacklem Date: Fri May 20 00:51:52 2011 New Revision: 222109 URL: http://svn.freebsd.org/changeset/base/222109 Log: MFC: r221517 Change the new NFS server so that it returns 0 when the f_bavail or f_ffree fields of "struct statfs" are negative, since the values that go on the wire are unsigned and will appear to be very large positive values otherwise. This makes the handling of a negative f_bavail compatible with the old/regular NFS server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Thu May 19 23:18:42 2011 (r222108) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri May 20 00:51:52 2011 (r222109) @@ -1277,8 +1277,23 @@ nfsvno_fsync(struct vnode *vp, u_int64_t int nfsvno_statfs(struct vnode *vp, struct statfs *sf) { + int error; - return (VFS_STATFS(vp->v_mount, sf)); + error = VFS_STATFS(vp->v_mount, sf); + if (error == 0) { + /* + * Since NFS handles these values as unsigned on the + * wire, there is no way to represent negative values, + * so set them to 0. Without this, they will appear + * to be very large positive values for clients like + * Solaris10. + */ + if (sf->f_bavail < 0) + sf->f_bavail = 0; + if (sf->f_ffree < 0) + sf->f_ffree = 0; + } + return (error); } /* From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 01:04:34 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F133106564A; Fri, 20 May 2011 01:04:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1DE78FC0A; Fri, 20 May 2011 01:04:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4K14XQ8060521; Fri, 20 May 2011 01:04:33 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4K14XK3060519; Fri, 20 May 2011 01:04:33 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105200104.p4K14XK3060519@svn.freebsd.org> From: Rick Macklem Date: Fri, 20 May 2011 01:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222110 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 01:04:34 -0000 Author: rmacklem Date: Fri May 20 01:04:33 2011 New Revision: 222110 URL: http://svn.freebsd.org/changeset/base/222110 Log: MFC: r221537 Set the initial value of maxfilesize to OFF_MAX in the new NFS client. It will then be reduced to whatever the server says it can support. There might be an argument that this could be one block larger, but since NFS is a byte granular system, I chose not to do that. Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Fri May 20 00:51:52 2011 (r222109) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Fri May 20 01:04:33 2011 (r222110) @@ -1218,7 +1218,7 @@ mountnfs(struct nfs_args *argp, struct m if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) nmp->nm_maxfilesize = 0xffffffffLL; else - nmp->nm_maxfilesize = (u_int64_t)0x80000000 * DEV_BSIZE - 1; + nmp->nm_maxfilesize = OFF_MAX; nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 07:51:47 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A1071065670; Fri, 20 May 2011 07:51:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED29E8FC0C; Fri, 20 May 2011 07:51:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4K7pkNO072553; Fri, 20 May 2011 07:51:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4K7pk5M072551; Fri, 20 May 2011 07:51:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201105200751.p4K7pk5M072551@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 20 May 2011 07:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222114 - stable/8/sys/dev/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 07:51:47 -0000 Author: hselasky Date: Fri May 20 07:51:46 2011 New Revision: 222114 URL: http://svn.freebsd.org/changeset/base/222114 Log: MFC r221883 and r221605. Add new USB ID's. Modified: stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Fri May 20 06:49:43 2011 (r222113) +++ stable/8/sys/dev/usb/usbdevs Fri May 20 07:51:46 2011 (r222114) @@ -627,6 +627,7 @@ vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline vendor SPARKLAN 0x15a9 SparkLAN +vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems @@ -1563,6 +1564,7 @@ product FALCOM TWIST 0x0001 USB GSM/GPR /* FEIYA products */ product FEIYA 5IN1 0x1132 5-in-1 Card Reader +product FEIYA AC110 0x6300 AC-110 Card Reader /* Fiberline */ product FIBERLINE WL430U 0x6003 WL-430U @@ -3126,6 +3128,10 @@ product SPARKLAN RT2573 0x0004 RT2573 product SPARKLAN RT2870_1 0x0006 RT2870 product SPARKLAN RT3070 0x0010 RT3070 +/* Soundgraph products */ +product SOUNDGRAPH IMON_VFD 0x0044 Antec Veris Elite VFD Panel, Knob, and Remote +product SOUNDGRAPH SSTONE_LC16 0xffdc Silverstone LC16 VFD Panel, Knob, and Remote + /* Speed Dragon Multimedia products */ product SPEEDDRAGON MS3303H 0x110b MS3303H Serial From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 12:40:31 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B581F1065670; Fri, 20 May 2011 12:40:31 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1818FC0C; Fri, 20 May 2011 12:40:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KCeVOR084342; Fri, 20 May 2011 12:40:31 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KCeVEq084340; Fri, 20 May 2011 12:40:31 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105201240.p4KCeVEq084340@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 20 May 2011 12:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222123 - stable/8/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 12:40:31 -0000 Author: pluknet Date: Fri May 20 12:40:31 2011 New Revision: 222123 URL: http://svn.freebsd.org/changeset/base/222123 Log: MFC r222013: Add missing section number for .Xr jail. Modified: stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Fri May 20 11:29:09 2011 (r222122) +++ stable/8/share/man/man5/rc.conf.5 Fri May 20 12:40:31 2011 (r222123) @@ -3605,7 +3605,7 @@ Set to .Dq Li -l -U root by default. These are flags to pass to -.Xr jail . +.Xr jail 8 . .It Va jail_ Ns Ao Ar jname Ac Ns Va _interface .Pq Vt str Unset by default. From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 12:48:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4590106564A; Fri, 20 May 2011 12:48:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31468FC13; Fri, 20 May 2011 12:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KCmdlw084680; Fri, 20 May 2011 12:48:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KCmdKW084678; Fri, 20 May 2011 12:48:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105201248.p4KCmdKW084678@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 May 2011 12:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222125 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 12:48:40 -0000 Author: jilles Date: Fri May 20 12:48:39 2011 New Revision: 222125 URL: http://svn.freebsd.org/changeset/base/222125 Log: MFC r220740: ktrace: Log the code for all signals (PSIG events). The code provides information on how the signal was generated. Formerly, the code was only logged for traps, much like only signal handlers for traps received a meaningful si_code before FreeBSD 7.0. In rare cases, no information is available and 0 is still logged. Modified: stable/8/sys/kern/kern_sig.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Fri May 20 12:41:33 2011 (r222124) +++ stable/8/sys/kern/kern_sig.c Fri May 20 12:48:39 2011 (r222125) @@ -1290,7 +1290,7 @@ out: mtx_lock(&ps->ps_mtx); action = ps->ps_sigact[_SIG_IDX(sig)]; mtx_unlock(&ps->ps_mtx); - ktrpsig(sig, action, &td->td_sigmask, 0); + ktrpsig(sig, action, &td->td_sigmask, ksi->ksi_code); } #endif if (sig == SIGKILL) @@ -2750,7 +2750,7 @@ postsig(sig) #ifdef KTRACE if (KTRPOINT(td, KTR_PSIG)) ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? - &td->td_oldsigmask : &td->td_sigmask, 0); + &td->td_oldsigmask : &td->td_sigmask, ksi.ksi_code); #endif if (p->p_stops & S_SIG) { mtx_unlock(&ps->ps_mtx); From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 12:52:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B2AF1065672; Fri, 20 May 2011 12:52:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4D08FC24; Fri, 20 May 2011 12:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KCq8VW084814; Fri, 20 May 2011 12:52:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KCq8NZ084812; Fri, 20 May 2011 12:52:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105201252.p4KCq8NZ084812@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 May 2011 12:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222126 - stable/8/usr.bin/kdump X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 12:52:08 -0000 Author: jilles Date: Fri May 20 12:52:08 2011 New Revision: 222126 URL: http://svn.freebsd.org/changeset/base/222126 Log: MFC r220756: kdump: Show code for signals with default action. This information is available as of kernel r222125. Trace files from older kernels will always have 0. Modified: stable/8/usr.bin/kdump/kdump.c Directory Properties: stable/8/usr.bin/kdump/ (props changed) Modified: stable/8/usr.bin/kdump/kdump.c ============================================================================== --- stable/8/usr.bin/kdump/kdump.c Fri May 20 12:48:39 2011 (r222125) +++ stable/8/usr.bin/kdump/kdump.c Fri May 20 12:52:08 2011 (r222126) @@ -1138,7 +1138,7 @@ ktrpsig(struct ktr_psig *psig) else (void)printf("SIG %d ", psig->signo); if (psig->action == SIG_DFL) - (void)printf("SIG_DFL\n"); + (void)printf("SIG_DFL code=0x%x\n", psig->code); else { (void)printf("caught handler=0x%lx mask=0x%x code=0x%x\n", (u_long)psig->action, psig->mask.__bits[0], psig->code); From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 17:29:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9706C1065673; Fri, 20 May 2011 17:29:03 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86B7D8FC1B; Fri, 20 May 2011 17:29:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHT35Y093853; Fri, 20 May 2011 17:29:03 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHT3Hv093851; Fri, 20 May 2011 17:29:03 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201105201729.p4KHT3Hv093851@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 20 May 2011 17:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222138 - stable/8/sbin/hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:29:03 -0000 Author: trociny Date: Fri May 20 17:29:03 2011 New Revision: 222138 URL: http://svn.freebsd.org/changeset/base/222138 Log: MFC r221632, r221643: r221632: Fix isitme(), which is used to check if node-specific configuration belongs to our node, and was returning false positive if the first part of a node name matches short hostname. r221643 (pjd): Allow to specify remote as 'none' again which was broken by r219351, where 'none' was defined as a value for checksum. Reported by: trasz Approved by: pjd (mentor) Modified: stable/8/sbin/hastd/parse.y Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Fri May 20 17:28:00 2011 (r222137) +++ stable/8/sbin/hastd/parse.y Fri May 20 17:29:03 2011 (r222138) @@ -92,8 +92,10 @@ isitme(const char *name) * Now check if it matches first part of the host name. */ pos = strchr(buf, '.'); - if (pos != NULL && pos != buf && strncmp(buf, name, pos - buf) == 0) + if (pos != NULL && (size_t)(pos - buf) == strlen(name) && + strncmp(buf, name, pos - buf) == 0) { return (1); + } /* * At the end check if name is equal to our host's UUID. @@ -287,6 +289,7 @@ yy_config_free(struct hastd_config *conf %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB +%type remote_str %type replication_type %type checksum_type %type compression_type @@ -794,7 +797,7 @@ resource_node_entry: source_statement ; -remote_statement: REMOTE STR +remote_statement: REMOTE remote_str { assert(depth == 2); if (mynode) { @@ -811,6 +814,12 @@ remote_statement: REMOTE STR } ; +remote_str: + NONE { $$ = strdup("none"); } + | + STR { } + ; + source_statement: SOURCE STR { assert(depth == 2); From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 17:40:22 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8A11065673; Fri, 20 May 2011 17:40:22 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34B098FC14; Fri, 20 May 2011 17:40:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHeMZT094271; Fri, 20 May 2011 17:40:22 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHeMKQ094267; Fri, 20 May 2011 17:40:22 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105201740.p4KHeMKQ094267@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 20 May 2011 17:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222140 - in stable/8/sys/dev: pci usb/controller X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:40:22 -0000 Author: ru Date: Fri May 20 17:40:21 2011 New Revision: 222140 URL: http://svn.freebsd.org/changeset/base/222140 Log: MFC r222018: Renamed PCI_INTERFACE_XHCI to PCIP_SERIALBUS_USB_XHCI and moved it to . Modified: stable/8/sys/dev/pci/pcireg.h stable/8/sys/dev/usb/controller/xhci_pci.c stable/8/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/pci/pcireg.h ============================================================================== --- stable/8/sys/dev/pci/pcireg.h Fri May 20 17:35:10 2011 (r222139) +++ stable/8/sys/dev/pci/pcireg.h Fri May 20 17:40:21 2011 (r222140) @@ -367,6 +367,7 @@ #define PCIP_SERIALBUS_USB_UHCI 0x00 #define PCIP_SERIALBUS_USB_OHCI 0x10 #define PCIP_SERIALBUS_USB_EHCI 0x20 +#define PCIP_SERIALBUS_USB_XHCI 0x30 #define PCIP_SERIALBUS_USB_DEVICE 0xfe #define PCIS_SERIALBUS_FC 0x04 #define PCIS_SERIALBUS_SMBUS 0x05 Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:35:10 2011 (r222139) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Fri May 20 17:40:21 2011 (r222140) @@ -137,7 +137,7 @@ xhci_pci_match(device_t self) { if ((pci_get_class(self) == PCIC_SERIALBUS) && (pci_get_subclass(self) == PCIS_SERIALBUS_USB) - && (pci_get_progif(self) == PCI_INTERFACE_XHCI)) { + && (pci_get_progif(self) == PCIP_SERIALBUS_USB_XHCI)) { return ("XHCI (generic) USB 3.0 controller"); } return (NULL); /* dunno */ Modified: stable/8/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhcireg.h Fri May 20 17:35:10 2011 (r222139) +++ stable/8/sys/dev/usb/controller/xhcireg.h Fri May 20 17:40:21 2011 (r222140) @@ -33,7 +33,6 @@ #define PCI_XHCI_USBREV 0x60 /* RO USB protocol revision */ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ -#define PCI_INTERFACE_XHCI 0x30 /* USB 3.0 - XHCI */ /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 17:43:38 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AFB106564A; Fri, 20 May 2011 17:43:38 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A76298FC1D; Fri, 20 May 2011 17:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KHhcLQ094403; Fri, 20 May 2011 17:43:38 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KHhcS7094401; Fri, 20 May 2011 17:43:38 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105201743.p4KHhcS7094401@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 20 May 2011 17:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222141 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 17:43:38 -0000 Author: ru Date: Fri May 20 17:43:38 2011 New Revision: 222141 URL: http://svn.freebsd.org/changeset/base/222141 Log: MFC: r222019: Document the supported hardware, somewhat. Modified: stable/8/share/man/man4/xhci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/xhci.4 ============================================================================== --- stable/8/share/man/man4/xhci.4 Fri May 20 17:40:21 2011 (r222140) +++ stable/8/share/man/man4/xhci.4 Fri May 20 17:43:38 2011 (r222141) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 24, 2011 +.Dd May 17, 2011 .Dt XHCI 4 .Os .Sh NAME @@ -49,6 +49,13 @@ The controller supports .Tn USB connection speeds up to 5.0Gbps when using a USB 3.0 compliant device. +.Sh HARDWARE +The +.Nm +driver supports +.Tn XHCI +compatible controllers having PCI class 12 (serial bus), +subclass 3 (USB) and programming interface 48 (XHCI). .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 20:26:16 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C3E106566C; Fri, 20 May 2011 20:26:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16DC8FC14; Fri, 20 May 2011 20:26:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KKQGio099303; Fri, 20 May 2011 20:26:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KKQGR6099300; Fri, 20 May 2011 20:26:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105202026.p4KKQGR6099300@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 20 May 2011 20:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222144 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 20:26:16 -0000 Author: yongari Date: Fri May 20 20:26:16 2011 New Revision: 222144 URL: http://svn.freebsd.org/changeset/base/222144 Log: MFC r221445: Add initial BCM57765 family support. The BCM57765 family seems to have similar hardware features of BCM5718 family except the number of receive return ring is 4. The BCM57765 family is known to support IEEE 802.3az EEE(Energy Efficient Ethernet) but this change does not include EEE support code. I hope EEE is implemented in near future. This change will support BCM57761, BCM57765, BCM57781, BCM57785, BCM57791 and BCM57795. All hardware offloading features are supported and suspend/resume also should work. Many thanks to Broadcom for continuing support of FreeBSD. Tested by: Paul Thornton (prt <> prt dot org) HW donated by: Broadcom Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri May 20 19:12:20 2011 (r222143) +++ stable/8/sys/dev/bge/if_bge.c Fri May 20 20:26:16 2011 (r222144) @@ -214,9 +214,15 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5906 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57765 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57781 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57785 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57788 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57790 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57791 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57795 }, { SK_VENDORID, SK_DEVICEID_ALTIMA }, @@ -307,6 +313,8 @@ static const struct bge_revision { { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, { BGE_CHIPID_BCM5906_A2, "BCM5906 A2" }, + { BGE_CHIPID_BCM57765_A0, "BCM57765 A0" }, + { BGE_CHIPID_BCM57765_B0, "BCM57765 B0" }, { BGE_CHIPID_BCM57780_A0, "BCM57780 A0" }, { BGE_CHIPID_BCM57780_A1, "BCM57780 A1" }, @@ -335,6 +343,7 @@ static const struct bge_revision const b /* 5754 and 5787 share the same ASIC ID */ { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, + { BGE_ASICREV_BCM57765, "unknown BCM57765" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, @@ -1467,8 +1476,11 @@ bge_chipinit(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5703 || sc->bge_asicrev == BGE_ASICREV_BCM5704) dma_rw_ctl &= ~BGE_PCIDMARWCTL_MINDMA; - if (BGE_IS_5717_PLUS(sc)) + if (BGE_IS_5717_PLUS(sc)) { dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; + if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0) + dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK; + } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); /* @@ -1552,7 +1564,8 @@ bge_blockinit(struct bge_softc *sc) } /* Configure mbuf pool watermarks */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM57765) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); if (sc->bge_ifp->if_mtu > ETHERMTU) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e); @@ -1819,7 +1832,8 @@ bge_blockinit(struct bge_softc *sc) limit = 16; } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; - else if (sc->bge_asicrev == BGE_ASICREV_BCM5755) + else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM57765) limit = 4; else limit = 1; @@ -2180,6 +2194,15 @@ bge_probe(device_t dev) id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; + case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57781: + case BCOM_DEVICEID_BCM57785: + case BCOM_DEVICEID_BCM57791: + case BCOM_DEVICEID_BCM57795: + id = pci_read_config(dev, + BGE_PCI_GEN15_PRODID_ASICREV, 4); + break; default: id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); @@ -2694,6 +2717,15 @@ bge_attach(device_t dev) sc->bge_chipid = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; + case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57781: + case BCOM_DEVICEID_BCM57785: + case BCOM_DEVICEID_BCM57791: + case BCOM_DEVICEID_BCM57795: + sc->bge_chipid = pci_read_config(dev, + BGE_PCI_GEN15_PRODID_ASICREV, 4); + break; default: sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); @@ -2750,9 +2782,11 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5717: + sc->bge_flags |= BGE_FLAG_SHORT_DMA_BUG; + case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | - BGE_FLAG_SHORT_DMA_BUG | BGE_FLAG_JUMBO_FRAME; + BGE_FLAG_JUMBO_FRAME; break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: @@ -2801,6 +2835,7 @@ bge_attach(device_t dev) sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_asicrev != BGE_ASICREV_BCM5717 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && + sc->bge_asicrev != BGE_ASICREV_BCM57765 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || @@ -3466,6 +3501,9 @@ bge_reset(struct bge_softc *sc) device_printf(dev, "firmware handshake timed out, found 0x%08x\n", val); + /* BCM57765 A0 needs additional time before accessing. */ + if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0) + DELAY(10 * 1000); /* XXX */ } /* @@ -3506,7 +3544,7 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && + !BGE_IS_5717_PLUS(sc) && sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && sc->bge_asicrev != BGE_ASICREV_BCM5785) { /* Enable Data FIFO protection. */ @@ -4739,7 +4777,10 @@ bge_init_locked(struct bge_softc *sc) * this number of frames, it will drop subsequent incoming * frames until the MBUF High Watermark is reached. */ - CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2); + if (sc->bge_asicrev == BGE_ASICREV_BCM57765) + CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 1); + else + CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2); /* Clear MAC statistics. */ if (BGE_IS_5705_PLUS(sc)) Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Fri May 20 19:12:20 2011 (r222143) +++ stable/8/sys/dev/bge/if_bgereg.h Fri May 20 20:26:16 2011 (r222144) @@ -223,6 +223,7 @@ #define BGE_PCI_ISR_MBX_LO 0xB4 #define BGE_PCI_PRODID_ASICREV 0xBC #define BGE_PCI_GEN2_PRODID_ASICREV 0xF4 +#define BGE_PCI_GEN15_PRODID_ASICREV 0xFC /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -318,6 +319,8 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM57765_A0 0x57785000 +#define BGE_CHIPID_BCM57765_B0 0x57785100 /* shorthand one */ #define BGE_ASICREV(x) ((x) >> 12) @@ -342,6 +345,7 @@ #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 +#define BGE_ASICREV_BCM57765 0x57785 #define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ @@ -381,6 +385,8 @@ #define BGE_PCIDMARWCTL_RD_CMD_SHIFT(x) ((x) << 24) #define BGE_PCIDMARWCTL_WR_CMD_SHIFT(x) ((x) << 28) +#define BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK 0x00000380 + #define BGE_PCI_READ_BNDRY_DISABLE 0x00000000 #define BGE_PCI_READ_BNDRY_16BYTES 0x00000100 #define BGE_PCI_READ_BNDRY_32BYTES 0x00000200 @@ -2298,9 +2304,15 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5906 0x1712 #define BCOM_DEVICEID_BCM5906M 0x1713 #define BCOM_DEVICEID_BCM57760 0x1690 +#define BCOM_DEVICEID_BCM57761 0x16B0 +#define BCOM_DEVICEID_BCM57765 0x16B4 #define BCOM_DEVICEID_BCM57780 0x1692 +#define BCOM_DEVICEID_BCM57781 0x16B1 +#define BCOM_DEVICEID_BCM57785 0x16B5 #define BCOM_DEVICEID_BCM57788 0x1691 #define BCOM_DEVICEID_BCM57790 0x1694 +#define BCOM_DEVICEID_BCM57791 0x16B2 +#define BCOM_DEVICEID_BCM57795 0x16B6 /* * Alteon AceNIC PCI vendor/device ID. From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 20:29:50 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E86E51065672; Fri, 20 May 2011 20:29:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD2B08FC12; Fri, 20 May 2011 20:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KKTo9q099486; Fri, 20 May 2011 20:29:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KKTomn099482; Fri, 20 May 2011 20:29:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105202029.p4KKTomn099482@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 20 May 2011 20:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222146 - in stable/8/sys/dev: bge mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 20:29:51 -0000 Author: yongari Date: Fri May 20 20:29:50 2011 New Revision: 222146 URL: http://svn.freebsd.org/changeset/base/222146 Log: MFC r221468: Enable Ethernet@WireSpeed for BCM5718/BCM57765 family. While I'm here inverse meaning of PHY flag as Ethernet@WireSpeed is enabled for most PHYs. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h stable/8/sys/dev/mii/brgphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri May 20 20:27:25 2011 (r222145) +++ stable/8/sys/dev/bge/if_bge.c Fri May 20 20:29:50 2011 (r222146) @@ -2769,12 +2769,12 @@ bge_attach(device_t dev) * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the * 5705 A0 and A1 chips. */ - if (sc->bge_asicrev != BGE_ASICREV_BCM5700 && - sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1 && - !BGE_IS_5717_PLUS(sc)) - sc->bge_phy_flags |= BGE_PHY_WIRESPEED; + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 || + (sc->bge_asicrev == BGE_ASICREV_BCM5705 && + (sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && + sc->bge_chipid != BGE_CHIPID_BCM5705_A1)) || + sc->bge_asicrev == BGE_ASICREV_BCM5906) + sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; if (bge_has_eaddr(sc)) sc->bge_flags |= BGE_FLAG_EADDR; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Fri May 20 20:27:25 2011 (r222145) +++ stable/8/sys/dev/bge/if_bgereg.h Fri May 20 20:29:50 2011 (r222146) @@ -2783,7 +2783,7 @@ struct bge_softc { #define BGE_FLAG_RX_ALIGNBUG 0x04000000 #define BGE_FLAG_SHORT_DMA_BUG 0x08000000 uint32_t bge_phy_flags; -#define BGE_PHY_WIRESPEED 0x00000001 +#define BGE_PHY_NO_WIRESPEED 0x00000001 #define BGE_PHY_ADC_BUG 0x00000002 #define BGE_PHY_5704_A0_BUG 0x00000004 #define BGE_PHY_JITTER_BUG 0x00000008 Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Fri May 20 20:27:25 2011 (r222145) +++ stable/8/sys/dev/mii/brgphy.c Fri May 20 20:29:50 2011 (r222146) @@ -970,7 +970,7 @@ brgphy_reset(struct mii_softc *sc) brgphy_jumbo_settings(sc, ifp->if_mtu); - if (bge_sc->bge_phy_flags & BGE_PHY_WIRESPEED) + if ((bge_sc->bge_phy_flags & BGE_PHY_NO_WIRESPEED) == 0) brgphy_ethernet_wirespeed(sc); /* Enable Link LED on Dell boxes */ From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 22:09:40 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AED491065672; Fri, 20 May 2011 22:09:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBA38FC08; Fri, 20 May 2011 22:09:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KM9eJa002663; Fri, 20 May 2011 22:09:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KM9evD002661; Fri, 20 May 2011 22:09:40 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105202209.p4KM9evD002661@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 20 May 2011 22:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222148 - stable/8/sys/x86/cpufreq X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:09:40 -0000 Author: jkim Date: Fri May 20 22:09:40 2011 New Revision: 222148 URL: http://svn.freebsd.org/changeset/base/222148 Log: MFC: r221102 Use ACPI-supplied CPU frequencies instead of estimated ones. Modified: stable/8/sys/x86/cpufreq/powernow.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/x86/cpufreq/powernow.c ============================================================================== --- stable/8/sys/x86/cpufreq/powernow.c Fri May 20 20:31:36 2011 (r222147) +++ stable/8/sys/x86/cpufreq/powernow.c Fri May 20 22:09:40 2011 (r222148) @@ -801,15 +801,13 @@ pn_decode_acpi(device_t dev, device_t pe if ((sc->errata & A0_ERRATA) && (pn7_fid_to_mult[state.fid] % 10) == 5) continue; - state.freq = 100 * pn7_fid_to_mult[state.fid] * sc->fsb; break; case PN8_TYPE: state.fid = ACPI_PN8_CTRL_TO_FID(ctrl); state.vid = ACPI_PN8_CTRL_TO_VID(ctrl); - state.freq = 100 * pn8_fid_to_mult[state.fid] * sc->fsb; break; } - + state.freq = sets[i].freq * 1000; state.power = sets[i].power; j = n; @@ -841,6 +839,7 @@ pn_decode_acpi(device_t dev, device_t pe device_printf(dev, "ACPI MAX frequency not found\n"); return (EINVAL); } + sc->fsb = state.freq / 100 / pn7_fid_to_mult[state.fid]; break; case PN8_TYPE: sc->vst = ACPI_PN8_CTRL_TO_VST(ctrl), @@ -856,6 +855,7 @@ pn_decode_acpi(device_t dev, device_t pe if (sc->powernow_max_states >= 2 && (sc->powernow_states[sc->powernow_max_states - 2].fid < 8)) return (EINVAL); + sc->fsb = state.freq / 100 / pn8_fid_to_mult[state.fid]; break; } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 22:22:56 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF54A1065672; Fri, 20 May 2011 22:22:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 952848FC0A; Fri, 20 May 2011 22:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KMMuGd003168; Fri, 20 May 2011 22:22:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KMMuqT003163; Fri, 20 May 2011 22:22:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105202222.p4KMMuqT003163@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 20 May 2011 22:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222150 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:22:56 -0000 Author: jkim Date: Fri May 20 22:22:56 2011 New Revision: 222150 URL: http://svn.freebsd.org/changeset/base/222150 Log: MFC: r221188 Define "Hypervisor Present" bit. This bit is used by several hypervisors to identify CPUs running under emulation. Modified: stable/8/sys/amd64/amd64/identcpu.c stable/8/sys/amd64/include/specialreg.h stable/8/sys/i386/i386/identcpu.c stable/8/sys/i386/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/identcpu.c Fri May 20 22:20:23 2011 (r222149) +++ stable/8/sys/amd64/amd64/identcpu.c Fri May 20 22:22:56 2011 (r222150) @@ -292,7 +292,7 @@ printcpuinfo(void) "\035" "\036" "\037" - "\040" + "\040HV" /* Hypervisor */ ); } Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Fri May 20 22:20:23 2011 (r222149) +++ stable/8/sys/amd64/include/specialreg.h Fri May 20 22:22:56 2011 (r222150) @@ -134,6 +134,7 @@ #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_HV 0x80000000 /* * Important bits in the Thermal and Power Management flags Modified: stable/8/sys/i386/i386/identcpu.c ============================================================================== --- stable/8/sys/i386/i386/identcpu.c Fri May 20 22:20:23 2011 (r222149) +++ stable/8/sys/i386/i386/identcpu.c Fri May 20 22:22:56 2011 (r222150) @@ -756,7 +756,7 @@ printcpuinfo(void) "\035" "\036" "\037" - "\040" + "\040HV" /* Hypervisor */ ); } Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Fri May 20 22:20:23 2011 (r222149) +++ stable/8/sys/i386/include/specialreg.h Fri May 20 22:22:56 2011 (r222150) @@ -131,6 +131,7 @@ #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_HV 0x80000000 /* * Important bits in the Thermal and Power Management flags From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 22:30:52 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3DA3106564A; Fri, 20 May 2011 22:30:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 45E328FC18; Fri, 20 May 2011 22:30:51 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4KMUmTa083605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 May 2011 01:30:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4KMUmIq017437; Sat, 21 May 2011 01:30:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4KMUmeE017436; Sat, 21 May 2011 01:30:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 May 2011 01:30:48 +0300 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20110520223048.GI48734@deviant.kiev.zoral.com.ua> References: <201105202222.p4KMMuqT003163@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VJJHO1/Syn9XC8G0" Content-Disposition: inline In-Reply-To: <201105202222.p4KMMuqT003163@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r222150 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:30:52 -0000 --VJJHO1/Syn9XC8G0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 20, 2011 at 10:22:56PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Fri May 20 22:22:56 2011 > New Revision: 222150 > URL: http://svn.freebsd.org/changeset/base/222150 >=20 > Log: > MFC: r221188 > =20 > Define "Hypervisor Present" bit. This bit is used by several hyperviso= rs to > identify CPUs running under emulation. In the latest revision of the Software Developer's Manual, Intel stated that bit 31 is always 0 for the real CPUs. So it is as much official as it can be. --VJJHO1/Syn9XC8G0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3W65gACgkQC3+MBN1Mb4hCVACgsCS8MK4yVqSieq51OsbJsk4O wDQAnRwbLWekMIo5WZwFB4RHzqQwIvf/ =/xlR -----END PGP SIGNATURE----- --VJJHO1/Syn9XC8G0-- From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 22:38:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F931065678; Fri, 20 May 2011 22:38:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1492A8FC16; Fri, 20 May 2011 22:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4KMc2xP003752; Fri, 20 May 2011 22:38:02 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4KMc2V7003747; Fri, 20 May 2011 22:38:02 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105202238.p4KMc2V7003747@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 20 May 2011 22:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222153 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:38:03 -0000 Author: jkim Date: Fri May 20 22:38:02 2011 New Revision: 222153 URL: http://svn.freebsd.org/changeset/base/222153 Log: MFC: r222043 Update CPUID bits to reflect AMD Bulldozer and Intel Sandy Bridge features. Modified: stable/8/sys/amd64/amd64/identcpu.c stable/8/sys/amd64/include/specialreg.h stable/8/sys/i386/i386/identcpu.c stable/8/sys/i386/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/identcpu.c Fri May 20 22:36:17 2011 (r222152) +++ stable/8/sys/amd64/amd64/identcpu.c Fri May 20 22:38:02 2011 (r222153) @@ -212,6 +212,14 @@ printcpuinfo(void) printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); + + /* + * AMD CPUID Specification + * http://support.amd.com/us/Embedded_TechDocs/25481.pdf + * + * Intel Processor Identification and CPUID Instruction + * http://www.intel.com/assets/pdf/appnote/241618.pdf + */ if (cpu_high > 0) { /* @@ -273,38 +281,29 @@ printcpuinfo(void) "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ "\014" - "\015" + "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022PCID" /* Process-context Identifiers */ + "\022PCID" /* Process-context Identifiers*/ "\023DCA" /* Direct Cache Access */ - "\024SSE4.1" - "\025SSE4.2" + "\024SSE4.1" /* SSE 4.1 */ + "\025SSE4.2" /* SSE 4.2 */ "\026x2APIC" /* xAPIC Extensions */ - "\027MOVBE" - "\030POPCNT" - "\031" - "\032AESNI" /* AES Crypto*/ - "\033XSAVE" - "\034OSXSAVE" - "\035" - "\036" + "\027MOVBE" /* MOVBE Instruction */ + "\030POPCNT" /* POPCNT Instruction */ + "\031TSCDLT" /* TSC-Deadline Timer */ + "\032AESNI" /* AES Crypto */ + "\033XSAVE" /* XSAVE/XRSTOR States */ + "\034OSXSAVE" /* OS-Enabled State Management*/ + "\035AVX" /* Advanced Vector Extensions */ + "\036F16C" /* Half-precision conversions */ "\037" "\040HV" /* Hypervisor */ ); } - /* - * AMD64 Architecture Programmer's Manual Volume 3: - * General-Purpose and System Instructions - * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf - * - * IA-32 Intel Architecture Software Developer's Manual, - * Volume 2A: Instruction Set Reference, A-M - * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf - */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -357,18 +356,18 @@ printcpuinfo(void) "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ "\012OSVW" /* OS visible workaround */ "\013IBS" /* Instruction based sampling */ - "\014SSE5" /* SSE5 */ + "\014XOP" /* XOP extended instructions */ "\015SKINIT" /* SKINIT/STGI */ "\016WDT" /* Watchdog timer */ "\017" - "\020" - "\021" + "\020LWP" /* Lightweight Profiling */ + "\021FMA4" /* 4-operand FMA instructions */ "\022" "\023" - "\024" + "\024NodeId" /* NodeId MSR support */ "\025" - "\026" - "\027" + "\026TBM" /* Trailing Bit Manipulation */ + "\027Topology" /* Topology Extensions */ "\030" "\031" "\032" Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Fri May 20 22:36:17 2011 (r222152) +++ stable/8/sys/amd64/include/specialreg.h Fri May 20 22:38:02 2011 (r222153) @@ -123,6 +123,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 @@ -133,7 +134,12 @@ #define CPUID2_X2APIC 0x00200000 #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 +#define CPUID2_TSCDLT 0x01000000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_XSAVE 0x04000000 +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define CPUID2_F16C 0x20000000 #define CPUID2_HV 0x80000000 /* @@ -170,9 +176,14 @@ #define AMDID2_PREFETCH 0x00000100 #define AMDID2_OSVW 0x00000200 #define AMDID2_IBS 0x00000400 -#define AMDID2_SSE5 0x00000800 +#define AMDID2_XOP 0x00000800 #define AMDID2_SKINIT 0x00001000 #define AMDID2_WDT 0x00002000 +#define AMDID2_LWP 0x00008000 +#define AMDID2_FMA4 0x00010000 +#define AMDID2_NODE_ID 0x00080000 +#define AMDID2_TBM 0x00200000 +#define AMDID2_TOPOLOGY 0x00400000 /* * CPUID instruction 1 eax info Modified: stable/8/sys/i386/i386/identcpu.c ============================================================================== --- stable/8/sys/i386/i386/identcpu.c Fri May 20 22:36:17 2011 (r222152) +++ stable/8/sys/i386/i386/identcpu.c Fri May 20 22:38:02 2011 (r222153) @@ -676,6 +676,13 @@ printcpuinfo(void) printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) printf("\n DIR=0x%04x", cyrix_did); + /* + * AMD CPUID Specification + * http://support.amd.com/us/Embedded_TechDocs/25481.pdf + * + * Intel Processor Identification and CPUID Instruction + * http://www.intel.com/assets/pdf/appnote/241618.pdf + */ if (cpu_high > 0) { /* @@ -737,38 +744,29 @@ printcpuinfo(void) "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ "\014" - "\015" + "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022PCID" /* Process-context Identifiers */ + "\022PCID" /* Process-context Identifiers*/ "\023DCA" /* Direct Cache Access */ - "\024SSE4.1" - "\025SSE4.2" + "\024SSE4.1" /* SSE 4.1 */ + "\025SSE4.2" /* SSE 4.2 */ "\026x2APIC" /* xAPIC Extensions */ - "\027MOVBE" - "\030POPCNT" - "\031" - "\032AESNI" /* AES Crypto*/ - "\033XSAVE" - "\034OSXSAVE" - "\035" - "\036" + "\027MOVBE" /* MOVBE Instruction */ + "\030POPCNT" /* POPCNT Instruction */ + "\031TSCDLT" /* TSC-Deadline Timer */ + "\032AESNI" /* AES Crypto */ + "\033XSAVE" /* XSAVE/XRSTOR States */ + "\034OSXSAVE" /* OS-Enabled State Management*/ + "\035AVX" /* Advanced Vector Extensions */ + "\036F16C" /* Half-precision conversions */ "\037" "\040HV" /* Hypervisor */ ); } - /* - * AMD64 Architecture Programmer's Manual Volume 3: - * General-Purpose and System Instructions - * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf - * - * IA-32 Intel Architecture Software Developer's Manual, - * Volume 2A: Instruction Set Reference, A-M - * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf - */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -821,18 +819,18 @@ printcpuinfo(void) "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ "\012OSVW" /* OS visible workaround */ "\013IBS" /* Instruction based sampling */ - "\014SSE5" /* SSE5 */ + "\014XOP" /* XOP extended instructions */ "\015SKINIT" /* SKINIT/STGI */ "\016WDT" /* Watchdog timer */ "\017" - "\020" - "\021" + "\020LWP" /* Lightweight Profiling */ + "\021FMA4" /* 4-operand FMA instructions */ "\022" "\023" - "\024" + "\024NodeId" /* NodeId MSR support */ "\025" - "\026" - "\027" + "\026TBM" /* Trailing Bit Manipulation */ + "\027Topology" /* Topology Extensions */ "\030" "\031" "\032" Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Fri May 20 22:36:17 2011 (r222152) +++ stable/8/sys/i386/include/specialreg.h Fri May 20 22:38:02 2011 (r222153) @@ -120,6 +120,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 @@ -130,7 +131,12 @@ #define CPUID2_X2APIC 0x00200000 #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 +#define CPUID2_TSCDLT 0x01000000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_XSAVE 0x04000000 +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define CPUID2_F16C 0x20000000 #define CPUID2_HV 0x80000000 /* @@ -167,9 +173,14 @@ #define AMDID2_PREFETCH 0x00000100 #define AMDID2_OSVW 0x00000200 #define AMDID2_IBS 0x00000400 -#define AMDID2_SSE5 0x00000800 +#define AMDID2_XOP 0x00000800 #define AMDID2_SKINIT 0x00001000 #define AMDID2_WDT 0x00002000 +#define AMDID2_LWP 0x00008000 +#define AMDID2_FMA4 0x00010000 +#define AMDID2_NODE_ID 0x00080000 +#define AMDID2_TBM 0x00200000 +#define AMDID2_TOPOLOGY 0x00400000 /* * CPUID instruction 1 eax info From owner-svn-src-stable-8@FreeBSD.ORG Fri May 20 22:45:48 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 9B5F6106564A; Fri, 20 May 2011 22:45:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kostik Belousov Date: Fri, 20 May 2011 18:45:35 -0400 User-Agent: KMail/1.6.2 References: <201105202222.p4KMMuqT003163@svn.freebsd.org> <20110520223048.GI48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110520223048.GI48734@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105201845.37305.jkim@FreeBSD.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r222150 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 22:45:48 -0000 On Friday 20 May 2011 06:30 pm, Kostik Belousov wrote: > On Fri, May 20, 2011 at 10:22:56PM +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Fri May 20 22:22:56 2011 > > New Revision: 222150 > > URL: http://svn.freebsd.org/changeset/base/222150 > > > > Log: > > MFC: r221188 > > > > Define "Hypervisor Present" bit. This bit is used by several > > hypervisors to identify CPUs running under emulation. > > In the latest revision of the Software Developer's Manual, Intel > stated that bit 31 is always 0 for the real CPUs. So it is as much > official as it can be. OTOH, AMD's "CPUID Specification" says "Reserved for use by hypervisor to indicate guest status". :-) Jung-uk Kim From owner-svn-src-stable-8@FreeBSD.ORG Sat May 21 00:38:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD08106564A; Sat, 21 May 2011 00:38:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9098FC08; Sat, 21 May 2011 00:38:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4L0ci7X007411; Sat, 21 May 2011 00:38:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4L0cijH007409; Sat, 21 May 2011 00:38:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105210038.p4L0cijH007409@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 21 May 2011 00:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222155 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 00:38:44 -0000 Author: yongari Date: Sat May 21 00:38:43 2011 New Revision: 222155 URL: http://svn.freebsd.org/changeset/base/222155 Log: MFC r221548,221552: r221548: Do not increment collision counter if transmit have failed. Transmission error in tun(4) is queueing error(i.e. ENOBUFS) and it has nothing to do with collision. r221552: Fix white space nits and style Modified: stable/8/sys/net/if_tun.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Fri May 20 22:55:18 2011 (r222154) +++ stable/8/sys/net/if_tun.c Sat May 21 00:38:43 2011 (r222155) @@ -228,8 +228,8 @@ tunclone(void *arg, struct ucred *cred, i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0); if (i) { if (append_unit) { - namelen = snprintf(devname, sizeof(devname), "%s%d", name, - u); + namelen = snprintf(devname, sizeof(devname), "%s%d", + name, u); name = devname; } /* No preexisting struct cdev *, create one */ @@ -577,11 +577,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd * tunoutput - queue packets from higher level ready to put out. */ static int -tunoutput( - struct ifnet *ifp, - struct mbuf *m0, - struct sockaddr *dst, - struct route *ro) +tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, + struct route *ro) { struct tun_softc *tp = ifp->if_softc; u_short cached_tun_flags; @@ -661,10 +658,8 @@ tunoutput( } error = (ifp->if_transmit)(ifp, m0); - if (error) { - ifp->if_collisions++; + if (error) return (ENOBUFS); - } ifp->if_opackets++; return (0); } @@ -673,7 +668,8 @@ tunoutput( * the cdevsw interface is now pretty minimal. */ static int -tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) +tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, + struct thread *td) { int error; struct tun_softc *tp = dev->si_drv1; @@ -995,7 +991,7 @@ tunkqfilter(struct cdev *dev, struct kno ifp->if_xname, dev2unit(dev)); kn->kn_fop = &tun_write_filterops; break; - + default: TUNDEBUG(ifp, "%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, dev2unit(dev)); From owner-svn-src-stable-8@FreeBSD.ORG Sat May 21 16:17:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A2EC106564A; Sat, 21 May 2011 16:17:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89DF88FC0A; Sat, 21 May 2011 16:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4LGHUuv036919; Sat, 21 May 2011 16:17:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4LGHUEb036917; Sat, 21 May 2011 16:17:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105211617.p4LGHUEb036917@svn.freebsd.org> From: Marius Strobl Date: Sat, 21 May 2011 16:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222159 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2011 16:17:30 -0000 Author: marius Date: Sat May 21 16:17:30 2011 New Revision: 222159 URL: http://svn.freebsd.org/changeset/base/222159 Log: MFC: r221812 Some PHYs like the Level One LXT970 optionally can default to isolation after rest, in which case we may need to deisolate them. Tested by: nwhitehorn Modified: stable/8/sys/dev/mii/mii_physubr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Sat May 21 14:52:26 2011 (r222158) +++ stable/8/sys/dev/mii/mii_physubr.c Sat May 21 16:17:30 2011 (r222159) @@ -260,7 +260,7 @@ void mii_phy_reset(struct mii_softc *sc) { struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; - int reg, i; + int i, reg; if ((sc->mii_flags & MIIF_NOISOLATE) != 0) reg = BMCR_RESET; @@ -276,11 +276,14 @@ mii_phy_reset(struct mii_softc *sc) DELAY(1000); } - if ((sc->mii_flags & MIIF_NOISOLATE) == 0) { - if ((ife == NULL && sc->mii_inst != 0) || - (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst)) - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - } + /* NB: a PHY may default to isolation. */ + reg &= ~BMCR_ISO; + if ((sc->mii_flags & MIIF_NOISOLATE) == 0 && + ((ife == NULL && sc->mii_inst != 0) || + (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst))) + reg |= BMCR_ISO; + if (PHY_READ(sc, MII_BMCR) != reg) + PHY_WRITE(sc, MII_BMCR, reg); } void