From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 06:38:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D3EB106566B; Sun, 26 Jul 2009 06:38:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA4F8FC16; Sun, 26 Jul 2009 06:38:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6Q6cu3e062242; Sun, 26 Jul 2009 06:38:56 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6Q6cuhZ062240; Sun, 26 Jul 2009 06:38:56 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200907260638.n6Q6cuhZ062240@svn.freebsd.org> From: Alan Cox Date: Sun, 26 Jul 2009 06:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195882 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 06:38:57 -0000 Author: alc Date: Sun Jul 26 06:38:56 2009 New Revision: 195882 URL: http://svn.freebsd.org/changeset/base/195882 Log: Eliminate a stale paragraph from the BUGS section. This "bug" was eliminated in r195693. Approved by: re (kensmith) Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Sun Jul 26 03:20:12 2009 (r195881) +++ head/lib/libc/sys/mmap.2 Sun Jul 26 06:38:56 2009 (r195882) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd July 14, 2009 +.Dd July 26, 2009 .Dt MMAP 2 .Os .Sh NAME @@ -353,10 +353,3 @@ Larger files may be possible on 64 bit s The previous documented limit of 2GB was a documentation bug. That limit has not existed since .Fx 2.2 . -.Pp -Note that an attempt to -.Fn mmap -zero bytes has no effect and succeeds, while an attempt to -.Fn munmap -zero bytes will return -.Bq Er EINVAL . From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 09:00:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF44106564A; Sun, 26 Jul 2009 09:00:37 +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 CD1238FC16; Sun, 26 Jul 2009 09:00:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6Q90bSP065077; Sun, 26 Jul 2009 09:00:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6Q90bpi065075; Sun, 26 Jul 2009 09:00:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907260900.n6Q90bpi065075@svn.freebsd.org> From: Xin LI Date: Sun, 26 Jul 2009 09:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195888 - in stable/7/lib/libc: . stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 09:00:38 -0000 Author: delphij Date: Sun Jul 26 09:00:37 2009 New Revision: 195888 URL: http://svn.freebsd.org/changeset/base/195888 Log: Implement %z for strptime. PR: kern/63064 Submitted by: Stefan `Sec` Zehl (with some small changes) Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/strptime.c Modified: stable/7/lib/libc/stdtime/strptime.c ============================================================================== --- stable/7/lib/libc/stdtime/strptime.c Sun Jul 26 08:47:00 2009 (r195887) +++ stable/7/lib/libc/stdtime/strptime.c Sun Jul 26 09:00:37 2009 (r195888) @@ -514,6 +514,34 @@ label: } } break; + + case 'z': + { + int sign = 1; + + if (*buf != '+') { + if (*buf == '-') + sign = -1; + else + return 0; + } + + buf++; + i = 0; + for (len = 4; len > 0; len--) { + if (isdigit((int)*buf)) { + i *= 10; + i += *buf - '0'; + buf++; + } else + return 0; + } + + tm->tm_hour -= sign * (i / 100); + tm->tm_min -= sign * (i % 100); + *GMTp = 1; + } + break; } } return (char *)buf; From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 09:01:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CBB106566C; Sun, 26 Jul 2009 09:01:15 +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 E0F128FC19; Sun, 26 Jul 2009 09:01:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6Q91FHP065146; Sun, 26 Jul 2009 09:01:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6Q91FqG065144; Sun, 26 Jul 2009 09:01:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907260901.n6Q91FqG065144@svn.freebsd.org> From: Xin LI Date: Sun, 26 Jul 2009 09:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195889 - in stable/6/lib/libc: . stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 09:01:16 -0000 Author: delphij Date: Sun Jul 26 09:01:15 2009 New Revision: 195889 URL: http://svn.freebsd.org/changeset/base/195889 Log: Implement %z for strptime. PR: kern/63064 Submitted by: Stefan `Sec` Zehl (with some small changes) Modified: stable/6/lib/libc/ (props changed) stable/6/lib/libc/stdtime/strptime.c Modified: stable/6/lib/libc/stdtime/strptime.c ============================================================================== --- stable/6/lib/libc/stdtime/strptime.c Sun Jul 26 09:00:37 2009 (r195888) +++ stable/6/lib/libc/stdtime/strptime.c Sun Jul 26 09:01:15 2009 (r195889) @@ -514,6 +514,34 @@ label: } } break; + + case 'z': + { + int sign = 1; + + if (*buf != '+') { + if (*buf == '-') + sign = -1; + else + return 0; + } + + buf++; + i = 0; + for (len = 4; len > 0; len--) { + if (isdigit((int)*buf)) { + i *= 10; + i += *buf - '0'; + buf++; + } else + return 0; + } + + tm->tm_hour -= sign * (i / 100); + tm->tm_min -= sign * (i % 100); + *GMTp = 1; + } + break; } } return (char *)buf; From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 11:25:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C75106564A; Sun, 26 Jul 2009 11:25:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF1C58FC20; Sun, 26 Jul 2009 11:25:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QBPvrx068912; Sun, 26 Jul 2009 11:25:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QBPvJY068910; Sun, 26 Jul 2009 11:25:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200907261125.n6QBPvJY068910@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 26 Jul 2009 11:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195890 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 11:25:58 -0000 Author: bz Date: Sun Jul 26 11:25:57 2009 New Revision: 195890 URL: http://svn.freebsd.org/changeset/base/195890 Log: Make ifconfig ifN -vnet actually work: - fix ifconfig to ignore the non-existent interface in the current network stack in case of '-vnet'. - in ifconfig: actually use the local variables defined for the vnet functions rather than modifying the global. Reviewed by: rwatson Approved by: re (kib) Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sun Jul 26 09:01:15 2009 (r195889) +++ head/sbin/ifconfig/ifconfig.c Sun Jul 26 11:25:57 2009 (r195890) @@ -252,6 +252,19 @@ main(int argc, char *argv[]) ifconfig(argc, argv, 1, NULL); exit(0); } + /* + * NOTE: We have to special-case the `-vnet' command + * right here as we would otherwise fail when trying + * to find the interface as it lives in another vnet. + */ + if (argc > 0 && (strcmp(argv[0], "-vnet") == 0)) { + iflen = strlcpy(name, ifname, sizeof(name)); + if (iflen >= sizeof(name)) + errx(1, "%s: interface name too long", + ifname); + ifconfig(argc, argv, 0, NULL); + exit(0); + } errx(1, "interface %s does not exist", ifname); } } @@ -636,10 +649,10 @@ setifvnet(const char *jname, int dummy _ struct ifreq my_ifr; memcpy(&my_ifr, &ifr, sizeof(my_ifr)); - ifr.ifr_jid = jail_getid(jname); - if (ifr.ifr_jid < 0) + my_ifr.ifr_jid = jail_getid(jname); + if (my_ifr.ifr_jid < 0) errx(1, "%s", jail_errmsg); - if (ioctl(s, SIOCSIFVNET, &ifr) < 0) + if (ioctl(s, SIOCSIFVNET, &my_ifr) < 0) err(1, "SIOCSIFVNET"); } @@ -650,11 +663,11 @@ setifrvnet(const char *jname, int dummy struct ifreq my_ifr; memcpy(&my_ifr, &ifr, sizeof(my_ifr)); - ifr.ifr_jid = jail_getid(jname); - if (ifr.ifr_jid < 0) + my_ifr.ifr_jid = jail_getid(jname); + if (my_ifr.ifr_jid < 0) errx(1, "%s", jail_errmsg); - if (ioctl(s, SIOCSIFRVNET, &ifr) < 0) - err(1, "SIOCSIFRVNET"); + if (ioctl(s, SIOCSIFRVNET, &my_ifr) < 0) + err(1, "SIOCSIFRVNET(%d, %s)", my_ifr.ifr_jid, my_ifr.ifr_name); } static void From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 11:29:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3F1106564A; Sun, 26 Jul 2009 11:29:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09D008FC14; Sun, 26 Jul 2009 11:29:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QBTQIL069004; Sun, 26 Jul 2009 11:29:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QBTQVT069000; Sun, 26 Jul 2009 11:29:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200907261129.n6QBTQVT069000@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 26 Jul 2009 11:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195891 - in head/sys: kern net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 11:29:27 -0000 Author: bz Date: Sun Jul 26 11:29:26 2009 New Revision: 195891 URL: http://svn.freebsd.org/changeset/base/195891 Log: Make the in-kernel logic for the SIOCSIFVNET, SIOCSIFRVNET ioctls (ifconfig ifN (-)vnet ) work correctly. Move vi_if_move to if.c and split it up into two functions(*), one for each ioctl. In the reclaim case, correctly set the vnet before calling if_vmove. Instead of silently allowing a move of an interface from the current vnet to the current vnet, return an error. (*) There is some duplicate interface name checking before actually moving the interface between network stacks without locking and thus race prone. Ideally if_vmove will correctly and automagically handle these in the future. Suggested by: rwatson (*) Approved by: re (kib) Modified: head/sys/kern/kern_vimage.c head/sys/net/if.c head/sys/sys/vimage.h Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Sun Jul 26 11:25:57 2009 (r195890) +++ head/sys/kern/kern_vimage.c Sun Jul 26 11:29:26 2009 (r195891) @@ -68,61 +68,6 @@ struct sx vnet_sxlock; struct vnet_list_head vnet_head; struct vnet *vnet0; -/* - * Move an ifnet to or from another vnet, specified by the jail id. - */ -int -vi_if_move(struct thread *td, struct ifnet *ifp, char *ifname, int jid) -{ - struct ifnet *t_ifp; - struct prison *pr; - struct vnet *new_vnet; - int error; - - sx_slock(&allprison_lock); - pr = prison_find_child(td->td_ucred->cr_prison, jid); - sx_sunlock(&allprison_lock); - if (pr == NULL) - return (ENXIO); - prison_hold_locked(pr); - mtx_unlock(&pr->pr_mtx); - if (ifp != NULL) { - /* SIOCSIFVNET */ - new_vnet = pr->pr_vnet; - } else { - /* SIOCSIFRVNET */ - new_vnet = TD_TO_VNET(td); - CURVNET_SET(pr->pr_vnet); - ifp = ifunit(ifname); - CURVNET_RESTORE(); - if (ifp == NULL) { - prison_free(pr); - return (ENXIO); - } - } - - error = 0; - if (new_vnet != ifp->if_vnet) { - /* - * Check for naming clashes in target vnet. Not locked so races - * are possible. - */ - CURVNET_SET_QUIET(new_vnet); - t_ifp = ifunit(ifname); - CURVNET_RESTORE(); - if (t_ifp != NULL) - error = EEXIST; - else { - /* Detach from curvnet and attach to new_vnet. */ - if_vmove(ifp, new_vnet); - - /* Report the new if_xname back to the userland */ - sprintf(ifname, "%s", ifp->if_xname); - } - } - prison_free(pr); - return (error); -} struct vnet * vnet_alloc(void) Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Jul 26 11:25:57 2009 (r195890) +++ head/sys/net/if.c Sun Jul 26 11:29:26 2009 (r195891) @@ -894,6 +894,94 @@ if_vmove(struct ifnet *ifp, struct vnet CURVNET_RESTORE(); } + +/* + * Move an ifnet to or from another child prison/vnet, specified by the jail id. + */ +static int +if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) +{ + struct prison *pr; + struct ifnet *difp; + + /* Try to find the prison within our visibility. */ + sx_slock(&allprison_lock); + pr = prison_find_child(td->td_ucred->cr_prison, jid); + sx_sunlock(&allprison_lock); + if (pr == NULL) + return (ENXIO); + prison_hold_locked(pr); + mtx_unlock(&pr->pr_mtx); + + /* Do not try to move the iface from and to the same prison. */ + if (pr->pr_vnet == ifp->if_vnet) { + prison_free(pr); + return (EEXIST); + } + + /* Make sure the named iface does not exists in the dst. prison/vnet. */ + /* XXX Lock interfaces to avoid races. */ + CURVNET_SET(pr->pr_vnet); + difp = ifunit(ifname); + CURVNET_RESTORE(); + if (difp != NULL) { + prison_free(pr); + return (EEXIST); + } + + /* Move the interface into the child jail/vnet. */ + if_vmove(ifp, pr->pr_vnet); + + /* Report the new if_xname back to the userland. */ + sprintf(ifname, "%s", ifp->if_xname); + + prison_free(pr); + return (0); +} + +static int +if_vmove_reclaim(struct thread *td, char *ifname, int jid) +{ + struct prison *pr; + struct vnet *vnet_dst; + struct ifnet *ifp; + + /* Try to find the prison within our visibility. */ + sx_slock(&allprison_lock); + pr = prison_find_child(td->td_ucred->cr_prison, jid); + sx_sunlock(&allprison_lock); + if (pr == NULL) + return (ENXIO); + prison_hold_locked(pr); + mtx_unlock(&pr->pr_mtx); + + /* Make sure the named iface exists in the source prison/vnet. */ + CURVNET_SET(pr->pr_vnet); + ifp = ifunit(ifname); /* XXX Lock to avoid races. */ + if (ifp == NULL) { + CURVNET_RESTORE(); + prison_free(pr); + return (ENXIO); + } + + /* Do not try to move the iface from and to the same prison. */ + vnet_dst = TD_TO_VNET(td); + if (vnet_dst == ifp->if_vnet) { + CURVNET_RESTORE(); + prison_free(pr); + return (EEXIST); + } + + /* Get interface back from child jail/vnet. */ + if_vmove(ifp, vnet_dst); + CURVNET_RESTORE(); + + /* Report the new if_xname back to the userland. */ + sprintf(ifname, "%s", ifp->if_xname); + + prison_free(pr); + return (0); +} #endif /* VIMAGE */ /* @@ -1990,7 +2078,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, error = priv_check(td, PRIV_NET_SETIFVNET); if (error) return (error); - error = vi_if_move(td, ifp, ifr->ifr_name, ifr->ifr_jid); + error = if_vmove_loan(td, ifp, ifr->ifr_name, ifr->ifr_jid); break; #endif @@ -2184,7 +2272,7 @@ ifioctl(struct socket *so, u_long cmd, c error = priv_check(td, PRIV_NET_SETIFVNET); if (error) return (error); - return (vi_if_move(td, NULL, ifr->ifr_name, ifr->ifr_jid)); + return (if_vmove_reclaim(td, ifr->ifr_name, ifr->ifr_jid)); #endif case SIOCIFCREATE: case SIOCIFCREATE2: Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sun Jul 26 11:25:57 2009 (r195890) +++ head/sys/sys/vimage.h Sun Jul 26 11:29:26 2009 (r195891) @@ -67,7 +67,6 @@ struct vnet { struct vnet; struct ifnet; -int vi_if_move(struct thread *, struct ifnet *, char *, int); struct vnet *vnet_alloc(void); void vnet_destroy(struct vnet *); void vnet_foreach(void (*vnet_foreach_fn)(struct vnet *, void *), From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 12:20:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77152106564A; Sun, 26 Jul 2009 12:20:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629B98FC16; Sun, 26 Jul 2009 12:20:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QCK7dC070009; Sun, 26 Jul 2009 12:20:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QCK7Fx069997; Sun, 26 Jul 2009 12:20:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200907261220.n6QCK7Fx069997@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 26 Jul 2009 12:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195892 - in head: share/man/man4 share/man/man9 sys/boot/forth sys/conf sys/modules sys/modules/if_epair sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 12:20:07 -0000 Author: bz Date: Sun Jul 26 12:20:07 2009 New Revision: 195892 URL: http://svn.freebsd.org/changeset/base/195892 Log: Update epair(4) to the new netisr implementation and polish things a bit: - use dpcpu data to track the ifps with packets queued up, - per-cpu locking and driver flags - along with .nh_drainedcpu and NETISR_POLICY_CPU. - Put the mbufs in flight reference count, preventing interfaces from going away, under INVARIANTS as this is a general problem of the stack and should be solved in if.c/netisr but still good to verify the internal queuing logic. - Permit changing the MTU to virtually everythinkg like we do for loopback. Hook epair(4) up to the build. Approved by: re (kib) Added: head/sys/modules/if_epair/ head/sys/modules/if_epair/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/epair.4 head/share/man/man9/netisr.9 head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile head/sys/net/if_epair.c head/sys/net/netisr.h Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Jul 26 11:29:26 2009 (r195891) +++ head/share/man/man4/Makefile Sun Jul 26 12:20:07 2009 (r195892) @@ -94,6 +94,7 @@ MAN= aac.4 \ em.4 \ en.4 \ enc.4 \ + epair.4 \ esp.4 \ et.4 \ exca.4 \ @@ -490,6 +491,7 @@ MLINKS+=ef.4 if_ef.4 MLINKS+=em.4 if_em.4 MLINKS+=en.4 if_en.4 MLINKS+=enc.4 if_enc.4 +MLINKS+=epair.4 if_epair.4 MLINKS+=et.4 if_et.4 MLINKS+=faith.4 if_faith.4 MLINKS+=fatm.4 if_fatm.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Sun Jul 26 11:29:26 2009 (r195891) +++ head/share/man/man4/altq.4 Sun Jul 26 12:20:07 2009 (r195892) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd July 26, 2009 .Dt ALTQ 4 .Os .Sh NAME @@ -131,6 +131,7 @@ They have been applied to the following .Xr ed 4 , .Xr em 4 , .Xr ep 4 , +.Xr epair 4 , .Xr fxp 4 , .Xr gem 4 , .Xr hme 4 , Modified: head/share/man/man4/epair.4 ============================================================================== --- head/share/man/man4/epair.4 Sun Jul 26 11:29:26 2009 (r195891) +++ head/share/man/man4/epair.4 Sun Jul 26 12:20:07 2009 (r195892) @@ -28,12 +28,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2008 +.Dd July 26, 2009 .Dt EPAIR 4 .Os .Sh NAME .Nm epair -.Nd Virtual cross-over Ethernet-like interface pair. +.Nd A pair of virtual back-to-back connected Ethernet interfaces. .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -52,7 +52,7 @@ if_epair_load="YES" The .Nm is a pair of Ethernet-like software interfaces, -which are directly connected by a virtual cross-over cable. +which are connected back-to-back with a virtual cross-over cable. .Pp Each .Nm Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Sun Jul 26 11:29:26 2009 (r195891) +++ head/share/man/man9/netisr.9 Sun Jul 26 12:20:07 2009 (r195892) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd July 26, 2009 .Dt NETISR 9 .Os .Sh NAME @@ -208,6 +208,8 @@ IPX/SPX IPv6 .It Dv NETISR_NATM ATM +.It Dv NETISR_EPAIR +.Xr epair 4 .El .Sh AUTHORS This manual page and the Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/boot/forth/loader.conf Sun Jul 26 12:20:07 2009 (r195892) @@ -190,6 +190,7 @@ streams_load="NO" # System V streams mo if_disc_load="NO" # Discard device if_ef_load="NO" # pseudo-device providing support for multiple # ethernet frame types +if_epair_load="NO" # Virtual b-t-b Ethernet-like interface pair if_faith_load="NO" # IPv6-to-IPv4 TCP relay capturing interface if_gif_load="NO" # generic tunnel interface if_gre_load="NO" # encapsulating network device Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/conf/NOTES Sun Jul 26 12:20:07 2009 (r195892) @@ -784,6 +784,10 @@ device bpf # included for testing and benchmarking purposes. device disc +# The `epair' device implements a virtual back-to-back connected Ethernet +# like interface pair. +device epair + # The `edsc' device implements a minimal Ethernet interface, # which discards all packets sent and receives none. device edsc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/conf/files Sun Jul 26 12:20:07 2009 (r195892) @@ -2202,6 +2202,7 @@ net/if_disc.c optional disc net/if_edsc.c optional edsc net/if_ef.c optional ef net/if_enc.c optional enc ipsec inet | enc ipsec inet6 +net/if_epair.c optional epair net/if_ethersubr.c optional ether \ compile-with "${NORMAL_C} -I$S/contrib/pf" net/if_faith.c optional faith Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/modules/Makefile Sun Jul 26 12:20:07 2009 (r195892) @@ -109,6 +109,7 @@ SUBDIR= ${_3dfx} \ if_disc \ if_edsc \ if_ef \ + if_epair \ if_faith \ if_gif \ if_gre \ Added: head/sys/modules/if_epair/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/if_epair/Makefile Sun Jul 26 12:20:07 2009 (r195892) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= if_epair +SRCS= if_epair.c + +.include Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/net/if_epair.c Sun Jul 26 12:20:07 2009 (r195892) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008 The FreeBSD Foundation + * Copyright (c) 2009 Bjoern A. Zeeb * All rights reserved. * * This software was developed by CK Software GmbH under sponsorship @@ -28,18 +29,22 @@ */ /* - * A pair of virtual ethernet interfaces directly connected with - * a virtual cross-over cable. + * A pair of virtual back-to-back connected ethernet like interfaces + * (``two interfaces with a virtual cross-over cable''). + * * This is mostly intended to be used to provide connectivity between * different virtual network stack instances. */ /* * Things to re-think once we have more experience: - * - ifp->if_reassign function once we can test with vimage. - * - Real random etheraddrs that are checked to be uniquish; - * in case we bridge we may need this or let the user handle that case? - * - netisr and callback logic. - * - netisr queue lengths. + * - ifp->if_reassign function once we can test with vimage. Depending on + * how if_vomve() is going to be improved. + * - Real random etheraddrs that are checked to be uniquish; we would need + * to re-do them in case we move the interface between network stacks + * in a private if_reassign function. + * In case we bridge to a real interface/network or between indepedent + * epairs on multiple stacks/machines, we may need this. + * For now let the user handle that case. */ #include @@ -51,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,84 +73,181 @@ __FBSDID("$FreeBSD$"); #define EPAIRNAME "epair" -#ifdef DEBUG_EPAIR -static int epair_debug = 0; SYSCTL_DECL(_net_link); SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW, 0, "epair sysctl"); + +#ifdef EPAIR_DEBUG +static int epair_debug = 0; SYSCTL_XINT(_net_link_epair, OID_AUTO, epair_debug, CTLFLAG_RW, &epair_debug, 0, "if_epair(4) debugging."); -#define DPRINTF(fmt, arg...) if (epair_debug) \ - printf("[%s:%d] " fmt, __func__, __LINE__, ##arg) +#define DPRINTF(fmt, arg...) \ + if (epair_debug) \ + printf("[%s:%d] " fmt, __func__, __LINE__, ##arg) #else #define DPRINTF(fmt, arg...) #endif +static void epair_nh_sintr(struct mbuf *); +static struct mbuf *epair_nh_m2cpuid(struct mbuf *, uintptr_t, u_int *); +static void epair_nh_drainedcpu(u_int); + +static void epair_start_locked(struct ifnet *); + +static int epair_clone_match(struct if_clone *, const char *); +static int epair_clone_create(struct if_clone *, char *, size_t, caddr_t); +static int epair_clone_destroy(struct if_clone *, struct ifnet *); + +/* Netisr realted definitions and sysctl. */ +static struct netisr_handler epair_nh = { + .nh_name = EPAIRNAME, + .nh_proto = NETISR_EPAIR, + .nh_policy = NETISR_POLICY_CPU, + .nh_handler = epair_nh_sintr, + .nh_m2cpuid = epair_nh_m2cpuid, + .nh_drainedcpu = epair_nh_drainedcpu, +}; + +static int +sysctl_epair_netisr_maxqlen(SYSCTL_HANDLER_ARGS) +{ + int error, qlimit; + + netisr_getqlimit(&epair_nh, &qlimit); + error = sysctl_handle_int(oidp, &qlimit, 0, req); + if (error || !req->newptr) + return (error); + if (qlimit < 1) + return (EINVAL); + return (netisr_setqlimit(&epair_nh, qlimit)); +} +SYSCTL_PROC(_net_link_epair, OID_AUTO, netisr_maxqlen, CTLTYPE_INT|CTLFLAG_RW, + 0, 0, sysctl_epair_netisr_maxqlen, "I", + "Maximum if_epair(4) netisr \"hw\" queue length"); + struct epair_softc { - struct ifnet *ifp; - struct ifnet *oifp; - u_int refcount; + struct ifnet *ifp; /* This ifp. */ + struct ifnet *oifp; /* other ifp of pair. */ + u_int refcount; /* # of mbufs in flight. */ + u_int cpuid; /* CPU ID assigned upon creation. */ void (*if_qflush)(struct ifnet *); + /* Original if_qflush routine. */ }; +/* + * Per-CPU list of ifps with data in the ifq that needs to be flushed + * to the netisr ``hw'' queue before we allow any further direct queuing + * to the ``hw'' queue. + */ struct epair_ifp_drain { STAILQ_ENTRY(epair_ifp_drain) ifp_next; struct ifnet *ifp; }; +STAILQ_HEAD(eid_list, epair_ifp_drain); -static STAILQ_HEAD(, epair_ifp_drain) epair_ifp_drain_list = - STAILQ_HEAD_INITIALIZER(epair_ifp_drain_list); - -#define ADD_IFQ_FOR_DRAINING(ifp) \ - do { \ - struct epair_ifp_drain *elm = NULL; \ - \ - STAILQ_FOREACH(elm, &epair_ifp_drain_list, ifp_next) { \ - if (elm->ifp == (ifp)) \ - break; \ - } \ - if (elm == NULL) { \ - elm = malloc(sizeof(struct epair_ifp_drain), \ - M_EPAIR, M_ZERO); \ - if (elm != NULL) { \ - elm->ifp = (ifp); \ - STAILQ_INSERT_TAIL( \ - &epair_ifp_drain_list, \ - elm, ifp_next); \ - } \ - } \ - } while(0) - -/* Our "hw" tx queue. */ -static struct ifqueue epairinq; -static int epair_drv_flags; - -static struct mtx if_epair_mtx; -#define EPAIR_LOCK_INIT() mtx_init(&if_epair_mtx, "if_epair", \ - NULL, MTX_DEF) -#define EPAIR_LOCK_DESTROY() mtx_destroy(&if_epair_mtx) -#define EPAIR_LOCK_ASSERT() mtx_assert(&if_epair_mtx, MA_OWNED) -#define EPAIR_LOCK() mtx_lock(&if_epair_mtx) -#define EPAIR_UNLOCK() mtx_unlock(&if_epair_mtx) +#define EPAIR_LOCK_INIT(dpcpu) mtx_init(&(dpcpu)->if_epair_mtx, \ + "if_epair", NULL, MTX_DEF) +#define EPAIR_LOCK_DESTROY(dpcpu) mtx_destroy(&(dpcpu)->if_epair_mtx) +#define EPAIR_LOCK_ASSERT(dpcpu) mtx_assert(&(dpcpu)->if_epair_mtx, \ + MA_OWNED) +#define EPAIR_LOCK(dpcpu) mtx_lock(&(dpcpu)->if_epair_mtx) +#define EPAIR_UNLOCK(dpcpu) mtx_unlock(&(dpcpu)->if_epair_mtx) + +#ifdef INVARIANTS +#define EPAIR_REFCOUNT_INIT(r, v) refcount_init((r), (v)) +#define EPAIR_REFCOUNT_AQUIRE(r) refcount_acquire((r)) +#define EPAIR_REFCOUNT_RELEASE(r) refcount_release((r)) +#define EPAIR_REFCOUNT_ASSERT(a, p) KASSERT(a, p) +#else +#define EPAIR_REFCOUNT_INIT(r, v) +#define EPAIR_REFCOUNT_AQUIRE(r) +#define EPAIR_REFCOUNT_RELEASE(r) +#define EPAIR_REFCOUNT_ASSERT(a, p) +#endif static MALLOC_DEFINE(M_EPAIR, EPAIRNAME, "Pair of virtual cross-over connected Ethernet-like interfaces"); -static int epair_clone_match(struct if_clone *, const char *); -static int epair_clone_create(struct if_clone *, char *, size_t, caddr_t); -static int epair_clone_destroy(struct if_clone *, struct ifnet *); - -static void epair_start_locked(struct ifnet *); - static struct if_clone epair_cloner = IFC_CLONE_INITIALIZER( EPAIRNAME, NULL, IF_MAXUNIT, NULL, epair_clone_match, epair_clone_create, epair_clone_destroy); +/* + * DPCPU area and functions. + */ +struct epair_dpcpu { + struct mtx if_epair_mtx; /* Per-CPU locking. */ + int epair_drv_flags; /* Per-CPU ``hw'' drv flags. */ + struct eid_list epair_ifp_drain_list; /* Per-CPU list of ifps with + * data in the ifq. */ +}; +DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); + +static void +epair_dpcpu_init(void) +{ + struct epair_dpcpu *epair_dpcpu; + struct eid_list *s; + u_int cpuid; + + for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { + if (CPU_ABSENT(cpuid)) + continue; + + epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); + + /* Initialize per-cpu lock. */ + EPAIR_LOCK_INIT(epair_dpcpu); + + /* Driver flags are per-cpu as are our netisr "hw" queues. */ + epair_dpcpu->epair_drv_flags = 0; + + /* + * Initialize per-cpu drain list. + * Manually do what STAILQ_HEAD_INITIALIZER would do. + */ + s = &epair_dpcpu->epair_ifp_drain_list; + s->stqh_first = NULL; + s->stqh_last = &s->stqh_first; + } +} + +static void +epair_dpcpu_detach(void) +{ + struct epair_dpcpu *epair_dpcpu; + u_int cpuid; + + for (cpuid = 0; cpuid <= mp_maxid; cpuid++) { + if (CPU_ABSENT(cpuid)) + continue; + + epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); + + /* Destroy per-cpu lock. */ + EPAIR_LOCK_DESTROY(epair_dpcpu); + } +} + +/* + * Helper functions. + */ +static u_int +cpuid_from_ifp(struct ifnet *ifp) +{ + struct epair_softc *sc; + + if (ifp == NULL) + return (0); + sc = ifp->if_softc; + + return (sc->cpuid); +} /* * Netisr handler functions. */ static void -epair_sintr(struct mbuf *m) +epair_nh_sintr(struct mbuf *m) { struct ifnet *ifp; struct epair_softc *sc; @@ -152,65 +255,101 @@ epair_sintr(struct mbuf *m) ifp = m->m_pkthdr.rcvif; (*ifp->if_input)(ifp, m); sc = ifp->if_softc; - refcount_release(&sc->refcount); + EPAIR_REFCOUNT_RELEASE(&sc->refcount); DPRINTF("ifp=%p refcount=%u\n", ifp, sc->refcount); } +static struct mbuf * +epair_nh_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +{ + + *cpuid = cpuid_from_ifp(m->m_pkthdr.rcvif); + + return (m); +} + static void -epair_sintr_drained(void) +epair_nh_drainedcpu(u_int cpuid) { + struct epair_dpcpu *epair_dpcpu; struct epair_ifp_drain *elm, *tvar; struct ifnet *ifp; - EPAIR_LOCK(); + epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu); + EPAIR_LOCK(epair_dpcpu); /* * Assume our "hw" queue and possibly ifq will be emptied * again. In case we will overflow the "hw" queue while * draining, epair_start_locked will set IFF_DRV_OACTIVE * again and we will stop and return. */ - STAILQ_FOREACH_SAFE(elm, &epair_ifp_drain_list, ifp_next, tvar) { + STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, + ifp_next, tvar) { ifp = elm->ifp; - epair_drv_flags &= ~IFF_DRV_OACTIVE; + epair_dpcpu->epair_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; epair_start_locked(ifp); IFQ_LOCK(&ifp->if_snd); if (IFQ_IS_EMPTY(&ifp->if_snd)) { - STAILQ_REMOVE(&epair_ifp_drain_list, elm, - epair_ifp_drain, ifp_next); + STAILQ_REMOVE(&epair_dpcpu->epair_ifp_drain_list, + elm, epair_ifp_drain, ifp_next); free(elm, M_EPAIR); } IFQ_UNLOCK(&ifp->if_snd); if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { /* Our "hw"q overflew again. */ - epair_drv_flags |= IFF_DRV_OACTIVE + epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE DPRINTF("hw queue length overflow at %u\n", - epairinq.ifq_maxlen); -#if 0 - /* ``Auto-tuning.'' */ - epairinq.ifq_maxlen += ifqmaxlen; -#endif + epair_nh.nh_qlimit); break; } } - EPAIR_UNLOCK(); + EPAIR_UNLOCK(epair_dpcpu); } /* * Network interface (`if') related functions. */ +static int +epair_add_ifp_for_draining(struct ifnet *ifp) +{ + struct epair_dpcpu *epair_dpcpu; + struct epair_softc *sc = sc = ifp->if_softc; + struct epair_ifp_drain *elm = NULL; + + epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); + STAILQ_FOREACH(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next) + if (elm->ifp == ifp) + break; + /* If the ipf is there already, return success. */ + if (elm != NULL) + return (0); + + elm = malloc(sizeof(struct epair_ifp_drain), M_EPAIR, M_NOWAIT|M_ZERO); + if (elm == NULL) + return (ENOMEM); + + elm->ifp = ifp; + STAILQ_INSERT_TAIL(&epair_dpcpu->epair_ifp_drain_list, elm, ifp_next); + + return (0); +} + static void epair_start_locked(struct ifnet *ifp) { + struct epair_dpcpu *epair_dpcpu; struct mbuf *m; struct epair_softc *sc; struct ifnet *oifp; int error; - EPAIR_LOCK_ASSERT(); DPRINTF("ifp=%p\n", ifp); + sc = ifp->if_softc; + epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); + EPAIR_LOCK_ASSERT(epair_dpcpu); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; @@ -222,7 +361,6 @@ epair_start_locked(struct ifnet *ifp) * and ned to put them into the input queue of the oifp * and call oifp->if_input() via netisr/epair_sintr(). */ - sc = ifp->if_softc; oifp = sc->oifp; sc = oifp->if_softc; for (;;) { @@ -247,7 +385,7 @@ epair_start_locked(struct ifnet *ifp) * Add a reference so the interface cannot go while the * packet is in transit as we rely on rcvif to stay valid. */ - refcount_acquire(&sc->refcount); + EPAIR_REFCOUNT_AQUIRE(&sc->refcount); m->m_pkthdr.rcvif = oifp; CURVNET_SET_QUIET(oifp->if_vnet); error = netisr_queue(NETISR_EPAIR, m); @@ -257,10 +395,13 @@ epair_start_locked(struct ifnet *ifp) /* Someone else received the packet. */ oifp->if_ipackets++; } else { - epair_drv_flags |= IFF_DRV_OACTIVE; + epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ADD_IFQ_FOR_DRAINING(ifp); - refcount_release(&sc->refcount); + if (epair_add_ifp_for_draining(ifp)) { + ifp->if_oerrors++; + m_freem(m); + } + EPAIR_REFCOUNT_RELEASE(&sc->refcount); } } } @@ -268,22 +409,27 @@ epair_start_locked(struct ifnet *ifp) static void epair_start(struct ifnet *ifp) { + struct epair_dpcpu *epair_dpcpu; - EPAIR_LOCK(); + epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); + EPAIR_LOCK(epair_dpcpu); epair_start_locked(ifp); - EPAIR_UNLOCK(); + EPAIR_UNLOCK(epair_dpcpu); } static int epair_transmit_locked(struct ifnet *ifp, struct mbuf *m) { + struct epair_dpcpu *epair_dpcpu; struct epair_softc *sc; struct ifnet *oifp; int error, len; short mflags; - EPAIR_LOCK_ASSERT(); DPRINTF("ifp=%p m=%p\n", ifp, m); + sc = ifp->if_softc; + epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); + EPAIR_LOCK_ASSERT(epair_dpcpu); if (m == NULL) return (0); @@ -309,7 +455,6 @@ epair_transmit_locked(struct ifnet *ifp, * In case the outgoing interface is not usable, * drop the packet. */ - sc = ifp->if_softc; oifp = sc->oifp; if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (oifp->if_flags & IFF_UP) ==0) { @@ -337,14 +482,14 @@ epair_transmit_locked(struct ifnet *ifp, if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) epair_start_locked(ifp); else - ADD_IFQ_FOR_DRAINING(ifp); + (void)epair_add_ifp_for_draining(ifp); } return (error); } IF_UNLOCK(&ifp->if_snd); #endif - if ((epair_drv_flags & IFF_DRV_OACTIVE) != 0) { + if ((epair_dpcpu->epair_drv_flags & IFF_DRV_OACTIVE) != 0) { /* * Our hardware queue is full, try to fall back * queuing to the ifq but do not call ifp->if_start. @@ -352,7 +497,7 @@ epair_transmit_locked(struct ifnet *ifp, */ IFQ_ENQUEUE(&ifp->if_snd, m, error); if (!error) - ADD_IFQ_FOR_DRAINING(ifp); + (void)epair_add_ifp_for_draining(ifp); return (error); } sc = oifp->if_softc; @@ -360,7 +505,7 @@ epair_transmit_locked(struct ifnet *ifp, * Add a reference so the interface cannot go while the * packet is in transit as we rely on rcvif to stay valid. */ - refcount_acquire(&sc->refcount); + EPAIR_REFCOUNT_AQUIRE(&sc->refcount); m->m_pkthdr.rcvif = oifp; CURVNET_SET_QUIET(oifp->if_vnet); error = netisr_queue(NETISR_EPAIR, m); @@ -379,8 +524,8 @@ epair_transmit_locked(struct ifnet *ifp, oifp->if_ipackets++; } else { /* The packet was freed already. */ - refcount_release(&sc->refcount); - epair_drv_flags |= IFF_DRV_OACTIVE; + EPAIR_REFCOUNT_RELEASE(&sc->refcount); + epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_OACTIVE; } @@ -390,31 +535,35 @@ epair_transmit_locked(struct ifnet *ifp, static int epair_transmit(struct ifnet *ifp, struct mbuf *m) { + struct epair_dpcpu *epair_dpcpu; int error; - EPAIR_LOCK(); + epair_dpcpu = DPCPU_ID_PTR(cpuid_from_ifp(ifp), epair_dpcpu); + EPAIR_LOCK(epair_dpcpu); error = epair_transmit_locked(ifp, m); - EPAIR_UNLOCK(); + EPAIR_UNLOCK(epair_dpcpu); return (error); } static void epair_qflush(struct ifnet *ifp) { + struct epair_dpcpu *epair_dpcpu; struct epair_softc *sc; struct ifaltq *ifq; - EPAIR_LOCK(); sc = ifp->if_softc; + epair_dpcpu = DPCPU_ID_PTR(sc->cpuid, epair_dpcpu); + EPAIR_LOCK(epair_dpcpu); ifq = &ifp->if_snd; DPRINTF("ifp=%p sc refcnt=%u ifq_len=%u\n", ifp, sc->refcount, ifq->ifq_len); /* - * Instead of calling refcount_release(&sc->refcount); + * Instead of calling EPAIR_REFCOUNT_RELEASE(&sc->refcount); * n times, just subtract for the cleanup. */ sc->refcount -= ifq->ifq_len; - EPAIR_UNLOCK(); + EPAIR_UNLOCK(epair_dpcpu); if (sc->if_qflush) sc->if_qflush(ifp); } @@ -433,6 +582,12 @@ epair_ioctl(struct ifnet *ifp, u_long cm error = 0; break; + case SIOCSIFMTU: + /* We basically allow all kinds of MTUs. */ + ifp->if_mtu = ifr->ifr_mtu; + error = 0; + break; + default: /* Let the common ethernet handler process this. */ error = ether_ioctl(ifp, cmd, data); @@ -543,7 +698,7 @@ epair_clone_create(struct if_clone *ifc, /* Allocate memory for both [ab] interfaces */ sca = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - refcount_init(&sca->refcount, 1); + EPAIR_REFCOUNT_INIT(&sca->refcount, 1); sca->ifp = if_alloc(IFT_ETHER); if (sca->ifp == NULL) { free(sca, M_EPAIR); @@ -552,7 +707,7 @@ epair_clone_create(struct if_clone *ifc, } scb = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); - refcount_init(&scb->refcount, 1); + EPAIR_REFCOUNT_INIT(&scb->refcount, 1); scb->ifp = if_alloc(IFT_ETHER); if (scb->ifp == NULL) { free(scb, M_EPAIR); @@ -567,6 +722,17 @@ epair_clone_create(struct if_clone *ifc, */ sca->oifp = scb->ifp; scb->oifp = sca->ifp; + + /* + * Calculate the cpuid for netisr queueing based on the + * ifIndex of the interfaces. As long as we cannot configure + * this or use cpuset information easily we cannot guarantee + * cache locality but we can at least allow parallelism. + */ + sca->cpuid = + netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount()); + scb->cpuid = + netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount()); /* Finish initialization of interface a. */ ifp = sca->ifp; @@ -661,7 +827,7 @@ epair_clone_destroy(struct if_clone *ifc * detached so there is no need to use atomics. */ DPRINTF("sca refcnt=%u scb refcnt=%u\n", sca->refcount, scb->refcount); - KASSERT(sca->refcount == 1 && scb->refcount == 1, + EPAIR_REFCOUNT_ASSERT(sca->refcount == 1 && scb->refcount == 1, ("%s: sca->refcount!=1: %d || scb->refcount!=1: %d", __func__, sca->refcount, scb->refcount)); @@ -674,8 +840,14 @@ epair_clone_destroy(struct if_clone *ifc panic("%s: if_clone_destroyif() for our 2nd iface failed: %d", __func__, error); - /* Finish cleaning up. Free them and release the unit. */ + /* + * Finish cleaning up. Free them and release the unit. + * As the other of the two interfaces my reside in a different vnet, + * we need to switch before freeing them. + */ + CURVNET_SET_QUIET(oifp->if_vnet); if_free_type(oifp, IFT_ETHER); + CURVNET_RESTORE(); if_free_type(ifp, IFT_ETHER); free(scb, M_EPAIR); free(sca, M_EPAIR); @@ -687,28 +859,24 @@ epair_clone_destroy(struct if_clone *ifc static int epair_modevent(module_t mod, int type, void *data) { - int tmp; + int qlimit; switch (type) { case MOD_LOAD: /* For now limit us to one global mutex and one inq. */ - EPAIR_LOCK_INIT(); - epair_drv_flags = 0; - epairinq.ifq_maxlen = 16 * ifqmaxlen; /* What is a good 16? */ - if (TUNABLE_INT_FETCH("net.link.epair.netisr_maxqlen", &tmp)) - epairinq.ifq_maxlen = tmp; - mtx_init(&epairinq.ifq_mtx, "epair_inq", NULL, MTX_DEF); - netisr_register2(NETISR_EPAIR, (netisr_t *)epair_sintr, - epair_sintr_drained, &epairinq, 0); + epair_dpcpu_init(); + epair_nh.nh_qlimit = 42 * ifqmaxlen; /* 42 shall be the number. */ + if (TUNABLE_INT_FETCH("net.link.epair.netisr_maxqlen", &qlimit)) + epair_nh.nh_qlimit = qlimit; + netisr_register(&epair_nh); if_clone_attach(&epair_cloner); if (bootverbose) printf("%s initialized.\n", EPAIRNAME); break; case MOD_UNLOAD: if_clone_detach(&epair_cloner); - netisr_unregister(NETISR_EPAIR); - mtx_destroy(&epairinq.ifq_mtx); - EPAIR_LOCK_DESTROY(); + netisr_unregister(&epair_nh); + epair_dpcpu_detach(); if (bootverbose) printf("%s unloaded.\n", EPAIRNAME); break; Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Sun Jul 26 11:29:26 2009 (r195891) +++ head/sys/net/netisr.h Sun Jul 26 12:20:07 2009 (r195892) @@ -50,6 +50,7 @@ #define NETISR_ETHER 9 /* ethernet input */ #define NETISR_IPV6 10 #define NETISR_NATM 11 +#define NETISR_EPAIR 12 /* if_epair(4) */ /*- * Protocols express ordering constraints and affinity preferences by From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 14:04:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 695C1106564A; Sun, 26 Jul 2009 14:04:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578B08FC1C; Sun, 26 Jul 2009 14:04:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QE4mRe072095; Sun, 26 Jul 2009 14:04:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QE4mw6072093; Sun, 26 Jul 2009 14:04:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907261404.n6QE4mw6072093@svn.freebsd.org> From: Alexander Motin Date: Sun, 26 Jul 2009 14:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195893 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 14:04:48 -0000 Author: mav Date: Sun Jul 26 14:04:48 2009 New Revision: 195893 URL: http://svn.freebsd.org/changeset/base/195893 Log: Restore PATA device probe order, broken by PMP support implementation, requesting IDENTIFY from slave device first. This order is important for proper cable type detection by master device. PR: kern/136438 Approved by: re (kib) Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sun Jul 26 12:20:07 2009 (r195892) +++ head/sys/dev/ata/ata-all.c Sun Jul 26 14:04:48 2009 (r195893) @@ -711,7 +711,7 @@ ata_identify(device_t dev) struct ata_channel *ch = device_get_softc(dev); struct ata_device *atadev; device_t *children; - device_t child; + device_t child, master = NULL; int nchildren, i, n = ch->devices; if (bootverbose) @@ -748,6 +748,15 @@ ata_identify(device_t dev) unit = (device_get_unit(dev) << 1) + i; #endif if ((child = ata_add_child(dev, atadev, unit))) { + /* + * PATA slave should be identified first, to allow + * device cable detection on master to work properly. + */ + if (i == 0 && (n & ATA_PORTMULTIPLIER) == 0 && + (n & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << 1)) != 0) { + master = child; + continue; + } if (ata_getparam(atadev, 1)) { device_delete_child(dev, child); free(atadev, M_ATA); @@ -757,6 +766,13 @@ ata_identify(device_t dev) free(atadev, M_ATA); } } + if (master) { + atadev = device_get_softc(master); + if (ata_getparam(atadev, 1)) { + device_delete_child(dev, master); + free(atadev, M_ATA); + } + } bus_generic_probe(dev); bus_generic_attach(dev); mtx_unlock(&Giant); From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 15:06:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0469106564A; Sun, 26 Jul 2009 15:06:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEBF48FC16; Sun, 26 Jul 2009 15:06:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QF6xpn073358; Sun, 26 Jul 2009 15:06:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QF6x1v073356; Sun, 26 Jul 2009 15:06:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200907261506.n6QF6x1v073356@svn.freebsd.org> From: Michael Tuexen Date: Sun, 26 Jul 2009 15:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195894 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 15:07:00 -0000 Author: tuexen Date: Sun Jul 26 15:06:59 2009 New Revision: 195894 URL: http://svn.freebsd.org/changeset/base/195894 Log: Add a missing unlock for the inp lock when returning early from sctp_add_to_readq(). Approved by: re, rrs (mentor) MFC after: 2 weeks. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jul 26 14:04:48 2009 (r195893) +++ head/sys/netinet/sctputil.c Sun Jul 26 15:06:59 2009 (r195894) @@ -4362,6 +4362,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp control->tail_mbuf = prev; } else { /* Everything got collapsed out?? */ + SCTP_INP_READ_UNLOCK(inp); return; } if (end) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 18:11:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F522106566B; Sun, 26 Jul 2009 18:11:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D34B8FC14; Sun, 26 Jul 2009 18:11:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QIBjIT076961; Sun, 26 Jul 2009 18:11:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QIBiFo076960; Sun, 26 Jul 2009 18:11:44 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200907261811.n6QIBiFo076960@svn.freebsd.org> From: Tim Kientzle Date: Sun, 26 Jul 2009 18:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195895 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 18:11:45 -0000 Author: kientzle Date: Sun Jul 26 18:11:44 2009 New Revision: 195895 URL: http://svn.freebsd.org/changeset/base/195895 Log: The parser for Rockridge symlinks tended to insert extra slashes at the beginning of absolute targets. Thanks to Jung-uk Kim for pointing this out to me. Approved by: re (kib) Modified: head/lib/libarchive/archive_read_support_format_iso9660.c Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Sun Jul 26 15:06:59 2009 (r195894) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Sun Jul 26 18:11:44 2009 (r195895) @@ -1175,12 +1175,12 @@ static void parse_rockridge_SL1(struct file_info *file, const unsigned char *data, int data_length) { - int component_continues = 1; + const char *separator = ""; - if (!file->symlink_continues) + if (!file->symlink_continues || file->symlink.length < 1) archive_string_empty(&file->symlink); - else - archive_strcat(&file->symlink, "/"); + else if (file->symlink.s[file->symlink.length - 1] != '/') + separator = "/"; file->symlink_continues = 0; /* @@ -1217,9 +1217,8 @@ parse_rockridge_SL1(struct file_info *fi unsigned char nlen = *data++; data_length -= 2; - if (!component_continues) - archive_strcat(&file->symlink, "/"); - component_continues = 0; + archive_strcat(&file->symlink, separator); + separator = "/"; switch(flag) { case 0: /* Usual case, this is text. */ @@ -1233,7 +1232,7 @@ parse_rockridge_SL1(struct file_info *fi return; archive_strncat(&file->symlink, (const char *)data, nlen); - component_continues = 1; + separator = ""; break; case 0x02: /* Current dir. */ archive_strcat(&file->symlink, "."); @@ -1244,6 +1243,7 @@ parse_rockridge_SL1(struct file_info *fi case 0x08: /* Root of filesystem. */ archive_string_empty(&file->symlink); archive_strcat(&file->symlink, "/"); + separator = ""; break; case 0x10: /* Undefined (historically "volume root" */ archive_string_empty(&file->symlink); From owner-svn-src-all@FreeBSD.ORG Sun Jul 26 20:12:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75230106566C; Sun, 26 Jul 2009 20:12:06 +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 643568FC0C; Sun, 26 Jul 2009 20:12:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6QKC66i079212; Sun, 26 Jul 2009 20:12:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6QKC6TN079210; Sun, 26 Jul 2009 20:12:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907262012.n6QKC6TN079210@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Jul 2009 20:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195896 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 20:12:06 -0000 Author: kib Date: Sun Jul 26 20:12:06 2009 New Revision: 195896 URL: http://svn.freebsd.org/changeset/base/195896 Log: Note that COMPAT_43 requires COMPAT_FREEBSD7 too. Submitted by: Steve Kargl Approved by: re (kensmith) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Jul 26 18:11:44 2009 (r195895) +++ head/UPDATING Sun Jul 26 20:12:06 2009 (r195896) @@ -65,9 +65,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. 20090624: The ABI of various structures related to the SYSV IPC API have - been changed. As a result, the COMPAT_FREEBSD[456] kernel - options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version - to 800100. + been changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 + kernel options now all require COMPAT_FREEBSD7. + Bump __FreeBSD_version to 800100. 20090622: Layout of struct vnet has changed as routing related variables From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 07:05:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E42B41065670; Mon, 27 Jul 2009 07:05:08 +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 D07C18FC08; Mon, 27 Jul 2009 07:05:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6R758vE091851; Mon, 27 Jul 2009 07:05:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6R758M9091813; Mon, 27 Jul 2009 07:05:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907270705.n6R758M9091813@svn.freebsd.org> From: Xin LI Date: Mon, 27 Jul 2009 07:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195902 - vendor/less/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 07:05:09 -0000 Author: delphij Date: Mon Jul 27 07:05:08 2009 New Revision: 195902 URL: http://svn.freebsd.org/changeset/base/195902 Log: Vendor import of less v436. Added: vendor/less/dist/cvt.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h Modified: vendor/less/dist/LICENSE vendor/less/dist/Makefile.aut vendor/less/dist/Makefile.dsb vendor/less/dist/Makefile.dsg vendor/less/dist/Makefile.dsu vendor/less/dist/Makefile.in vendor/less/dist/Makefile.o2e vendor/less/dist/Makefile.o9c vendor/less/dist/Makefile.o9u vendor/less/dist/Makefile.wnb vendor/less/dist/Makefile.wnm vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/configure.ac vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/forwback.c vendor/less/dist/funcs.h vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkhelp.c vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/version.c Modified: vendor/less/dist/LICENSE ============================================================================== --- vendor/less/dist/LICENSE Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/LICENSE Mon Jul 27 07:05:08 2009 (r195902) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2008 Mark Nudelman +Copyright (C) 1984-2009 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: vendor/less/dist/Makefile.aut ============================================================================== --- vendor/less/dist/Makefile.aut Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.aut Mon Jul 27 07:05:08 2009 (r195902) @@ -10,10 +10,10 @@ srcdir = . SRC = \ main.c screen.c brac.c ch.c charset.c cmdbuf.c \ - command.c decode.c edit.c filename.c forwback.c \ + command.c cvt.c decode.c edit.c filename.c forwback.c \ help.c ifile.c input.c jump.c line.c linenum.c \ lsystem.c mark.c optfunc.c option.c opttbl.c os.c \ - output.c position.c prompt.c search.c signal.c \ + output.c pattern.c position.c prompt.c search.c signal.c \ tags.c ttyin.c version.c DISTFILES_W = \ defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \ @@ -24,7 +24,8 @@ DISTFILES = \ ${SRC} regexp.c regexp.h \ COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \ configure configure.ac lesskey.c lessecho.c scrsize.c \ - charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h pckeys.h position.h \ + charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \ + pckeys.h pattern.h position.h \ install.sh defines.h.in mkinstalldirs \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \ less.hlp \ @@ -109,6 +110,8 @@ dist: ${DISTFILES} cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \ echo "Creating release/$$REL/$$REL.tar.gz"; \ tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \ + echo "Signing release/$$REL/$$REL.tar.gz"; \ + gpg --detach-sign release/$$REL/$$REL.tar.gz; \ echo "Creating release/$$REL/$$REL.zip"; \ zip -rq release/$$REL/$$REL.zip $$REL; \ rm -rf $$REL Modified: vendor/less/dist/Makefile.dsb ============================================================================== --- vendor/less/dist/Makefile.dsb Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.dsb Mon Jul 27 07:05:08 2009 (r195902) @@ -18,12 +18,13 @@ EXT = .EXE .c.obj: $(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj all: less$(EXT) lesskey$(EXT) Modified: vendor/less/dist/Makefile.dsg ============================================================================== --- vendor/less/dist/Makefile.dsg Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.dsg Mon Jul 27 07:05:08 2009 (r195902) @@ -33,11 +33,12 @@ manext = 1 .c.o: ${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} all: less lesskey lessecho Modified: vendor/less/dist/Makefile.dsu ============================================================================== --- vendor/less/dist/Makefile.dsu Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.dsu Mon Jul 27 07:05:08 2009 (r195902) @@ -27,12 +27,13 @@ LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\gr .c.obj: $(CC) -c -I. -I$(INCDIR) $(CPPFLAGS) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj all: less lesskey Modified: vendor/less/dist/Makefile.in ============================================================================== --- vendor/less/dist/Makefile.in Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.in Mon Jul 27 07:05:08 2009 (r195902) @@ -43,11 +43,12 @@ SHELL = /bin/sh .c.o: ${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} @REGEX_O@ all: less$(EXEEXT) lesskey$(EXEEXT) lessecho$(EXEEXT) Modified: vendor/less/dist/Makefile.o2e ============================================================================== --- vendor/less/dist/Makefile.o2e Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.o2e Mon Jul 27 07:05:08 2009 (r195902) @@ -18,11 +18,12 @@ O = obj .c.${O}: ${CC} -c ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less.exe lesskey.exe scrsize.exe Modified: vendor/less/dist/Makefile.o9c ============================================================================== --- vendor/less/dist/Makefile.o9c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.o9c Mon Jul 27 07:05:08 2009 (r195902) @@ -22,11 +22,12 @@ O = r .c.${O}: ${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less lessecho lesskey Modified: vendor/less/dist/Makefile.o9u ============================================================================== --- vendor/less/dist/Makefile.o9u Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.o9u Mon Jul 27 07:05:08 2009 (r195902) @@ -21,11 +21,12 @@ O = r .c.${O}: ${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less lesskey Modified: vendor/less/dist/Makefile.wnb ============================================================================== --- vendor/less/dist/Makefile.wnb Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.wnb Mon Jul 27 07:05:08 2009 (r195902) @@ -25,12 +25,13 @@ LIBS = ${LIBDIR}\import32.lib ${LIBDIR}\ .c.obj: ${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj regexp.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj regexp.obj all: less lesskey lessecho Modified: vendor/less/dist/Makefile.wnm ============================================================================== --- vendor/less/dist/Makefile.wnm Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/Makefile.wnm Mon Jul 27 07:05:08 2009 (r195902) @@ -23,12 +23,13 @@ LIBS = user32.lib .c.obj: $(CC) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj regexp.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj regexp.obj all: less.exe lesskey.exe Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/NEWS Mon Jul 27 07:05:08 2009 (r195902) @@ -12,6 +12,18 @@ ====================================================================== + Major changes between "less" versions 429 and 436 + +* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". + +* Allow a fraction as the argument to the -# (--shift) option. + +* Fix highlight bug when underlined/overstruck text matches at end of line. + +* Fix non-regex searches with ctrl-R. + +====================================================================== + Major changes between "less" versions 424 and 429 * LESSOPEN pipe will now be used on standard input, if the LESSOPEN Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/README Mon Jul 27 07:05:08 2009 (r195902) @@ -1,7 +1,7 @@ - Less, version 429 + Less, version 436 - This is the distribution of less, version 429, released 11 Apr 2009. + This is the distribution of less, version 436, released 07 Jul 2009. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/brac.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/ch.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/charset.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -425,7 +425,7 @@ prchar(c) c &= 0377; if ((c < 128 || !utf_mode) && !control_char(c)) - SNPRINTF1(buf, sizeof(buf), "%c", c); + SNPRINTF1(buf, sizeof(buf), "%c", (int) c); else if (c == ESC) strcpy(buf, "ESC"); #if IS_EBCDIC_HOST @@ -442,7 +442,7 @@ prchar(c) "..V....D....TU.Z"[c]); #else else if (c < 128 && !control_char(c ^ 0100)) - SNPRINTF1(buf, sizeof(buf), "^%c", c ^ 0100); + SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100)); #endif else SNPRINTF1(buf, sizeof(buf), binfmt, c); Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/charset.h Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Mark Nudelman + * Copyright (C) 2005-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/cmd.h Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/cmdbuf.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/command.c ============================================================================== --- vendor/less/dist/command.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/command.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/configure.ac ============================================================================== --- vendor/less/dist/configure.ac Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/configure.ac Mon Jul 27 07:05:08 2009 (r195902) @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -# Copyright (C) 1984-2008 Mark Nudelman +# Copyright (C) 1984-2009 Mark Nudelman # # You may distribute under the terms of either the GNU General Public # License or the Less License, as specified in the README file. Added: vendor/less/dist/cvt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/less/dist/cvt.c Mon Jul 27 07:05:08 2009 (r195902) @@ -0,0 +1,120 @@ +/* + * Copyright (C) 1984-2009 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information about less, or for information on how to + * contact the author, see the README file. + */ + +/* + * Routines to convert text in various ways. Used by search. + */ + +#include "less.h" +#include "charset.h" + +extern int utf_mode; + +/* + * Get the length of a buffer needed to convert a string. + */ + public int +cvt_length(len, ops) + int len; + int ops; +{ + if (utf_mode) + /* + * Just copying a string in UTF-8 mode can cause it to grow + * in length. + * Four output bytes for one input byte is the worst case. + */ + len *= 4; + return (len + 1); +} + +/* + * Allocate a chpos array for use by cvt_text. + */ + public int * +cvt_alloc_chpos(len) + int len; +{ + int i; + int *chpos = (int *) ecalloc(sizeof(int), len); + /* Initialize all entries to an invalid position. */ + for (i = 0; i < len; i++) + chpos[i] = -1; + return (chpos); +} + +/* + * Convert text. Perform the transformations specified by ops. + * Returns converted text in odst. The original offset of each + * odst character (when it was in osrc) is returned in the chpos array. + */ + public void +cvt_text(odst, osrc, chpos, lenp, ops) + char *odst; + char *osrc; + int *chpos; + int *lenp; + int ops; +{ + char *dst; + char *src; + register char *src_end; + LWCHAR ch; + + if (lenp != NULL) + src_end = osrc + *lenp; + else + src_end = osrc + strlen(osrc); + + for (src = osrc, dst = odst; src < src_end; ) + { + int src_pos = src - osrc; + int dst_pos = dst - odst; + ch = step_char(&src, +1, src_end); + if ((ops & CVT_BS) && ch == '\b' && dst > odst) + { + /* Delete backspace and preceding char. */ + do { + dst--; + } while (dst > odst && + !IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst)); + } else if ((ops & CVT_ANSI) && IS_CSI_START(ch)) + { + /* Skip to end of ANSI escape sequence. */ + src++; /* skip the CSI start char */ + while (src < src_end) + if (!is_ansi_middle(*src++)) + break; + } else + { + /* Just copy the char to the destination buffer. */ + if ((ops & CVT_TO_LC) && IS_UPPER(ch)) + ch = TO_LOWER(ch); + put_wchar(&dst, ch); + /* + * Record the original position of the char. + * But if we've already recorded a position + * for this char (due to a backspace), leave + * it alone; if multiple source chars map to + * one destination char, we want the position + * of the first one. + */ + if (chpos != NULL && chpos[dst_pos] < 0) + chpos[dst_pos] = src_pos; + } + } + if ((ops & CVT_CRLF) && dst > odst && dst[-1] == '\r') + dst--; + *dst = '\0'; + if (lenp != NULL) + *lenp = dst - odst; + if (chpos != NULL) + chpos[dst - odst] = src - osrc; +} Modified: vendor/less/dist/decode.c ============================================================================== --- vendor/less/dist/decode.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/decode.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.ds ============================================================================== --- vendor/less/dist/defines.ds Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/defines.ds Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.o2 ============================================================================== --- vendor/less/dist/defines.o2 Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/defines.o2 Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.o9 ============================================================================== --- vendor/less/dist/defines.o9 Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/defines.o9 Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/defines.wn ============================================================================== --- vendor/less/dist/defines.wn Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/defines.wn Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/edit.c ============================================================================== --- vendor/less/dist/edit.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/edit.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/filename.c ============================================================================== --- vendor/less/dist/filename.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/filename.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -843,17 +843,17 @@ open_altfile(filename, pf, pfd) #else lessopen++; returnfd = 1; - if (*lessopen == '-') { - /* - * Lessopen preprocessor will accept "-" as a filename. - */ - lessopen++; - } else { - if (strcmp(filename, "-") == 0) - return (NULL); - } #endif } + if (*lessopen == '-') { + /* + * Lessopen preprocessor will accept "-" as a filename. + */ + lessopen++; + } else { + if (strcmp(filename, "-") == 0) + return (NULL); + } len = strlen(lessopen) + strlen(filename) + 2; cmd = (char *) ecalloc(len, sizeof(char)); Modified: vendor/less/dist/forwback.c ============================================================================== --- vendor/less/dist/forwback.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/forwback.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/funcs.h ============================================================================== --- vendor/less/dist/funcs.h Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/funcs.h Mon Jul 27 07:05:08 2009 (r195902) @@ -83,6 +83,9 @@ public void ungetcc (); public void ungetsc (); public void commands (); + public int cvt_length (); + public int * cvt_alloc_chpos (); + public void cvt_text (); public void init_cmds (); public void add_fcmd_table (); public void add_ecmd_table (); @@ -193,6 +196,8 @@ public void opt_l (); public void opt_j (); public void calc_jump_sline (); + public void opt_shift (); + public void calc_shift_count (); public void opt_k (); public void opt_t (); public void opt__T (); @@ -233,6 +238,10 @@ public void error (); public void ierror (); public int query (); + public int compile_pattern (); + public void uncompile_pattern (); + public int is_null_pattern (); + public int match_pattern (); public POSITION position (); public void add_forw_pos (); public void add_back_pos (); @@ -248,6 +257,7 @@ public char * eq_message (); public char * pr_string (); public char * wait_message (); + public void init_search (); public void repaint_hilite (); public void clear_attn (); public void undo_search (); Modified: vendor/less/dist/ifile.c ============================================================================== --- vendor/less/dist/ifile.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/ifile.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/input.c ============================================================================== --- vendor/less/dist/input.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/input.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -196,7 +196,7 @@ get_forw_line: c = ch_forw_get(); } - pdone(endline, c); + pdone(endline, 1); #if HILITE_SEARCH if (is_filtered(base_pos)) @@ -398,7 +398,7 @@ get_back_line: } } while (new_pos < curr_pos); - pdone(endline, ch_forw_get()); + pdone(endline, 0); #if HILITE_SEARCH if (is_filtered(base_pos)) Modified: vendor/less/dist/jump.c ============================================================================== --- vendor/less/dist/jump.c Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/jump.c Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: vendor/less/dist/less.h ============================================================================== --- vendor/less/dist/less.h Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/less.h Mon Jul 27 07:05:08 2009 (r195902) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -488,6 +488,12 @@ struct textlist #define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@" +/* Flags for cvt_text */ +#define CVT_TO_LC 01 /* Convert upper-case to lower-case */ +#define CVT_BS 02 /* Do backspace processing */ +#define CVT_CRLF 04 /* Remove CR after LF */ +#define CVT_ANSI 010 /* Remove ANSI escape sequences */ + #include "funcs.h" /* Functions not included in funcs.h */ Modified: vendor/less/dist/less.man ============================================================================== --- vendor/less/dist/less.man Mon Jul 27 04:41:04 2009 (r195901) +++ vendor/less/dist/less.man Mon Jul 27 07:05:08 2009 (r195902) @@ -809,51 +809,58 @@ LESS(1) Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number speci- fied is zero, it sets the default number of positions to one - half of the screen width. + half of the screen width. Alternately, the number may be speci- + fied as a fraction of the width of the screen, starting with a + decimal point: .5 is half of the screen width, .3 is three + tenths of the screen width, and so on. If the number is speci- + fied as a fraction, the actual number of scroll positions is + recalculated if the terminal window is resized, so that the + actual scroll remains at the specified fraction of the screen + width. --no-keypad - Disables sending the keypad initialization and deinitialization + Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. --follow-name - Normally, if the input file is renamed while an F command is - executing, less will continue to display the contents of the - original file despite its name change. If --follow-name is + Normally, if the input file is renamed while an F command is + executing, less will continue to display the contents of the + original file despite its name change. If --follow-name is specified, during an F command less will periodically attempt to reopen the file by name. If the reopen succeeds and the file is - a different file from the original (which means that a new file - has been created with the same name as the original (now + a different file from the original (which means that a new file + has been created with the same name as the original (now renamed) file), less will display the contents of that new file. - -- A command line argument of "--" marks the end of option argu- - ments. Any arguments following this are interpreted as file- + -- A command line argument of "--" marks the end of option argu- + ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins with a "-" or "+". - + If a command line option begins with +, the remainder of that - option is taken to be an initial command to less. For example, - +G tells less to start at the end of the file rather than the - beginning, and +/xyz tells it to start at the first occurrence - of "xyz" in the file. As a special case, + acts like + + If a command line option begins with +, the remainder of that + option is taken to be an initial command to less. For example, + +G tells less to start at the end of the file rather than the + beginning, and +/xyz tells it to start at the first occurrence + of "xyz" in the file. As a special case, + acts like +g; that is, it starts the display at the specified line - number (however, see the caveat under the "g" command above). - If the option starts with ++, the initial command applies to - every file being viewed, not just the first one. The + command + number (however, see the caveat under the "g" command above). + If the option starts with ++, the initial command applies to + every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an ini- tial command for every file. LINE EDITING - When entering command line at the bottom of the screen (for example, a + When entering command line at the bottom of the screen (for example, a filename for the :e command, or the pattern for a search command), cer- - tain keys can be used to manipulate the command line. Most commands - have an alternate form in [ brackets ] which can be used if a key does - not exist on a particular keyboard. (Note that the forms beginning - with ESC do not work in some MS-DOS and Windows systems because ESC is - the line erase character.) Any of these special keys may be entered - literally by preceding it with the "literal" character, either ^V or - ^A. A backslash itself may also be entered literally by entering two + tain keys can be used to manipulate the command line. Most commands + have an alternate form in [ brackets ] which can be used if a key does + not exist on a particular keyboard. (Note that the forms beginning + with ESC do not work in some MS-DOS and Windows systems because ESC is + the line erase character.) Any of these special keys may be entered + literally by preceding it with the "literal" character, either ^V or + ^A. A backslash itself may also be entered literally by entering two backslashes. LEFTARROW [ ESC-h ] @@ -863,7 +870,7 @@ LESS(1) Move the cursor one space to the right. ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] - (That is, CONTROL and LEFTARROW simultaneously.) Move the cur- + (That is, CONTROL and LEFTARROW simultaneously.) Move the cur- sor one word to the left. ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] @@ -877,18 +884,18 @@ LESS(1) Move the cursor to the end of the line. BACKSPACE - Delete the character to the left of the cursor, or cancel the + Delete the character to the left of the cursor, or cancel the command if the command line is empty. DELETE or [ ESC-x ] Delete the character under the cursor. ^BACKSPACE [ ESC-BACKSPACE ] - (That is, CONTROL and BACKSPACE simultaneously.) Delete the + (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. ^DELETE [ ESC-X or ESC-DELETE ] - (That is, CONTROL and DELETE simultaneously.) Delete the word + (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. UPARROW [ ESC-k ] @@ -897,96 +904,96 @@ LESS(1) DOWNARROW [ ESC-j ] Retrieve the next command line. - TAB Complete the partial filename to the left of the cursor. If it - matches more than one filename, the first match is entered into - the command line. Repeated TABs will cycle thru the other + TAB Complete the partial filename to the left of the cursor. If it + matches more than one filename, the first match is entered into + the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a - "/" is appended to the filename. (On MS-DOS systems, a "\" is - appended.) The environment variable LESSSEPARATOR can be used - to specify a different character to append to a directory name. + "/" is appended to the filename. (On MS-DOS systems, a "\" is + appended.) The environment variable LESSSEPARATOR can be used + to specify a different character to append to a directory name. BACKTAB [ ESC-TAB ] Like, TAB, but cycles in the reverse direction thru the matching filenames. - ^L Complete the partial filename to the left of the cursor. If it + ^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). ^U (Unix and OS/2) or ESC (MS-DOS) - Delete the entire command line, or cancel the command if the + Delete the entire command line, or cancel the command if the command line is empty. If you have changed your line-kill char- acter in Unix to something other than ^U, that character is used instead of ^U. KEY BINDINGS - You may define your own less commands by using the program lesskey (1) - to create a lesskey file. This file specifies a set of command keys - and an action associated with each key. You may also use lesskey to + You may define your own less commands by using the program lesskey (1) + to create a lesskey file. This file specifies a set of command keys + and an action associated with each key. You may also use lesskey to change the line-editing keys (see LINE EDITING), and to set environment - variables. If the environment variable LESSKEY is set, less uses that - as the name of the lesskey file. Otherwise, less looks in a standard - place for the lesskey file: On Unix systems, less looks for a lesskey - file called "$HOME/.less". On MS-DOS and Windows systems, less looks - for a lesskey file called "$HOME/_less", and if it is not found there, + variables. If the environment variable LESSKEY is set, less uses that + as the name of the lesskey file. Otherwise, less looks in a standard + place for the lesskey file: On Unix systems, less looks for a lesskey + file called "$HOME/.less". On MS-DOS and Windows systems, less looks + for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified - in the PATH environment variable. On OS/2 systems, less looks for a - lesskey file called "$HOME/less.ini", and if it is not found, then - looks for a lesskey file called "less.ini" in any directory specified + in the PATH environment variable. On OS/2 systems, less looks for a + lesskey file called "$HOME/less.ini", and if it is not found, then + looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks - for a lesskey file called "less.ini" in any directory specified in the - PATH environment variable. See the lesskey manual page for more + for a lesskey file called "less.ini" in any directory specified in the + PATH environment variable. See the lesskey manual page for more details. - A system-wide lesskey file may also be set up to provide key bindings. + A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide - file, key bindings in the local file take precedence over those in the - system-wide file. If the environment variable LESSKEY_SYSTEM is set, + file, key bindings in the local file take precedence over those in the + system-wide file. If the environment variable LESSKEY_SYSTEM is set, less uses that as the name of the system-wide lesskey file. Otherwise, - less looks in a standard place for the system-wide lesskey file: On - Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. - (However, if less was built with a different sysconf directory than + less looks in a standard place for the system-wide lesskey file: On + Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. + (However, if less was built with a different sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On - MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys- + MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys- less. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini. INPUT PREPROCESSOR - You may define an "input preprocessor" for less. Before less opens a + You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way - the contents of the file are displayed. An input preprocessor is sim- - ply an executable program (or shell script), which writes the contents + the contents of the file are displayed. An input preprocessor is sim- + ply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The con- - tents of the replacement file are then displayed in place of the con- - tents of the original file. However, it will appear to the user as if - the original file is opened; that is, less will display the original + tents of the replacement file are then displayed in place of the con- + tents of the original file. However, it will appear to the user as if + the original file is opened; that is, less will display the original filename as the name of the current file. - An input preprocessor receives one command line argument, the original - filename, as entered by the user. It should create the replacement - file, and when finished, print the name of the replacement file to its - standard output. If the input preprocessor does not output a replace- - ment filename, less uses the original file, as normal. The input pre- - processor is not called when viewing standard input. To set up an - input preprocessor, set the LESSOPEN environment variable to a command - line which will invoke your input preprocessor. This command line - should include one occurrence of the string "%s", which will be - replaced by the filename when the input preprocessor command is + An input preprocessor receives one command line argument, the original + filename, as entered by the user. It should create the replacement + file, and when finished, print the name of the replacement file to its + standard output. If the input preprocessor does not output a replace- + ment filename, less uses the original file, as normal. The input pre- + processor is not called when viewing standard input. To set up an + input preprocessor, set the LESSOPEN environment variable to a command + line which will invoke your input preprocessor. This command line + should include one occurrence of the string "%s", which will be + replaced by the filename when the input preprocessor command is invoked. When less closes a file opened in such a way, it will call another pro- - gram, called the input postprocessor, which may perform any desired - clean-up action (such as deleting the replacement file created by + gram, called the input postprocessor, which may perform any desired + clean-up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the orig- - inal filename as entered by the user, and the name of the replacement - file. To set up an input postprocessor, set the LESSCLOSE environment - variable to a command line which will invoke your input postprocessor. - It may include two occurrences of the string "%s"; the first is - replaced with the original name of the file and the second with the + inal filename as entered by the user, and the name of the replacement + file. To set up an input postprocessor, set the LESSCLOSE environment + variable to a command line which will invoke your input postprocessor. + It may include two occurrences of the string "%s"; the first is + replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. - For example, on many Unix systems, these two scripts will allow you to + For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let less view them directly: lessopen.sh: @@ -1005,25 +1012,25 @@ LESS(1) #! /bin/sh rm $2 - To use these scripts, put them both where they can be executed and set + To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More - complex LESSOPEN and LESSCLOSE scripts may be written to accept other + complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. - It is also possible to set up an input preprocessor to pipe the file - data directly to less, rather than putting the data into a replacement + It is also possible to set up an input preprocessor to pipe the file + data directly to less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before start- ing to view it. An input preprocessor that works this way is called an - input pipe. An input pipe, instead of writing the name of a replace- - ment file on its standard output, writes the entire contents of the - replacement file on its standard output. If the input pipe does not - write any characters on its standard output, then there is no replace- - ment file and less uses the original file, as normal. To use an input - pipe, make the first character in the LESSOPEN environment variable a - vertical bar (|) to signify that the input preprocessor is an input + input pipe. An input pipe, instead of writing the name of a replace- + ment file on its standard output, writes the entire contents of the + replacement file on its standard output. If the input pipe does not + write any characters on its standard output, then there is no replace- + ment file and less uses the original file, as normal. To use an input + pipe, make the first character in the LESSOPEN environment variable a + vertical bar (|) to signify that the input preprocessor is an input pipe. - For example, on many Unix systems, this script will work like the pre- + For example, on many Unix systems, this script will work like the pre- vious example scripts: lesspipe.sh: @@ -1034,15 +1041,21 @@ LESS(1) esac To use this script, put it where it can be executed and set - LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE - postprocessor can be used, but it is usually not necessary since there + LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE + postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-". - For compatibility with previous versions of less, the input pipe is not - used if less is viewing standard input. However, if the character - after the vertical bar is a dash (-), the input pipe is used on stan- - dard input as well as other files. + For compatibility with previous versions of less, the input preproces- + sor or pipe is not used if less is viewing standard input. However, if + the first character of LESSOPEN is a dash (-), the input preprocessor + is used on standard input as well as other files. In this case, the + dash is not considered to be part of the preprocessor command. If *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 07:07:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77FB81065673; Mon, 27 Jul 2009 07:07:56 +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 4C9078FC1B; Mon, 27 Jul 2009 07:07:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6R77uWH091936; Mon, 27 Jul 2009 07:07:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6R77uuC091935; Mon, 27 Jul 2009 07:07:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907270707.n6R77uuC091935@svn.freebsd.org> From: Xin LI Date: Mon, 27 Jul 2009 07:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195903 - vendor/less/v436 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 07:07:56 -0000 Author: delphij Date: Mon Jul 27 07:07:56 2009 New Revision: 195903 URL: http://svn.freebsd.org/changeset/base/195903 Log: Tag for less v436. Added: vendor/less/v436/ - copied from r195902, vendor/less/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 12:09:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27892106566C; Mon, 27 Jul 2009 12:09:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15CCD8FC13; Mon, 27 Jul 2009 12:09:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RC9W9V099935; Mon, 27 Jul 2009 12:09:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RC9Wis099934; Mon, 27 Jul 2009 12:09:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200907271209.n6RC9Wis099934@svn.freebsd.org> From: Michael Tuexen Date: Mon, 27 Jul 2009 12:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195904 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 12:09:33 -0000 Author: tuexen Date: Mon Jul 27 12:09:32 2009 New Revision: 195904 URL: http://svn.freebsd.org/changeset/base/195904 Log: Get rid of unused field. This will also be deleted in the official speciication of the SCTP socket API. Approved by:re, rrs (mentor) Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Mon Jul 27 07:07:56 2009 (r195903) +++ head/sys/netinet/sctp_uio.h Mon Jul 27 12:09:32 2009 (r195904) @@ -95,7 +95,6 @@ struct sctp_sndrcvinfo { uint16_t sinfo_stream; uint16_t sinfo_ssn; uint16_t sinfo_flags; - uint16_t sinfo_pr_policy; uint32_t sinfo_ppid; uint32_t sinfo_context; uint32_t sinfo_timetolive; From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 13:34:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C1A106564A; Mon, 27 Jul 2009 13:34:24 +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 7A3908FC12; Mon, 27 Jul 2009 13:34:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id F3A0746B99; Mon, 27 Jul 2009 09:34:23 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2B9158A0A4; Mon, 27 Jul 2009 09:34:23 -0400 (EDT) From: John Baldwin To: Scott Long Date: Mon, 27 Jul 2009 08:21:51 -0400 User-Agent: KMail/1.9.7 References: <4A68DA56.60301@samsco.org> <20090724.235420.319856209.imp@bsdimp.com> <4A6A855C.7090003@samsco.org> In-Reply-To: <4A6A855C.7090003@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907270821.52571.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 27 Jul 2009 09:34:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org, svn-src-head@freebsd.org, mav@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:34:25 -0000 On Saturday 25 July 2009 12:09:00 am Scott Long wrote: > M. Warner Losh wrote: > > In message: <4A6A7F2D.90807@samsco.org> > > Scott Long writes: > > : M. Warner Losh wrote: > > : > In message: <4A68DA56.60301@samsco.org> > > : > Scott Long writes: > > : > : M. Warner Losh wrote: > > : > : > In message: <4A66D0F4.4030108@FreeBSD.org> > > : > : > Alexander Motin writes: > > : > : > : Colin Percival wrote: > > : > : > : > Author: cperciva > > : > : > : > Date: Wed Jul 22 03:50:54 2009 > > : > : > : > New Revision: 195817 > > : > : > : > URL: http://svn.freebsd.org/changeset/base/195817 > > : > : > : > > > : > : > : > Log: > > : > : > : > Remove the "dedicated disk mode" partitioning option from sysinstall, in > > : > : > : > both the disk partitioning screen (the 'F' key) and via install.cfg (the > > : > : > : > VAR_DEDICATED_DISK option). This functionality is currently broken in 8.x > > : > : > : > due to libdisk and geom generating different partition names; this commit > > : > : > : > merely acts to help steer users away from the breakage. > > : > : > : > > > : > : > : > Submitted by: randi > > : > : > : > Approved by: re (kensmith) > > : > : > : > > > : > : > : > Modified: > > : > : > : > head/usr.sbin/sysinstall/disks.c > > : > : > : > > : > : > : Is there any other way to not align FS block to the ugly legacy 63 > > : > : > : sectors per track boundary with sysinstall now? I think RAIDs won't be > > : > : > : happy. May be it would be better to fix it? > > : > : > > > : > : > The reason we do it like this is because the boot blocks occupy the > > : > : > first cylinder group. Which with today's fake goemetry is 63 > > : > : > blocks... > > : > : > > > : > : > > : > : I already covered this. Unfortunately, Randi didn't take my bait. > > : > : Anyways, '63' is a minimum, it's not a singular value. It's also > > : > : an incredibly bad default. > > : > > > : > Yes. 256 is just as good as 63, unless the geometry reports more than > > : > 256 heads, which I don't think is possible... > > : > > > : > Warner > > : > > : If there is a BIOS in existence that can't find sector 256, then it > > : likely can't boot off of anything other than partition 1 in the fdisk > > : table. I bet that bugs like that were likely caught 15-20 years ago. > > > > I think you were missing the point I was trying to make, I must have > > been unclear. > > > > If there were more than 256 sectors in the first cylinder, then > > starting at 256 would overlap. This is largely a theoretical > > problem, I think, since I don't think that the BIOS can report a > > geometry > 64. > > > > The only issue that I can think of is that FreeBSD's fdisk wants to > > have things on cylinder boundaries, which 256 isn't, so fdisk will > > bitch and moan... > > > > Warner > > Ah, we will never be freed of the CHS bonds, will we. Oh well. GPT doesn't use C/H/S and thus doesn't have the weird limitations of the MBR + BSD label arrangement. As soon as sysinstall can install to a GPT-labelled disk you will be free of the bonds in sysinstall. I think the easiest way to allow for that w/o dealing with the headaches of fdisk.c and label.c and libgeom support in sysinstall, etc., etc. is to add a sort of "cheat" mode to sysinstall where you can say "look, I've already partitioned my drives and newfs'd my filesystems and they are mounted at '/foo', go install all the bits into there". We could then let people setup their disks using command line tools with the livefs or what is in the install rescue build using GPT or ZFS or gmirror, etc. Getting /etc/fstab correct in that instance becomes a bit more tricky, but not impossible. (If nothing else one could take the output of mount -p, find all the paths starting with /foo, chop off the leading /foo, and write that out as an initial /etc/fstab.) That would at least allow people to do more creative things with disks with sysinstall until the disk labeller can be overhauled. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 13:36:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0606106566B; Mon, 27 Jul 2009 13:36:35 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE4EF8FC08; Mon, 27 Jul 2009 13:36:35 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RDaZZD001820; Mon, 27 Jul 2009 13:36:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RDaZgI001818; Mon, 27 Jul 2009 13:36:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907271336.n6RDaZgI001818@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Jul 2009 13:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195905 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:36:36 -0000 Author: rpaulo Date: Mon Jul 27 13:36:35 2009 New Revision: 195905 URL: http://svn.freebsd.org/changeset/base/195905 Log: * Document the dev.asmc.N.light.control sysctl. [1] * Add more models that have the SMC. PR: 137168 [1] Submitted by: Patrick Lamaiziere Approved by: re (kib) Modified: head/share/man/man4/asmc.4 Modified: head/share/man/man4/asmc.4 ============================================================================== --- head/share/man/man4/asmc.4 Mon Jul 27 12:09:32 2009 (r195904) +++ head/share/man/man4/asmc.4 Mon Jul 27 13:36:35 2009 (r195905) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2007, 2008 Rui Paulo +.\" Copyright (c) 2007, 2008, 2009 Rui Paulo .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2008 +.Dd July 27, 2009 .Dt ASMC 4 .Os .Sh NAME @@ -54,11 +54,17 @@ The SMC is known to be found on the foll .Pp .Bl -bullet -offset indent -compact .It -MacBook (any generation) +MacBook .It -MacBook Pro (any generation) +MacBook Pro .It Intel MacMini +.It +Mac Pro +.It +MacBook Air +.It +Intel iMac .El .Pp With this driver, you can configure your keyboard backlight @@ -72,15 +78,16 @@ under the device tree .Sh KEYBOARD BACKLIGHT On .Tn MacBook Pro -systems, you can control the keyboard brightness by writing values to +systems, you can control the keyboard brightness by writing a value to the +.Va dev.asmc.%d.light.control +sysctl MIB. +.Pp +The following sysctl MIBs contains the raw value returned by the left +and right light sensors: .Va dev.asmc.%d.light.left or -.Va dev.asmc.%d.light.right -sysctl MIBs. -.Pp -Each of these sysctl MIBs contains the raw value returned by the left -and right light sensors. +.Va dev.asmc.%d.light.right . .Sh TEMPERATURES The number of temperature sensors and their description varies among systems. From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 13:41:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5529B1065670; Mon, 27 Jul 2009 13:41:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4387E8FC19; Mon, 27 Jul 2009 13:41:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RDfk3j001970; Mon, 27 Jul 2009 13:41:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RDfk8H001968; Mon, 27 Jul 2009 13:41:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200907271341.n6RDfk8H001968@svn.freebsd.org> From: Michael Tuexen Date: Mon, 27 Jul 2009 13:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195906 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:41:46 -0000 Author: tuexen Date: Mon Jul 27 13:41:45 2009 New Revision: 195906 URL: http://svn.freebsd.org/changeset/base/195906 Log: Fix the handling of unordered messages when using PR-SCTP. Approved by: re, rrs (mentor) MFC after: 3 weeks. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Jul 27 13:36:35 2009 (r195905) +++ head/sys/netinet/sctp_indata.c Mon Jul 27 13:41:45 2009 (r195906) @@ -5923,7 +5923,13 @@ sctp_flush_reassm_for_str_seq(struct sct chk = TAILQ_FIRST(&asoc->reasmqueue); while (chk) { at = TAILQ_NEXT(chk, sctp_next); - if (chk->rec.data.stream_number != stream) { + /* + * Do not toss it if on a different stream or marked + * for unordered delivery in which case the stream + * sequence number has no meaning. + */ + if ((chk->rec.data.stream_number != stream) || + ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { chk = at; continue; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 13:51:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7121065672; Mon, 27 Jul 2009 13:51:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1388FC15; Mon, 27 Jul 2009 13:51:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RDptLT002242; Mon, 27 Jul 2009 13:51:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RDptNX002239; Mon, 27 Jul 2009 13:51:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907271351.n6RDptNX002239@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Jul 2009 13:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 13:51:55 -0000 Author: rpaulo Date: Mon Jul 27 13:51:55 2009 New Revision: 195907 URL: http://svn.freebsd.org/changeset/base/195907 Log: Refine the MacBook hack to only match early models that have Intel ICH. Discussed with: kjim Approved by: re (kib) Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Jul 27 13:41:45 2009 (r195906) +++ head/sys/amd64/amd64/machdep.c Mon Jul 27 13:51:55 2009 (r195907) @@ -213,7 +213,10 @@ cpu_startup(dummy) */ sysenv = getenv("smbios.system.product"); if (sysenv != NULL) { - if (strncmp(sysenv, "MacBook", 7) == 0) { + if (strncmp(sysenv, "MacBook1,1", 10) == 0 || + strncmp(sysenv, "MacBookPro1,1", 13) == 0 || + strncmp(sysenv, "MacBookPro1,2", 13) == 0 || + strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " "Intel ICH.\n"); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jul 27 13:41:45 2009 (r195906) +++ head/sys/i386/i386/machdep.c Mon Jul 27 13:51:55 2009 (r195907) @@ -257,7 +257,10 @@ cpu_startup(dummy) */ sysenv = getenv("smbios.system.product"); if (sysenv != NULL) { - if (strncmp(sysenv, "MacBook", 7) == 0) { + if (strncmp(sysenv, "MacBook1,1", 10) == 0 || + strncmp(sysenv, "MacBookPro1,1", 13) == 0 || + strncmp(sysenv, "MacBookPro1,2", 13) == 0 || + strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " "Intel ICH.\n"); From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:05:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D88711065670; Mon, 27 Jul 2009 14:05:05 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 928B68FC15; Mon, 27 Jul 2009 14:05:05 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:56038 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1MVQop-00075R-5y; Mon, 27 Jul 2009 16:04:49 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id CCA55BC4B1; Mon, 27 Jul 2009 16:04:45 +0200 (CEST) Message-Id: From: Thomas Backman To: Rui Paulo In-Reply-To: <200907271351.n6RDptNX002239@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 27 Jul 2009 16:04:43 +0200 References: <200907271351.n6RDptNX002239@svn.freebsd.org> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1MVQop-00075R-5y. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MVQop-00075R-5y 38ba588d934717f3d1f0fb09efacda02 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:05:06 -0000 On Jul 27, 2009, at 15:51, Rui Paulo wrote: > Author: rpaulo > Date: Mon Jul 27 13:51:55 2009 > New Revision: 195907 > URL: http://svn.freebsd.org/changeset/base/195907 > > Log: > Refine the MacBook hack to only match early models that have Intel > ICH. Hmm, My MacBookPro2,2 has an ICH7M chipset. Does that count? :-) Regards, Thomas From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:13:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B6081065675; Mon, 27 Jul 2009 14:13:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 0887F8FC1B; Mon, 27 Jul 2009 14:13:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4E8B858296; Mon, 27 Jul 2009 08:45:18 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id sLgHfm1jbyL4; Mon, 27 Jul 2009 08:45:18 -0500 (CDT) Received: from wanderer.tachypleus.net (unknown [76.210.76.212]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 1A83C5827A; Mon, 27 Jul 2009 08:45:16 -0500 (CDT) Message-ID: <4A6DAF6B.1050701@freebsd.org> Date: Mon, 27 Jul 2009 08:45:15 -0500 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.22 (X11/20090727) MIME-Version: 1.0 To: John Baldwin References: <4A68DA56.60301@samsco.org> <20090724.235420.319856209.imp@bsdimp.com> <4A6A855C.7090003@samsco.org> <200907270821.52571.jhb@freebsd.org> In-Reply-To: <200907270821.52571.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, cperciva@freebsd.org, svn-src-head@freebsd.org, mav@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r195817 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:13:55 -0000 John Baldwin wrote: > [snipped] >> Ah, we will never be freed of the CHS bonds, will we. Oh well. >> > > GPT doesn't use C/H/S and thus doesn't have the weird limitations of the MBR + > BSD label arrangement. As soon as sysinstall can install to a GPT-labelled > disk you will be free of the bonds in sysinstall. I think the easiest way to > allow for that w/o dealing with the headaches of fdisk.c and label.c and > libgeom support in sysinstall, etc., etc. is to add a sort of "cheat" mode to > sysinstall where you can say "look, I've already partitioned my drives and > newfs'd my filesystems and they are mounted at '/foo', go install all the > bits into there". We could then let people setup their disks using command > line tools with the livefs or what is in the install rescue build using GPT > or ZFS or gmirror, etc. Getting /etc/fstab correct in that instance becomes > a bit more tricky, but not impossible. (If nothing else one could take the > output of mount -p, find all the paths starting with /foo, chop off the > leading /foo, and write that out as an initial /etc/fstab.) That would at > least allow people to do more creative things with disks with sysinstall > until the disk labeller can be overhauled. > > This would be extremely useful also on PowerPC, and probably some embedded systems as well (though I doubt they are using sysinstall). sysinstall currently cannot write APM partitions, so we don't currently ship a functional installer on PPC. However, gpart can write APM partitions, and so this even this stopgap would be the difference between an installable 8.0-RELEASE on PowerPC and an uninstallable one for many users. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:22:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D230106564A; Mon, 27 Jul 2009 14:22:09 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 795E18FC0A; Mon, 27 Jul 2009 14:22:09 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6REM9NW002956; Mon, 27 Jul 2009 14:22:09 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6REM9fR002950; Mon, 27 Jul 2009 14:22:09 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907271422.n6REM9fR002950@svn.freebsd.org> From: Rui Paulo Date: Mon, 27 Jul 2009 14:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195908 - in head: sbin/ifconfig sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:22:10 -0000 Author: rpaulo Date: Mon Jul 27 14:22:09 2009 New Revision: 195908 URL: http://svn.freebsd.org/changeset/base/195908 Log: Mesh fixes, namely: * don't clobber proxy entries * HWMP seq number processing, including discard of old frames * flush routing table entries based on nexthop * print route flags in ifconfig * more debugging messages and comments Proxy changes submitted by sam. Approved by: re (kib) Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Jul 27 13:51:55 2009 (r195907) +++ head/sbin/ifconfig/ifieee80211.c Mon Jul 27 14:22:09 2009 (r195908) @@ -3952,9 +3952,9 @@ list_regdomain(int s, int channelsalso) static void list_mesh(int s) { - int i; struct ieee80211req ireq; struct ieee80211req_mesh_route routes[128]; + struct ieee80211req_mesh_route *rt; (void) memset(&ireq, 0, sizeof(ireq)); (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); @@ -3965,23 +3965,26 @@ list_mesh(int s) if (ioctl(s, SIOCG80211, &ireq) < 0) err(1, "unable to get the Mesh routing table"); - printf("%-17.17s %-17.17s %4s %4s %4s %6s\n" + printf("%-17.17s %-17.17s %4s %4s %4s %6s %s\n" , "DEST" , "NEXT HOP" , "HOPS" , "METRIC" , "LIFETIME" - , "MSEQ"); + , "MSEQ" + , "FLAGS"); - for (i = 0; i < ireq.i_len / sizeof(*routes); i++) { + for (rt = &routes[0]; rt - &routes[0] < ireq.i_len / sizeof(*rt); rt++){ printf("%s ", - ether_ntoa((const struct ether_addr *)routes[i].imr_dest)); - printf("%s %4u %4u %6u %6u\n", - ether_ntoa((const struct ether_addr *) - routes[i].imr_nexthop), - routes[i].imr_nhops, routes[i].imr_metric, - routes[i].imr_lifetime, - routes[i].imr_lastmseq); + ether_ntoa((const struct ether_addr *)rt->imr_dest)); + printf("%s %4u %4u %6u %6u %c%c\n", + ether_ntoa((const struct ether_addr *)rt->imr_nexthop), + rt->imr_nhops, rt->imr_metric, rt->imr_lifetime, + rt->imr_lastmseq, + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_VALID) ? + 'V' : '!', + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_PROXY) ? + 'P' : ' '); } } Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Mon Jul 27 13:51:55 2009 (r195907) +++ head/sys/net80211/ieee80211_hwmp.c Mon Jul 27 14:22:09 2009 (r195908) @@ -137,15 +137,18 @@ static const uint8_t broadcastaddr[IEEE8 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; typedef uint32_t ieee80211_hwmp_seq; -#define IEEE80211_HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) -#define IEEE80211_HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) +#define HWMP_SEQ_LT(a, b) ((int32_t)((a)-(b)) < 0) +#define HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define HWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) +#define HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) /* * Private extension of ieee80211_mesh_route. */ struct ieee80211_hwmp_route { - ieee80211_hwmp_seq hr_seq; /* HWMP sequence number */ - ieee80211_hwmp_seq hr_preqid; /* Last PREQ ID seen */ + ieee80211_hwmp_seq hr_seq; /* last HWMP seq seen from dst*/ + ieee80211_hwmp_seq hr_preqid; /* last PREQ ID seen from dst */ + ieee80211_hwmp_seq hr_targetseq; /* seq. no. on our latest PREQ*/ int hr_preqretries; }; struct ieee80211_hwmp_state { @@ -274,7 +277,6 @@ hwmp_newstate(struct ieee80211vap *vap, __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg); - /* Flush the table on RUN -> !RUN, e.g. interface down & up */ if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) callout_drain(&hs->hs_roottimer); if (nstate == IEEE80211_S_RUN) @@ -656,8 +658,9 @@ hwmp_rootmode_cb(void *arg) IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, "%s", "send broadcast PREQ"); - /* XXX check portal role */ preq.preq_flags = IEEE80211_MESHPREQ_FLAGS_AM; + if (ms->ms_flags & IEEE80211_MESHFLAGS_PORTAL) + preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_PR; if (hs->hs_rootmode == IEEE80211_HWMP_ROOTMODE_PROACTIVE) preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_PP; preq.preq_hopcount = 0; @@ -695,8 +698,8 @@ hwmp_rootmode_rann_cb(void *arg) IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, "%s", "send broadcast RANN"); - /* XXX check portal role */ - rann.rann_flags = 0; + if (ms->ms_flags & IEEE80211_MESHFLAGS_PORTAL) + rann.rann_flags |= IEEE80211_MESHRANN_FLAGS_PR; rann.rann_hopcount = 0; rann.rann_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(rann.rann_addr, vap->iv_myaddr); @@ -717,7 +720,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, { struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt = NULL; - struct ieee80211_hwmp_route *hr; + struct ieee80211_mesh_route *rtorig = NULL; + struct ieee80211_hwmp_route *hrorig; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; struct ieee80211_meshprep_ie prep; @@ -744,9 +748,26 @@ hwmp_recv_preq(struct ieee80211vap *vap, preq->preq_origaddr, NULL, "%s", "not accepting PREQ"); return; } + rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); + if (rtorig == NULL) + rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); + hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route); + /* + * Sequence number validation. + */ + if (HWMP_SEQ_LEQ(preq->preq_id, hrorig->hr_preqid) && + HWMP_SEQ_LEQ(preq->preq_origseq, hrorig->hr_seq)) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREQ from %s, old seq no %u <= %u", + ether_sprintf(preq->preq_origaddr), + preq->preq_origseq, hrorig->hr_seq); + return; + } + hrorig->hr_preqid = preq->preq_id; + hrorig->hr_seq = preq->preq_origseq; + /* * Check if the PREQ is addressed to us. - * XXX: check if this is part of a proxy address. */ if (IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -823,8 +844,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, } rt = ieee80211_mesh_rt_find(vap, PREQ_TADDR(0)); - /* XXX missing. Check for AE bit and update proxy information */ - /* * Forwarding and Intermediate reply for PREQs with 1 target. */ @@ -837,11 +856,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ if (rt != NULL && (rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { - - hr = IEEE80211_MESH_ROUTE_PRIV(rt, - struct ieee80211_hwmp_route); - hr->hr_preqid = preq->preq_id; - hr->hr_seq = preq->preq_origseq; if (preq->preq_ttl > 1 && preq->preq_hopcount < hs->hs_maxhops) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -880,13 +894,13 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(&prep.prep_targetaddr, preq->preq_origaddr); - prep.prep_targetseq = hr->hr_seq; + prep.prep_targetseq = hrorig->hr_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = rt->rt_metric + ms->ms_pmetric->mpm_metric(ni); IEEE80211_ADDR_COPY(&prep.prep_origaddr, PREQ_TADDR(0)); - prep.prep_origseq = hs->hs_seq++; + prep.prep_origseq = hrorig->hr_seq; hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &prep); } @@ -906,12 +920,12 @@ hwmp_recv_preq(struct ieee80211vap *vap, return; } } - hr = IEEE80211_MESH_ROUTE_PRIV(rt, - struct ieee80211_hwmp_route); rt->rt_metric = preq->preq_metric; rt->rt_lifetime = preq->preq_lifetime; - hr->hr_seq = preq->preq_origseq; - hr->hr_preqid = preq->preq_id; + hrorig = IEEE80211_MESH_ROUTE_PRIV(rt, + struct ieee80211_hwmp_route); + hrorig->hr_seq = preq->preq_origseq; + hrorig->hr_preqid = preq->preq_id; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "forward PREQ from %s", @@ -984,25 +998,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "received PREP from %s", ether_sprintf(prep->prep_origaddr)); - /* - * If it's NOT for us, propagate the PREP. - */ - if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr) && - prep->prep_ttl > 1 && prep->prep_hopcount < hs->hs_maxhops) { - struct ieee80211_meshprep_ie pprep; /* propagated PREP */ - - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "propagate PREP from %s", - ether_sprintf(prep->prep_origaddr)); - - memcpy(&pprep, prep, sizeof(pprep)); - pprep.prep_hopcount += 1; - pprep.prep_ttl -= 1; - pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); - IEEE80211_ADDR_COPY(pprep.prep_origaddr, vap->iv_myaddr); - hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); - } - rt = ieee80211_mesh_rt_find(vap, prep->prep_origaddr); if (rt == NULL) { /* @@ -1022,48 +1017,86 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_lifetime = prep->prep_lifetime; rt->rt_metric = prep->prep_metric; rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "add root path to %s nhops %d metric %d (PREP)", + ether_sprintf(prep->prep_origaddr), + rt->rt_nhops, rt->rt_metric); return; } return; } + /* + * Sequence number validation. + */ + hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + if (HWMP_SEQ_LEQ(prep->prep_origseq, hr->hr_seq)) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP from %s, old seq no %u <= %u", + ether_sprintf(prep->prep_origaddr), + prep->prep_origseq, hr->hr_seq); + return; + } + hr->hr_seq = prep->prep_origseq; + /* + * If it's NOT for us, propagate the PREP. + */ + if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr) && + prep->prep_ttl > 1 && prep->prep_hopcount < hs->hs_maxhops) { + struct ieee80211_meshprep_ie pprep; /* propagated PREP */ + + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "propagate PREP from %s", + ether_sprintf(prep->prep_origaddr)); + + memcpy(&pprep, prep, sizeof(pprep)); + pprep.prep_hopcount += 1; + pprep.prep_ttl -= 1; + pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); + IEEE80211_ADDR_COPY(pprep.prep_origaddr, vap->iv_myaddr); + hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); + } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (prep->prep_targetseq == hr->hr_seq) { - int useprep = 0; + if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) { + /* NB: never clobber a proxy entry */; + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP for %s, route is marked PROXY", + ether_sprintf(prep->prep_origaddr)); + vap->iv_stats.is_hwmp_proxy++; + } else if (prep->prep_targetseq == hr->hr_targetseq) { /* * Check if we already have a path to this node. * If we do, check if this path reply contains a * better route. */ - if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) - useprep = 1; - else if (prep->prep_hopcount < rt->rt_nhops || - prep->prep_metric < rt->rt_metric) - useprep = 1; - if (useprep) { + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || + (prep->prep_hopcount < rt->rt_nhops || + prep->prep_metric < rt->rt_metric)) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "%s path to %s, hopcount %d:%d metric %d:%d", + rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? + "prefer" : "update", + ether_sprintf(prep->prep_origaddr), + rt->rt_nhops, prep->prep_hopcount, + rt->rt_metric, prep->prep_metric); IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); rt->rt_nhops = prep->prep_hopcount; rt->rt_lifetime = prep->prep_lifetime; rt->rt_metric = prep->prep_metric; rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; + } else { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "ignore PREP for %s, hopcount %d:%d metric %d:%d", + ether_sprintf(prep->prep_origaddr), + rt->rt_nhops, prep->prep_hopcount, + rt->rt_metric, prep->prep_metric); } } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP from %s, wrong seqno %u != %u", + "discard PREP for %s, wrong seqno %u != %u", ether_sprintf(prep->prep_origaddr), prep->prep_targetseq, hr->hr_seq); vap->iv_stats.is_hwmp_wrongseq++; } - - /* - * XXX: If it's for us and the AE bit is set, update the - * proxy information table. - */ - - /* - * XXX: If it's NOT for us and the AE bit is set, - * update the proxy information table. - */ - /* * Check for frames queued awaiting path discovery. * XXX probably can tell exactly and avoid remove call @@ -1125,7 +1158,8 @@ hwmp_peerdown(struct ieee80211_node *ni) perr.perr_ndests = 1; IEEE80211_ADDR_COPY(PERR_DADDR(0), rt->rt_dest); PERR_DSEQ(0) = hr->hr_seq; - ieee80211_mesh_rt_del(vap, ni->ni_macaddr); + /* NB: flush everything passing through peer */ + ieee80211_mesh_rt_flush_peer(vap, ni->ni_macaddr); hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr); } #undef PERR_DADDR @@ -1160,8 +1194,9 @@ hwmp_recv_perr(struct ieee80211vap *vap, continue; hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (PERR_DSEQ(i) >= hr->hr_seq) { + if (HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) { ieee80211_mesh_rt_del(vap, rt->rt_dest); + ieee80211_mesh_rt_flush_peer(vap, rt->rt_dest); rt = NULL; forward = 1; } @@ -1174,7 +1209,8 @@ hwmp_recv_perr(struct ieee80211vap *vap, IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "propagate PERR from %s", ether_sprintf(wh->i_addr2)); memcpy(&pperr, perr, sizeof(*perr)); - hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &pperr); + hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, + &pperr); } } #undef PEER_DADDR @@ -1233,7 +1269,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, return; } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (rann->rann_seq > hr->hr_seq && rann->rann_ttl > 1 && + if (HWMP_SEQ_GT(rann->rann_seq, hr->hr_seq) && rann->rann_ttl > 1 && rann->rann_hopcount < hs->hs_maxhops && (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) { memcpy(&prann, rann, sizeof(prann)); @@ -1302,10 +1338,8 @@ hwmp_discover(struct ieee80211vap *vap, hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { - if (hr->hr_preqid == 0) { - hr->hr_seq = ++hs->hs_seq; - hr->hr_preqid = ++hs->hs_preqid; - } + if (hr->hr_targetseq == 0) + hr->hr_targetseq = ++hs->hs_seq; rt->rt_metric = IEEE80211_MESHLMETRIC_INITIALVAL; rt->rt_lifetime = ticks_to_msecs(ieee80211_hwmp_pathtimeout); @@ -1321,9 +1355,9 @@ hwmp_discover(struct ieee80211vap *vap, preq.preq_flags = 0; preq.preq_hopcount = 0; preq.preq_ttl = ms->ms_ttl; - preq.preq_id = hr->hr_preqid; + preq.preq_id = ++hs->hs_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); - preq.preq_origseq = hr->hr_seq; + preq.preq_origseq = hr->hr_targetseq; preq.preq_lifetime = rt->rt_lifetime; preq.preq_metric = rt->rt_metric; preq.preq_tcount = 1; Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Jul 27 13:51:55 2009 (r195907) +++ head/sys/net80211/ieee80211_ioctl.h Mon Jul 27 14:22:09 2009 (r195908) @@ -240,8 +240,9 @@ struct ieee80211_stats { uint32_t is_mesh_rtaddfailed; /* route add failed */ uint32_t is_mesh_notproxy; /* dropped 'cuz not proxying */ uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ + uint32_t is_hwmp_proxy; /* PREP for proxy route */ - uint32_t is_spare[12]; + uint32_t is_spare[11]; }; /* @@ -333,10 +334,13 @@ enum { }; struct ieee80211req_mesh_route { + uint8_t imr_flags; +#define IEEE80211_MESHRT_FLAGS_VALID 0x01 +#define IEEE80211_MESHRT_FLAGS_PROXY 0x02 uint8_t imr_dest[IEEE80211_ADDR_LEN]; uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; uint16_t imr_nhops; - uint16_t imr_pad; + uint8_t imr_pad; uint32_t imr_metric; uint32_t imr_lifetime; uint32_t imr_lastmseq; Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Mon Jul 27 13:51:55 2009 (r195907) +++ head/sys/net80211/ieee80211_mesh.c Mon Jul 27 14:22:09 2009 (r195908) @@ -236,6 +236,8 @@ ieee80211_mesh_proxy_check(struct ieee80 "%s", "unable to add proxy entry"); vap->iv_stats.is_mesh_rtaddfailed++; } else { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, dest, + "%s", "add proxy entry"); IEEE80211_ADDR_COPY(rt->rt_nexthop, vap->iv_myaddr); rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID | IEEE80211_MESHRT_FLAGS_PROXY; @@ -301,6 +303,21 @@ ieee80211_mesh_rt_flush(struct ieee80211 MESH_RT_UNLOCK(ms); } +void +ieee80211_mesh_rt_flush_peer(struct ieee80211vap *vap, + const uint8_t peer[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt, *next; + + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { + if (IEEE80211_ADDR_EQ(rt->rt_nexthop, peer)) + mesh_rt_del(ms, rt); + } + MESH_RT_UNLOCK(ms); +} + /* * Flush expired routing entries, i.e. those in invalid state for * some time. @@ -770,6 +787,7 @@ mesh_generateid(struct ieee80211vap *vap /* * Verifies if we already received this packet by checking its * sequence number. + * Returns 0 if the frame is to be accepted, 1 otherwise. */ static int mesh_checkpseq(struct ieee80211vap *vap, @@ -779,11 +797,16 @@ mesh_checkpseq(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_find(vap, source); if (rt == NULL) { + rt = ieee80211_mesh_rt_add(vap, source); + if (rt == NULL) { + IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, source, + "%s", "add mcast route failed"); + vap->iv_stats.is_mesh_rtaddfailed++; + return 1; + } IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, source, "add mcast route, mesh seqno %d", seq); - rt = ieee80211_mesh_rt_add(vap, source); - if (rt != NULL) - rt->rt_lastmseq = seq; + rt->rt_lastmseq = seq; return 0; } if (IEEE80211_MESH_SEQ_GEQ(rt->rt_lastmseq, seq)) { @@ -1159,9 +1182,6 @@ mesh_input(struct ieee80211_node *ni, st goto out; } if (mesh_checkpseq(vap, addr, seq) != 0) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, - addr, "data", "duplicate mesh seqno %u ttl %u", - seq, mc->mc_ttl); vap->iv_stats.is_rx_dup++; goto out; } @@ -2642,6 +2662,7 @@ mesh_ioctl_get80211(struct ieee80211vap break; imr = (struct ieee80211req_mesh_route *) (p + off); + imr->imr_flags = rt->rt_flags; IEEE80211_ADDR_COPY(imr->imr_dest, rt->rt_dest); IEEE80211_ADDR_COPY(imr->imr_nexthop, Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Mon Jul 27 13:51:55 2009 (r195907) +++ head/sys/net80211/ieee80211_mesh.h Mon Jul 27 14:22:09 2009 (r195908) @@ -469,6 +469,8 @@ struct ieee80211_mesh_route * void ieee80211_mesh_rt_del(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); void ieee80211_mesh_rt_flush(struct ieee80211vap *); +void ieee80211_mesh_rt_flush_peer(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); void ieee80211_mesh_proxy_check(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:23:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5C61065676; Mon, 27 Jul 2009 14:23:38 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f217.google.com (mail-ew0-f217.google.com [209.85.219.217]) by mx1.freebsd.org (Postfix) with ESMTP id D03568FC1F; Mon, 27 Jul 2009 14:23:37 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy17 with SMTP id 17so1362001ewy.43 for ; Mon, 27 Jul 2009 07:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=j8yctbImD0Tf7fndklieA4laQE55cd4L/GHlIpKFLc4=; b=GvtXFNrQOrsaQMn8kpuEBZHTQda/aH1+b/Q/0t55nfizg5Sw26KjeuHLnFtkCKYw1l tVcb6CsMCLggqyock01jzcYlrN+5aQP0iBD75B50IEQR+TUJ4LR6jo4VU7D2wz2srUEs SDY/XL+8/OFKpFwgsublyAoj9/Db3Xkzq7WJM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Sg/SLcqWwJFGFBAy2Hy0GaCqHxkiqlJw5IBJZt5bCE0nUMBy/mWusv4rmpywzlOfaW nfBoY8cH6iyYEbP2LLrX1D6En/TLGEA/ukbxoBL+dMnStzf5VfOxS/vYALgBGZLw2rHI lGIvswkUJhvVkxW9x/T4Dj907VP0ZGR0PD0wY= Received: by 10.216.1.205 with SMTP id 55mr1720577wed.191.1248704616696; Mon, 27 Jul 2009 07:23:36 -0700 (PDT) Received: from mac-mini.lan (bl6-153-66.dsl.telepac.pt [82.155.153.66]) by mx.google.com with ESMTPS id 24sm10560636eyx.23.2009.07.27.07.23.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Jul 2009 07:23:36 -0700 (PDT) Sender: Rui Paulo Message-Id: <0DDAF35E-7D0F-4874-8BDB-E357070B7D54@freebsd.org> From: Rui Paulo To: Thomas Backman In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 27 Jul 2009 15:23:34 +0100 References: <200907271351.n6RDptNX002239@svn.freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:23:38 -0000 On 27 Jul 2009, at 15:04, Thomas Backman wrote: > On Jul 27, 2009, at 15:51, Rui Paulo wrote: >> Author: rpaulo >> Date: Mon Jul 27 13:51:55 2009 >> New Revision: 195907 >> URL: http://svn.freebsd.org/changeset/base/195907 >> >> Log: >> Refine the MacBook hack to only match early models that have Intel >> ICH. > Hmm, My MacBookPro2,2 has an ICH7M chipset. Does that count? :-) Depends. Does this change break booting FreeBSD on your macbook pro? If so, I'll add it to the list. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:28:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E161065670; Mon, 27 Jul 2009 14:28:09 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 7F86E8FC24; Mon, 27 Jul 2009 14:28:09 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:38103 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1MVRAk-00039L-3z; Mon, 27 Jul 2009 16:27:28 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id BA388BC4DD; Mon, 27 Jul 2009 16:27:26 +0200 (CEST) Message-Id: <78B04A23-FA5E-46BE-B196-B450BC40E081@exscape.org> From: Thomas Backman To: Rui Paulo In-Reply-To: <0DDAF35E-7D0F-4874-8BDB-E357070B7D54@freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 27 Jul 2009 16:27:24 +0200 References: <200907271351.n6RDptNX002239@svn.freebsd.org> <0DDAF35E-7D0F-4874-8BDB-E357070B7D54@freebsd.org> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1MVRAk-00039L-3z. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MVRAk-00039L-3z 9d4d8983f731c094bc2fcca0fab6844b Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:28:10 -0000 On Jul 27, 2009, at 16:23, Rui Paulo wrote: > > On 27 Jul 2009, at 15:04, Thomas Backman wrote: > >> On Jul 27, 2009, at 15:51, Rui Paulo wrote: >>> Author: rpaulo >>> Date: Mon Jul 27 13:51:55 2009 >>> New Revision: 195907 >>> URL: http://svn.freebsd.org/changeset/base/195907 >>> >>> Log: >>> Refine the MacBook hack to only match early models that have Intel >>> ICH. >> Hmm, My MacBookPro2,2 has an ICH7M chipset. Does that count? :-) > > Depends. Does this change break booting FreeBSD on your macbook pro? > If so, I'll add it to the list. To be short and honest: no clue. I just wondered, since the commit message mentioned "early models that have Intel ICH", and the models added aren't the only ones with Intel ICH-family chipsets. (I don't run FreeBSD on this computer, except in VMware.) Regards, Thomas From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 14:52:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3ACD1065678; Mon, 27 Jul 2009 14:52:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B94408FC14; Mon, 27 Jul 2009 14:52:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6REqY7P003653; Mon, 27 Jul 2009 14:52:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6REqY4l003651; Mon, 27 Jul 2009 14:52:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200907271452.n6REqY4l003651@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 27 Jul 2009 14:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195909 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 14:52:35 -0000 Author: pjd Date: Mon Jul 27 14:52:34 2009 New Revision: 195909 URL: http://svn.freebsd.org/changeset/base/195909 Log: We don't support ephemeral IDs in FreeBSD and without this fix ZFS can panic when in zfs_fuid_create_cred() when userid is negative. It is converted to unsigned value which makes IS_EPHEMERAL() macro to incorrectly report that this is ephemeral ID. The most reasonable solution for now is to always report that the given ID is not ephemeral. PR: kern/132337 Submitted by: Matthew West Tested by: Thomas Backman , Michael Reifenberger Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Jul 27 14:22:09 2009 (r195908) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Jul 27 14:52:34 2009 (r195909) @@ -78,7 +78,11 @@ extern "C" { /* * Is ID ephemeral? */ +#ifdef TODO #define IS_EPHEMERAL(x) (x > MAXUID) +#else +#define IS_EPHEMERAL(x) (0) +#endif /* * Should we use FUIDs? From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 16:03:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DF461065670; Mon, 27 Jul 2009 16:03:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 068628FC14; Mon, 27 Jul 2009 16:03:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RG34ft005247; Mon, 27 Jul 2009 16:03:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RG34gg005245; Mon, 27 Jul 2009 16:03:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907271603.n6RG34gg005245@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Jul 2009 16:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195911 - head/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 16:03:05 -0000 Author: jhb Date: Mon Jul 27 16:03:04 2009 New Revision: 195911 URL: http://svn.freebsd.org/changeset/base/195911 Log: Fix the freebsd32 versions of semsys(), shmsys(), and msgsys() to use the old ABI versions of the relevant control system call (e.g. freebsd7_freebsd32_msgctl() instead of freebsd32_msgctl() for msgsys()). Approved by: re (kib) Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Jul 27 15:32:18 2009 (r195910) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Jul 27 16:03:04 2009 (r195911) @@ -1416,8 +1416,8 @@ freebsd32_semsys(struct thread *td, stru defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) switch (uap->which) { case 0: - return (freebsd32_semctl(td, - (struct freebsd32_semctl_args *)&uap->a2)); + return (freebsd7_freebsd32_semctl(td, + (struct freebsd7_freebsd32_semctl_args *)&uap->a2)); default: return (semsys(td, (struct semsys_args *)uap)); } @@ -1580,8 +1580,8 @@ freebsd32_msgsys(struct thread *td, stru defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) switch (uap->which) { case 0: - return (freebsd32_msgctl(td, - (struct freebsd32_msgctl_args *)&uap->a2)); + return (freebsd7_freebsd32_msgctl(td, + (struct freebsd7_freebsd32_msgctl_args *)&uap->a2)); case 2: return (freebsd32_msgsnd(td, (struct freebsd32_msgsnd_args *)&uap->a2)); @@ -1751,12 +1751,12 @@ freebsd32_shmsys(struct thread *td, stru return (sysent[SYS_shmget].sy_call(td, &ap)); } case 4: { /* shmctl */ - struct freebsd32_shmctl_args ap; + struct freebsd7_freebsd32_shmctl_args ap; ap.shmid = uap->a2; ap.cmd = uap->a3; ap.buf = PTRIN(uap->a4); - return (freebsd32_shmctl(td, &ap)); + return (freebsd7_freebsd32_shmctl(td, &ap)); } case 1: /* oshmctl */ default: From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 16:05:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C30D106564A; Mon, 27 Jul 2009 16:05:52 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBD8C8FC18; Mon, 27 Jul 2009 16:05:51 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RG5pd9005340; Mon, 27 Jul 2009 16:05:51 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RG5p0h005329; Mon, 27 Jul 2009 16:05:51 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200907271605.n6RG5p0h005329@svn.freebsd.org> From: Robert Noland Date: Mon, 27 Jul 2009 16:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195912 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 16:05:52 -0000 Author: rnoland Date: Mon Jul 27 16:05:51 2009 New Revision: 195912 URL: http://svn.freebsd.org/changeset/base/195912 Log: MFC r194741,194745-194746,194748-194749,194759,194960,194963,194965-194966,194969,194986,194996 This pulls in numerous vblank related fixes from HEAD. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drmP.h stable/7/sys/dev/drm/drm_drv.c stable/7/sys/dev/drm/drm_irq.c stable/7/sys/dev/drm/drm_sysctl.c stable/7/sys/dev/drm/i915_dma.c stable/7/sys/dev/drm/i915_drv.c stable/7/sys/dev/drm/i915_drv.h stable/7/sys/dev/drm/i915_irq.c stable/7/sys/dev/drm/radeon_cp.c stable/7/sys/dev/drm/radeon_irq.c Modified: stable/7/sys/dev/drm/drmP.h ============================================================================== --- stable/7/sys/dev/drm/drmP.h Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/drmP.h Mon Jul 27 16:05:51 2009 (r195912) @@ -502,19 +502,10 @@ typedef struct drm_local_map { TAILQ_ENTRY(drm_local_map) link; } drm_local_map_t; -TAILQ_HEAD(drm_vbl_sig_list, drm_vbl_sig); -typedef struct drm_vbl_sig { - TAILQ_ENTRY(drm_vbl_sig) link; - unsigned int sequence; - int signo; - int pid; -} drm_vbl_sig_t; - struct drm_vblank_info { wait_queue_head_t queue; /* vblank wait queue */ atomic_t count; /* number of VBLANK interrupts */ /* (driver must alloc the right number of counters) */ - struct drm_vbl_sig_list sigs; /* signal list to send on VBLANK */ atomic_t refcount; /* number of users of vblank interrupts */ u32 last; /* protected by dev->vbl_lock, used */ /* for wraparound handling */ @@ -684,7 +675,6 @@ struct drm_device { int last_context; /* Last current context */ int vblank_disable_allowed; - atomic_t vbl_signal_pending; /* number of signals pending on all crtcs */ struct callout vblank_disable_timer; u32 max_vblank_count; /* size of vblank counter register */ struct drm_vblank_info *vblank; /* per crtc vblank info */ @@ -802,7 +792,6 @@ void drm_vblank_put(struct drm_device *d void drm_vblank_cleanup(struct drm_device *dev); int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); int drm_vblank_init(struct drm_device *dev, int num_crtcs); -void drm_vbl_send_signals(struct drm_device *dev, int crtc); int drm_modeset_ctl(struct drm_device *dev, void *data, struct drm_file *file_priv); Modified: stable/7/sys/dev/drm/drm_drv.c ============================================================================== --- stable/7/sys/dev/drm/drm_drv.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/drm_drv.c Mon Jul 27 16:05:51 2009 (r195912) @@ -273,11 +273,14 @@ int drm_detach(device_t kdev) drm_unload(dev); - bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, dev->irqr); - - if (dev->msi_enabled) { - pci_release_msi(dev->device); - DRM_INFO("MSI released\n"); + if (dev->irqr) { + bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, + dev->irqr); + + if (dev->msi_enabled) { + pci_release_msi(dev->device); + DRM_INFO("MSI released\n"); + } } return 0; Modified: stable/7/sys/dev/drm/drm_irq.c ============================================================================== --- stable/7/sys/dev/drm/drm_irq.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/drm_irq.c Mon Jul 27 16:05:51 2009 (r195912) @@ -70,6 +70,9 @@ static void vblank_disable_fn(void *arg) struct drm_device *dev = (struct drm_device *)arg; int i; + /* Make sure that we are called with the lock held */ + mtx_assert(&dev->vbl_lock, MA_OWNED); + if (callout_pending(&dev->vblank_disable_timer)) { /* callout was reset */ return; @@ -86,7 +89,7 @@ static void vblank_disable_fn(void *arg) return; for (i = 0; i < dev->num_crtcs; i++) { - if (atomic_read(&dev->vblank[i].refcount) == 0 && + if (dev->vblank[i].refcount == 0 && dev->vblank[i].enabled && !dev->vblank[i].inmodeset) { DRM_DEBUG("disabling vblank on crtc %d\n", i); dev->vblank[i].last = @@ -109,7 +112,9 @@ void drm_vblank_cleanup(struct drm_devic callout_drain(&dev->vblank_disable_timer); + DRM_SPINLOCK(&dev->vbl_lock); vblank_disable_fn((void *)dev); + DRM_SPINUNLOCK(&dev->vbl_lock); free(dev->vblank, DRM_MEM_DRIVER); @@ -121,7 +126,6 @@ int drm_vblank_init(struct drm_device *d int i, ret = ENOMEM; callout_init_mtx(&dev->vblank_disable_timer, &dev->vbl_lock, 0); - atomic_set(&dev->vbl_signal_pending, 0); dev->num_crtcs = num_crtcs; dev->vblank = malloc(sizeof(struct drm_vblank_info) * num_crtcs, @@ -132,14 +136,14 @@ int drm_vblank_init(struct drm_device *d DRM_DEBUG("\n"); /* Zero per-crtc vblank stuff */ + DRM_SPINLOCK(&dev->vbl_lock); for (i = 0; i < num_crtcs; i++) { DRM_INIT_WAITQUEUE(&dev->vblank[i].queue); - TAILQ_INIT(&dev->vblank[i].sigs); - atomic_set(&dev->vblank[i].count, 0); - atomic_set(&dev->vblank[i].refcount, 0); + dev->vblank[i].refcount = 0; + atomic_set_rel_32(&dev->vblank[i].count, 0); } - dev->vblank_disable_allowed = 0; + DRM_SPINUNLOCK(&dev->vbl_lock); return 0; @@ -272,7 +276,7 @@ int drm_control(struct drm_device *dev, u32 drm_vblank_count(struct drm_device *dev, int crtc) { - return atomic_read(&dev->vblank[crtc].count); + return atomic_load_acq_32(&dev->vblank[crtc].count); } static void drm_update_vblank_count(struct drm_device *dev, int crtc) @@ -298,45 +302,48 @@ static void drm_update_vblank_count(stru DRM_DEBUG("enabling vblank interrupts on crtc %d, missed %d\n", crtc, diff); - atomic_add(diff, &dev->vblank[crtc].count); + atomic_add_rel_32(&dev->vblank[crtc].count, diff); } int drm_vblank_get(struct drm_device *dev, int crtc) { int ret = 0; - DRM_SPINLOCK(&dev->vbl_lock); + /* Make sure that we are called with the lock held */ + mtx_assert(&dev->vbl_lock, MA_OWNED); + /* Going from 0->1 means we have to enable interrupts again */ - atomic_add_acq_int(&dev->vblank[crtc].refcount, 1); - if (dev->vblank[crtc].refcount == 1 && + if (++dev->vblank[crtc].refcount == 1 && !dev->vblank[crtc].enabled) { ret = dev->driver->enable_vblank(dev, crtc); DRM_DEBUG("enabling vblank on crtc %d, ret: %d\n", crtc, ret); if (ret) - atomic_dec(&dev->vblank[crtc].refcount); + --dev->vblank[crtc].refcount; else { dev->vblank[crtc].enabled = 1; drm_update_vblank_count(dev, crtc); } } - DRM_SPINUNLOCK(&dev->vbl_lock); + + if (dev->vblank[crtc].enabled) + dev->vblank[crtc].last = + dev->driver->get_vblank_counter(dev, crtc); return ret; } void drm_vblank_put(struct drm_device *dev, int crtc) { - KASSERT(atomic_read(&dev->vblank[crtc].refcount) > 0, + /* Make sure that we are called with the lock held */ + mtx_assert(&dev->vbl_lock, MA_OWNED); + + KASSERT(dev->vblank[crtc].refcount > 0, ("invalid refcount")); /* Last user schedules interrupt disable */ - atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1); - - DRM_SPINLOCK(&dev->vbl_lock); - if (dev->vblank[crtc].refcount == 0) + if (--dev->vblank[crtc].refcount == 0) callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ, (timeout_t *)vblank_disable_fn, (void *)dev); - DRM_SPINUNLOCK(&dev->vbl_lock); } int drm_modeset_ctl(struct drm_device *dev, void *data, @@ -345,13 +352,11 @@ int drm_modeset_ctl(struct drm_device *d struct drm_modeset_ctl *modeset = data; int crtc, ret = 0; - DRM_DEBUG("num_crtcs=%d\n", dev->num_crtcs); /* If drm_vblank_init() hasn't been called yet, just no-op */ if (!dev->num_crtcs) goto out; crtc = modeset->crtc; - DRM_DEBUG("crtc=%d\n", crtc); if (crtc >= dev->num_crtcs) { ret = EINVAL; goto out; @@ -366,25 +371,25 @@ int drm_modeset_ctl(struct drm_device *d */ switch (modeset->cmd) { case _DRM_PRE_MODESET: - DRM_DEBUG("pre-modeset\n"); + DRM_DEBUG("pre-modeset, crtc %d\n", crtc); + DRM_SPINLOCK(&dev->vbl_lock); if (!dev->vblank[crtc].inmodeset) { dev->vblank[crtc].inmodeset = 0x1; if (drm_vblank_get(dev, crtc) == 0) dev->vblank[crtc].inmodeset |= 0x2; } + DRM_SPINUNLOCK(&dev->vbl_lock); break; case _DRM_POST_MODESET: - DRM_DEBUG("post-modeset\n"); + DRM_DEBUG("post-modeset, crtc %d\n", crtc); + DRM_SPINLOCK(&dev->vbl_lock); if (dev->vblank[crtc].inmodeset) { - DRM_SPINLOCK(&dev->vbl_lock); - dev->vblank_disable_allowed = 1; - DRM_SPINUNLOCK(&dev->vbl_lock); - if (dev->vblank[crtc].inmodeset & 0x2) drm_vblank_put(dev, crtc); - dev->vblank[crtc].inmodeset = 0; } + dev->vblank_disable_allowed = 1; + DRM_SPINUNLOCK(&dev->vbl_lock); break; default: ret = EINVAL; @@ -418,7 +423,9 @@ int drm_wait_vblank(struct drm_device *d if (crtc >= dev->num_crtcs) return EINVAL; + DRM_SPINLOCK(&dev->vbl_lock); ret = drm_vblank_get(dev, crtc); + DRM_SPINUNLOCK(&dev->vbl_lock); if (ret) { DRM_ERROR("failed to acquire vblank counter, %d\n", ret); return ret; @@ -442,28 +449,11 @@ int drm_wait_vblank(struct drm_device *d } if (flags & _DRM_VBLANK_SIGNAL) { -#if 0 /* disabled */ - drm_vbl_sig_t *vbl_sig = malloc(sizeof(drm_vbl_sig_t), - DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (vbl_sig == NULL) - return ENOMEM; - - vbl_sig->sequence = vblwait->request.sequence; - vbl_sig->signo = vblwait->request.signal; - vbl_sig->pid = DRM_CURRENTPID; - - vblwait->reply.sequence = atomic_read(&dev->vbl_received); - - DRM_SPINLOCK(&dev->vbl_lock); - TAILQ_INSERT_HEAD(&dev->vbl_sig_list, vbl_sig, link); - DRM_SPINUNLOCK(&dev->vbl_lock); - ret = 0; -#endif + /* There have never been any consumers */ ret = EINVAL; } else { DRM_DEBUG("waiting on vblank count %d, crtc %d\n", vblwait->request.sequence, crtc); - dev->vblank[crtc].last = vblwait->request.sequence; for ( ret = 0 ; !ret && !(((drm_vblank_count(dev, crtc) - vblwait->request.sequence) <= (1 << 23)) || !dev->irq_enabled) ; ) { @@ -473,7 +463,7 @@ int drm_wait_vblank(struct drm_device *d !dev->irq_enabled)) ret = mtx_sleep(&dev->vblank[crtc].queue, &dev->irq_lock, PCATCH, "vblwtq", - 3 * DRM_HZ); + DRM_HZ); mtx_unlock(&dev->irq_lock); } @@ -492,42 +482,16 @@ int drm_wait_vblank(struct drm_device *d } done: + DRM_SPINLOCK(&dev->vbl_lock); drm_vblank_put(dev, crtc); - return ret; -} - -void drm_vbl_send_signals(struct drm_device *dev, int crtc) -{ -} - -#if 0 /* disabled */ -void drm_vbl_send_signals(struct drm_device *dev, int crtc ) -{ - drm_vbl_sig_t *vbl_sig; - unsigned int vbl_seq = atomic_read( &dev->vbl_received ); - struct proc *p; - - vbl_sig = TAILQ_FIRST(&dev->vbl_sig_list); - while (vbl_sig != NULL) { - drm_vbl_sig_t *next = TAILQ_NEXT(vbl_sig, link); - - if ((vbl_seq - vbl_sig->sequence) <= (1 << 23)) { - p = pfind(vbl_sig->pid); - if (p != NULL) - psignal(p, vbl_sig->signo); + DRM_SPINUNLOCK(&dev->vbl_lock); - TAILQ_REMOVE(&dev->vbl_sig_list, vbl_sig, link); - DRM_FREE(vbl_sig,sizeof(*vbl_sig)); - } - vbl_sig = next; - } + return ret; } -#endif void drm_handle_vblank(struct drm_device *dev, int crtc) { - atomic_inc(&dev->vblank[crtc].count); + atomic_add_rel_32(&dev->vblank[crtc].count, 1); DRM_WAKEUP(&dev->vblank[crtc].queue); - drm_vbl_send_signals(dev, crtc); } Modified: stable/7/sys/dev/drm/drm_sysctl.c ============================================================================== --- stable/7/sys/dev/drm/drm_sysctl.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/drm_sysctl.c Mon Jul 27 16:05:51 2009 (r195912) @@ -38,6 +38,7 @@ static int drm_name_info DRM_SYSCTL_H static int drm_vm_info DRM_SYSCTL_HANDLER_ARGS; static int drm_clients_info DRM_SYSCTL_HANDLER_ARGS; static int drm_bufs_info DRM_SYSCTL_HANDLER_ARGS; +static int drm_vblank_info DRM_SYSCTL_HANDLER_ARGS; struct drm_sysctl_list { const char *name; @@ -47,6 +48,7 @@ struct drm_sysctl_list { {"vm", drm_vm_info}, {"clients", drm_clients_info}, {"bufs", drm_bufs_info}, + {"vblank", drm_vblank_info}, }; #define DRM_SYSCTL_ENTRIES (sizeof(drm_sysctl_list)/sizeof(drm_sysctl_list[0])) @@ -313,3 +315,25 @@ done: free(tempprivs, DRM_MEM_DRIVER); return retcode; } + +static int drm_vblank_info DRM_SYSCTL_HANDLER_ARGS +{ + struct drm_device *dev = arg1; + char buf[128]; + int retcode; + int i; + + DRM_SYSCTL_PRINT("\ncrtc ref count last enabled inmodeset\n"); + for(i = 0 ; i < dev->num_crtcs ; i++) { + DRM_SYSCTL_PRINT(" %02d %02d %08d %08d %02d %02d\n", + i, atomic_load_acq_32(&dev->vblank[i].refcount), + atomic_load_acq_32(&dev->vblank[i].count), + atomic_load_acq_32(&dev->vblank[i].last), + atomic_load_acq_int(&dev->vblank[i].enabled), + atomic_load_acq_int(&dev->vblank[i].inmodeset)); + } + + SYSCTL_OUT(req, "", -1); +done: + return retcode; +} Modified: stable/7/sys/dev/drm/i915_dma.c ============================================================================== --- stable/7/sys/dev/drm/i915_dma.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/i915_dma.c Mon Jul 27 16:05:51 2009 (r195912) @@ -644,18 +644,17 @@ static int i915_batchbuffer(struct drm_d return -EFAULT; } } - DRM_LOCK(); ret = i915_dispatch_batchbuffer(dev, batch); - if (sarea_priv) - sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); - - DRM_UNLOCK(); if (batch->num_cliprects) vsunlock(batch->cliprects, cliplen); + DRM_LOCK(); + if (sarea_priv) + sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); + return ret; } @@ -697,10 +696,9 @@ static int i915_cmdbuffer(struct drm_dev return -EFAULT; } } - DRM_LOCK(); ret = i915_dispatch_cmdbuffer(dev, cmdbuf); - DRM_UNLOCK(); + if (cmdbuf->num_cliprects) { vsunlock(cmdbuf->buf, cmdbuf->sz); vsunlock(cmdbuf->cliprects, cliplen); Modified: stable/7/sys/dev/drm/i915_drv.c ============================================================================== --- stable/7/sys/dev/drm/i915_drv.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/i915_drv.c Mon Jul 27 16:05:51 2009 (r195912) @@ -52,7 +52,10 @@ static int i915_suspend(device_t kdev) return -ENODEV; } + DRM_LOCK(); + DRM_DEBUG("starting suspend\n"); i915_save_state(dev); + DRM_UNLOCK(); return (bus_generic_suspend(kdev)); } @@ -61,7 +64,10 @@ static int i915_resume(device_t kdev) { struct drm_device *dev = device_get_softc(kdev); + DRM_LOCK(); i915_restore_state(dev); + DRM_DEBUG("finished resume\n"); + DRM_UNLOCK(); return (bus_generic_resume(kdev)); } Modified: stable/7/sys/dev/drm/i915_drv.h ============================================================================== --- stable/7/sys/dev/drm/i915_drv.h Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/i915_drv.h Mon Jul 27 16:05:51 2009 (r195912) @@ -129,7 +129,6 @@ typedef struct drm_i915_private { int page_flipping; wait_queue_head_t irq_queue; - atomic_t irq_received; /** Protects user_irq_refcount and irq_mask_reg */ DRM_SPINTYPE user_irq_lock; /** Refcount for i915_user_irq_get() versus i915_user_irq_put(). */ Modified: stable/7/sys/dev/drm/i915_irq.c ============================================================================== --- stable/7/sys/dev/drm/i915_irq.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/i915_irq.c Mon Jul 27 16:05:51 2009 (r195912) @@ -53,12 +53,6 @@ __FBSDID("$FreeBSD$"); #define I915_INTERRUPT_ENABLE_MASK (I915_INTERRUPT_ENABLE_FIX | \ I915_INTERRUPT_ENABLE_VAR) -#define I915_PIPE_VBLANK_STATUS (PIPE_START_VBLANK_INTERRUPT_STATUS |\ - PIPE_VBLANK_INTERRUPT_STATUS) - -#define I915_PIPE_VBLANK_ENABLE (PIPE_START_VBLANK_INTERRUPT_ENABLE |\ - PIPE_VBLANK_INTERRUPT_ENABLE) - #define DRM_I915_VBLANK_PIPE_ALL (DRM_I915_VBLANK_PIPE_A | \ DRM_I915_VBLANK_PIPE_B) @@ -154,7 +148,7 @@ u32 i915_get_vblank_counter(struct drm_d low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL; if (!i915_pipe_enabled(dev, pipe)) { - DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); + DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe); return 0; } @@ -183,7 +177,7 @@ u32 g45_get_vblank_counter(struct drm_de int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; if (!i915_pipe_enabled(dev, pipe)) { - DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); + DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe); return 0; } @@ -200,12 +194,10 @@ irqreturn_t i915_driver_irq_handler(DRM_ u32 vblank_enable; int irq_received; - atomic_inc(&dev_priv->irq_received); - iir = I915_READ(IIR); if (IS_I965G(dev)) { - vblank_status = I915_START_VBLANK_INTERRUPT_STATUS; + vblank_status = PIPE_START_VBLANK_INTERRUPT_STATUS; vblank_enable = PIPE_START_VBLANK_INTERRUPT_ENABLE; } else { vblank_status = I915_VBLANK_INTERRUPT_STATUS; @@ -305,9 +297,12 @@ void i915_user_irq_get(struct drm_device { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + if (dev->irq_enabled == 0) + return; + DRM_DEBUG("\n"); DRM_SPINLOCK(&dev_priv->user_irq_lock); - if (dev->irq_enabled && (++dev_priv->user_irq_refcount == 1)) + if (++dev_priv->user_irq_refcount == 1) i915_enable_irq(dev_priv, I915_USER_INTERRUPT); DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } @@ -316,12 +311,13 @@ void i915_user_irq_put(struct drm_device { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + if (dev->irq_enabled == 0) + return; + DRM_SPINLOCK(&dev_priv->user_irq_lock); - if (dev->irq_enabled) { - KASSERT(dev_priv->user_irq_refcount > 0, ("invalid refcount")); - if (--dev_priv->user_irq_refcount == 0) - i915_disable_irq(dev_priv, I915_USER_INTERRUPT); - } + KASSERT(dev_priv->user_irq_refcount > 0, ("invalid refcount")); + if (--dev_priv->user_irq_refcount == 0) + i915_disable_irq(dev_priv, I915_USER_INTERRUPT); DRM_SPINUNLOCK(&dev_priv->user_irq_lock); } @@ -408,11 +404,8 @@ int i915_irq_wait(struct drm_device *dev int i915_enable_vblank(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; - u32 pipeconf; - pipeconf = I915_READ(pipeconf_reg); - if (!(pipeconf & PIPEACONF_ENABLE)) + if (!i915_pipe_enabled(dev, pipe)) return -EINVAL; DRM_SPINLOCK(&dev_priv->user_irq_lock); @@ -500,8 +493,6 @@ void i915_driver_irq_preinstall(struct d { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - atomic_set_int(&dev_priv->irq_received, 0); - I915_WRITE(HWSTAM, 0xeffe); I915_WRITE(PIPEASTAT, 0); I915_WRITE(PIPEBSTAT, 0); @@ -519,9 +510,6 @@ int i915_driver_irq_postinstall(struct d /* Unmask the interrupts that we always want on. */ dev_priv->irq_mask_reg = ~I915_INTERRUPT_ENABLE_FIX; - dev_priv->pipestat[0] = 0; - dev_priv->pipestat[1] = 0; - /* Disable pipe interrupt enables, clear pending pipe status */ I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); @@ -531,6 +519,10 @@ int i915_driver_irq_postinstall(struct d I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK); I915_WRITE(IMR, dev_priv->irq_mask_reg); + I915_WRITE(PIPEASTAT, dev_priv->pipestat[0] | + (dev_priv->pipestat[0] >> 16)); + I915_WRITE(PIPEBSTAT, dev_priv->pipestat[1] | + (dev_priv->pipestat[1] >> 16)); (void) I915_READ(IER); return 0; Modified: stable/7/sys/dev/drm/radeon_cp.c ============================================================================== --- stable/7/sys/dev/drm/radeon_cp.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/radeon_cp.c Mon Jul 27 16:05:51 2009 (r195912) @@ -2064,16 +2064,22 @@ int radeon_driver_load(struct drm_device drm_get_resource_len(dev, 2), _DRM_REGISTERS, _DRM_READ_ONLY | _DRM_DRIVER, &dev_priv->mmio); if (ret != 0) - return ret; + goto error; ret = drm_vblank_init(dev, 2); - if (ret) { - radeon_driver_unload(dev); - return ret; - } + if (ret != 0) + goto error; + + dev->max_vblank_count = 0x001fffff; DRM_DEBUG("%s card detected\n", - ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); + ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : + (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); + + return ret; + +error: + radeon_driver_unload(dev); return ret; } Modified: stable/7/sys/dev/drm/radeon_irq.c ============================================================================== --- stable/7/sys/dev/drm/radeon_irq.c Mon Jul 27 16:03:04 2009 (r195911) +++ stable/7/sys/dev/drm/radeon_irq.c Mon Jul 27 16:05:51 2009 (r195912) @@ -380,8 +380,6 @@ int radeon_driver_irq_postinstall(struct atomic_set(&dev_priv->swi_emitted, 0); DRM_INIT_WAITQUEUE(&dev_priv->swi_queue); - dev->max_vblank_count = 0x001fffff; - radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); return 0; From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 16:11:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 738AF106564A; Mon, 27 Jul 2009 16:11:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60B1D8FC20; Mon, 27 Jul 2009 16:11:44 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RGBiT8005646; Mon, 27 Jul 2009 16:11:44 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RGBicY005642; Mon, 27 Jul 2009 16:11:44 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200907271611.n6RGBicY005642@svn.freebsd.org> From: Robert Noland Date: Mon, 27 Jul 2009 16:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195913 - in stable/7/sys: . contrib/pf dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 16:11:45 -0000 Author: rnoland Date: Mon Jul 27 16:11:44 2009 New Revision: 195913 URL: http://svn.freebsd.org/changeset/base/195913 Log: MFC r195501 Add support for Radeon HD 4770 (RV740) chips. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/drm/drm_pciids.h stable/7/sys/dev/drm/r600_cp.c stable/7/sys/dev/drm/radeon_drv.h Modified: stable/7/sys/dev/drm/drm_pciids.h ============================================================================== --- stable/7/sys/dev/drm/drm_pciids.h Mon Jul 27 16:05:51 2009 (r195912) +++ stable/7/sys/dev/drm/drm_pciids.h Mon Jul 27 16:11:44 2009 (r195913) @@ -257,6 +257,11 @@ {0x1002, 0x940A, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V8650"}, \ {0x1002, 0x940B, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V8600"}, \ {0x1002, 0x940F, CHIP_R600|RADEON_NEW_MEMMAP, "ATI FireGL V7600"}, \ + {0x1002, 0x94A0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4830"}, \ + {0x1002, 0x94A1, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4850"}, \ + {0x1002, 0x94B1, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI RV740"}, \ + {0x1002, 0x94B3, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI Radeon HD 4770"}, \ + {0x1002, 0x94B5, CHIP_RV740|RADEON_NEW_MEMMAP, "ATI Radeon HD 4770"}, \ {0x1002, 0x94C0, CHIP_RV610|RADEON_NEW_MEMMAP, "RV610"}, \ {0x1002, 0x94C1, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 XT"}, \ {0x1002, 0x94C3, CHIP_RV610|RADEON_NEW_MEMMAP, "Radeon HD 2400 Pro"}, \ Modified: stable/7/sys/dev/drm/r600_cp.c ============================================================================== --- stable/7/sys/dev/drm/r600_cp.c Mon Jul 27 16:05:51 2009 (r195912) +++ stable/7/sys/dev/drm/r600_cp.c Mon Jul 27 16:11:44 2009 (r195913) @@ -421,7 +421,8 @@ static void r700_cp_load_microcode(drm_r cp = RV770_cp_microcode; break; case CHIP_RV730: - DRM_INFO("Loading RV730 Microcode\n"); + case CHIP_RV740: + DRM_INFO("Loading RV730/RV740 Microcode\n"); pfp = RV730_pfp_microcode; cp = RV730_cp_microcode; break; @@ -1244,6 +1245,31 @@ static void r700_gfx_init(struct drm_dev dev_priv->r700_sc_hiz_tile_fifo_size = 0x30; dev_priv->r700_sc_earlyz_tile_fifo_fize = 0x130; break; + case CHIP_RV740: + dev_priv->r600_max_pipes = 4; + dev_priv->r600_max_tile_pipes = 4; + dev_priv->r600_max_simds = 8; + dev_priv->r600_max_backends = 4; + dev_priv->r600_max_gprs = 256; + dev_priv->r600_max_threads = 248; + dev_priv->r600_max_stack_entries = 512; + dev_priv->r600_max_hw_contexts = 8; + dev_priv->r600_max_gs_threads = 16 * 2; + dev_priv->r600_sx_max_export_size = 256; + dev_priv->r600_sx_max_export_pos_size = 32; + dev_priv->r600_sx_max_export_smx_size = 224; + dev_priv->r600_sq_num_cf_insts = 2; + + dev_priv->r700_sx_num_of_sets = 7; + dev_priv->r700_sc_prim_fifo_size = 0x100; + dev_priv->r700_sc_hiz_tile_fifo_size = 0x30; + dev_priv->r700_sc_earlyz_tile_fifo_fize = 0x130; + + if (dev_priv->r600_sx_max_export_pos_size > 16) { + dev_priv->r600_sx_max_export_pos_size -= 16; + dev_priv->r600_sx_max_export_smx_size += 16; + } + break; case CHIP_RV730: dev_priv->r600_max_pipes = 2; dev_priv->r600_max_tile_pipes = 4; @@ -1263,6 +1289,11 @@ static void r700_gfx_init(struct drm_dev dev_priv->r700_sc_prim_fifo_size = 0xf9; dev_priv->r700_sc_hiz_tile_fifo_size = 0x30; dev_priv->r700_sc_earlyz_tile_fifo_fize = 0x130; + + if (dev_priv->r600_sx_max_export_pos_size > 16) { + dev_priv->r600_sx_max_export_pos_size -= 16; + dev_priv->r600_sx_max_export_smx_size += 16; + } break; case CHIP_RV710: dev_priv->r600_max_pipes = 2; @@ -1430,6 +1461,7 @@ static void r700_gfx_init(struct drm_dev case CHIP_RV770: sq_ms_fifo_sizes |= R600_FETCH_FIFO_HIWATER(0x1); break; + case CHIP_RV740: case CHIP_RV730: case CHIP_RV710: default: @@ -1507,6 +1539,7 @@ static void r700_gfx_init(struct drm_dev switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_RV770: + case CHIP_RV740: case CHIP_RV730: gs_prim_buffer_depth = 384; break; Modified: stable/7/sys/dev/drm/radeon_drv.h ============================================================================== --- stable/7/sys/dev/drm/radeon_drv.h Mon Jul 27 16:05:51 2009 (r195912) +++ stable/7/sys/dev/drm/radeon_drv.h Mon Jul 27 16:11:44 2009 (r195913) @@ -146,6 +146,7 @@ enum radeon_family { CHIP_RV670, CHIP_RS780, CHIP_RV770, + CHIP_RV740, CHIP_RV730, CHIP_RV710, CHIP_LAST, From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 17:08:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB5541065670; Mon, 27 Jul 2009 17:08:08 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA238FC0A; Mon, 27 Jul 2009 17:08:08 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RH87YT006778; Mon, 27 Jul 2009 17:08:07 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RH87PJ006773; Mon, 27 Jul 2009 17:08:07 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200907271708.n6RH87PJ006773@svn.freebsd.org> From: Qing Li Date: Mon, 27 Jul 2009 17:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195914 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 17:08:09 -0000 Author: qingli Date: Mon Jul 27 17:08:06 2009 New Revision: 195914 URL: http://svn.freebsd.org/changeset/base/195914 Log: This patch does the following: - Allow loopback route to be installed for address assigned to interface of IFF_POINTOPOINT type. - Install loopback route for an IPv4 interface addreess when the "useloopback" sysctl variable is enabled. Similarly, install loopback route for an IPv6 interface address when the sysctl variable "nd6_useloopback" is enabled. Deleting loopback routes for interface addresses is unconditional in case these sysctl variables were disabled after an interface address has been assigned. Reviewed by: bz Approved by: re Modified: head/sys/net/if_var.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Jul 27 16:11:44 2009 (r195913) +++ head/sys/net/if_var.h Mon Jul 27 17:08:06 2009 (r195914) @@ -784,11 +784,13 @@ VNET_DECLARE(struct ifnethead, ifnet); VNET_DECLARE(struct ifgrouphead, ifg_head); VNET_DECLARE(int, if_index); VNET_DECLARE(struct ifnet *, loif); /* first loopback interface */ +VNET_DECLARE(int, useloopback); #define V_ifnet VNET(ifnet) #define V_ifg_head VNET(ifg_head) #define V_if_index VNET(if_index) #define V_loif VNET(loif) +#define V_useloopback VNET(useloopback) extern int ifqmaxlen; Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Jul 27 16:11:44 2009 (r195913) +++ head/sys/netinet/if_ether.c Mon Jul 27 17:08:06 2009 (r195914) @@ -81,17 +81,17 @@ __FBSDID("$FreeBSD$"); SYSCTL_DECL(_net_link_ether); SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, ""); +VNET_DEFINE(int, useloopback) = 1; /* use loopback interface for + * local traffic */ + /* timer values */ static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 * minutes */ static VNET_DEFINE(int, arp_maxtries) = 5; -static VNET_DEFINE(int, useloopback) = 1; /* use loopback interface for - * local traffic */ static VNET_DEFINE(int, arp_proxyall); #define V_arpt_keep VNET(arpt_keep) #define V_arp_maxtries VNET(arp_maxtries) -#define V_useloopback VNET(useloopback) #define V_arp_proxyall VNET(arp_proxyall) SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Jul 27 16:11:44 2009 (r195913) +++ head/sys/netinet/in.c Mon Jul 27 17:08:06 2009 (r195914) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -918,7 +919,7 @@ in_ifinit(struct ifnet *ifp, struct in_i /* * add a loopback route to self */ - if (!(ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { bzero(&info, sizeof(info)); info.rti_ifp = V_loif; info.rti_flags = ia->ia_flags | RTF_HOST | RTF_STATIC; @@ -1027,8 +1028,18 @@ in_scrubprefix(struct in_ifaddr *target) if ((target->ia_flags & IFA_ROUTE) == 0) return (0); + /* + * Remove the loopback route to the interface address. + * The "useloopback" setting is not consulted because if the + * user configures an interface address, turns off this + * setting, and then tries to delete that interface address, + * checking the current setting of "useloopback" would leave + * that interface address loopback route untouched, which + * would be wrong. Therefore the interface address loopback route + * deletion is unconditional. + */ if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && - !(target->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { bzero(&null_sdl, sizeof(null_sdl)); null_sdl.sdl_len = sizeof(null_sdl); null_sdl.sdl_family = AF_LINK; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jul 27 16:11:44 2009 (r195913) +++ head/sys/netinet6/in6.c Mon Jul 27 17:08:06 2009 (r195914) @@ -1191,7 +1191,11 @@ in6_purgeaddr(struct ifaddr *ifa) ifa_ref(ifa0); IF_ADDR_UNLOCK(ifp); - if (!(ia->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + /* + * Remove the loopback route to the interface address. + * The check for the current setting of "nd6_useloopback" is not needed. + */ + if (!(ia->ia_ifp->if_flags & IFF_LOOPBACK)) { struct rt_addrinfo info; struct sockaddr_dl null_sdl; @@ -1773,7 +1777,7 @@ in6_ifinit(struct ifnet *ifp, struct in6 /* * add a loopback route to self */ - if (!(ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) { + if (V_nd6_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { struct rt_addrinfo info; struct rtentry *rt = NULL; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 18:07:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58062106564A; Mon, 27 Jul 2009 18:07:45 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 460188FC1D; Mon, 27 Jul 2009 18:07:45 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RI7jrQ008202; Mon, 27 Jul 2009 18:07:45 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RI7j5R008201; Mon, 27 Jul 2009 18:07:45 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200907271807.n6RI7j5R008201@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 27 Jul 2009 18:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195915 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 18:07:45 -0000 Author: weongyo Date: Mon Jul 27 18:07:44 2009 New Revision: 195915 URL: http://svn.freebsd.org/changeset/base/195915 Log: urtw(4) supports RTL8187B chipset now. Approved by: re (kib) Modified: head/share/man/man4/urtw.4 Modified: head/share/man/man4/urtw.4 ============================================================================== --- head/share/man/man4/urtw.4 Mon Jul 27 17:08:06 2009 (r195914) +++ head/share/man/man4/urtw.4 Mon Jul 27 18:07:44 2009 (r195915) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2008 +.Dd July 25, 2009 .Dt URTW 4 .Os .Sh NAME .Nm urtw -.Nd Realtek RTL8187L USB IEEE 802.11b/g wireless network device +.Nd Realtek RTL8187B/L USB IEEE 802.11b/g wireless network device .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -52,7 +52,7 @@ if_urtw_load="YES" The .Nm driver supports USB 802.11b/g wireless adapters based on the -Realtek RTL8187L. +Realtek RTL8187B/L. .Pp .Nm supports @@ -66,7 +66,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports Realtek RTL8187L based wireless network devices, including: +driver supports Realtek RTL8187B/L based wireless network devices, including: .Pp .Bl -column "Shuttle XPC Accessory PN20" "RTL8225" "USB" -compact -offset 6n .It Em "Card Radio Bus" From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 20:17:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60771065691; Mon, 27 Jul 2009 20:17:20 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B41798FC1D; Mon, 27 Jul 2009 20:17:20 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RKHKkX010996; Mon, 27 Jul 2009 20:17:20 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RKHK5M010993; Mon, 27 Jul 2009 20:17:20 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200907272017.n6RKHK5M010993@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 27 Jul 2009 20:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195916 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 20:17:21 -0000 Author: weongyo Date: Mon Jul 27 20:17:20 2009 New Revision: 195916 URL: http://svn.freebsd.org/changeset/base/195916 Log: adds DLINK2 DWA120 device. PR: usb/136950 Reported by: Alexander Kuznetsov Approved by: re (kib) Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_uath.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 27 18:07:44 2009 (r195915) +++ head/sys/dev/usb/usbdevs Mon Jul 27 20:17:20 2009 (r195916) @@ -1179,6 +1179,8 @@ product DLINK2 DWLG122C1 0x3c03 DWL-G122 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 product DLINK2 DWA110 0x3c07 DWA-110 +product DLINK2 DWA120_NF 0x3c0d DWA-120 (no firmware) +product DLINK2 DWA120 0x3c0e DWA-120 /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Mon Jul 27 18:07:44 2009 (r195915) +++ head/sys/dev/usb/wlan/if_uath.c Mon Jul 27 20:17:20 2009 (r195916) @@ -180,6 +180,7 @@ static const struct usb_device_id uath_d UATH_DEV(DLINK, DWLAG122), UATH_DEV(DLINK, DWLAG132), UATH_DEV(DLINK, DWLG132), + UATH_DEV(DLINK2, DWA120), UATH_DEV(GIGASET, AR5523), UATH_DEV(GIGASET, SMCWUSBTG), UATH_DEV(GLOBALSUN, AR5523_1), From owner-svn-src-all@FreeBSD.ORG Mon Jul 27 20:24:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB6ED1065686; Mon, 27 Jul 2009 20:24:00 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9BF98FC0C; Mon, 27 Jul 2009 20:24:00 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RKO0IT011157; Mon, 27 Jul 2009 20:24:00 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6RKO0SW011154; Mon, 27 Jul 2009 20:24:00 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200907272024.n6RKO0SW011154@svn.freebsd.org> From: Colin Percival Date: Mon, 27 Jul 2009 20:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195917 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 20:24:01 -0000 Author: cperciva Date: Mon Jul 27 20:24:00 2009 New Revision: 195917 URL: http://svn.freebsd.org/changeset/base/195917 Log: Add INDEX-8 to the default portsnap configuration file, and remove INDEX-5. The Portsnap buildbox now generates teh bits needed for portsnap to produce INDEX-8; and it hasn't built INDEX-5 for a long time, although the bits are still distributed for an INDEX-5 from when FreeBSD 5.x reached its EoL. Approved by: re (kib) MFC after: 3 days (INDEX-8 addition only) Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Mon Jul 27 20:17:20 2009 (r195916) +++ head/etc/portsnap.conf Mon Jul 27 20:24:00 2009 (r195917) @@ -30,6 +30,6 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-5 DESCRIBE.5 INDEX INDEX-6 DESCRIBE.6 INDEX INDEX-7 DESCRIBE.7 +INDEX INDEX-8 DESCRIBE.8 From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 07:35:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B87A106566B; Tue, 28 Jul 2009 07:35:24 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by mx1.freebsd.org (Postfix) with ESMTP id 71C228FC21; Tue, 28 Jul 2009 07:35:20 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id 071AC940150; Tue, 28 Jul 2009 09:35:14 +0200 (CEST) Received: from endor.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp1-g21.free.fr (Postfix) with ESMTP id 2E60994012A; Tue, 28 Jul 2009 09:35:12 +0200 (CEST) Received: from felucia.tataz.chchile.org (felucia.tataz.chchile.org [192.168.1.9]) by endor.tataz.chchile.org (Postfix) with ESMTP id 0762436313; Tue, 28 Jul 2009 07:34:36 +0000 (UTC) Received: by felucia.tataz.chchile.org (Postfix, from userid 1000) id D41B3A22C8; Tue, 28 Jul 2009 07:34:35 +0000 (UTC) Date: Tue, 28 Jul 2009 09:34:35 +0200 From: Jeremie Le Hen To: Alexander Kabaev Message-ID: <20090728073435.GD64335@felucia.tataz.chchile.org> References: <200907142119.n6ELJDG1071501@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907142119.n6ELJDG1071501@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195697 - in head: . contrib/gcc/config gnu/lib/libgcc gnu/lib/libssp/libssp_nonshared lib/libc lib/libc/sys libexec/rtld-elf share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 07:35:24 -0000 On Tue, Jul 14, 2009 at 09:19:13PM +0000, Alexander Kabaev wrote: > Author: kan > Date: Tue Jul 14 21:19:13 2009 > New Revision: 195697 > URL: http://svn.freebsd.org/changeset/base/195697 > > Log: > Second attempt at eliminating .text relocations in shared libraries > compiled with stack protector. > > Use libssp_nonshared library to pull __stack_chk_fail_local symbol into > each library that needs it instead of pulling it from libc. GCC > generates local calls to this function which result in absolute > relocations put into position-independent code segment, making dynamic > loader do extra work every time given shared library is being relocated > and making affected text pages non-shareable. Wow, this is a nice catch. I'm glad you figured it out before the release. Thanks! Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 14:09:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 737F91065672; Tue, 28 Jul 2009 14:09:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F028FC08; Tue, 28 Jul 2009 14:09:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SE970w034588; Tue, 28 Jul 2009 14:09:07 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SE971u034585; Tue, 28 Jul 2009 14:09:07 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200907281409.n6SE971u034585@svn.freebsd.org> From: Randall Stewart Date: Tue, 28 Jul 2009 14:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 14:09:07 -0000 Author: rrs Date: Tue Jul 28 14:09:06 2009 New Revision: 195918 URL: http://svn.freebsd.org/changeset/base/195918 Log: Turns out that when a receiver forwards through its TNS's the processing code holds the read lock (when processing a FWD-TSN for pr-sctp). If it finds stranded data that can be given to the application, it calls sctp_add_to_readq(). The readq function also grabs this lock. So if INVAR is on we get a double recurse on a non-recursive lock and panic. This fix will change it so that readq() function gets a flag to tell if the lock is held, if so then it does not get the lock. Approved by: re@freebsd.org (Kostik Belousov) MFC after: 1 week Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Mon Jul 27 20:24:00 2009 (r195917) +++ head/sys/netinet/sctp_auth.c Tue Jul 28 14:09:06 2009 (r195918) @@ -1960,7 +1960,7 @@ sctp_notify_authentication(struct sctp_t /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, so_locked); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); } Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Jul 27 20:24:00 2009 (r195917) +++ head/sys/netinet/sctp_indata.c Tue Jul 28 14:09:06 2009 (r195918) @@ -388,7 +388,8 @@ abandon: else end = 0; sctp_add_to_readq(stcb->sctp_ep, - stcb, control, &stcb->sctp_socket->so_rcv, end, SCTP_SO_NOT_LOCKED); + stcb, control, &stcb->sctp_socket->so_rcv, end, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); cntDel++; } else { if (chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) @@ -516,7 +517,8 @@ abandon: nr_tsn = ctl->sinfo_tsn; sctp_add_to_readq(stcb->sctp_ep, stcb, ctl, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); /* * EY -now something is * delivered, calculate @@ -685,8 +687,8 @@ protocol_error: nr_tsn = control->sinfo_tsn; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); - + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); /* * EY this is the chunk that should be tagged nr gapped * calculate the gap and such then tag this TSN nr @@ -739,7 +741,9 @@ protocol_error: nr_tsn = control->sinfo_tsn; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, + SCTP_SO_NOT_LOCKED); /* * EY this is the chunk that should be * tagged nr gapped calculate the gap and @@ -1910,7 +1914,9 @@ sctp_process_a_data_chunk(struct sctp_tc if (control == NULL) { goto failed_express_del; } - sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, &stcb->sctp_socket->so_rcv, + 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); /* * EY here I should check if this delivered tsn is @@ -2248,7 +2254,7 @@ failed_pdapi_express_del: /* queue directly into socket buffer */ sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); /* * EY It is added to the read queue in prev if block @@ -5722,7 +5728,7 @@ sctp_kick_prsctp_reorder_queue(struct sc nr_tsn = ctl->sinfo_tsn; sctp_add_to_readq(stcb->sctp_ep, stcb, ctl, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); /* * EY this is the chunk that should be * tagged nr gapped calculate the gap and @@ -5823,7 +5829,7 @@ sctp_kick_prsctp_reorder_queue(struct sc nr_tsn = ctl->sinfo_tsn; sctp_add_to_readq(stcb->sctp_ep, stcb, ctl, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); /* * EY this is the chunk that should be * tagged nr gapped calculate the gap and Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Jul 27 20:24:00 2009 (r195917) +++ head/sys/netinet/sctputil.c Tue Jul 28 14:09:06 2009 (r195918) @@ -2839,7 +2839,8 @@ sctp_notify_assoc_change(uint32_t event, control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, so_locked); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, + so_locked); if (event == SCTP_COMM_LOST) { /* Wake up any sleeper */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2935,7 +2936,9 @@ sctp_notify_peer_addr_change(struct sctp control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, + SCTP_SO_NOT_LOCKED); } @@ -3016,7 +3019,9 @@ sctp_notify_send_failed(struct sctp_tcb control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, so_locked); + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, + so_locked); } @@ -3090,7 +3095,7 @@ sctp_notify_send_failed2(struct sctp_tcb control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, so_locked); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); } @@ -3137,7 +3142,7 @@ sctp_notify_adaptation_layer(struct sctp control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } /* This always must be called with the read-queue LOCKED in the INP */ @@ -3277,7 +3282,7 @@ sctp_notify_shutdown_event(struct sctp_t control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } static void @@ -3324,7 +3329,7 @@ sctp_notify_sender_dry_event(struct sctp /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, so_locked); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); } @@ -3380,7 +3385,7 @@ sctp_notify_stream_reset_add(struct sctp control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } @@ -3446,7 +3451,7 @@ sctp_notify_stream_reset(struct sctp_tcb control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } @@ -4301,6 +4306,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp struct sctp_queued_to_read *control, struct sockbuf *sb, int end, + int inp_read_lock_held, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -4321,7 +4327,8 @@ sctp_add_to_readq(struct sctp_inpcb *inp #endif return; } - SCTP_INP_READ_LOCK(inp); + if (inp_read_lock_held == 0) + SCTP_INP_READ_LOCK(inp); if (!(control->spec_flags & M_NOTIFICATION)) { atomic_add_int(&inp->total_recvs, 1); if (!control->do_not_ref_stcb) { @@ -4362,14 +4369,16 @@ sctp_add_to_readq(struct sctp_inpcb *inp control->tail_mbuf = prev; } else { /* Everything got collapsed out?? */ - SCTP_INP_READ_UNLOCK(inp); + if (inp_read_lock_held == 0) + SCTP_INP_READ_UNLOCK(inp); return; } if (end) { control->end_added = 1; } TAILQ_INSERT_TAIL(&inp->read_queue, control, next); - SCTP_INP_READ_UNLOCK(inp); + if (inp_read_lock_held == 0) + SCTP_INP_READ_UNLOCK(inp); if (inp && inp->sctp_socket) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Mon Jul 27 20:24:00 2009 (r195917) +++ head/sys/netinet/sctputil.h Tue Jul 28 14:09:06 2009 (r195918) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) +#define SCTP_READ_LOCK_HELD 1 +#define SCTP_READ_LOCK_NOT_HELD 0 #ifdef SCTP_ASOCLOG_OF_TSNS void sctp_print_out_track_log(struct sctp_tcb *stcb); @@ -103,6 +105,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp struct sctp_queued_to_read *control, struct sockbuf *sb, int end, + int inpread_locked, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 15:07:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43E75106566B; Tue, 28 Jul 2009 15:07:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27CC58FC17; Tue, 28 Jul 2009 15:07:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SF7fgZ035955; Tue, 28 Jul 2009 15:07:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SF7fOQ035954; Tue, 28 Jul 2009 15:07:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200907281507.n6SF7fOQ035954@svn.freebsd.org> From: Michael Tuexen Date: Tue, 28 Jul 2009 15:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195919 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 15:07:42 -0000 Author: tuexen Date: Tue Jul 28 15:07:41 2009 New Revision: 195919 URL: http://svn.freebsd.org/changeset/base/195919 Log: Fix a bug where wrong initialization value in used for an SCTP specific sysctl variable. Approved by: re, rrs(mentor). MFC after: 2 weeks. Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Jul 28 14:09:06 2009 (r195918) +++ head/sys/netinet/sctp_sysctl.c Tue Jul 28 15:07:41 2009 (r195919) @@ -112,7 +112,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; - SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_DEFAULT; + SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; #if defined(SCTP_DEBUG) SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; #endif @@ -621,7 +621,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #endif RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); @@ -910,7 +910,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, en SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_INT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", - SCTPCTL_NAT_FRIENDLY_DESC); + SCTPCTL_NAT_FRIENDLY_INITS_DESC); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_INT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Tue Jul 28 14:09:06 2009 (r195918) +++ head/sys/netinet/sctp_sysctl.h Tue Jul 28 15:07:41 2009 (r195919) @@ -477,7 +477,7 @@ struct sctp_sysctl { #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN /* Enable sending of the SACK-IMMEDIATELY bit */ -#define SCTPCTL_NAT_FRIENDLY_INITS "Enable sending of the nat-friendly SCTP option on INITs." +#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs." #define SCTPCTL_NAT_FRIENDLY_INITS_MIN 0 #define SCTPCTL_NAT_FRIENDLY_INITS_MAX 1 #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 17:16:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFE21065673; Tue, 28 Jul 2009 17:16:55 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC818FC08; Tue, 28 Jul 2009 17:16:55 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SHGt7g038666; Tue, 28 Jul 2009 17:16:55 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SHGtGC038664; Tue, 28 Jul 2009 17:16:55 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200907281716.n6SHGtGC038664@svn.freebsd.org> From: Qing Li Date: Tue, 28 Jul 2009 17:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195921 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 17:16:55 -0000 Author: qingli Date: Tue Jul 28 17:16:54 2009 New Revision: 195921 URL: http://svn.freebsd.org/changeset/base/195921 Log: The new flow table caches both the routing table entry as well as the L2 information. For an indirect route the cached L2 entry contains the MAC address of the gateway. Typically the default route is used to transmit multicast packets when explicit multicast routes are not available. The ether_output() function bypasses L2 resolution function if it verifies the L2 cache is valid, because the cached L2 address (a unicast MAC address) is copied into the packets as the destination MAC address. This validation, however, does not apply to broadcast and multicast packets because the destination MAC address is mapped according to a standard method instead. Submitted by: Xin Li Reviewed by: bz Approved by: re Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Jul 28 15:57:53 2009 (r195920) +++ head/sys/net/if_ethersubr.c Tue Jul 28 17:16:54 2009 (r195921) @@ -174,7 +174,8 @@ ether_output(struct ifnet *ifp, struct m int hlen; /* link layer header length */ if (ro != NULL) { - lle = ro->ro_lle; + if (!(m->m_flags & (M_BCAST | M_MCAST))) + lle = ro->ro_lle; rt0 = ro->ro_rt; } #ifdef MAC From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 17:35:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19EEB106566B; Tue, 28 Jul 2009 17:35:08 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from pil.idi.ntnu.no (pil.idi.ntnu.no [129.241.107.93]) by mx1.freebsd.org (Postfix) with ESMTP id 90B1B8FC19; Tue, 28 Jul 2009 17:35:07 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by pil.idi.ntnu.no (8.14.1/8.13.1) with ESMTP id n6SHAQmJ016372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 28 Jul 2009 19:10:27 +0200 (MEST) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.14.2/8.14.2) with ESMTP id n6SHAQm1048803; Tue, 28 Jul 2009 17:10:26 GMT (envelope-from Tor.Egge@cvsup.no.freebsd.org) Date: Tue, 28 Jul 2009 17:09:55 +0000 (UTC) Message-Id: <20090728.170954.74706437.Tor.Egge@cvsup.no.freebsd.org> To: julian@freebsd.org From: Tor Egge In-Reply-To: <200907250642.n6P6ggKw032784@svn.freebsd.org> References: <200907250642.n6P6ggKw032784@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned-By: mimedefang.idi.ntnu.no, using CLAMD X-SMTP-From: Sender=, Relay/Client=c2h5oh.idi.ntnu.no [129.241.103.69], EHLO=cvsup.no.freebsd.org X-Scanned-By: MIMEDefang 2.48 on 129.241.107.38 X-Scanned-By: mimedefang.idi.ntnu.no, using MIMEDefang 2.48 with local filter 16.42-idi X-Filter-Time: 1 seconds Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195862 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 17:35:09 -0000 This commit causes my laptop to hang during boot. ipfw and ipfw_nat are both compiled into the kernel: options IPFIREWALL options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=100 options IPFIREWALL_FORWARD options IPFIREWALL_NAT options IPDIVERT The kernel hangs during IPFW_WLOCK(&V_layer3_chain); at the start of ipfw_nat_init. The lock is not yet initialized at this time (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY), since the commit moved the initialization of the lock from (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256) (cf. ipfw_modevent() calling ipfw_init()) to (SI_SUB_KTHREAD_INIT, SI_ORDER_ANY) (cf. vnet_ipfw_init()). - Tor Egge From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 18:07:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCED51065793 for ; Tue, 28 Jul 2009 18:07:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outw.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id A1E748FC20 for ; Tue, 28 Jul 2009 18:07:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 5D416C3FB; Tue, 28 Jul 2009 11:07:06 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 920292D601F; Tue, 28 Jul 2009 11:07:05 -0700 (PDT) Message-ID: <4A6F3E4D.3050803@elischer.org> Date: Tue, 28 Jul 2009 11:07:09 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Tor Egge References: <200907250642.n6P6ggKw032784@svn.freebsd.org> <20090728.170954.74706437.Tor.Egge@cvsup.no.freebsd.org> In-Reply-To: <20090728.170954.74706437.Tor.Egge@cvsup.no.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, julian@freebsd.org Subject: Re: svn commit: r195862 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 18:07:07 -0000 Tor Egge wrote: > This commit causes my laptop to hang during boot. > > ipfw and ipfw_nat are both compiled into the kernel: > > options IPFIREWALL > options IPFIREWALL_VERBOSE > options IPFIREWALL_VERBOSE_LIMIT=100 > options IPFIREWALL_FORWARD > options IPFIREWALL_NAT > options IPDIVERT > > The kernel hangs during > > IPFW_WLOCK(&V_layer3_chain); > > at the start of ipfw_nat_init. The lock is not yet initialized at this time > (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY), since the commit moved the > initialization of the lock from > (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256) (cf. ipfw_modevent() calling > ipfw_init()) to (SI_SUB_KTHREAD_INIT, SI_ORDER_ANY) (cf. vnet_ipfw_init()). > > - Tor Egge hmmm odd, runs here... I'll check it right now I wonder whats diff...... ooooooh my last tests were with ipfw as a module..... ok I wonder where the "right" place to add it is.. probably keep it at SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256. an you check if that fixes it? possibly moving the 256 to 255? From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 18:19:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E2E81065680; Tue, 28 Jul 2009 18:19:22 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0528FC2B; Tue, 28 Jul 2009 18:19:22 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 0082E3BDB84; Tue, 28 Jul 2009 14:19:20 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 28 Jul 2009 14:19:21 -0400 X-Sasl-enc: MSy7qQgwKzkcJC8yqzFMyX2fjpKOxOTsA18j0eI/EUSW 1248805160 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 457EFD3A1; Tue, 28 Jul 2009 14:19:20 -0400 (EDT) Message-ID: <4A6F4124.6080204@incunabulum.net> Date: Tue, 28 Jul 2009 19:19:16 +0100 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Qing Li References: <200907281716.n6SHGtGC038664@svn.freebsd.org> In-Reply-To: <200907281716.n6SHGtGC038664@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195921 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 18:19:25 -0000 Thanks for committing this fix. From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 18:46:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 172B3106567B; Tue, 28 Jul 2009 18:46:00 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from pil.idi.ntnu.no (pil.idi.ntnu.no [129.241.107.93]) by mx1.freebsd.org (Postfix) with ESMTP id 8BA148FC33; Tue, 28 Jul 2009 18:45:58 +0000 (UTC) (envelope-from Tor.Egge@cvsup.no.freebsd.org) Received: from cvsup.no.freebsd.org (c2h5oh.idi.ntnu.no [129.241.103.69]) by pil.idi.ntnu.no (8.14.1/8.13.1) with ESMTP id n6SIjsAx026020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 28 Jul 2009 20:45:54 +0200 (MEST) Received: from localhost (localhost [127.0.0.1]) by cvsup.no.freebsd.org (8.14.2/8.14.2) with ESMTP id n6SIjsI4049806; Tue, 28 Jul 2009 18:45:54 GMT (envelope-from Tor.Egge@cvsup.no.freebsd.org) Date: Tue, 28 Jul 2009 18:45:41 +0000 (UTC) Message-Id: <20090728.184541.41675682.Tor.Egge@cvsup.no.freebsd.org> To: julian@elischer.org From: Tor Egge In-Reply-To: <4A6F3E4D.3050803@elischer.org> References: <200907250642.n6P6ggKw032784@svn.freebsd.org> <20090728.170954.74706437.Tor.Egge@cvsup.no.freebsd.org> <4A6F3E4D.3050803@elischer.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned-By: mimedefang.idi.ntnu.no, using CLAMD X-SMTP-From: Sender=, Relay/Client=c2h5oh.idi.ntnu.no [129.241.103.69], EHLO=cvsup.no.freebsd.org X-Scanned-By: MIMEDefang 2.48 on 129.241.107.38 X-Scanned-By: mimedefang.idi.ntnu.no, using MIMEDefang 2.48 with local filter 16.42-idi X-Filter-Time: 1 seconds Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, julian@freebsd.org Subject: Re: svn commit: r195862 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 18:46:00 -0000 > ok I wonder where the "right" place to add it is.. probably keep it > at SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256. > > an you check if that fixes it? possibly moving the 256 to 255? That depends on the wanted order between ipfw_init() and vnet_ipfw_init(). Using (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 256) makes the order undefined. Changing the VNET_SYS*INIT() macro arguments in ip_fw2.c from (SI_SUB_KTHREAD_INIT, SI_ORDER_ANY) to (SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255) allows my laptop to boot. I'm not familiar with VIMAGE, and my laptop kernel does not have that option, so I don't know if that will interfere with the initialization order between vnet_ipfw_init() and other VIMAGE/vnet related initializations. - Tor Egge From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 19:43:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22BE6106566B; Tue, 28 Jul 2009 19:43:28 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAB388FC18; Tue, 28 Jul 2009 19:43:27 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SJhRW2041617; Tue, 28 Jul 2009 19:43:27 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SJhRqv041613; Tue, 28 Jul 2009 19:43:27 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200907281943.n6SJhRqv041613@svn.freebsd.org> From: Julian Elischer Date: Tue, 28 Jul 2009 19:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195922 - in head/sys: kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 19:43:28 -0000 Author: julian Date: Tue Jul 28 19:43:27 2009 New Revision: 195922 URL: http://svn.freebsd.org/changeset/base/195922 Log: Somewhere along the line accept sockets stopped honoring the FIB selected for them. Fix this. Reviewed by: ambrisko Approved by: re (kib) MFC after: 3 days Modified: head/sys/kern/uipc_socket.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Jul 28 17:16:54 2009 (r195921) +++ head/sys/kern/uipc_socket.c Tue Jul 28 19:43:27 2009 (r195922) @@ -438,6 +438,7 @@ sonewconn(struct socket *head, int conns so->so_options = head->so_options &~ SO_ACCEPTCONN; so->so_linger = head->so_linger; so->so_state = head->so_state | SS_NOFDREF; + so->so_fibnum = head->so_fibnum; so->so_proto = head->so_proto; so->so_cred = crhold(head->so_cred); #ifdef MAC Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 28 17:16:54 2009 (r195921) +++ head/sys/netinet/tcp_input.c Tue Jul 28 19:43:27 2009 (r195922) @@ -758,6 +758,7 @@ findpcb: } inc.inc_fport = th->th_sport; inc.inc_lport = th->th_dport; + inc.inc_fibnum = so->so_fibnum; /* * Check for an existing connection attempt in syncache if Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Jul 28 17:16:54 2009 (r195921) +++ head/sys/netinet/tcp_syncache.c Tue Jul 28 19:43:27 2009 (r195922) @@ -642,8 +642,7 @@ syncache_socket(struct syncache *sc, str #endif inp = sotoinpcb(so); - inp->inp_inc.inc_fibnum = sc->sc_inc.inc_fibnum; - so->so_fibnum = sc->sc_inc.inc_fibnum; + inp->inp_inc.inc_fibnum = so->so_fibnum; INP_WLOCK(inp); /* Insert new socket into PCB hash list. */ @@ -1128,8 +1127,6 @@ _syncache_add(struct in_conninfo *inc, s sc->sc_cred = cred; cred = NULL; sc->sc_ipopts = ipopts; - /* XXX-BZ this fib assignment is just useless. */ - sc->sc_inc.inc_fibnum = inp->inp_inc.inc_fibnum; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); #ifdef INET6 if (!(inc->inc_flags & INC_ISIPV6)) @@ -1403,6 +1400,7 @@ syncache_respond(struct syncache *sc) } else optlen = 0; + M_SETFIB(m, sc->sc_inc.inc_fibnum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { th->th_sum = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 19:58:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A229F106571F; Tue, 28 Jul 2009 19:58:07 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 909FF8FC21; Tue, 28 Jul 2009 19:58:07 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SJw781041927; Tue, 28 Jul 2009 19:58:07 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SJw7aN041925; Tue, 28 Jul 2009 19:58:07 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200907281958.n6SJw7aN041925@svn.freebsd.org> From: Julian Elischer Date: Tue, 28 Jul 2009 19:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195923 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 19:58:08 -0000 Author: julian Date: Tue Jul 28 19:58:07 2009 New Revision: 195923 URL: http://svn.freebsd.org/changeset/base/195923 Log: Startup the vnet part of initialization a bit after the global part. Fixes crash on boot if ipfw compiled in. Submitted by: tegge@ Reviewed by: tegge@ Approved by: re (kib) Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Jul 28 19:43:27 2009 (r195922) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Jul 28 19:58:07 2009 (r195923) @@ -4767,10 +4767,10 @@ vnet_ipfw_uninit(const void *unused) return 0; } -VNET_SYSINIT(vnet_ipfw_init, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, +VNET_SYSINIT(vnet_ipfw_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255, vnet_ipfw_init, NULL); -VNET_SYSUNINIT(vnet_ipfw_uninit, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_ipfw_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY - 255, vnet_ipfw_uninit, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 21:39:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A5710656EF; Tue, 28 Jul 2009 21:39:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2CAB8FC23; Tue, 28 Jul 2009 21:39:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SLdwTv044243; Tue, 28 Jul 2009 21:39:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SLdw3a044235; Tue, 28 Jul 2009 21:39:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907282139.n6SLdw3a044235@svn.freebsd.org> From: Robert Watson Date: Tue, 28 Jul 2009 21:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195925 - in head/sys: kern security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 21:40:00 -0000 Author: rwatson Date: Tue Jul 28 21:39:58 2009 New Revision: 195925 URL: http://svn.freebsd.org/changeset/base/195925 Log: Audit file descriptors passed to fooat(2) system calls, which are used instead of the root/current working directory as the starting point for lookups. Up to two such descriptors can be audited. Add audit record BSM encoding for fooat(2). Note: due to an error in the OpenBSM 1.1p1 configuration file, a further change is required to that file in order to fix openat(2) auditing. Approved by: re (kib) Reviewed by: rdivacky (fooat(2) portions) Obtained from: TrustedBSD Project MFC after: 1 month Modified: head/sys/kern/vfs_lookup.c head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/kern/vfs_lookup.c Tue Jul 28 21:39:58 2009 (r195925) @@ -203,8 +203,13 @@ namei(struct nameidata *ndp) if (ndp->ni_startdir != NULL) { dp = ndp->ni_startdir; error = 0; - } else if (ndp->ni_dirfd != AT_FDCWD) + } else if (ndp->ni_dirfd != AT_FDCWD) { + if (cnp->cn_flags & AUDITVNODE1) + AUDIT_ARG_ATFD1(ndp->ni_dirfd); + if (cnp->cn_flags & AUDITVNODE2) + AUDIT_ARG_ATFD2(ndp->ni_dirfd); error = fgetvp(td, ndp->ni_dirfd, &dp); + } if (error != 0 || dp != NULL) { FILEDESC_SUNLOCK(fdp); if (error == 0 && dp->v_type != VDIR) { Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit.c Tue Jul 28 21:39:58 2009 (r195925) @@ -409,17 +409,22 @@ audit_commit(struct kaudit_record *ar, i else sorf = AU_PRS_SUCCESS; + /* + * syscalls.master sometimes contains a prototype event number, which + * we will transform into a more specific event number now that we + * have more complete information gathered during the system call. + */ switch(ar->k_ar.ar_event) { case AUE_OPEN_RWTC: - /* - * The open syscall always writes a AUE_OPEN_RWTC event; - * change it to the proper type of event based on the flags - * and the error value. - */ ar->k_ar.ar_event = audit_flags_and_error_to_openevent( ar->k_ar.ar_arg_fflags, error); break; + case AUE_OPENAT_RWTC: + ar->k_ar.ar_event = audit_flags_and_error_to_openatevent( + ar->k_ar.ar_arg_fflags, error); + break; + case AUE_SYSCTL: ar->k_ar.ar_event = audit_ctlname_to_sysctlevent( ar->k_ar.ar_arg_ctlname, ar->k_ar.ar_valid_arg); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit.h Tue Jul 28 21:39:58 2009 (r195925) @@ -114,6 +114,8 @@ extern int audit_suspended; #define ARG_IOVECSTR 0x0000800000000000ULL #define ARG_ARGV 0x0001000000000000ULL #define ARG_ENVV 0x0002000000000000ULL +#define ARG_ATFD1 0x0004000000000000ULL +#define ARG_ATFD2 0x0008000000000000ULL #define ARG_NONE 0x0000000000000000ULL #define ARG_ALL 0xFFFFFFFFFFFFFFFFULL @@ -132,6 +134,8 @@ union auditon_udata; void audit_arg_addr(void * addr); void audit_arg_exit(int status, int retval); void audit_arg_len(int len); +void audit_arg_atfd1(int atfd); +void audit_arg_atfd2(int atfd); void audit_arg_fd(int fd); void audit_arg_fflags(int fflags); void audit_arg_gid(gid_t gid); @@ -197,6 +201,16 @@ void audit_thread_free(struct thread *t audit_arg_argv((argv), (argc), (length)); \ } while (0) +#define AUDIT_ARG_ATFD1(atfd) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_atfd1((atfd)); \ +} while (0) + +#define AUDIT_ARG_ATFD2(atfd) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_atfd2((atfd)); \ +} while (0) + #define AUDIT_ARG_AUDITON(udata) do { \ if (AUDITING_TD(curthread)) \ audit_arg_auditon((udata)); \ @@ -360,6 +374,8 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_ADDR(addr) #define AUDIT_ARG_ARGV(argv, argc, length) +#define AUDIT_ARG_ATFD1(atfd) +#define AUDIT_ARG_ATFD2(atfd) #define AUDIT_ARG_AUDITON(udata) #define AUDIT_ARG_CMD(cmd) #define AUDIT_ARG_DEV(dev) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit_arg.c Tue Jul 28 21:39:58 2009 (r195925) @@ -101,6 +101,32 @@ audit_arg_len(int len) } void +audit_arg_atfd1(int atfd) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + ar->k_ar.ar_arg_atfd1 = atfd; + ARG_SET_VALID(ar, ARG_ATFD1); +} + +void +audit_arg_atfd2(int atfd) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + ar->k_ar.ar_arg_atfd2 = atfd; + ARG_SET_VALID(ar, ARG_ATFD2); +} + +void audit_arg_fd(int fd) { struct kaudit_record *ar; Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit_bsm.c Tue Jul 28 21:39:58 2009 (r195925) @@ -183,6 +183,20 @@ kau_free(struct au_record *rec) * XXXAUDIT: These macros assume that 'kar', 'ar', 'rec', and 'tok' in the * caller are OK with this. */ +#define ATFD1_TOKENS(argnum) do { \ + if (ARG_IS_VALID(kar, ARG_ATFD1)) { \ + tok = au_to_arg32(argnum, "at fd 1", ar->ar_arg_atfd1); \ + kau_write(rec, tok); \ + } \ +} while (0) + +#define ATFD2_TOKENS(argnum) do { \ + if (ARG_IS_VALID(kar, ARG_ATFD2)) { \ + tok = au_to_arg32(argnum, "at fd 2", ar->ar_arg_atfd2); \ + kau_write(rec, tok); \ + } \ +} while (0) + #define UPATH1_TOKENS do { \ if (ARG_IS_VALID(kar, ARG_UPATH1)) { \ tok = au_to_path(ar->ar_arg_upath1); \ @@ -198,6 +212,10 @@ kau_free(struct au_record *rec) } while (0) #define VNODE1_TOKENS do { \ + if (ARG_IS_VALID(kar, ARG_ATFD)) { \ + tok = au_to_arg32(1, "at fd", ar->ar_arg_atfd); \ + kau_write(rec, tok); \ + } \ if (ARG_IS_VALID(kar, ARG_VNODE1)) { \ tok = au_to_attr32(&ar->ar_arg_vnode1); \ kau_write(rec, tok); \ @@ -715,6 +733,8 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_CHDIR: case AUE_CHROOT: + case AUE_FSTATAT: + case AUE_FUTIMESAT: case AUE_GETATTRLIST: case AUE_JAIL: case AUE_LUTIMES: @@ -733,7 +753,9 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_TRUNCATE: case AUE_UNDELETE: case AUE_UNLINK: + case AUE_UNLINKAT: case AUE_UTIMES: + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; break; @@ -771,6 +793,16 @@ kaudit_to_bsm(struct kaudit_record *kar, UPATH1_VNODE1_TOKENS; break; + case AUE_FCHMODAT: + ATFD1_TOKENS(1); + if (ARG_IS_VALID(kar, ARG_MODE)) { + tok = au_to_arg32(3, "new file mode", + ar->ar_arg_mode); + kau_write(rec, tok); + } + UPATH1_VNODE1_TOKENS; + break; + case AUE_CHOWN: case AUE_LCHOWN: if (ARG_IS_VALID(kar, ARG_UID)) { @@ -784,6 +816,19 @@ kaudit_to_bsm(struct kaudit_record *kar, UPATH1_VNODE1_TOKENS; break; + case AUE_FCHOWNAT: + ATFD1_TOKENS(1); + if (ARG_IS_VALID(kar, ARG_UID)) { + tok = au_to_arg32(3, "new file uid", ar->ar_arg_uid); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_GID)) { + tok = au_to_arg32(4, "new file gid", ar->ar_arg_gid); + kau_write(rec, tok); + } + UPATH1_VNODE1_TOKENS; + break; + case AUE_EXCHANGEDATA: UPATH1_VNODE1_TOKENS; UPATH2_TOKENS; @@ -991,8 +1036,12 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_LINK: + case AUE_LINKAT: case AUE_RENAME: + case AUE_RENAMEAT: + ATFD1_TOKENS(1); UPATH1_VNODE1_TOKENS; + ATFD2_TOKENS(3); UPATH2_TOKENS; break; @@ -1136,6 +1185,32 @@ kaudit_to_bsm(struct kaudit_record *kar, UPATH1_VNODE1_TOKENS; break; + case AUE_OPENAT_RC: + case AUE_OPENAT_RTC: + case AUE_OPENAT_RWC: + case AUE_OPENAT_RWTC: + case AUE_OPENAT_WC: + case AUE_OPENAT_WTC: + if (ARG_IS_VALID(kar, ARG_MODE)) { + tok = au_to_arg32(3, "mode", ar->ar_arg_mode); + kau_write(rec, tok); + } + /* FALLTHROUGH */ + + case AUE_OPENAT_R: + case AUE_OPENAT_RT: + case AUE_OPENAT_RW: + case AUE_OPENAT_RWT: + case AUE_OPENAT_W: + case AUE_OPENAT_WT: + if (ARG_IS_VALID(kar, ARG_FFLAGS)) { + tok = au_to_arg32(2, "flags", ar->ar_arg_fflags); + kau_write(rec, tok); + } + ATFD1_TOKENS(1); + UPATH1_VNODE1_TOKENS; + break; + case AUE_PTRACE: if (ARG_IS_VALID(kar, ARG_CMD)) { tok = au_to_arg32(1, "request", ar->ar_arg_cmd); Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit_bsm_klib.c Tue Jul 28 21:39:58 2009 (r195925) @@ -75,6 +75,43 @@ static struct evclass_list evclass_hash[ #define EVCLASS_WLOCK() rw_wlock(&evclass_lock) #define EVCLASS_WUNLOCK() rw_wunlock(&evclass_lock) +struct aue_open_event { + int aoe_flags; + au_event_t aoe_event; +}; + +static const struct aue_open_event aue_open[] = { + { O_RDONLY, AUE_OPEN_R }, + { (O_RDONLY | O_CREAT), AUE_OPEN_RC }, + { (O_RDONLY | O_CREAT | O_TRUNC), AUE_OPEN_RTC }, + { (O_RDONLY | O_TRUNC), AUE_OPEN_RT }, + { O_RDWR, AUE_OPEN_RW }, + { (O_RDWR | O_CREAT), AUE_OPEN_RWC }, + { (O_RDWR | O_CREAT | O_TRUNC), AUE_OPEN_RWTC }, + { (O_RDWR | O_TRUNC), AUE_OPEN_RWT }, + { O_WRONLY, AUE_OPEN_W }, + { (O_WRONLY | O_CREAT), AUE_OPEN_WC }, + { (O_WRONLY | O_CREAT | O_TRUNC), AUE_OPEN_WTC }, + { (O_WRONLY | O_TRUNC), AUE_OPEN_WT }, +}; +static const int aue_open_count = sizeof(aue_open) / sizeof(aue_open[0]); + +static const struct aue_open_event aue_openat[] = { + { O_RDONLY, AUE_OPENAT_R }, + { (O_RDONLY | O_CREAT), AUE_OPENAT_RC }, + { (O_RDONLY | O_CREAT | O_TRUNC), AUE_OPENAT_RTC }, + { (O_RDONLY | O_TRUNC), AUE_OPENAT_RT }, + { O_RDWR, AUE_OPENAT_RW }, + { (O_RDWR | O_CREAT), AUE_OPENAT_RWC }, + { (O_RDWR | O_CREAT | O_TRUNC), AUE_OPENAT_RWTC }, + { (O_RDWR | O_TRUNC), AUE_OPENAT_RWT }, + { O_WRONLY, AUE_OPENAT_W }, + { (O_WRONLY | O_CREAT), AUE_OPENAT_WC }, + { (O_WRONLY | O_CREAT | O_TRUNC), AUE_OPENAT_WTC }, + { (O_WRONLY | O_TRUNC), AUE_OPENAT_WT }, +}; +static const int aue_openat_count = sizeof(aue_openat) / sizeof(aue_openat[0]); + /* * Look up the class for an audit event in the class mapping table. */ @@ -253,94 +290,33 @@ audit_ctlname_to_sysctlevent(int name[], au_event_t audit_flags_and_error_to_openevent(int oflags, int error) { - au_event_t aevent; + int i; /* * Need to check only those flags we care about. */ oflags = oflags & (O_RDONLY | O_CREAT | O_TRUNC | O_RDWR | O_WRONLY); - - /* - * These checks determine what flags are on with the condition that - * ONLY that combination is on, and no other flags are on. - */ - switch (oflags) { - case O_RDONLY: - aevent = AUE_OPEN_R; - break; - - case (O_RDONLY | O_CREAT): - aevent = AUE_OPEN_RC; - break; - - case (O_RDONLY | O_CREAT | O_TRUNC): - aevent = AUE_OPEN_RTC; - break; - - case (O_RDONLY | O_TRUNC): - aevent = AUE_OPEN_RT; - break; - - case O_RDWR: - aevent = AUE_OPEN_RW; - break; - - case (O_RDWR | O_CREAT): - aevent = AUE_OPEN_RWC; - break; - - case (O_RDWR | O_CREAT | O_TRUNC): - aevent = AUE_OPEN_RWTC; - break; - - case (O_RDWR | O_TRUNC): - aevent = AUE_OPEN_RWT; - break; - - case O_WRONLY: - aevent = AUE_OPEN_W; - break; - - case (O_WRONLY | O_CREAT): - aevent = AUE_OPEN_WC; - break; - - case (O_WRONLY | O_CREAT | O_TRUNC): - aevent = AUE_OPEN_WTC; - break; - - case (O_WRONLY | O_TRUNC): - aevent = AUE_OPEN_WT; - break; - - default: - aevent = AUE_OPEN; - break; + for (i = 0; i < aue_open_count; i++) { + if (aue_open[i].aoe_flags == oflags) + return (aue_open[i].aoe_event); } + return (AUE_OPEN); +} + +au_event_t +audit_flags_and_error_to_openatevent(int oflags, int error) +{ + int i; -#if 0 /* - * Convert chatty errors to better matching events. Failures to - * find a file are really just attribute events -- so recast them as - * such. - * - * XXXAUDIT: Solaris defines that AUE_OPEN will never be returned, it - * is just a placeholder. However, in Darwin we return that in - * preference to other events. For now, comment this out as we don't - * have a BSM conversion routine for AUE_OPEN. - */ - switch (aevent) { - case AUE_OPEN_R: - case AUE_OPEN_RT: - case AUE_OPEN_RW: - case AUE_OPEN_RWT: - case AUE_OPEN_W: - case AUE_OPEN_WT: - if (error == ENOENT) - aevent = AUE_OPEN; + * Need to check only those flags we care about. + */ + oflags = oflags & (O_RDONLY | O_CREAT | O_TRUNC | O_RDWR | O_WRONLY); + for (i = 0; i < aue_openat_count; i++) { + if (aue_openat[i].aoe_flags == oflags) + return (aue_openat[i].aoe_event); } -#endif - return (aevent); + return (AUE_OPENAT); } /* Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Tue Jul 28 21:18:26 2009 (r195924) +++ head/sys/security/audit/audit_private.h Tue Jul 28 21:39:58 2009 (r195925) @@ -196,6 +196,8 @@ struct audit_record { gid_t ar_arg_gid; struct groupset ar_arg_groups; int ar_arg_fd; + int ar_arg_atfd1; + int ar_arg_atfd2; int ar_arg_fflags; mode_t ar_arg_mode; int ar_arg_dev; @@ -323,6 +325,7 @@ void au_evclassmap_insert(au_event_t e au_class_t au_event_class(au_event_t event); au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg); au_event_t audit_flags_and_error_to_openevent(int oflags, int error); +au_event_t audit_flags_and_error_to_openatevent(int oflags, int error); au_event_t audit_msgctl_to_event(int cmd); au_event_t audit_semctl_to_event(int cmr); void audit_canon_path(struct thread *td, char *path, char *cpath); From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 21:52:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70D761065679; Tue, 28 Jul 2009 21:52:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9EB8FC1D; Tue, 28 Jul 2009 21:52:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SLqOpE044520; Tue, 28 Jul 2009 21:52:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SLqOBR044513; Tue, 28 Jul 2009 21:52:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907282152.n6SLqOBR044513@svn.freebsd.org> From: Robert Watson Date: Tue, 28 Jul 2009 21:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195926 - in head/sys: kern security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 21:52:25 -0000 Author: rwatson Date: Tue Jul 28 21:52:24 2009 New Revision: 195926 URL: http://svn.freebsd.org/changeset/base/195926 Log: Rework vnode argument auditing to follow the same structure, in order to avoid exposing ARG_ macros/flag values outside of the audit code in order to name which one of two possible vnodes will be audited for a system call. Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 month Modified: head/sys/kern/kern_exec.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/kern/kern_exec.c Tue Jul 28 21:52:24 2009 (r195926) @@ -419,7 +419,7 @@ interpret: goto exec_fail; vfslocked = VFS_LOCK_GIANT(binvp->v_mount); vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY); - AUDIT_ARG_VNODE(binvp, ARG_VNODE1); + AUDIT_ARG_VNODE1(binvp); imgp->vp = binvp; } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/kern/vfs_lookup.c Tue Jul 28 21:52:24 2009 (r195926) @@ -574,9 +574,9 @@ dirloop: ndp->ni_vp = dp; if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_VNODE(dp, ARG_VNODE1); + AUDIT_ARG_VNODE1(dp); else if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_VNODE(dp, ARG_VNODE2); + AUDIT_ARG_VNODE2(dp); if (!(cnp->cn_flags & (LOCKPARENT | LOCKLEAF))) VOP_UNLOCK(dp, 0); @@ -859,9 +859,9 @@ nextname: VOP_UNLOCK(ndp->ni_dvp, 0); if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_VNODE(dp, ARG_VNODE1); + AUDIT_ARG_VNODE1(dp); else if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_VNODE(dp, ARG_VNODE2); + AUDIT_ARG_VNODE2(dp); if ((cnp->cn_flags & LOCKLEAF) == 0) VOP_UNLOCK(dp, 0); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/kern/vfs_syscalls.c Tue Jul 28 21:52:24 2009 (r195926) @@ -379,7 +379,7 @@ kern_fstatfs(struct thread *td, int fd, vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); #ifdef AUDIT - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; if (mp) @@ -752,7 +752,7 @@ fchdir(td, uap) fdrop(fp, td); vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { int tvfslocked; @@ -2779,7 +2779,7 @@ fchflags(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfflags(td, fp->f_vnode, uap->flags); @@ -2940,7 +2940,7 @@ fchmod(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfmode(td, fp->f_vnode, uap->mode); @@ -3117,7 +3117,7 @@ fchown(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfown(td, fp->f_vnode, uap->uid, uap->gid); @@ -3353,7 +3353,7 @@ kern_futimes(struct thread *td, int fd, vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); @@ -3513,7 +3513,7 @@ fsync(td, uap) lock_flags = LK_EXCLUSIVE; } vn_lock(vp, lock_flags | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); if (vp->v_object != NULL) { VM_OBJECT_LOCK(vp->v_object); vm_object_page_clean(vp->v_object, 0, 0, 0); @@ -4103,7 +4103,7 @@ unionread: auio.uio_td = td; auio.uio_resid = count; vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); loff = auio.uio_offset = fp->f_offset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/security/audit/audit.h Tue Jul 28 21:52:24 2009 (r195926) @@ -163,7 +163,8 @@ void audit_arg_auid(uid_t auid); void audit_arg_auditinfo(struct auditinfo *au_info); void audit_arg_auditinfo_addr(struct auditinfo_addr *au_info); void audit_arg_upath(struct thread *td, char *upath, u_int64_t flags); -void audit_arg_vnode(struct vnode *vp, u_int64_t flags); +void audit_arg_vnode1(struct vnode *vp); +void audit_arg_vnode2(struct vnode *vp); void audit_arg_text(char *text); void audit_arg_cmd(int cmd); void audit_arg_svipc_cmd(int cmd); @@ -341,9 +342,14 @@ void audit_thread_free(struct thread *t audit_arg_value((value)); \ } while (0) -#define AUDIT_ARG_VNODE(vp, flags) do { \ +#define AUDIT_ARG_VNODE1(vp) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_vnode((vp), (flags)); \ + audit_arg_vnode1((vp)); \ +} while (0) + +#define AUDIT_ARG_VNODE2(vp) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_vnode2((vp)); \ } while (0) #define AUDIT_SYSCALL_ENTER(code, td) do { \ @@ -402,7 +408,8 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_UID(uid) #define AUDIT_ARG_UPATH(td, upath, flags) #define AUDIT_ARG_VALUE(value) -#define AUDIT_ARG_VNODE(vp, flags) +#define AUDIT_ARG_VNODE1(vp) +#define AUDIT_ARG_VNODE2(vp) #define AUDIT_SYSCALL_ENTER(code, td) #define AUDIT_SYSCALL_EXIT(error, td) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/security/audit/audit_arg.c Tue Jul 28 21:52:24 2009 (r195926) @@ -667,7 +667,7 @@ audit_arg_file(struct proc *p, struct fi vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - audit_arg_vnode(vp, ARG_VNODE1); + audit_arg_vnode1(vp); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); break; @@ -761,17 +761,11 @@ audit_arg_upath(struct thread *td, char * * XXXAUDIT: Possibly KASSERT the path pointer is NULL? */ -void -audit_arg_vnode(struct vnode *vp, u_int64_t flags) +static int +audit_arg_vnode(struct vnode *vp, struct vnode_au_info *vnp) { - struct kaudit_record *ar; struct vattr vattr; int error; - struct vnode_au_info *vnp; - - KASSERT(vp != NULL, ("audit_arg_vnode: vp == NULL")); - KASSERT((flags == ARG_VNODE1) || (flags == ARG_VNODE2), - ("audit_arg_vnode: flags %jd", (intmax_t)flags)); /* * Assume that if the caller is calling audit_arg_vnode() on a @@ -780,27 +774,10 @@ audit_arg_vnode(struct vnode *vp, u_int6 VFS_ASSERT_GIANT(vp->v_mount); ASSERT_VOP_LOCKED(vp, "audit_arg_vnode"); - ar = currecord(); - if (ar == NULL) - return; - - /* - * XXXAUDIT: The below clears, and then resets the flags for valid - * arguments. Ideally, either the new vnode is used, or the old one - * would be. - */ - if (flags & ARG_VNODE1) { - ar->k_ar.ar_valid_arg &= (ARG_ALL ^ ARG_VNODE1); - vnp = &ar->k_ar.ar_arg_vnode1; - } else { - ar->k_ar.ar_valid_arg &= (ARG_ALL ^ ARG_VNODE2); - vnp = &ar->k_ar.ar_arg_vnode2; - } - error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); if (error) { /* XXX: How to handle this case? */ - return; + return (error); } vnp->vn_mode = vattr.va_mode; @@ -810,9 +787,38 @@ audit_arg_vnode(struct vnode *vp, u_int6 vnp->vn_fsid = vattr.va_fsid; vnp->vn_fileid = vattr.va_fileid; vnp->vn_gen = vattr.va_gen; - if (flags & ARG_VNODE1) + return (0); +} + +void +audit_arg_vnode1(struct vnode *vp) +{ + struct kaudit_record *ar; + int error; + + ar = currecord(); + if (ar == NULL) + return; + + ARG_CLEAR_VALID(ar, ARG_VNODE1); + error = audit_arg_vnode(vp, &ar->k_ar.ar_arg_vnode1); + if (error == 0) ARG_SET_VALID(ar, ARG_VNODE1); - else +} + +void +audit_arg_vnode2(struct vnode *vp) +{ + struct kaudit_record *ar; + int error; + + ar = currecord(); + if (ar == NULL) + return; + + ARG_CLEAR_VALID(ar, ARG_VNODE2); + error = audit_arg_vnode(vp, &ar->k_ar.ar_arg_vnode2); + if (error == 0) ARG_SET_VALID(ar, ARG_VNODE2); } @@ -885,7 +891,7 @@ audit_sysclose(struct thread *td, int fd vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - audit_arg_vnode(vp, ARG_VNODE1); + audit_arg_vnode1(vp); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Tue Jul 28 21:39:58 2009 (r195925) +++ head/sys/security/audit/audit_private.h Tue Jul 28 21:52:24 2009 (r195926) @@ -240,6 +240,9 @@ struct audit_record { #define ARG_SET_VALID(kar, arg) do { \ (kar)->k_ar.ar_valid_arg |= (arg); \ } while (0) +#define ARG_CLEAR_VALID(kar, arg) do { \ + (kar)->k_ar.ar_valid_arg &= ~(arg); \ +} while (0) /* * In-kernel version of audit record; the basic record plus queue meta-data. From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 22:17:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA093106564A; Tue, 28 Jul 2009 22:17:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D839D8FC0C; Tue, 28 Jul 2009 22:17:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SMHYda045036; Tue, 28 Jul 2009 22:17:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SMHYm7045034; Tue, 28 Jul 2009 22:17:34 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907282217.n6SMHYm7045034@svn.freebsd.org> From: Robert Watson Date: Tue, 28 Jul 2009 22:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195927 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 22:17:35 -0000 Author: rwatson Date: Tue Jul 28 22:17:34 2009 New Revision: 195927 URL: http://svn.freebsd.org/changeset/base/195927 Log: Revise header comments for vnet.h as we now implement VNET_SYSINIT, not just VNET_DEFINE in vnet.h. Approved by: re (vimage blanket) Modified: head/sys/net/vnet.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Tue Jul 28 21:52:24 2009 (r195926) +++ head/sys/net/vnet.h Tue Jul 28 22:17:34 2009 (r195927) @@ -28,10 +28,14 @@ */ /* - * This is the virtual network stack memory allocator, which provides support - * for virtualized global variables via a special linker set, set_vnet. When - * "options VIMAGE" isn't defined, virtualized global variables are compiled - * as normal globals. + * This header file defines two sets of interfaces supporting virtualized + * network stacks: a virtual network stack memory allocator, which provides + * support for virtualized global variables via a special linker set, + * set_vnet, and virtualized sysinits/sysuninits, which allow constructors + * and destructors to be run for each network stack subsystem as virtual + * instances are created and destroyed. If VIMAGE isn't compiled into the + * kernel, virtualized global variables compile to normal global variables, + * and virtualized sysinits to regular sysinits. */ #ifndef _NET_VNET_H_ From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 22:58:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E41BF106564A; Tue, 28 Jul 2009 22:58:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7AB88FC0C; Tue, 28 Jul 2009 22:58:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SMweon045915; Tue, 28 Jul 2009 22:58:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SMweIx045911; Tue, 28 Jul 2009 22:58:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282258.n6SMweIx045911@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 22:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195928 - in vendor/bind9/dist: . bin/named X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 22:58:41 -0000 Author: dougb Date: Tue Jul 28 22:58:40 2009 New Revision: 195928 URL: http://svn.freebsd.org/changeset/base/195928 Log: Vendor import of BIND 9.6.1-P1 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/bin/named/update.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Tue Jul 28 22:17:34 2009 (r195927) +++ vendor/bind9/dist/CHANGES Tue Jul 28 22:58:40 2009 (r195928) @@ -1,3 +1,7 @@ + --- 9.6.1-P1 released --- + +2640. [security] A specially crafted update packet will cause named + to exit. [RT #20000] --- 9.6.1 released --- Modified: vendor/bind9/dist/bin/named/update.c ============================================================================== --- vendor/bind9/dist/bin/named/update.c Tue Jul 28 22:17:34 2009 (r195927) +++ vendor/bind9/dist/bin/named/update.c Tue Jul 28 22:58:40 2009 (r195928) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.151.12.5 2009/04/30 07:03:37 marka Exp $ */ +/* $Id: update.c,v 1.151.12.5.12.1 2009/07/28 14:18:08 marka Exp $ */ #include @@ -979,7 +979,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Tue Jul 28 22:17:34 2009 (r195927) +++ vendor/bind9/dist/version Tue Jul 28 22:58:40 2009 (r195928) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.5 2009/06/04 04:02:41 marka Exp $ +# $Id: version,v 1.43.12.5.8.1 2009/07/28 14:18:08 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=6 PATCHVER=1 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 22:59:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B307B1065670; Tue, 28 Jul 2009 22:59:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8796F8FC16; Tue, 28 Jul 2009 22:59:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SMxBmS045969; Tue, 28 Jul 2009 22:59:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SMxBbh045968; Tue, 28 Jul 2009 22:59:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282259.n6SMxBbh045968@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 22:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195929 - vendor/bind9/9.6.1-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 22:59:12 -0000 Author: dougb Date: Tue Jul 28 22:59:11 2009 New Revision: 195929 URL: http://svn.freebsd.org/changeset/base/195929 Log: Tag the 9.6.1-P1 release Added: vendor/bind9/9.6.1-P1/ - copied from r195928, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 23:23:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A48D106566C; Tue, 28 Jul 2009 23:23:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DFC58FC16; Tue, 28 Jul 2009 23:23:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SNNmBs046540; Tue, 28 Jul 2009 23:23:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SNNmCh046536; Tue, 28 Jul 2009 23:23:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282323.n6SNNmCh046536@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 23:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195930 - in vendor/bind9/dist-9.4: . bin/named X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 23:23:49 -0000 Author: dougb Date: Tue Jul 28 23:23:48 2009 New Revision: 195930 URL: http://svn.freebsd.org/changeset/base/195930 Log: Vendor import of BIND 9.4.3-P3 Modified: vendor/bind9/dist-9.4/CHANGES vendor/bind9/dist-9.4/bin/named/update.c vendor/bind9/dist-9.4/version Modified: vendor/bind9/dist-9.4/CHANGES ============================================================================== --- vendor/bind9/dist-9.4/CHANGES Tue Jul 28 22:59:11 2009 (r195929) +++ vendor/bind9/dist-9.4/CHANGES Tue Jul 28 23:23:48 2009 (r195930) @@ -1,3 +1,8 @@ + --- 9.4.3-P3 released --- + +2640. [security] A specially crafted update packet will cause named + to exit. [RT #20000] + --- 9.4.3-P2 released --- 2579. [bug] DNSSEC lookaside validation failed to handle unknown Modified: vendor/bind9/dist-9.4/bin/named/update.c ============================================================================== --- vendor/bind9/dist-9.4/bin/named/update.c Tue Jul 28 22:59:11 2009 (r195929) +++ vendor/bind9/dist-9.4/bin/named/update.c Tue Jul 28 23:23:48 2009 (r195930) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.109.18.27 2008/02/07 03:16:08 marka Exp $ */ +/* $Id: update.c,v 1.109.18.27.4.1 2009/07/28 13:57:27 marka Exp $ */ #include @@ -865,7 +865,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: vendor/bind9/dist-9.4/version ============================================================================== --- vendor/bind9/dist-9.4/version Tue Jul 28 22:59:11 2009 (r195929) +++ vendor/bind9/dist-9.4/version Tue Jul 28 23:23:48 2009 (r195930) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.23.2.2 2009/03/17 02:23:49 marka Exp $ +# $Id: version,v 1.29.134.23.2.3 2009/07/28 13:57:27 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 23:24:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33B48106566C; Tue, 28 Jul 2009 23:24:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 084968FC19; Tue, 28 Jul 2009 23:24:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SNOjvw046596; Tue, 28 Jul 2009 23:24:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SNOjBf046595; Tue, 28 Jul 2009 23:24:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282324.n6SNOjBf046595@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 23:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195931 - vendor/bind9/9.4.3-P3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 23:24:46 -0000 Author: dougb Date: Tue Jul 28 23:24:45 2009 New Revision: 195931 URL: http://svn.freebsd.org/changeset/base/195931 Log: Tag the 9.4.3-P3 release Added: vendor/bind9/9.4.3-P3/ - copied from r195930, vendor/bind9/dist-9.4/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 23:42:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B2E6106564A; Tue, 28 Jul 2009 23:42:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2CC48FC1B; Tue, 28 Jul 2009 23:42:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SNgdhq047001; Tue, 28 Jul 2009 23:42:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SNgd7A047000; Tue, 28 Jul 2009 23:42:39 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282342.n6SNgd7A047000@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 23:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195932 - stable/7/contrib/bind9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 23:42:40 -0000 Author: dougb Date: Tue Jul 28 23:42:39 2009 New Revision: 195932 URL: http://svn.freebsd.org/changeset/base/195932 Log: These files don't belong in contrib at all anymore, so remove them. Deleted: stable/7/contrib/bind9/FREEBSD-Upgrade stable/7/contrib/bind9/FREEBSD-Xlist From owner-svn-src-all@FreeBSD.ORG Tue Jul 28 23:59:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC5E7106568C; Tue, 28 Jul 2009 23:59:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AECA28FC15; Tue, 28 Jul 2009 23:59:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6SNxMl7047459; Tue, 28 Jul 2009 23:59:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6SNxMib047455; Tue, 28 Jul 2009 23:59:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907282359.n6SNxMib047455@svn.freebsd.org> From: Doug Barton Date: Tue, 28 Jul 2009 23:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195933 - in stable/7/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 23:59:23 -0000 Author: dougb Date: Tue Jul 28 23:59:22 2009 New Revision: 195933 URL: http://svn.freebsd.org/changeset/base/195933 Log: Update to version 9.4.3-P3 which addresses a remote DoS vulnerability: Receipt of a specially-crafted dynamic update message may cause BIND 9 servers to exit. This vulnerability affects all servers -- it is not limited to those that are configured to allow dynamic updates. Access controls will not provide an effective workaround. More details can be found here: https://www.isc.org/node/474 All BIND users are encouraged to update to a patched version ASAP. Modified: stable/7/contrib/bind9/ (props changed) stable/7/contrib/bind9/CHANGES (contents, props changed) stable/7/contrib/bind9/bin/named/update.c stable/7/contrib/bind9/lib/dns/validator.c (props changed) stable/7/contrib/bind9/version (contents, props changed) Modified: stable/7/contrib/bind9/CHANGES ============================================================================== --- stable/7/contrib/bind9/CHANGES Tue Jul 28 23:42:39 2009 (r195932) +++ stable/7/contrib/bind9/CHANGES Tue Jul 28 23:59:22 2009 (r195933) @@ -1,3 +1,8 @@ + --- 9.4.3-P3 released --- + +2640. [security] A specially crafted update packet will cause named + to exit. [RT #20000] + --- 9.4.3-P2 released --- 2579. [bug] DNSSEC lookaside validation failed to handle unknown Modified: stable/7/contrib/bind9/bin/named/update.c ============================================================================== --- stable/7/contrib/bind9/bin/named/update.c Tue Jul 28 23:42:39 2009 (r195932) +++ stable/7/contrib/bind9/bin/named/update.c Tue Jul 28 23:59:22 2009 (r195933) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.109.18.27 2008/02/07 03:16:08 marka Exp $ */ +/* $Id: update.c,v 1.109.18.27.4.1 2009/07/28 13:57:27 marka Exp $ */ #include @@ -865,7 +865,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: stable/7/contrib/bind9/version ============================================================================== --- stable/7/contrib/bind9/version Tue Jul 28 23:42:39 2009 (r195932) +++ stable/7/contrib/bind9/version Tue Jul 28 23:59:22 2009 (r195933) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.23.2.2 2009/03/17 02:23:49 marka Exp $ +# $Id: version,v 1.29.134.23.2.3 2009/07/28 13:57:27 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 00:13:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FAF8106564A; Wed, 29 Jul 2009 00:13:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB298FC13; Wed, 29 Jul 2009 00:13:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T0Dl1h047827; Wed, 29 Jul 2009 00:13:47 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T0Dlu1047825; Wed, 29 Jul 2009 00:13:47 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907290013.n6T0Dlu1047825@svn.freebsd.org> From: Doug Barton Date: Wed, 29 Jul 2009 00:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195934 - stable/6/contrib/bind9/bin/named X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 00:13:48 -0000 Author: dougb Date: Wed Jul 29 00:13:47 2009 New Revision: 195934 URL: http://svn.freebsd.org/changeset/base/195934 Log: Apply the patch derived from version 9.6.1-P1 which addresses a remote DoS vulnerability: Receipt of a specially-crafted dynamic update message may cause BIND 9 servers to exit. This vulnerability affects all servers -- it is not limited to those that are configured to allow dynamic updates. Access controls will not provide an effective workaround. More details can be found here: https://www.isc.org/node/474 All BIND users are encouraged to update to a patched version ASAP. Modified: stable/6/contrib/bind9/bin/named/update.c Modified: stable/6/contrib/bind9/bin/named/update.c ============================================================================== --- stable/6/contrib/bind9/bin/named/update.c Tue Jul 28 23:59:22 2009 (r195933) +++ stable/6/contrib/bind9/bin/named/update.c Wed Jul 29 00:13:47 2009 (r195934) @@ -863,7 +863,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 00:14:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0093D106566B; Wed, 29 Jul 2009 00:14:15 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF4DF8FC1B; Wed, 29 Jul 2009 00:14:14 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T0EE5L047887; Wed, 29 Jul 2009 00:14:14 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T0EEk3047874; Wed, 29 Jul 2009 00:14:14 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200907290014.n6T0EEk3047874@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 29 Jul 2009 00:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195935 - in releng: 6.3 6.3/contrib/bind9/bin/named 6.3/sys/conf 6.4 6.4/contrib/bind9/bin/named 6.4/sys/conf 7.1 7.1/contrib/bind9/bin/named 7.1/sys/conf 7.2 7.2/contrib/bind9/bin/nam... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 00:14:15 -0000 Author: simon Date: Wed Jul 29 00:14:14 2009 New Revision: 195935 URL: http://svn.freebsd.org/changeset/base/195935 Log: Fix BIND named(8) dynamic update message remote DoS. Obtained from: ISC Security: FreeBSD-SA-09:12.bind Security: CVE-2009-0696 Approved by: so (simon) Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/bin/named/update.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/bin/named/update.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/bin/named/update.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/bind9/bin/named/update.c releng/7.2/sys/conf/newvers.sh Modified: releng/6.3/UPDATING ============================================================================== --- releng/6.3/UPDATING Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.3/UPDATING Wed Jul 29 00:14:14 2009 (r195935) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090729: p12 FreeBSD-SA-09:12.bind + Fix BIND named(8) dynamic update message remote DoS. + 20090610: p11 FreeBSD-SA-09:09.pipe, FreeBSD-SA-09:10.ipv6, FreeBSD-SA-09:11.ntpd Prevent integer overflow in direct pipe write code from circumventing Modified: releng/6.3/contrib/bind9/bin/named/update.c ============================================================================== --- releng/6.3/contrib/bind9/bin/named/update.c Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.3/contrib/bind9/bin/named/update.c Wed Jul 29 00:14:14 2009 (r195935) @@ -859,7 +859,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: releng/6.3/sys/conf/newvers.sh ============================================================================== --- releng/6.3/sys/conf/newvers.sh Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.3/sys/conf/newvers.sh Wed Jul 29 00:14:14 2009 (r195935) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.3" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/6.4/UPDATING ============================================================================== --- releng/6.4/UPDATING Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.4/UPDATING Wed Jul 29 00:14:14 2009 (r195935) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090729: p6 FreeBSD-SA-09:12.bind + Fix BIND named(8) dynamic update message remote DoS. + 20090610: p5 FreeBSD-SA-09:09.pipe, FreeBSD-SA-09:10.ipv6, FreeBSD-SA-09:11.ntpd Prevent integer overflow in direct pipe write code from circumventing Modified: releng/6.4/contrib/bind9/bin/named/update.c ============================================================================== --- releng/6.4/contrib/bind9/bin/named/update.c Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.4/contrib/bind9/bin/named/update.c Wed Jul 29 00:14:14 2009 (r195935) @@ -863,7 +863,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: releng/6.4/sys/conf/newvers.sh ============================================================================== --- releng/6.4/sys/conf/newvers.sh Wed Jul 29 00:13:47 2009 (r195934) +++ releng/6.4/sys/conf/newvers.sh Wed Jul 29 00:14:14 2009 (r195935) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.4" -BRANCH="RELEASE-p5" +BRANCH="RELEASE-p6" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.1/UPDATING Wed Jul 29 00:14:14 2009 (r195935) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090729: p7 FreeBSD-SA-09:12.bind + Fix BIND named(8) dynamic update message remote DoS. + 20090610: p6 FreeBSD-SA-09:09.pipe, FreeBSD-SA-09:10.ipv6, FreeBSD-SA-09:11.ntpd Prevent integer overflow in direct pipe write code from circumventing Modified: releng/7.1/contrib/bind9/bin/named/update.c ============================================================================== --- releng/7.1/contrib/bind9/bin/named/update.c Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.1/contrib/bind9/bin/named/update.c Wed Jul 29 00:14:14 2009 (r195935) @@ -861,7 +861,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.1/sys/conf/newvers.sh Wed Jul 29 00:14:14 2009 (r195935) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.2/UPDATING ============================================================================== --- releng/7.2/UPDATING Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.2/UPDATING Wed Jul 29 00:14:14 2009 (r195935) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090729: p3 FreeBSD-SA-09:12.bind + Fix BIND named(8) dynamic update message remote DoS. + 20090624: p2 FreeBSD-EN-09:02.bce, FreeBSD-EN-09:03.fxp, FreeBSD-EN-09:04.fork Fix packet length calculation in bce(4). [EN-09:02] Modified: releng/7.2/contrib/bind9/bin/named/update.c ============================================================================== --- releng/7.2/contrib/bind9/bin/named/update.c Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.2/contrib/bind9/bin/named/update.c Wed Jul 29 00:14:14 2009 (r195935) @@ -865,7 +865,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: releng/7.2/sys/conf/newvers.sh ============================================================================== --- releng/7.2/sys/conf/newvers.sh Wed Jul 29 00:13:47 2009 (r195934) +++ releng/7.2/sys/conf/newvers.sh Wed Jul 29 00:14:14 2009 (r195935) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.2" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 00:15:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0A1106564A; Wed, 29 Jul 2009 00:15:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1C988FC17; Wed, 29 Jul 2009 00:15:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T0FduV047960; Wed, 29 Jul 2009 00:15:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T0Fd3L047955; Wed, 29 Jul 2009 00:15:39 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200907290015.n6T0Fd3L047955@svn.freebsd.org> From: Doug Barton Date: Wed, 29 Jul 2009 00:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195936 - in head/contrib/bind9: . bin/named X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 00:15:40 -0000 Author: dougb Date: Wed Jul 29 00:15:39 2009 New Revision: 195936 URL: http://svn.freebsd.org/changeset/base/195936 Log: Update to version 9.6.1-P1 which addresses a remote DoS vulnerability: Receipt of a specially-crafted dynamic update message may cause BIND 9 servers to exit. This vulnerability affects all servers -- it is not limited to those that are configured to allow dynamic updates. Access controls will not provide an effective workaround. More details can be found here: https://www.isc.org/node/474 All BIND users are encouraged to update to a patched version ASAP. Approved by: re (re -> SO -> dougb) Modified: head/contrib/bind9/ (props changed) head/contrib/bind9/CHANGES head/contrib/bind9/bin/named/update.c head/contrib/bind9/version Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Wed Jul 29 00:14:14 2009 (r195935) +++ head/contrib/bind9/CHANGES Wed Jul 29 00:15:39 2009 (r195936) @@ -1,3 +1,7 @@ + --- 9.6.1-P1 released --- + +2640. [security] A specially crafted update packet will cause named + to exit. [RT #20000] --- 9.6.1 released --- Modified: head/contrib/bind9/bin/named/update.c ============================================================================== --- head/contrib/bind9/bin/named/update.c Wed Jul 29 00:14:14 2009 (r195935) +++ head/contrib/bind9/bin/named/update.c Wed Jul 29 00:15:39 2009 (r195936) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.151.12.5 2009/04/30 07:03:37 marka Exp $ */ +/* $Id: update.c,v 1.151.12.5.12.1 2009/07/28 14:18:08 marka Exp $ */ #include @@ -979,7 +979,11 @@ temp_check(isc_mem_t *mctx, dns_diff_t * if (type == dns_rdatatype_rrsig || type == dns_rdatatype_sig) covers = dns_rdata_covers(&t->rdata); - else + else if (type == dns_rdatatype_any) { + dns_db_detachnode(db, &node); + dns_diff_clear(&trash); + return (DNS_R_NXRRSET); + } else covers = 0; /* Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Wed Jul 29 00:14:14 2009 (r195935) +++ head/contrib/bind9/version Wed Jul 29 00:15:39 2009 (r195936) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.5 2009/06/04 04:02:41 marka Exp $ +# $Id: version,v 1.43.12.5.8.1 2009/07/28 14:18:08 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=6 PATCHVER=1 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 05:10:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9F13106564A; Wed, 29 Jul 2009 05:10:00 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 117B18FC2E; Wed, 29 Jul 2009 05:09:58 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C88FC456B1; Wed, 29 Jul 2009 07:09:56 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8AD6345684; Wed, 29 Jul 2009 07:09:51 +0200 (CEST) Date: Wed, 29 Jul 2009 07:10:16 +0200 From: Pawel Jakub Dawidek To: Randall Stewart Message-ID: <20090729051016.GB3550@garage.freebsd.pl> References: <200907281409.n6SE971u034585@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <200907281409.n6SE971u034585@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 05:10:01 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 28, 2009 at 02:09:07PM +0000, Randall Stewart wrote: > Author: rrs > Date: Tue Jul 28 14:09:06 2009 > New Revision: 195918 > URL: http://svn.freebsd.org/changeset/base/195918 >=20 > Log: > Turns out that when a receiver forwards through its TNS's the > processing code holds the read lock (when processing a > FWD-TSN for pr-sctp). If it finds stranded data that > can be given to the application, it calls sctp_add_to_readq(). > The readq function also grabs this lock. So if INVAR is on > we get a double recurse on a non-recursive lock and panic. > =20 > This fix will change it so that readq() function gets a > flag to tell if the lock is held, if so then it does not > get the lock. > =20 > Approved by: re@freebsd.org (Kostik Belousov) > MFC after: 1 week [...] > sctp_add_to_readq(stcb->sctp_ep, stcb, control, > - &stcb->sctp_socket->so_rcv, 1, so_locked); > + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); [...] > @@ -4301,6 +4306,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp > struct sctp_queued_to_read *control, > struct sockbuf *sb, > int end, > + int inp_read_lock_held, > int so_locked > #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) > SCTP_UNUSED > @@ -4321,7 +4327,8 @@ sctp_add_to_readq(struct sctp_inpcb *inp > #endif > return; > } > - SCTP_INP_READ_LOCK(inp); > + if (inp_read_lock_held =3D=3D 0) It would be a bit cleaner to compare with SCTP_READ_LOCK_NOT_HELD here, instead of 0. > + SCTP_INP_READ_LOCK(inp); > if (!(control->spec_flags & M_NOTIFICATION)) { > atomic_add_int(&inp->total_recvs, 1); > if (!control->do_not_ref_stcb) { > @@ -4362,14 +4369,16 @@ sctp_add_to_readq(struct sctp_inpcb *inp > control->tail_mbuf =3D prev; > } else { > /* Everything got collapsed out?? */ > - SCTP_INP_READ_UNLOCK(inp); > + if (inp_read_lock_held =3D=3D 0) > + SCTP_INP_READ_UNLOCK(inp); > return; > } > if (end) { > control->end_added =3D 1; > } > TAILQ_INSERT_TAIL(&inp->read_queue, control, next); > - SCTP_INP_READ_UNLOCK(inp); > + if (inp_read_lock_held =3D=3D 0) > + SCTP_INP_READ_UNLOCK(inp); > if (inp && inp->sctp_socket) { > if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { > SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); Instead of using additional argument to the sctp_add_to_readq() function, wouldn't it be sufficient to just check with mtx_owned(9) if the lock is already held? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKb9m4ForvXbEpPzQRAh/FAJ0Uc/bklivoexP+BYV0cx6dFI69fwCgs6in SiImPQCzfLDftrdDiobxcDg= =W5Wi -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 05:23:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7E31065676; Wed, 29 Jul 2009 05:23:27 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id C568C8FC1A; Wed, 29 Jul 2009 05:23:26 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n6T5NOx9067702 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 29 Jul 2009 01:23:25 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1248845005; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=Ucss2vgJLoq/Tf4lyVOzEzdHAU6NS+HORZRXCOIZCLDXOA41nFyB0O/ 0tm8yKOdwK8xjN1E+W2r3qD/+WGYJwA== Message-Id: <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> From: Randall Stewart To: Pawel Jakub Dawidek In-Reply-To: <20090729051016.GB3550@garage.freebsd.pl> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Wed, 29 Jul 2009 01:23:24 -0400 References: <200907281409.n6SE971u034585@svn.freebsd.org> <20090729051016.GB3550@garage.freebsd.pl> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 05:23:27 -0000 On Jul 29, 2009, at 1:10 AM, Pawel Jakub Dawidek wrote: > On Tue, Jul 28, 2009 at 02:09:07PM +0000, Randall Stewart wrote: >> Author: rrs >> Date: Tue Jul 28 14:09:06 2009 >> New Revision: 195918 >> URL: http://svn.freebsd.org/changeset/base/195918 >> >> Log: >> Turns out that when a receiver forwards through its TNS's the >> processing code holds the read lock (when processing a >> FWD-TSN for pr-sctp). If it finds stranded data that >> can be given to the application, it calls sctp_add_to_readq(). >> The readq function also grabs this lock. So if INVAR is on >> we get a double recurse on a non-recursive lock and panic. >> >> This fix will change it so that readq() function gets a >> flag to tell if the lock is held, if so then it does not >> get the lock. >> >> Approved by: re@freebsd.org (Kostik Belousov) >> MFC after: 1 week > [...] >> sctp_add_to_readq(stcb->sctp_ep, stcb, control, >> - &stcb->sctp_socket->so_rcv, 1, so_locked); >> + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, >> so_locked); > [...] >> @@ -4301,6 +4306,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp >> struct sctp_queued_to_read *control, >> struct sockbuf *sb, >> int end, >> + int inp_read_lock_held, >> int so_locked >> #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) >> SCTP_UNUSED >> @@ -4321,7 +4327,8 @@ sctp_add_to_readq(struct sctp_inpcb *inp >> #endif >> return; >> } >> - SCTP_INP_READ_LOCK(inp); >> + if (inp_read_lock_held == 0) > > It would be a bit cleaner to compare with SCTP_READ_LOCK_NOT_HELD > here, > instead of 0. I suppose so ;-) > >> + SCTP_INP_READ_LOCK(inp); >> if (!(control->spec_flags & M_NOTIFICATION)) { >> atomic_add_int(&inp->total_recvs, 1); >> if (!control->do_not_ref_stcb) { >> @@ -4362,14 +4369,16 @@ sctp_add_to_readq(struct sctp_inpcb *inp >> control->tail_mbuf = prev; >> } else { >> /* Everything got collapsed out?? */ >> - SCTP_INP_READ_UNLOCK(inp); >> + if (inp_read_lock_held == 0) >> + SCTP_INP_READ_UNLOCK(inp); >> return; >> } >> if (end) { >> control->end_added = 1; >> } >> TAILQ_INSERT_TAIL(&inp->read_queue, control, next); >> - SCTP_INP_READ_UNLOCK(inp); >> + if (inp_read_lock_held == 0) >> + SCTP_INP_READ_UNLOCK(inp); >> if (inp && inp->sctp_socket) { >> if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { >> SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); > > Instead of using additional argument to the sctp_add_to_readq() > function, wouldn't it be sufficient to just check with mtx_owned(9) if > the lock is already held? Hmm... I suppose one could go that way... but traditionally upper code as told the lower code that it holds/does not hold the lock. This is true in quite a few other functions... R > > -- > Pawel Jakub Dawidek http://www.wheel.pl > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 05:23:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C99F1065670; Wed, 29 Jul 2009 05:23:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4038FC16; Wed, 29 Jul 2009 05:23:53 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T5NrY9054692; Wed, 29 Jul 2009 05:23:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T5NqLY054690; Wed, 29 Jul 2009 05:23:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200907290523.n6T5NqLY054690@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 29 Jul 2009 05:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195938 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 05:23:53 -0000 Author: pjd Date: Wed Jul 29 05:23:52 2009 New Revision: 195938 URL: http://svn.freebsd.org/changeset/base/195938 Log: Currently there is a problem with fscking UFS file systems created on top of ZVOLs. The problem is that rc.d/fsck runs before rc.d/zfs. The latter makes ZVOLs to appear in /dev/. In such case rc.d/fsck cannot find devfs entry and aborts. We cannot simply move rc.d/zfs before rc.d/fsck, because we first want kern.hostid to be configured (by rc.d/hostid). If we won't wait (hostid will be 0) we can reuse disks which are in use by different systems (eg. in SAN/NAS environment). We also cannot move rc.d/hostid before rc.d/fsck, because rc.d/hostid on first system start stores generated kern.hostuuid in /etc/hostid file, so it needs root file system to be mounted read-write. The fix is to split rc.d/hostid so that rc.d/hostid (which will now run before rc.d/fsck) only generates hostid and sets up sysctls, but doesn't touch root file system and rc.d/hostid_save (which is run after rc.d/root) and only creates /etc/hostid file. With that in place, we can move ZVOL initialization to dedicated rc.d/zvol script which runs before rc.d/fsck. PR: conf/120194 Reported by: James Snow Reviewed by: brooks Approved by: re (kib) MFC after: 2 weeks Added: head/etc/rc.d/hostid_save (contents, props changed) head/etc/rc.d/zvol (contents, props changed) Modified: head/etc/rc.d/Makefile head/etc/rc.d/hostid head/etc/rc.d/zfs Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Wed Jul 29 00:39:46 2009 (r195937) +++ head/etc/rc.d/Makefile Wed Jul 29 05:23:52 2009 (r195938) @@ -13,7 +13,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI fsck ftp-proxy ftpd \ gbde geli geli2 gssd \ hcsecd \ - hostapd hostid hostname \ + hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted \ @@ -40,7 +40,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI watchdogd wpa_supplicant \ ypbind yppasswdd ypserv \ ypset ypupdated ypxfrd \ - zfs + zfs zvol .if ${MK_OPENSSH} != "no" FILES+= sshd Modified: head/etc/rc.d/hostid ============================================================================== --- head/etc/rc.d/hostid Wed Jul 29 00:39:46 2009 (r195937) +++ head/etc/rc.d/hostid Wed Jul 29 05:23:52 2009 (r195938) @@ -28,8 +28,7 @@ # # PROVIDE: hostid -# REQUIRE: root -# BEFORE: mountcritlocal +# BEFORE: fsck # KEYWORD: nojail . /etc/rc.subr @@ -68,7 +67,7 @@ hostid_hardware() esac } -hostid_reset() +hostid_generate() { # First look for UUID in hardware. uuid=`hostid_hardware` @@ -76,12 +75,17 @@ hostid_reset() # If not found, fall back to software-generated UUID. uuid=`uuidgen` fi + hostid_set $uuid +} + +hostid_reset() +{ + hostid_generate # Store newly generated UUID in ${hostid_file}. echo $uuid > ${hostid_file} if [ $? -ne 0 ]; then warn "could not store hostuuid in ${hostid_file}." fi - hostid_set $uuid } hostid_start() @@ -91,7 +95,7 @@ hostid_start() hostid_set `cat ${hostid_file}` else # No hostid file, generate UUID. - hostid_reset + hostid_generate fi } Added: head/etc/rc.d/hostid_save ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/hostid_save Wed Jul 29 05:23:52 2009 (r195938) @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: hostid_save +# REQUIRE: root +# BEFORE: mountcritlocal +# KEYWORD: nojail + +. /etc/rc.subr + +name="hostid_save" +start_cmd="hostid_save" +stop_cmd=":" +rcvar="hostid_enable" + +hostid_save() +{ + if [ ! -r ${hostid_file} ]; then + $SYSCTL_N kern.hostuuid > ${hostid_file} + if [ $? -ne 0 ]; then + warn "could not store hostuuid in ${hostid_file}." + fi + fi +} + +load_rc_config $name +run_rc_command "$1" Modified: head/etc/rc.d/zfs ============================================================================== --- head/etc/rc.d/zfs Wed Jul 29 00:39:46 2009 (r195937) +++ head/etc/rc.d/zfs Wed Jul 29 05:23:52 2009 (r195938) @@ -23,21 +23,11 @@ zfs_start_jail() zfs_start_main() { - zfs volinit zfs mount -a zfs share -a if [ ! -r /etc/zfs/exports ]; then touch /etc/zfs/exports fi - # Enable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ - while read state name; do - case "${state}" in - [oO][nN]) - swapon /dev/zvol/${name} - ;; - esac - done } zfs_start() @@ -58,18 +48,8 @@ zfs_stop_jail() zfs_stop_main() { - # Disable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ - while read state name; do - case "${state}" in - [oO][nN]) - swapoff /dev/zvol/${name} - ;; - esac - done zfs unshare -a zfs unmount -a - zfs volfini } zfs_stop() Added: head/etc/rc.d/zvol ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/zvol Wed Jul 29 05:23:52 2009 (r195938) @@ -0,0 +1,48 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zvol +# REQUIRE: hostid +# BEFORE: fsck +# KEYWORD: nojail + +. /etc/rc.subr + +name="zvol" +rcvar="zfs_enable" +start_cmd="zvol_start" +stop_cmd="zvol_stop" +required_modules="zfs" + +zvol_start() +{ + zfs volinit + # Enable swap on ZVOLs with property org.freebsd:swap=on. + zfs list -H -o org.freebsd:swap,name -t volume | \ + while read state name; do + case "${state}" in + [oO][nN]) + swapon /dev/zvol/${name} + ;; + esac + done +} + +zvol_stop() +{ + # Disable swap on ZVOLs with property org.freebsd:swap=on. + zfs list -H -o org.freebsd:swap,name -t volume | \ + while read state name; do + case "${state}" in + [oO][nN]) + swapoff /dev/zvol/${name} + ;; + esac + done + zfs volfini +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 05:30:39 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A35B106566C; Wed, 29 Jul 2009 05:30:39 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4808FC1B; Wed, 29 Jul 2009 05:30:38 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 074F645C99; Wed, 29 Jul 2009 07:30:37 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6457A45685; Wed, 29 Jul 2009 07:30:31 +0200 (CEST) Date: Wed, 29 Jul 2009 07:30:56 +0200 From: Pawel Jakub Dawidek To: Randall Stewart Message-ID: <20090729053056.GC3550@garage.freebsd.pl> References: <200907281409.n6SE971u034585@svn.freebsd.org> <20090729051016.GB3550@garage.freebsd.pl> <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Content-Disposition: inline In-Reply-To: <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 05:30:39 -0000 --qjNfmADvan18RZcF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 29, 2009 at 01:23:24AM -0400, Randall Stewart wrote: > >Instead of using additional argument to the sctp_add_to_readq() > >function, wouldn't it be sufficient to just check with mtx_owned(9) if > >the lock is already held? >=20 > Hmm... I suppose one could go that way... but traditionally upper code = =20 > as > told the lower code that it holds/does not hold the lock. This is true > in quite a few other functions... We can find examples of both behaviours in many places, that's true. The reason to keep additional argument is that once you decide to move to read-write locks it might not be reliable to check if read-lock is already held by the current thread. All in all both solutions work, my observation was only that diff could be significantly reduced by using mtx_owned(9), nothing major. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --qjNfmADvan18RZcF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKb96QForvXbEpPzQRAojyAJ9tCSLHEaovLIDI5QylnxwIl0VKvACg+Cty AG6WF5UCdcAEE6i+01J2NSs= =q126 -----END PGP SIGNATURE----- --qjNfmADvan18RZcF-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 07:02:28 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91AF6106566B; Wed, 29 Jul 2009 07:02:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6AB2A8FC1D; Wed, 29 Jul 2009 07:02:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 0A96046B0C; Wed, 29 Jul 2009 03:02:28 -0400 (EDT) Date: Wed, 29 Jul 2009 08:02:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> Message-ID: References: <200907281409.n6SE971u034585@svn.freebsd.org> <20090729051016.GB3550@garage.freebsd.pl> <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 07:02:29 -0000 On Wed, 29 Jul 2009, Randall Stewart wrote: >> Instead of using additional argument to the sctp_add_to_readq() function, >> wouldn't it be sufficient to just check with mtx_owned(9) if the lock is >> already held? > > Hmm... I suppose one could go that way... but traditionally upper code as > told the lower code that it holds/does not hold the lock. This is true in > quite a few other functions... Structures of the form: if (mtx_owned(&mtx)) mtx_unlock(&mtx); Strike me as less robust than code with either fixed assertions about lock state from the caller, or code that accepts a flag that in effect leads to two variants each with fixed state that can be asserted. I.e., void foo(void *obj) { OBJ_LOCK_ASSERT(obj); ... } or: void foo(void *obj, int arg_locked) { if (arg_locked) OBJ_LOCK_ASSERT(obj); else OBJ_LOCK(obj); ... if (!arg_locked) OBJ_UNLOCK(obj); } I guess I'm sort of OK with structure but it smacks of poor code design: void foo(void *obj) { int locked; if (OBJ_LOCK_OWNED(obj)) { locked = 1; OBJ_LOCK(obj); } else locked = 0; ... if (locked) OBJ_UNLOCK(obj); } However, this structure doesn't lend itself to moving to lock types that can't cheaply support mtx_owned()-like operations, such as read acquisitions of reader-writer locks. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 07:44:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DBC10656B3; Wed, 29 Jul 2009 07:44:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 513998FC0C; Wed, 29 Jul 2009 07:44:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T7iiNT057465; Wed, 29 Jul 2009 07:44:44 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T7ii1C057459; Wed, 29 Jul 2009 07:44:44 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907290744.n6T7ii1C057459@svn.freebsd.org> From: Robert Watson Date: Wed, 29 Jul 2009 07:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195939 - in head/sys: kern security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 07:44:45 -0000 Author: rwatson Date: Wed Jul 29 07:44:43 2009 New Revision: 195939 URL: http://svn.freebsd.org/changeset/base/195939 Log: Eliminate ARG_UPATH[12] arguments to AUDIT_ARG_UPATH() and instead provide specific macros, AUDIT_ARG_UPATH1() and AUDIT_ARG_UPATH2() to capture path information for audit records. This allows us to move the definitions of ARG_* out of the public audit header file, as they are an implementation detail of our current kernel-internal audit record, which may change. Approved by: re (kensmith) Obtained from: TrustedBSD Project MFC after: 1 month Modified: head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Jul 29 05:23:52 2009 (r195938) +++ head/sys/kern/vfs_lookup.c Wed Jul 29 07:44:43 2009 (r195939) @@ -164,9 +164,9 @@ namei(struct nameidata *ndp) /* If we are auditing the kernel pathname, save the user pathname. */ if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_UPATH(td, cnp->cn_pnbuf, ARG_UPATH1); + AUDIT_ARG_UPATH1(td, cnp->cn_pnbuf); if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_UPATH(td, cnp->cn_pnbuf, ARG_UPATH2); + AUDIT_ARG_UPATH2(td, cnp->cn_pnbuf); /* * Don't allow empty pathnames. Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Jul 29 05:23:52 2009 (r195938) +++ head/sys/kern/vfs_mount.c Wed Jul 29 07:44:43 2009 (r195939) @@ -1144,7 +1144,7 @@ unmount(td, uap) } mtx_unlock(&mountlist_mtx); } else { - AUDIT_ARG_UPATH(td, pathbuf, ARG_UPATH1); + AUDIT_ARG_UPATH1(td, pathbuf); mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Wed Jul 29 05:23:52 2009 (r195938) +++ head/sys/security/audit/audit.h Wed Jul 29 07:44:43 2009 (r195939) @@ -56,69 +56,6 @@ extern int audit_enabled; extern int audit_suspended; -/* - * Define the masks for the audited arguments. - * - * XXXRW: These need to remain in audit.h for now because our vnode and name - * lookup audit calls rely on passing in flags to indicate which name or - * vnode is being logged. These should move to audit_private.h when that is - * fixed. - */ -#define ARG_EUID 0x0000000000000001ULL -#define ARG_RUID 0x0000000000000002ULL -#define ARG_SUID 0x0000000000000004ULL -#define ARG_EGID 0x0000000000000008ULL -#define ARG_RGID 0x0000000000000010ULL -#define ARG_SGID 0x0000000000000020ULL -#define ARG_PID 0x0000000000000040ULL -#define ARG_UID 0x0000000000000080ULL -#define ARG_AUID 0x0000000000000100ULL -#define ARG_GID 0x0000000000000200ULL -#define ARG_FD 0x0000000000000400ULL -#define ARG_POSIX_IPC_PERM 0x0000000000000800ULL -#define ARG_FFLAGS 0x0000000000001000ULL -#define ARG_MODE 0x0000000000002000ULL -#define ARG_DEV 0x0000000000004000ULL -#define ARG_ADDR 0x0000000000008000ULL -#define ARG_LEN 0x0000000000010000ULL -#define ARG_MASK 0x0000000000020000ULL -#define ARG_SIGNUM 0x0000000000040000ULL -#define ARG_LOGIN 0x0000000000080000ULL -#define ARG_SADDRINET 0x0000000000100000ULL -#define ARG_SADDRINET6 0x0000000000200000ULL -#define ARG_SADDRUNIX 0x0000000000400000ULL -#define ARG_TERMID_ADDR 0x0000000000400000ULL -#define ARG_UNUSED2 0x0000000001000000ULL -#define ARG_UPATH1 0x0000000002000000ULL -#define ARG_UPATH2 0x0000000004000000ULL -#define ARG_TEXT 0x0000000008000000ULL -#define ARG_VNODE1 0x0000000010000000ULL -#define ARG_VNODE2 0x0000000020000000ULL -#define ARG_SVIPC_CMD 0x0000000040000000ULL -#define ARG_SVIPC_PERM 0x0000000080000000ULL -#define ARG_SVIPC_ID 0x0000000100000000ULL -#define ARG_SVIPC_ADDR 0x0000000200000000ULL -#define ARG_GROUPSET 0x0000000400000000ULL -#define ARG_CMD 0x0000000800000000ULL -#define ARG_SOCKINFO 0x0000001000000000ULL -#define ARG_ASID 0x0000002000000000ULL -#define ARG_TERMID 0x0000004000000000ULL -#define ARG_AUDITON 0x0000008000000000ULL -#define ARG_VALUE 0x0000010000000000ULL -#define ARG_AMASK 0x0000020000000000ULL -#define ARG_CTLNAME 0x0000040000000000ULL -#define ARG_PROCESS 0x0000080000000000ULL -#define ARG_MACHPORT1 0x0000100000000000ULL -#define ARG_MACHPORT2 0x0000200000000000ULL -#define ARG_EXIT 0x0000400000000000ULL -#define ARG_IOVECSTR 0x0000800000000000ULL -#define ARG_ARGV 0x0001000000000000ULL -#define ARG_ENVV 0x0002000000000000ULL -#define ARG_ATFD1 0x0004000000000000ULL -#define ARG_ATFD2 0x0008000000000000ULL -#define ARG_NONE 0x0000000000000000ULL -#define ARG_ALL 0xFFFFFFFFFFFFFFFFULL - void audit_syscall_enter(unsigned short code, struct thread *td); void audit_syscall_exit(int error, struct thread *td); @@ -162,7 +99,8 @@ void audit_arg_sockaddr(struct thread * void audit_arg_auid(uid_t auid); void audit_arg_auditinfo(struct auditinfo *au_info); void audit_arg_auditinfo_addr(struct auditinfo_addr *au_info); -void audit_arg_upath(struct thread *td, char *upath, u_int64_t flags); +void audit_arg_upath1(struct thread *td, char *upath); +void audit_arg_upath2(struct thread *td, char *upath); void audit_arg_vnode1(struct vnode *vp); void audit_arg_vnode2(struct vnode *vp); void audit_arg_text(char *text); @@ -332,9 +270,14 @@ void audit_thread_free(struct thread *t audit_arg_uid((uid)); \ } while (0) -#define AUDIT_ARG_UPATH(td, upath, flags) do { \ +#define AUDIT_ARG_UPATH1(td, upath) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_upath1((td), (upath)); \ +} while (0) + +#define AUDIT_ARG_UPATH2(td, upath) do { \ if (AUDITING_TD(curthread)) \ - audit_arg_upath((td), (upath), (flags)); \ + audit_arg_upath2((td), (upath)); \ } while (0) #define AUDIT_ARG_VALUE(value) do { \ @@ -406,7 +349,8 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_SUID(suid) #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) -#define AUDIT_ARG_UPATH(td, upath, flags) +#define AUDIT_ARG_UPATH1(td, upath) +#define AUDIT_ARG_UPATH2(td, upath) #define AUDIT_ARG_VALUE(value) #define AUDIT_ARG_VNODE1(vp) #define AUDIT_ARG_VNODE2(vp) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Wed Jul 29 05:23:52 2009 (r195938) +++ head/sys/security/audit/audit_arg.c Wed Jul 29 07:44:43 2009 (r195939) @@ -463,8 +463,7 @@ audit_arg_sockaddr(struct thread *td, st break; case AF_UNIX: - audit_arg_upath(td, ((struct sockaddr_un *)sa)->sun_path, - ARG_UPATH1); + audit_arg_upath1(td, ((struct sockaddr_un *)sa)->sun_path); ARG_SET_VALID(ar, ARG_SADDRUNIX); break; /* XXXAUDIT: default:? */ @@ -709,38 +708,40 @@ audit_arg_file(struct proc *p, struct fi * record stored on the user thread. This function will allocate the memory * to store the path info if not already available. This memory will be * freed when the audit record is freed. - * - * XXXAUDIT: Possibly assert that the memory isn't already allocated? */ +static void +audit_arg_upath(struct thread *td, char *upath, char **pathp) +{ + + if (*pathp == NULL) + *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); + audit_canon_path(td, upath, *pathp); +} + void -audit_arg_upath(struct thread *td, char *upath, u_int64_t flag) +audit_arg_upath1(struct thread *td, char *upath) { struct kaudit_record *ar; - char **pathp; - - KASSERT(td != NULL, ("audit_arg_upath: td == NULL")); - KASSERT(upath != NULL, ("audit_arg_upath: upath == NULL")); ar = currecord(); if (ar == NULL) return; - KASSERT((flag == ARG_UPATH1) || (flag == ARG_UPATH2), - ("audit_arg_upath: flag %llu", (unsigned long long)flag)); - KASSERT((flag != ARG_UPATH1) || (flag != ARG_UPATH2), - ("audit_arg_upath: flag %llu", (unsigned long long)flag)); - - if (flag == ARG_UPATH1) - pathp = &ar->k_ar.ar_arg_upath1; - else - pathp = &ar->k_ar.ar_arg_upath2; + audit_arg_upath(td, upath, &ar->k_ar.ar_arg_upath1); + ARG_SET_VALID(ar, ARG_UPATH1); +} - if (*pathp == NULL) - *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); +void +audit_arg_upath2(struct thread *td, char *upath) +{ + struct kaudit_record *ar; - audit_canon_path(td, upath, *pathp); + ar = currecord(); + if (ar == NULL) + return; - ARG_SET_VALID(ar, flag); + audit_arg_upath(td, upath, &ar->k_ar.ar_arg_upath2); + ARG_SET_VALID(ar, ARG_UPATH2); } /* Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Wed Jul 29 05:23:52 2009 (r195938) +++ head/sys/security/audit/audit_private.h Wed Jul 29 07:44:43 2009 (r195939) @@ -236,6 +236,61 @@ struct audit_record { * indicate if they are present so they can be included in the audit log * stream only if defined. */ +#define ARG_EUID 0x0000000000000001ULL +#define ARG_RUID 0x0000000000000002ULL +#define ARG_SUID 0x0000000000000004ULL +#define ARG_EGID 0x0000000000000008ULL +#define ARG_RGID 0x0000000000000010ULL +#define ARG_SGID 0x0000000000000020ULL +#define ARG_PID 0x0000000000000040ULL +#define ARG_UID 0x0000000000000080ULL +#define ARG_AUID 0x0000000000000100ULL +#define ARG_GID 0x0000000000000200ULL +#define ARG_FD 0x0000000000000400ULL +#define ARG_POSIX_IPC_PERM 0x0000000000000800ULL +#define ARG_FFLAGS 0x0000000000001000ULL +#define ARG_MODE 0x0000000000002000ULL +#define ARG_DEV 0x0000000000004000ULL +#define ARG_ADDR 0x0000000000008000ULL +#define ARG_LEN 0x0000000000010000ULL +#define ARG_MASK 0x0000000000020000ULL +#define ARG_SIGNUM 0x0000000000040000ULL +#define ARG_LOGIN 0x0000000000080000ULL +#define ARG_SADDRINET 0x0000000000100000ULL +#define ARG_SADDRINET6 0x0000000000200000ULL +#define ARG_SADDRUNIX 0x0000000000400000ULL +#define ARG_TERMID_ADDR 0x0000000000400000ULL +#define ARG_UNUSED2 0x0000000001000000ULL +#define ARG_UPATH1 0x0000000002000000ULL +#define ARG_UPATH2 0x0000000004000000ULL +#define ARG_TEXT 0x0000000008000000ULL +#define ARG_VNODE1 0x0000000010000000ULL +#define ARG_VNODE2 0x0000000020000000ULL +#define ARG_SVIPC_CMD 0x0000000040000000ULL +#define ARG_SVIPC_PERM 0x0000000080000000ULL +#define ARG_SVIPC_ID 0x0000000100000000ULL +#define ARG_SVIPC_ADDR 0x0000000200000000ULL +#define ARG_GROUPSET 0x0000000400000000ULL +#define ARG_CMD 0x0000000800000000ULL +#define ARG_SOCKINFO 0x0000001000000000ULL +#define ARG_ASID 0x0000002000000000ULL +#define ARG_TERMID 0x0000004000000000ULL +#define ARG_AUDITON 0x0000008000000000ULL +#define ARG_VALUE 0x0000010000000000ULL +#define ARG_AMASK 0x0000020000000000ULL +#define ARG_CTLNAME 0x0000040000000000ULL +#define ARG_PROCESS 0x0000080000000000ULL +#define ARG_MACHPORT1 0x0000100000000000ULL +#define ARG_MACHPORT2 0x0000200000000000ULL +#define ARG_EXIT 0x0000400000000000ULL +#define ARG_IOVECSTR 0x0000800000000000ULL +#define ARG_ARGV 0x0001000000000000ULL +#define ARG_ENVV 0x0002000000000000ULL +#define ARG_ATFD1 0x0004000000000000ULL +#define ARG_ATFD2 0x0008000000000000ULL +#define ARG_NONE 0x0000000000000000ULL +#define ARG_ALL 0xFFFFFFFFFFFFFFFFULL + #define ARG_IS_VALID(kar, arg) ((kar)->k_ar.ar_valid_arg & (arg)) #define ARG_SET_VALID(kar, arg) do { \ (kar)->k_ar.ar_valid_arg |= (arg); \ From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 08:49:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D42BC106564A; Wed, 29 Jul 2009 08:49:58 +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 C15D08FC21; Wed, 29 Jul 2009 08:49:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T8nwid058904; Wed, 29 Jul 2009 08:49:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T8nw5u058896; Wed, 29 Jul 2009 08:49:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907290849.n6T8nw5u058896@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Jul 2009 08:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195940 - in head/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 08:49:59 -0000 Author: kib Date: Wed Jul 29 08:49:58 2009 New Revision: 195940 URL: http://svn.freebsd.org/changeset/base/195940 Log: As was done in r195820 for amd64, use clflush for flushing cache lines when memory page caching attributes changed, and CPU does not support self-snoop, but implemented clflush, for i386. Take care of possible mappings of the page by sf buffer by utilizing the mapping for clflush, otherwise map the page transiently. Amd64 used direct map. Proposed and reviewed by: alc Approved by: re (kensmith) Modified: head/sys/i386/i386/initcpu.c head/sys/i386/i386/pmap.c head/sys/i386/i386/vm_machdep.c head/sys/i386/include/cpufunc.h head/sys/i386/include/md_var.h head/sys/i386/include/pmap.h head/sys/i386/include/sf_buf.h Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/i386/initcpu.c Wed Jul 29 08:49:58 2009 (r195940) @@ -91,6 +91,7 @@ u_int cpu_procinfo = 0; /* HyperThreadin u_int cpu_procinfo2 = 0; /* Multicore info */ char cpu_vendor[20] = ""; /* CPU Origin code */ u_int cpu_vendor_id = 0; /* CPU vendor ID */ +u_int cpu_clflush_line_size = 32; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); @@ -709,6 +710,14 @@ initializecpu(void) } enable_sse(); + /* + * CPUID with %eax = 1, %ebx returns + * Bits 15-8: CLFLUSH line size + * (Value * 8 = cache line size in bytes) + */ + if ((cpu_feature & CPUID_CLFSH) != 0) + cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; + #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) /* * OS should flush L1 cache by itself because no PC-98 supports Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/i386/pmap.c Wed Jul 29 08:49:58 2009 (r195940) @@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -732,7 +733,7 @@ SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, pro * Determine the appropriate bits to set in a PTE or PDE for a specified * caching mode. */ -static int +int pmap_cache_bits(int mode, boolean_t is_pde) { int pat_flag, pat_index, cache_bits; @@ -945,6 +946,40 @@ pmap_invalidate_cache(void) } #endif /* !SMP */ +void +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +{ + + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + + if (cpu_feature & CPUID_SS) + ; /* If "Self Snoop" is supported, do nothing. */ + else if (cpu_feature & CPUID_CLFSH) { + + /* + * Otherwise, do per-cache line flush. Use the mfence + * instruction to insure that previous stores are + * included in the write-back. The processor + * propagates flush to other processors in the cache + * coherence domain. + */ + mfence(); + for (; eva < sva; eva += cpu_clflush_line_size) + clflush(eva); + mfence(); + } else { + + /* + * No targeted cache flush methods are supported by CPU, + * globally invalidate cache as a last resort. + */ + pmap_invalidate_cache(); + } +} + /* * Are we current address space or kernel? N.B. We return FALSE when * a pmap's page table is in use because a kernel thread is borrowing @@ -4400,7 +4435,8 @@ pmap_clear_reference(vm_page_t m) void * pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) { - vm_offset_t va, tmpva, offset; + vm_offset_t va, offset; + vm_size_t tmpsize; offset = pa & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); @@ -4413,16 +4449,10 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); - for (tmpva = va; size > 0; ) { - pmap_kenter_attr(tmpva, pa, mode); - size -= PAGE_SIZE; - tmpva += PAGE_SIZE; - pa += PAGE_SIZE; - } - pmap_invalidate_range(kernel_pmap, va, tmpva); - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) + pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); + pmap_invalidate_range(kernel_pmap, va, va + tmpsize); + pmap_invalidate_cache_range(va, va + size); return ((void *)(va + offset)); } @@ -4462,16 +4492,48 @@ pmap_unmapdev(vm_offset_t va, vm_size_t void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + struct sysmaps *sysmaps; + vm_offset_t sva, eva; m->md.pat_mode = ma; + if ((m->flags & PG_FICTITIOUS) != 0) + return; /* * If "m" is a normal page, flush it from the cache. + * See pmap_invalidate_cache_range(). + * + * First, try to find an existing mapping of the page by sf + * buffer. sf_buf_invalidate_cache() modifies mapping and + * flushes the cache. */ - if ((m->flags & PG_FICTITIOUS) == 0) { - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + if (sf_buf_invalidate_cache(m)) + return; + + /* + * If page is not mapped by sf buffer, but CPU does not + * support self snoop, map the page transient and do + * invalidation. In the worst case, whole cache is flushed by + * pmap_invalidate_cache_range(). + */ + if ((cpu_feature & (CPUID_SS|CPUID_CLFSH)) == CPUID_CLFSH) { + sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; + mtx_lock(&sysmaps->lock); + if (*sysmaps->CMAP2) + panic("pmap_page_set_memattr: CMAP2 busy"); + sched_pin(); + *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | + PG_A | PG_M | pmap_cache_bits(m->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR2); + sva = (vm_offset_t)sysmaps->CADDR2; + eva = sva + PAGE_SIZE; + } else + sva = eva = 0; /* gcc */ + pmap_invalidate_cache_range(sva, eva); + if (sva != 0) { + *sysmaps->CMAP2 = 0; + sched_unpin(); + mtx_unlock(&sysmaps->lock); } } @@ -4537,9 +4599,7 @@ pmap_change_attr(vm_offset_t va, vm_size */ if (changed) { pmap_invalidate_range(kernel_pmap, base, tmpva); - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + pmap_invalidate_cache_range(base, tmpva); } return (0); } Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/i386/vm_machdep.c Wed Jul 29 08:49:58 2009 (r195940) @@ -720,6 +720,39 @@ sf_buf_init(void *arg) } /* + * Invalidate the cache lines that may belong to the page, if + * (possibly old) mapping of the page by sf buffer exists. Returns + * TRUE when mapping was found and cache invalidated. + */ +boolean_t +sf_buf_invalidate_cache(vm_page_t m) +{ + struct sf_head *hash_list; + struct sf_buf *sf; + boolean_t ret; + + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; + ret = FALSE; + mtx_lock(&sf_buf_lock); + LIST_FOREACH(sf, hash_list, list_entry) { + if (sf->m == m) { + /* + * Use pmap_qenter to update the pte for + * existing mapping, in particular, the PAT + * settings are recalculated. + */ + pmap_qenter(sf->kva, &m, 1); + pmap_invalidate_cache_range(sf->kva, sf->kva + + PAGE_SIZE); + ret = TRUE; + break; + } + } + mtx_unlock(&sf_buf_lock); + return (ret); +} + +/* * Get an sf_buf from the freelist. May block if none are available. */ struct sf_buf * @@ -787,9 +820,10 @@ sf_buf_alloc(struct vm_page *m, int flag opte = *ptep; #ifdef XEN PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag - | PG_RW | PG_V); + | PG_RW | PG_V | pmap_cache_bits(m->md.pat_mode, 0)); #else - *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V; + *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V | + pmap_cache_bits(m->md.pat_mode, 0); #endif /* Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/include/cpufunc.h Wed Jul 29 08:49:58 2009 (r195940) @@ -90,6 +90,13 @@ bsrl(u_int mask) } static __inline void +clflush(u_long addr) +{ + + __asm __volatile("clflush %0" : : "m" (*(char *)addr)); +} + +static __inline void disable_intr(void) { #ifdef XEN @@ -138,6 +145,13 @@ cpu_mwait(int extensions, int hints) __asm __volatile("mwait;" : :"a" (hints), "c" (extensions)); } +static __inline void +mfence(void) +{ + + __asm __volatile("mfence" : : : "memory"); +} + #ifdef _KERNEL #define HAVE_INLINE_FFS Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/include/md_var.h Wed Jul 29 08:49:58 2009 (r195940) @@ -52,6 +52,7 @@ extern u_int amd_feature2; extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; +extern u_int cpu_clflush_line_size; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/include/pmap.h Wed Jul 29 08:49:58 2009 (r195940) @@ -463,6 +463,7 @@ extern vm_offset_t virtual_end; #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) void pmap_bootstrap(vm_paddr_t); +int pmap_cache_bits(int mode, boolean_t is_pde); int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_init_pat(void); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); @@ -480,6 +481,7 @@ void pmap_invalidate_page(pmap_t, vm_off void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t); void pmap_invalidate_all(pmap_t); void pmap_invalidate_cache(void); +void pmap_invalidate_cache_range(vm_offset_t, vm_offset_t); #endif /* _KERNEL */ Modified: head/sys/i386/include/sf_buf.h ============================================================================== --- head/sys/i386/include/sf_buf.h Wed Jul 29 07:44:43 2009 (r195939) +++ head/sys/i386/include/sf_buf.h Wed Jul 29 08:49:58 2009 (r195940) @@ -58,4 +58,6 @@ sf_buf_page(struct sf_buf *sf) return (sf->m); } +boolean_t sf_buf_invalidate_cache(vm_page_t m); + #endif /* !_MACHINE_SF_BUF_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 09:20:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09FC4106567D; Wed, 29 Jul 2009 09:20:33 +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 E9B4E8FC14; Wed, 29 Jul 2009 09:20:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6T9KWRa059609; Wed, 29 Jul 2009 09:20:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6T9KWjC059571; Wed, 29 Jul 2009 09:20:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907290920.n6T9KWjC059571@svn.freebsd.org> From: Xin LI Date: Wed, 29 Jul 2009 09:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195941 - in head: contrib/less usr.bin/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 09:20:33 -0000 Author: delphij Date: Wed Jul 29 09:20:32 2009 New Revision: 195941 URL: http://svn.freebsd.org/changeset/base/195941 Log: Update less to v436. This is considered as a bugfix release from vendor. Major changes from v429: * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". * Allow a fraction as the argument to the -# (--shift) option. * Fix highlight bug when underlined/overstruck text matches at end of line. * Fix non-regex searches with ctrl-R. Approved by: re (kensmith, kib) Added: head/contrib/less/cvt.c - copied unchanged from r195903, vendor/less/dist/cvt.c head/contrib/less/pattern.c - copied unchanged from r195903, vendor/less/dist/pattern.c head/contrib/less/pattern.h - copied, changed from r195903, vendor/less/dist/pattern.h Modified: head/contrib/less/ (props changed) head/contrib/less/LICENSE head/contrib/less/Makefile.aut head/contrib/less/Makefile.dsb head/contrib/less/Makefile.dsg head/contrib/less/Makefile.dsu head/contrib/less/Makefile.in head/contrib/less/Makefile.o2e head/contrib/less/Makefile.o9c head/contrib/less/Makefile.o9u head/contrib/less/Makefile.wnb head/contrib/less/Makefile.wnm head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/configure.ac head/contrib/less/decode.c head/contrib/less/defines.ds head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.man head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.man head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.man head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c head/usr.bin/less/Makefile Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/LICENSE Wed Jul 29 09:20:32 2009 (r195941) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2008 Mark Nudelman +Copyright (C) 1984-2009 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/Makefile.aut ============================================================================== --- head/contrib/less/Makefile.aut Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.aut Wed Jul 29 09:20:32 2009 (r195941) @@ -10,10 +10,10 @@ srcdir = . SRC = \ main.c screen.c brac.c ch.c charset.c cmdbuf.c \ - command.c decode.c edit.c filename.c forwback.c \ + command.c cvt.c decode.c edit.c filename.c forwback.c \ help.c ifile.c input.c jump.c line.c linenum.c \ lsystem.c mark.c optfunc.c option.c opttbl.c os.c \ - output.c position.c prompt.c search.c signal.c \ + output.c pattern.c position.c prompt.c search.c signal.c \ tags.c ttyin.c version.c DISTFILES_W = \ defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \ @@ -24,7 +24,8 @@ DISTFILES = \ ${SRC} regexp.c regexp.h \ COPYING INSTALL LICENSE Makefile.in Makefile.aut NEWS README \ configure configure.ac lesskey.c lessecho.c scrsize.c \ - charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h pckeys.h position.h \ + charset.h cmd.h funcs.h lglob.h less.h lesskey.h option.h \ + pckeys.h pattern.h position.h \ install.sh defines.h.in mkinstalldirs \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \ less.hlp \ @@ -109,6 +110,8 @@ dist: ${DISTFILES} cd $$REL; chmod +w ${DISTFILES_W}; cd ..; \ echo "Creating release/$$REL/$$REL.tar.gz"; \ tar -cf - $$REL | gzip -c >release/$$REL/$$REL.tar.gz; \ + echo "Signing release/$$REL/$$REL.tar.gz"; \ + gpg --detach-sign release/$$REL/$$REL.tar.gz; \ echo "Creating release/$$REL/$$REL.zip"; \ zip -rq release/$$REL/$$REL.zip $$REL; \ rm -rf $$REL Modified: head/contrib/less/Makefile.dsb ============================================================================== --- head/contrib/less/Makefile.dsb Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.dsb Wed Jul 29 09:20:32 2009 (r195941) @@ -18,12 +18,13 @@ EXT = .EXE .c.obj: $(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj all: less$(EXT) lesskey$(EXT) Modified: head/contrib/less/Makefile.dsg ============================================================================== --- head/contrib/less/Makefile.dsg Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.dsg Wed Jul 29 09:20:32 2009 (r195941) @@ -33,11 +33,12 @@ manext = 1 .c.o: ${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} all: less lesskey lessecho Modified: head/contrib/less/Makefile.dsu ============================================================================== --- head/contrib/less/Makefile.dsu Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.dsu Wed Jul 29 09:20:32 2009 (r195941) @@ -27,12 +27,13 @@ LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\gr .c.obj: $(CC) -c -I. -I$(INCDIR) $(CPPFLAGS) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj all: less lesskey Modified: head/contrib/less/Makefile.in ============================================================================== --- head/contrib/less/Makefile.in Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.in Wed Jul 29 09:20:32 2009 (r195941) @@ -43,11 +43,12 @@ SHELL = /bin/sh .c.o: ${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} @REGEX_O@ all: less$(EXEEXT) lesskey$(EXEEXT) lessecho$(EXEEXT) Modified: head/contrib/less/Makefile.o2e ============================================================================== --- head/contrib/less/Makefile.o2e Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.o2e Wed Jul 29 09:20:32 2009 (r195941) @@ -18,11 +18,12 @@ O = obj .c.${O}: ${CC} -c ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less.exe lesskey.exe scrsize.exe Modified: head/contrib/less/Makefile.o9c ============================================================================== --- head/contrib/less/Makefile.o9c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.o9c Wed Jul 29 09:20:32 2009 (r195941) @@ -22,11 +22,12 @@ O = r .c.${O}: ${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less lessecho lesskey Modified: head/contrib/less/Makefile.o9u ============================================================================== --- head/contrib/less/Makefile.o9u Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.o9u Wed Jul 29 09:20:32 2009 (r195941) @@ -21,11 +21,12 @@ O = r .c.${O}: ${CC} ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ - command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ +OBJ = \ + main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \ + command.${O} cvt.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \ help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \ lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \ - output.${O} position.${O} prompt.${O} search.${O} signal.${O} \ + output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \ tags.${O} ttyin.${O} version.${O} regexp.${O} all: less lesskey Modified: head/contrib/less/Makefile.wnb ============================================================================== --- head/contrib/less/Makefile.wnb Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.wnb Wed Jul 29 09:20:32 2009 (r195941) @@ -25,12 +25,13 @@ LIBS = ${LIBDIR}\import32.lib ${LIBDIR}\ .c.obj: ${CC} -c -I. ${CPPFLAGS} ${CFLAGS} $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj regexp.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj regexp.obj all: less lesskey lessecho Modified: head/contrib/less/Makefile.wnm ============================================================================== --- head/contrib/less/Makefile.wnm Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/Makefile.wnm Wed Jul 29 09:20:32 2009 (r195941) @@ -23,12 +23,13 @@ LIBS = user32.lib .c.obj: $(CC) $(CFLAGS) $< -OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \ - decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \ - input.obj jump.obj line.obj linenum.obj lsystem.obj \ - mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \ - position.obj prompt.obj search.obj signal.obj tags.obj \ - ttyin.obj version.obj regexp.obj +OBJ = \ + main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj \ + command.obj cvt.obj decode.obj edit.obj filename.obj forwback.obj \ + help.obj ifile.obj input.obj jump.obj line.obj linenum.obj \ + lsystem.obj mark.obj optfunc.obj option.obj opttbl.obj os.obj \ + output.obj pattern.obj position.obj prompt.obj search.obj signal.obj \ + tags.obj ttyin.obj version.obj regexp.obj all: less.exe lesskey.exe Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/NEWS Wed Jul 29 09:20:32 2009 (r195941) @@ -12,6 +12,18 @@ ====================================================================== + Major changes between "less" versions 429 and 436 + +* Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". + +* Allow a fraction as the argument to the -# (--shift) option. + +* Fix highlight bug when underlined/overstruck text matches at end of line. + +* Fix non-regex searches with ctrl-R. + +====================================================================== + Major changes between "less" versions 424 and 429 * LESSOPEN pipe will now be used on standard input, if the LESSOPEN Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/README Wed Jul 29 09:20:32 2009 (r195941) @@ -1,7 +1,7 @@ - Less, version 429 + Less, version 436 - This is the distribution of less, version 429, released 11 Apr 2009. + This is the distribution of less, version 436, released 07 Jul 2009. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/brac.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/ch.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/charset.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -425,7 +425,7 @@ prchar(c) c &= 0377; if ((c < 128 || !utf_mode) && !control_char(c)) - SNPRINTF1(buf, sizeof(buf), "%c", c); + SNPRINTF1(buf, sizeof(buf), "%c", (int) c); else if (c == ESC) strcpy(buf, "ESC"); #if IS_EBCDIC_HOST @@ -442,7 +442,7 @@ prchar(c) "..V....D....TU.Z"[c]); #else else if (c < 128 && !control_char(c ^ 0100)) - SNPRINTF1(buf, sizeof(buf), "^%c", c ^ 0100); + SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100)); #endif else SNPRINTF1(buf, sizeof(buf), binfmt, c); Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/charset.h Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Mark Nudelman + * Copyright (C) 2005-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/cmd.h Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/cmdbuf.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/command.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/configure.ac ============================================================================== --- head/contrib/less/configure.ac Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/configure.ac Wed Jul 29 09:20:32 2009 (r195941) @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -# Copyright (C) 1984-2008 Mark Nudelman +# Copyright (C) 1984-2009 Mark Nudelman # # You may distribute under the terms of either the GNU General Public # License or the Less License, as specified in the README file. Copied: head/contrib/less/cvt.c (from r195903, vendor/less/dist/cvt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/less/cvt.c Wed Jul 29 09:20:32 2009 (r195941, copy of r195903, vendor/less/dist/cvt.c) @@ -0,0 +1,120 @@ +/* + * Copyright (C) 1984-2009 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information about less, or for information on how to + * contact the author, see the README file. + */ + +/* + * Routines to convert text in various ways. Used by search. + */ + +#include "less.h" +#include "charset.h" + +extern int utf_mode; + +/* + * Get the length of a buffer needed to convert a string. + */ + public int +cvt_length(len, ops) + int len; + int ops; +{ + if (utf_mode) + /* + * Just copying a string in UTF-8 mode can cause it to grow + * in length. + * Four output bytes for one input byte is the worst case. + */ + len *= 4; + return (len + 1); +} + +/* + * Allocate a chpos array for use by cvt_text. + */ + public int * +cvt_alloc_chpos(len) + int len; +{ + int i; + int *chpos = (int *) ecalloc(sizeof(int), len); + /* Initialize all entries to an invalid position. */ + for (i = 0; i < len; i++) + chpos[i] = -1; + return (chpos); +} + +/* + * Convert text. Perform the transformations specified by ops. + * Returns converted text in odst. The original offset of each + * odst character (when it was in osrc) is returned in the chpos array. + */ + public void +cvt_text(odst, osrc, chpos, lenp, ops) + char *odst; + char *osrc; + int *chpos; + int *lenp; + int ops; +{ + char *dst; + char *src; + register char *src_end; + LWCHAR ch; + + if (lenp != NULL) + src_end = osrc + *lenp; + else + src_end = osrc + strlen(osrc); + + for (src = osrc, dst = odst; src < src_end; ) + { + int src_pos = src - osrc; + int dst_pos = dst - odst; + ch = step_char(&src, +1, src_end); + if ((ops & CVT_BS) && ch == '\b' && dst > odst) + { + /* Delete backspace and preceding char. */ + do { + dst--; + } while (dst > odst && + !IS_ASCII_OCTET(*dst) && !IS_UTF8_LEAD(*dst)); + } else if ((ops & CVT_ANSI) && IS_CSI_START(ch)) + { + /* Skip to end of ANSI escape sequence. */ + src++; /* skip the CSI start char */ + while (src < src_end) + if (!is_ansi_middle(*src++)) + break; + } else + { + /* Just copy the char to the destination buffer. */ + if ((ops & CVT_TO_LC) && IS_UPPER(ch)) + ch = TO_LOWER(ch); + put_wchar(&dst, ch); + /* + * Record the original position of the char. + * But if we've already recorded a position + * for this char (due to a backspace), leave + * it alone; if multiple source chars map to + * one destination char, we want the position + * of the first one. + */ + if (chpos != NULL && chpos[dst_pos] < 0) + chpos[dst_pos] = src_pos; + } + } + if ((ops & CVT_CRLF) && dst > odst && dst[-1] == '\r') + dst--; + *dst = '\0'; + if (lenp != NULL) + *lenp = dst - odst; + if (chpos != NULL) + chpos[dst - odst] = src - osrc; +} Modified: head/contrib/less/decode.c ============================================================================== --- head/contrib/less/decode.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/decode.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/defines.ds ============================================================================== --- head/contrib/less/defines.ds Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/defines.ds Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/defines.o2 ============================================================================== --- head/contrib/less/defines.o2 Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/defines.o2 Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/defines.o9 ============================================================================== --- head/contrib/less/defines.o9 Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/defines.o9 Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/defines.wn ============================================================================== --- head/contrib/less/defines.wn Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/defines.wn Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/edit.c ============================================================================== --- head/contrib/less/edit.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/edit.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/filename.c ============================================================================== --- head/contrib/less/filename.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/filename.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -843,17 +843,17 @@ open_altfile(filename, pf, pfd) #else lessopen++; returnfd = 1; - if (*lessopen == '-') { - /* - * Lessopen preprocessor will accept "-" as a filename. - */ - lessopen++; - } else { - if (strcmp(filename, "-") == 0) - return (NULL); - } #endif } + if (*lessopen == '-') { + /* + * Lessopen preprocessor will accept "-" as a filename. + */ + lessopen++; + } else { + if (strcmp(filename, "-") == 0) + return (NULL); + } len = strlen(lessopen) + strlen(filename) + 2; cmd = (char *) ecalloc(len, sizeof(char)); Modified: head/contrib/less/forwback.c ============================================================================== --- head/contrib/less/forwback.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/forwback.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/funcs.h ============================================================================== --- head/contrib/less/funcs.h Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/funcs.h Wed Jul 29 09:20:32 2009 (r195941) @@ -83,6 +83,9 @@ public void ungetcc (); public void ungetsc (); public void commands (); + public int cvt_length (); + public int * cvt_alloc_chpos (); + public void cvt_text (); public void init_cmds (); public void add_fcmd_table (); public void add_ecmd_table (); @@ -193,6 +196,8 @@ public void opt_l (); public void opt_j (); public void calc_jump_sline (); + public void opt_shift (); + public void calc_shift_count (); public void opt_k (); public void opt_t (); public void opt__T (); @@ -233,6 +238,10 @@ public void error (); public void ierror (); public int query (); + public int compile_pattern (); + public void uncompile_pattern (); + public int is_null_pattern (); + public int match_pattern (); public POSITION position (); public void add_forw_pos (); public void add_back_pos (); @@ -248,6 +257,7 @@ public char * eq_message (); public char * pr_string (); public char * wait_message (); + public void init_search (); public void repaint_hilite (); public void clear_attn (); public void undo_search (); Modified: head/contrib/less/ifile.c ============================================================================== --- head/contrib/less/ifile.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/ifile.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/input.c ============================================================================== --- head/contrib/less/input.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/input.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -196,7 +196,7 @@ get_forw_line: c = ch_forw_get(); } - pdone(endline, c); + pdone(endline, 1); #if HILITE_SEARCH if (is_filtered(base_pos)) @@ -398,7 +398,7 @@ get_back_line: } } while (new_pos < curr_pos); - pdone(endline, ch_forw_get()); + pdone(endline, 0); #if HILITE_SEARCH if (is_filtered(base_pos)) Modified: head/contrib/less/jump.c ============================================================================== --- head/contrib/less/jump.c Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/jump.c Wed Jul 29 09:20:32 2009 (r195941) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/less.h ============================================================================== --- head/contrib/less/less.h Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/less.h Wed Jul 29 09:20:32 2009 (r195941) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2008 Mark Nudelman + * Copyright (C) 1984-2009 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -489,6 +489,12 @@ struct textlist #define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@" +/* Flags for cvt_text */ +#define CVT_TO_LC 01 /* Convert upper-case to lower-case */ +#define CVT_BS 02 /* Do backspace processing */ +#define CVT_CRLF 04 /* Remove CR after LF */ +#define CVT_ANSI 010 /* Remove ANSI escape sequences */ + #include "funcs.h" /* Functions not included in funcs.h */ Modified: head/contrib/less/less.man ============================================================================== --- head/contrib/less/less.man Wed Jul 29 08:49:58 2009 (r195940) +++ head/contrib/less/less.man Wed Jul 29 09:20:32 2009 (r195941) @@ -809,51 +809,58 @@ LESS(1) Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number speci- fied is zero, it sets the default number of positions to one - half of the screen width. + half of the screen width. Alternately, the number may be speci- + fied as a fraction of the width of the screen, starting with a + decimal point: .5 is half of the screen width, .3 is three + tenths of the screen width, and so on. If the number is speci- + fied as a fraction, the actual number of scroll positions is + recalculated if the terminal window is resized, so that the + actual scroll remains at the specified fraction of the screen + width. --no-keypad - Disables sending the keypad initialization and deinitialization + Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. --follow-name - Normally, if the input file is renamed while an F command is - executing, less will continue to display the contents of the - original file despite its name change. If --follow-name is + Normally, if the input file is renamed while an F command is + executing, less will continue to display the contents of the + original file despite its name change. If --follow-name is specified, during an F command less will periodically attempt to reopen the file by name. If the reopen succeeds and the file is - a different file from the original (which means that a new file - has been created with the same name as the original (now + a different file from the original (which means that a new file + has been created with the same name as the original (now renamed) file), less will display the contents of that new file. - -- A command line argument of "--" marks the end of option argu- - ments. Any arguments following this are interpreted as file- + -- A command line argument of "--" marks the end of option argu- + ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins with a "-" or "+". - + If a command line option begins with +, the remainder of that - option is taken to be an initial command to less. For example, - +G tells less to start at the end of the file rather than the - beginning, and +/xyz tells it to start at the first occurrence - of "xyz" in the file. As a special case, + acts like + + If a command line option begins with +, the remainder of that + option is taken to be an initial command to less. For example, + +G tells less to start at the end of the file rather than the + beginning, and +/xyz tells it to start at the first occurrence + of "xyz" in the file. As a special case, + acts like +g; that is, it starts the display at the specified line - number (however, see the caveat under the "g" command above). - If the option starts with ++, the initial command applies to - every file being viewed, not just the first one. The + command + number (however, see the caveat under the "g" command above). + If the option starts with ++, the initial command applies to + every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an ini- tial command for every file. LINE EDITING - When entering command line at the bottom of the screen (for example, a + When entering command line at the bottom of the screen (for example, a filename for the :e command, or the pattern for a search command), cer- - tain keys can be used to manipulate the command line. Most commands - have an alternate form in [ brackets ] which can be used if a key does - not exist on a particular keyboard. (Note that the forms beginning - with ESC do not work in some MS-DOS and Windows systems because ESC is - the line erase character.) Any of these special keys may be entered - literally by preceding it with the "literal" character, either ^V or - ^A. A backslash itself may also be entered literally by entering two + tain keys can be used to manipulate the command line. Most commands + have an alternate form in [ brackets ] which can be used if a key does + not exist on a particular keyboard. (Note that the forms beginning + with ESC do not work in some MS-DOS and Windows systems because ESC is + the line erase character.) Any of these special keys may be entered + literally by preceding it with the "literal" character, either ^V or + ^A. A backslash itself may also be entered literally by entering two backslashes. LEFTARROW [ ESC-h ] @@ -863,7 +870,7 @@ LESS(1) Move the cursor one space to the right. ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] - (That is, CONTROL and LEFTARROW simultaneously.) Move the cur- + (That is, CONTROL and LEFTARROW simultaneously.) Move the cur- sor one word to the left. ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] @@ -877,18 +884,18 @@ LESS(1) Move the cursor to the end of the line. BACKSPACE - Delete the character to the left of the cursor, or cancel the + Delete the character to the left of the cursor, or cancel the command if the command line is empty. DELETE or [ ESC-x ] Delete the character under the cursor. ^BACKSPACE [ ESC-BACKSPACE ] - (That is, CONTROL and BACKSPACE simultaneously.) Delete the + (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. ^DELETE [ ESC-X or ESC-DELETE ] - (That is, CONTROL and DELETE simultaneously.) Delete the word + (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. UPARROW [ ESC-k ] @@ -897,96 +904,96 @@ LESS(1) DOWNARROW [ ESC-j ] Retrieve the next command line. - TAB Complete the partial filename to the left of the cursor. If it - matches more than one filename, the first match is entered into - the command line. Repeated TABs will cycle thru the other + TAB Complete the partial filename to the left of the cursor. If it + matches more than one filename, the first match is entered into + the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a - "/" is appended to the filename. (On MS-DOS systems, a "\" is - appended.) The environment variable LESSSEPARATOR can be used - to specify a different character to append to a directory name. + "/" is appended to the filename. (On MS-DOS systems, a "\" is + appended.) The environment variable LESSSEPARATOR can be used + to specify a different character to append to a directory name. BACKTAB [ ESC-TAB ] Like, TAB, but cycles in the reverse direction thru the matching filenames. - ^L Complete the partial filename to the left of the cursor. If it + ^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). ^U (Unix and OS/2) or ESC (MS-DOS) - Delete the entire command line, or cancel the command if the + Delete the entire command line, or cancel the command if the command line is empty. If you have changed your line-kill char- acter in Unix to something other than ^U, that character is used instead of ^U. KEY BINDINGS - You may define your own less commands by using the program lesskey (1) - to create a lesskey file. This file specifies a set of command keys - and an action associated with each key. You may also use lesskey to + You may define your own less commands by using the program lesskey (1) + to create a lesskey file. This file specifies a set of command keys + and an action associated with each key. You may also use lesskey to change the line-editing keys (see LINE EDITING), and to set environment - variables. If the environment variable LESSKEY is set, less uses that - as the name of the lesskey file. Otherwise, less looks in a standard - place for the lesskey file: On Unix systems, less looks for a lesskey - file called "$HOME/.less". On MS-DOS and Windows systems, less looks - for a lesskey file called "$HOME/_less", and if it is not found there, + variables. If the environment variable LESSKEY is set, less uses that + as the name of the lesskey file. Otherwise, less looks in a standard + place for the lesskey file: On Unix systems, less looks for a lesskey + file called "$HOME/.less". On MS-DOS and Windows systems, less looks + for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified - in the PATH environment variable. On OS/2 systems, less looks for a - lesskey file called "$HOME/less.ini", and if it is not found, then - looks for a lesskey file called "less.ini" in any directory specified + in the PATH environment variable. On OS/2 systems, less looks for a + lesskey file called "$HOME/less.ini", and if it is not found, then + looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks - for a lesskey file called "less.ini" in any directory specified in the - PATH environment variable. See the lesskey manual page for more + for a lesskey file called "less.ini" in any directory specified in the + PATH environment variable. See the lesskey manual page for more details. - A system-wide lesskey file may also be set up to provide key bindings. + A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide - file, key bindings in the local file take precedence over those in the - system-wide file. If the environment variable LESSKEY_SYSTEM is set, + file, key bindings in the local file take precedence over those in the + system-wide file. If the environment variable LESSKEY_SYSTEM is set, less uses that as the name of the system-wide lesskey file. Otherwise, - less looks in a standard place for the system-wide lesskey file: On - Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. - (However, if less was built with a different sysconf directory than + less looks in a standard place for the system-wide lesskey file: On + Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. + (However, if less was built with a different sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On - MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys- + MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys- less. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini. INPUT PREPROCESSOR - You may define an "input preprocessor" for less. Before less opens a + You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way - the contents of the file are displayed. An input preprocessor is sim- - ply an executable program (or shell script), which writes the contents + the contents of the file are displayed. An input preprocessor is sim- + ply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The con- - tents of the replacement file are then displayed in place of the con- - tents of the original file. However, it will appear to the user as if - the original file is opened; that is, less will display the original + tents of the replacement file are then displayed in place of the con- + tents of the original file. However, it will appear to the user as if + the original file is opened; that is, less will display the original filename as the name of the current file. - An input preprocessor receives one command line argument, the original - filename, as entered by the user. It should create the replacement - file, and when finished, print the name of the replacement file to its - standard output. If the input preprocessor does not output a replace- - ment filename, less uses the original file, as normal. The input pre- - processor is not called when viewing standard input. To set up an - input preprocessor, set the LESSOPEN environment variable to a command - line which will invoke your input preprocessor. This command line - should include one occurrence of the string "%s", which will be - replaced by the filename when the input preprocessor command is + An input preprocessor receives one command line argument, the original + filename, as entered by the user. It should create the replacement + file, and when finished, print the name of the replacement file to its + standard output. If the input preprocessor does not output a replace- + ment filename, less uses the original file, as normal. The input pre- + processor is not called when viewing standard input. To set up an + input preprocessor, set the LESSOPEN environment variable to a command + line which will invoke your input preprocessor. This command line + should include one occurrence of the string "%s", which will be + replaced by the filename when the input preprocessor command is invoked. When less closes a file opened in such a way, it will call another pro- - gram, called the input postprocessor, which may perform any desired - clean-up action (such as deleting the replacement file created by + gram, called the input postprocessor, which may perform any desired + clean-up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the orig- - inal filename as entered by the user, and the name of the replacement - file. To set up an input postprocessor, set the LESSCLOSE environment - variable to a command line which will invoke your input postprocessor. - It may include two occurrences of the string "%s"; the first is - replaced with the original name of the file and the second with the + inal filename as entered by the user, and the name of the replacement + file. To set up an input postprocessor, set the LESSCLOSE environment + variable to a command line which will invoke your input postprocessor. + It may include two occurrences of the string "%s"; the first is + replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. - For example, on many Unix systems, these two scripts will allow you to + For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let less view them directly: lessopen.sh: @@ -1005,25 +1012,25 @@ LESS(1) #! /bin/sh rm $2 - To use these scripts, put them both where they can be executed and set + To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More - complex LESSOPEN and LESSCLOSE scripts may be written to accept other + complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. - It is also possible to set up an input preprocessor to pipe the file - data directly to less, rather than putting the data into a replacement + It is also possible to set up an input preprocessor to pipe the file + data directly to less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before start- ing to view it. An input preprocessor that works this way is called an - input pipe. An input pipe, instead of writing the name of a replace- - ment file on its standard output, writes the entire contents of the - replacement file on its standard output. If the input pipe does not - write any characters on its standard output, then there is no replace- - ment file and less uses the original file, as normal. To use an input - pipe, make the first character in the LESSOPEN environment variable a - vertical bar (|) to signify that the input preprocessor is an input + input pipe. An input pipe, instead of writing the name of a replace- + ment file on its standard output, writes the entire contents of the + replacement file on its standard output. If the input pipe does not + write any characters on its standard output, then there is no replace- + ment file and less uses the original file, as normal. To use an input + pipe, make the first character in the LESSOPEN environment variable a + vertical bar (|) to signify that the input preprocessor is an input pipe. - For example, on many Unix systems, this script will work like the pre- + For example, on many Unix systems, this script will work like the pre- vious example scripts: lesspipe.sh: @@ -1034,15 +1041,21 @@ LESS(1) esac To use this script, put it where it can be executed and set - LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE - postprocessor can be used, but it is usually not necessary since there + LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE + postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-". - For compatibility with previous versions of less, the input pipe is not - used if less is viewing standard input. However, if the character - after the vertical bar is a dash (-), the input pipe is used on stan- - dard input as well as other files. + For compatibility with previous versions of less, the input preproces- + sor or pipe is not used if less is viewing standard input. However, if *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 14:44:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28AEF1065670; Wed, 29 Jul 2009 14:44:10 +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 F06498FC3E; Wed, 29 Jul 2009 14:44:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TEi938074231; Wed, 29 Jul 2009 14:44:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TEi9oN074230; Wed, 29 Jul 2009 14:44:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907291444.n6TEi9oN074230@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Jul 2009 14:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195942 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 14:44:10 -0000 Author: rmacklem Date: Wed Jul 29 14:44:09 2009 New Revision: 195942 URL: http://svn.freebsd.org/changeset/base/195942 Log: Delete the descriptions of the gssname and allgssname optionss from mount_nfs.8 since these options are not implemented in FreeBSD8. This is content change for the man page. Approved by: re (kensmith), kib (mentor) Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Wed Jul 29 09:20:32 2009 (r195941) +++ head/sbin/mount_nfs/mount_nfs.8 Wed Jul 29 14:44:09 2009 (r195942) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd February 11, 2008 +.Dd July 28, 2009 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -132,47 +132,6 @@ short. .It Cm fg Same as not specifying .Cm bg . -.It Cm gssname Ns = Ns Aq Ar name -For the RPCSEC_GSS security flavors, such as krb5, krb5i and krb5p when being -used for an NFSv4 mount, this option specifies the host based principal -name to be used for the state related operations SetClientID, -SetClientIDConfirm, ReleaseLockOwner and Renew. -It is also used for other operations, such as Getattr for -.Xr statfs 2 -information and during open/lock state recovery. -An entry for this principal must exist -in the client machine's default keytab file. -If possible, the keytab entry should be created using DES_CBC_CRC -encryption. If another encryption algorithm is used, the sysctl variable -.Va vfs.newnfs.keytab_enctype -must be set to the numeric value representing that encryption algorithm. -(The numeric values can be found in /usr/include/krb5_asn1.h. Look -for constants named ETYPE_xxx.) -If this option is given -as a name without an ``@'', such as ``root'' or ``nfs'', -``@'' will be appended to it. -.sp -If this option is not specified -for NFSv4 mounts using krb5[ip], the above operations will be done using the -user principal for the user that performed the mount. This -only works for mounts done by a user other than ``root'' and the user must -have a valid TGT in their credentials cache at the time the mount is done. -(Setting the -.Va vfs.usermount -to non-zero will allow users to do mounts.) -Because the user's TGT is used to acquire credentials for these operations, -it is important that that user's TGT does not expire before -.Xr umount 8 -is done. -.It Cm allgssname -This option can be used along with -.Cm gssname -to indicate that all accesses to the mount point are to be done using -the host based principal specified by the -.Cm gssname -option. -This might be useful for nfsv4 mounts using sec=krb5[ip] that are being accessed -by batch utilities over long periods of time. .It Cm hard Same as not specifying .Cm soft . From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 14:50:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E21941065670; Wed, 29 Jul 2009 14:50:31 +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 CFE998FC16; Wed, 29 Jul 2009 14:50:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TEoV0r074392; Wed, 29 Jul 2009 14:50:31 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TEoVK7074390; Wed, 29 Jul 2009 14:50:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907291450.n6TEoVK7074390@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Jul 2009 14:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195943 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 14:50:32 -0000 Author: rmacklem Date: Wed Jul 29 14:50:31 2009 New Revision: 195943 URL: http://svn.freebsd.org/changeset/base/195943 Log: Fix the experimental nfs client so that it only calls ncl_vinvalbuf() for NFSv2 and not NFSv4 when nfscl_mustflush() returns 0. Since nfscl_mustflush() only returns 0 when there is a valid write delegation issued to the client, it only affects the case of an NFSv4 mount with callbacks/delegations enabled. Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 29 14:44:09 2009 (r195942) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jul 29 14:50:31 2009 (r195943) @@ -687,11 +687,17 @@ nfs_close(struct vop_close_args *ap) int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); /* np->n_flag &= ~NMODIFIED; */ - } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) { - int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); - /* as above w.r.t. races when clearing NMODIFIED */ - /* np->n_flag &= ~NMODIFIED; */ + } else if (NFS_ISV4(vp)) { + if (nfscl_mustflush(vp)) { + int cm = newnfs_commit_on_close ? 1 : 0; + error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, + cm); + /* + * as above w.r.t races when clearing + * NMODIFIED. + * np->n_flag &= ~NMODIFIED; + */ + } } else error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); mtx_lock(&np->n_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 16:41:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F77106566B; Wed, 29 Jul 2009 16:41:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64E988FC12; Wed, 29 Jul 2009 16:41:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TGf20m076624; Wed, 29 Jul 2009 16:41:02 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TGf2mb076622; Wed, 29 Jul 2009 16:41:02 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907291641.n6TGf2mb076622@svn.freebsd.org> From: Jamie Gritton Date: Wed, 29 Jul 2009 16:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195944 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 16:41:03 -0000 Author: jamie Date: Wed Jul 29 16:41:02 2009 New Revision: 195944 URL: http://svn.freebsd.org/changeset/base/195944 Log: Change the default value of the "ip4" and "ip6" jail parameters to "disable", which only allows access to the parent/physical system's IP addresses when specifically directed. Change the default value of "host" to "new", and don't copy the parent host values, to insulate jails from the parent hostname et al. Approved by: re (kib), bz (mentor) Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Jul 29 14:50:31 2009 (r195943) +++ head/sys/kern/kern_jail.c Wed Jul 29 16:41:02 2009 (r195944) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include +#define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" + MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); /* prison0 describes what is "real" about the system. */ @@ -81,7 +83,7 @@ struct prison prison0 = { .pr_path = "/", .pr_securelevel = -1, .pr_childmax = JAIL_MAX, - .pr_hostuuid = "00000000-0000-0000-0000-000000000000", + .pr_hostuuid = DEFAULT_HOSTUUID, .pr_children = LIST_HEAD_INITIALIZER(&prison0.pr_children), .pr_flags = PR_HOST, .pr_allow = PR_ALLOW_ALL, @@ -1128,40 +1130,18 @@ kern_jail_set(struct thread *td, struct /* Set some default values, and inherit some from the parent. */ if (name == NULL) name = ""; - if (host != NULL || domain != NULL || uuid != NULL || gothid) { - if (host == NULL) - host = ppr->pr_hostname; - if (domain == NULL) - domain = ppr->pr_domainname; - if (uuid == NULL) - uuid = ppr->pr_hostuuid; - if (!gothid) - hid = ppr->pr_hostid; - } if (path == NULL) { path = "/"; root = mypr->pr_root; vref(root); } + strlcpy(pr->pr_hostuuid, DEFAULT_HOSTUUID, HOSTUUIDLEN); + pr->pr_flags |= PR_HOST; #ifdef INET - pr->pr_flags |= ppr->pr_flags & PR_IP4; - pr->pr_ip4s = ppr->pr_ip4s; - if (ppr->pr_ip4 != NULL) { - pr->pr_ip4 = malloc(pr->pr_ip4s * - sizeof(struct in_addr), M_PRISON, M_WAITOK); - bcopy(ppr->pr_ip4, pr->pr_ip4, - pr->pr_ip4s * sizeof(*pr->pr_ip4)); - } + pr->pr_flags |= PR_IP4 | PR_IP4_USER | PR_IP4_DISABLE; #endif #ifdef INET6 - pr->pr_flags |= ppr->pr_flags & PR_IP6; - pr->pr_ip6s = ppr->pr_ip6s; - if (ppr->pr_ip6 != NULL) { - pr->pr_ip6 = malloc(pr->pr_ip6s * - sizeof(struct in6_addr), M_PRISON, M_WAITOK); - bcopy(ppr->pr_ip6, pr->pr_ip6, - pr->pr_ip6s * sizeof(*pr->pr_ip6)); - } + pr->pr_flags |= PR_IP6 | PR_IP6_USER | PR_IP6_DISABLE; #endif pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 16:46:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06E3106566C; Wed, 29 Jul 2009 16:46:59 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9396E8FC1A; Wed, 29 Jul 2009 16:46:59 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TGkxWX076778; Wed, 29 Jul 2009 16:46:59 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TGkxGu076776; Wed, 29 Jul 2009 16:46:59 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907291646.n6TGkxGu076776@svn.freebsd.org> From: Jamie Gritton Date: Wed, 29 Jul 2009 16:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195945 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 16:47:00 -0000 Author: jamie Date: Wed Jul 29 16:46:59 2009 New Revision: 195945 URL: http://svn.freebsd.org/changeset/base/195945 Log: Don't allow mixing the "vnet" and "ip4/6" jail parameters, since vnet jails have their own IP stack and don't have access to the parent IP addresses anyway. Note that a virtual network stack forms a break between prisons with regard to the list of allowed IP addresses. Approved by: re (kib), bz (mentor) Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Jul 29 16:41:02 2009 (r195944) +++ head/sys/kern/kern_jail.c Wed Jul 29 16:46:59 2009 (r195945) @@ -468,7 +468,7 @@ kern_jail_set(struct thread *td, struct #endif struct vfsopt *opt; struct vfsoptlist *opts; - struct prison *pr, *deadpr, *mypr, *ppr, *tpr; + struct prison *pr, *deadpr, *mypr, *ppr, *tpr, *tppr; struct vnode *root; char *domain, *errmsg, *host, *name, *p, *path, *uuid; #if defined(INET) || defined(INET6) @@ -821,6 +821,15 @@ kern_jail_set(struct thread *td, struct } #endif +#if defined(VIMAGE) && (defined(INET) || defined(INET6)) + if ((ch_flags & PR_VNET) && (ch_flags & (PR_IP4_USER | PR_IP6_USER))) { + error = EINVAL; + vfs_opterror(opts, + "vnet jails cannot have IP address restrictions"); + goto done_errmsg; + } +#endif + root = NULL; error = vfs_getopt(opts, "path", (void **)&path, &len); if (error == ENOENT) @@ -1137,11 +1146,18 @@ kern_jail_set(struct thread *td, struct } strlcpy(pr->pr_hostuuid, DEFAULT_HOSTUUID, HOSTUUIDLEN); pr->pr_flags |= PR_HOST; +#if defined(INET) || defined(INET6) +#ifdef VIMAGE + if (!(pr_flags & PR_VNET)) +#endif + { #ifdef INET - pr->pr_flags |= PR_IP4 | PR_IP4_USER | PR_IP4_DISABLE; + pr->pr_flags |= PR_IP4 | PR_IP4_USER | PR_IP4_DISABLE; #endif #ifdef INET6 - pr->pr_flags |= PR_IP6 | PR_IP6_USER | PR_IP6_DISABLE; + pr->pr_flags |= PR_IP6 | PR_IP6_USER | PR_IP6_DISABLE; +#endif + } #endif pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; @@ -1173,6 +1189,15 @@ kern_jail_set(struct thread *td, struct */ } else { created = 0; +#if defined(VIMAGE) && (defined(INET) || defined(INET6)) + if ((pr->pr_flags & PR_VNET) && + (ch_flags & (PR_IP4_USER | PR_IP6_USER))) { + error = EINVAL; + vfs_opterror(opts, + "vnet jails cannot have IP address restrictions"); + goto done_deref_locked; + } +#endif /* * Grab a reference for existing prisons, to ensure they * continue to exist for the duration of the call. @@ -1299,8 +1324,19 @@ kern_jail_set(struct thread *td, struct * there is a duplicate on a jail with more than one * IP stop checking and return error. */ - FOREACH_PRISON_DESCENDANT(&prison0, tpr, descend) { - if (tpr == pr || tpr->pr_uref == 0) { + tppr = ppr; +#ifdef VIMAGE + for (; tppr != &prison0; tppr = tppr->pr_parent) + if (tppr->pr_flags & PR_VNET) + break; +#endif + FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { + if (tpr == pr || +#ifdef VIMAGE + (tpr != tppr && + (tpr->pr_flags & PR_VNET)) || +#endif + tpr->pr_uref == 0) { descend = 0; continue; } @@ -1407,8 +1443,19 @@ kern_jail_set(struct thread *td, struct } if (ip6s > 0) { /* Check for conflicting IP addresses. */ - FOREACH_PRISON_DESCENDANT(&prison0, tpr, descend) { - if (tpr == pr || tpr->pr_uref == 0) { + tppr = ppr; +#ifdef VIMAGE + for (; tppr != &prison0; tppr = tppr->pr_parent) + if (tppr->pr_flags & PR_VNET) + break; +#endif + FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { + if (tpr == pr || +#ifdef VIMAGE + (tpr != tppr && + (tpr->pr_flags & PR_VNET)) || +#endif + tpr->pr_uref == 0) { descend = 0; continue; } @@ -1490,6 +1537,12 @@ kern_jail_set(struct thread *td, struct pr->pr_ip4s = 0; } FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { +#ifdef VIMAGE + if (tpr->pr_flags & PR_VNET) { + descend = 0; + continue; + } +#endif if (prison_restrict_ip4(tpr, NULL)) { redo_ip4 = 1; descend = 0; @@ -1522,6 +1575,12 @@ kern_jail_set(struct thread *td, struct pr->pr_ip6s = 0; } FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { +#ifdef VIMAGE + if (tpr->pr_flags & PR_VNET) { + descend = 0; + continue; + } +#endif if (prison_restrict_ip6(tpr, NULL)) { redo_ip6 = 1; descend = 0; @@ -1655,6 +1714,12 @@ kern_jail_set(struct thread *td, struct mtx_lock(&pr->pr_mtx); redo_ip4 = 0; FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { +#ifdef VIMAGE + if (tpr->pr_flags & PR_VNET) { + descend = 0; + continue; + } +#endif if (prison_restrict_ip4(tpr, ip4)) { if (ip4 != NULL) ip4 = NULL; @@ -1672,6 +1737,12 @@ kern_jail_set(struct thread *td, struct mtx_lock(&pr->pr_mtx); redo_ip6 = 0; FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { +#ifdef VIMAGE + if (tpr->pr_flags & PR_VNET) { + descend = 0; + continue; + } +#endif if (prison_restrict_ip6(tpr, ip6)) { if (ip6 != NULL) ip6 = NULL; @@ -2697,9 +2768,17 @@ prison_equal_ip4(struct prison *pr1, str * proper locking order and end up needing allprison_lock anyway. */ sx_slock(&allprison_lock); - while (pr1 != &prison0 && !(pr1->pr_flags & PR_IP4_USER)) + while (pr1 != &prison0 && +#ifdef VIMAGE + !(pr1->pr_flags & PR_VNET) && +#endif + !(pr1->pr_flags & PR_IP4_USER)) pr1 = pr1->pr_parent; - while (pr2 != &prison0 && !(pr2->pr_flags & PR_IP4_USER)) + while (pr2 != &prison0 && +#ifdef VIMAGE + !(pr2->pr_flags & PR_VNET) && +#endif + !(pr2->pr_flags & PR_IP4_USER)) pr2 = pr2->pr_parent; sx_sunlock(&allprison_lock); return (pr1 == pr2); @@ -2995,9 +3074,17 @@ prison_equal_ip6(struct prison *pr1, str return (1); sx_slock(&allprison_lock); - while (pr1 != &prison0 && !(pr1->pr_flags & PR_IP6_USER)) + while (pr1 != &prison0 && +#ifdef VIMAGE + !(pr1->pr_flags & PR_VNET) && +#endif + !(pr1->pr_flags & PR_IP6_USER)) pr1 = pr1->pr_parent; - while (pr2 != &prison0 && !(pr2->pr_flags & PR_IP6_USER)) + while (pr2 != &prison0 && +#ifdef VIMAGE + !(pr2->pr_flags & PR_VNET) && +#endif + !(pr2->pr_flags & PR_IP6_USER)) pr2 = pr2->pr_parent; sx_sunlock(&allprison_lock); return (pr1 == pr2); From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 16:51:02 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 264CB106564A; Wed, 29 Jul 2009 16:51:02 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id F0B8E8FC14; Wed, 29 Jul 2009 16:51:01 +0000 (UTC) (envelope-from sam@errno.com) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n6TGp1DY073634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Jul 2009 09:51:01 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4A707DF5.5050108@errno.com> Date: Wed, 29 Jul 2009 09:51:01 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Jamie Gritton References: <200907291641.n6TGf2mb076622@svn.freebsd.org> In-Reply-To: <200907291641.n6TGf2mb076622@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-URT-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195944 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 16:51:02 -0000 Jamie Gritton wrote: > Author: jamie > Date: Wed Jul 29 16:41:02 2009 > New Revision: 195944 > URL: http://svn.freebsd.org/changeset/base/195944 > > Log: > Change the default value of the "ip4" and "ip6" jail parameters to > "disable", which only allows access to the parent/physical system's > IP addresses when specifically directed. Change the default value of > "host" to "new", and don't copy the parent host values, to insulate > jails from the parent hostname et al. This does not say why you're making these changes; please explain. Sam From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 17:18:05 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 089041065674; Wed, 29 Jul 2009 17:18:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id C54D38FC0C; Wed, 29 Jul 2009 17:18:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n6TH53H8005661; Wed, 29 Jul 2009 11:05:03 -0600 (MDT) Message-ID: <4A70813A.6020502@FreeBSD.org> Date: Wed, 29 Jul 2009 11:04:58 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Sam Leffler References: <200907291641.n6TGf2mb076622@svn.freebsd.org> <4A707DF5.5050108@errno.com> In-Reply-To: <4A707DF5.5050108@errno.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195944 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 17:18:05 -0000 Sam Leffler wrote: > Jamie Gritton wrote: >> Author: jamie >> Date: Wed Jul 29 16:41:02 2009 >> New Revision: 195944 >> URL: http://svn.freebsd.org/changeset/base/195944 >> >> Log: >> Change the default value of the "ip4" and "ip6" jail parameters to >> "disable", which only allows access to the parent/physical system's >> IP addresses when specifically directed. Change the default value of >> "host" to "new", and don't copy the parent host values, to insulate >> jails from the parent hostname et al. > > This does not say why you're making these changes; please explain. My apologies. The ip4/6 change fixed an error with the old-style command line of jail(8), where specifying IPv4 address(es) but not IPv6 addresses would allow access to the full IPv6 stack, a regression from 7.2 which allows only specifically noted IPv6 addresses. This could have been fixed in jail(8), but the default to act like the current jail implementation even for new-style command lines made more sense, and the kernel is the place for such policy points. The host change arose from a discrepancy between the it and the "linux" parameters that control the Linux MIB entries. These had different defaults for no reason other than I coded them at different times without a lot of thought as to what the most reasonable default would be. I also made a cleaner break with the parent system when one value (typically host.hostname) is set and the others aren't - it didn't make sense to copy some and set others. - Jamie From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 18:25:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43A8A106566B; Wed, 29 Jul 2009 18:25:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id EC5818FC1D; Wed, 29 Jul 2009 18:25:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 1958D41C71D; Wed, 29 Jul 2009 20:25:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id tEo33RnEI-Fw; Wed, 29 Jul 2009 20:25:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 55A0B41C710; Wed, 29 Jul 2009 20:25:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 145A34448E6; Wed, 29 Jul 2009 18:24:03 +0000 (UTC) Date: Wed, 29 Jul 2009 18:24:02 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Jamie Gritton In-Reply-To: <4A70813A.6020502@FreeBSD.org> Message-ID: <20090729181634.E245@maildrop.int.zabbadoz.net> References: <200907291641.n6TGf2mb076622@svn.freebsd.org> <4A707DF5.5050108@errno.com> <4A70813A.6020502@FreeBSD.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Sam Leffler , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195944 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 18:25:09 -0000 On Wed, 29 Jul 2009, Jamie Gritton wrote: Hi, let me add a few words. > Sam Leffler wrote: >> Jamie Gritton wrote: >>> Author: jamie >>> Date: Wed Jul 29 16:41:02 2009 >>> New Revision: 195944 >>> URL: http://svn.freebsd.org/changeset/base/195944 >>> >>> Log: >>> Change the default value of the "ip4" and "ip6" jail parameters to >>> "disable", which only allows access to the parent/physical system's >>> IP addresses when specifically directed. Change the default value of >>> "host" to "new", and don't copy the parent host values, to insulate >>> jails from the parent hostname et al. >> >> This does not say why you're making these changes; please explain. > > My apologies. The ip4/6 change fixed an error with the old-style > command line of jail(8), where specifying IPv4 address(es) but not IPv6 > addresses would allow access to the full IPv6 stack, a regression from > 7.2 which allows only specifically noted IPv6 addresses. And vice versa for IPv6 only jails and also with no-IP jails where addresses of both AFs were inherited rather than denied. This behaviour is actually needed to not break lots of jail setups with mostly Java[1] and some other apps that have strange defaults and `understandings' of what dual-stack or socket operations in one of those means. It's bascically reverting to the old or rather expected defaults of a jail so that jails can continue to run 1:1 when upgrading from 7 to 8. At least hoping most (all) things are shaken out now with regard to this. In case you know anything that doesn't work as expected, now would be a good time to tell us. /bz [1] http://diario.behrens.de/2008/10/12/java_and_ipv6_on_bsd.html -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 18:42:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70112106566C; Wed, 29 Jul 2009 18:42:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 449528FC14; Wed, 29 Jul 2009 18:42:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TIgF1p079125; Wed, 29 Jul 2009 18:42:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TIgFpB079123; Wed, 29 Jul 2009 18:42:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200907291842.n6TIgFpB079123@svn.freebsd.org> From: Ed Schouten Date: Wed, 29 Jul 2009 18:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195946 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 18:42:15 -0000 Author: ed Date: Wed Jul 29 18:42:14 2009 New Revision: 195946 URL: http://svn.freebsd.org/changeset/base/195946 Log: Free jilles@ from mentorship! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Jul 29 16:46:59 2009 (r195945) +++ svnadmin/conf/mentors Wed Jul 29 18:42:14 2009 (r195946) @@ -16,7 +16,6 @@ eri mlaier Co-mentor: thompsa fabient jkoshy ivoras gnn jamie bz Co-mentor: brooks -jilles ed jinmei gnn lstewart gnn nork imp From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 19:07:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7E48106566B; Wed, 29 Jul 2009 19:07:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB4658FC1B; Wed, 29 Jul 2009 19:07:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TJ7OTF079715; Wed, 29 Jul 2009 19:07:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TJ7OTL079712; Wed, 29 Jul 2009 19:07:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907291907.n6TJ7OTL079712@svn.freebsd.org> From: John Baldwin Date: Wed, 29 Jul 2009 19:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195947 - head/usr.sbin/acpi/acpidump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 19:07:25 -0000 Author: jhb Date: Wed Jul 29 19:07:24 2009 New Revision: 195947 URL: http://svn.freebsd.org/changeset/base/195947 Log: Parse the System Resource Affinity Table ('SRAT') used to describe affinity relationships between CPUs and memory. Reviewed by: jkim Approved by: re (kib) MFC after: 1 week Modified: head/usr.sbin/acpi/acpidump/acpi.c head/usr.sbin/acpi/acpidump/acpidump.h Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Wed Jul 29 18:42:14 2009 (r195946) +++ head/usr.sbin/acpi/acpidump/acpi.c Wed Jul 29 19:07:24 2009 (r195947) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,11 @@ static void acpi_print_intr(u_int32_t in static void acpi_print_apic(struct MADT_APIC *mp); static void acpi_handle_apic(struct ACPIsdt *sdp); static void acpi_handle_hpet(struct ACPIsdt *sdp); +static void acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain, + uint32_t flags); +static void acpi_print_srat_memory(struct SRAT_memory *mp); +static void acpi_print_srat(struct SRATentry *srat); +static void acpi_handle_srat(struct ACPIsdt *sdp); static void acpi_print_sdt(struct ACPIsdt *sdp); static void acpi_print_fadt(struct ACPIsdt *sdp); static void acpi_print_facs(struct FACSbody *facs); @@ -258,7 +264,10 @@ static void acpi_print_apic(struct MADT_APIC *mp) { - printf("\tType=%s\n", apic_types[mp->type]); + if (mp->type < sizeof(apic_types) / sizeof(apic_types[0])) + printf("\tType=%s\n", apic_types[mp->type]); + else + printf("\tType=%d (unknown)\n", mp->type); switch (mp->type) { case ACPI_MADT_APIC_TYPE_LOCAL_APIC: acpi_print_local_apic(mp->body.local_apic.cpu_id, @@ -307,9 +316,6 @@ acpi_print_apic(struct MADT_APIC *mp) acpi_print_intr(mp->body.int_src.intr, mp->body.int_src.mps_flags); break; - default: - printf("\tUnknown type %d\n", (u_int)mp->type); - break; } } @@ -393,10 +399,92 @@ acpi_handle_mcfg(struct ACPIsdt *sdp) sizeof(*mcfg->s); for (i = 0; i < e; i++, mcfg++) { printf("\n"); - printf("\tBase Address= 0x%016jx\n", mcfg->s[i].baseaddr); - printf("\tSegment Group= 0x%04x\n", mcfg->s[i].seg_grp); - printf("\tStart Bus= %d\n", mcfg->s[i].start); - printf("\tEnd Bus= %d\n", mcfg->s[i].end); + printf("\tBase Address=0x%016jx\n", mcfg->s[i].baseaddr); + printf("\tSegment Group=0x%04x\n", mcfg->s[i].seg_grp); + printf("\tStart Bus=%d\n", mcfg->s[i].start); + printf("\tEnd Bus=%d\n", mcfg->s[i].end); + } + printf(END_COMMENT); +} + +static void +acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain, + uint32_t flags) +{ + + printf("\tFlags={"); + if (flags & ACPI_SRAT_CPU_ENABLED) + printf("ENABLED"); + else + printf("DISABLED"); + printf("}\n"); + printf("\tAPIC ID=%d\n", apic_id); + printf("\tProximity Domain=%d\n", proximity_domain); +} + +static void +acpi_print_srat_memory(struct SRAT_memory *mp) +{ + + printf("\tFlags={"); + if (mp->flags & ACPI_SRAT_MEM_ENABLED) + printf("ENABLED"); + else + printf("DISABLED"); + if (mp->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) + printf(",HOT_PLUGGABLE"); + if (mp->flags & ACPI_SRAT_MEM_NON_VOLATILE) + printf(",NON_VOLATILE"); + printf("}\n"); + printf("\tBase Address=0x%016jx\n", (uintmax_t)mp->base_address); + printf("\tLength=0x%016jx\n", (uintmax_t)mp->length); + printf("\tProximity Domain=%d\n", mp->proximity_domain); +} + +const char *srat_types[] = { "CPU", "Memory", "X2APIC" }; + +static void +acpi_print_srat(struct SRATentry *srat) +{ + + if (srat->type < sizeof(srat_types) / sizeof(srat_types[0])) + printf("\tType=%s\n", srat_types[srat->type]); + else + printf("\tType=%d (unknown)\n", srat->type); + switch (srat->type) { + case ACPI_SRAT_TYPE_CPU_AFFINITY: + acpi_print_srat_cpu(srat->body.cpu.apic_id, + srat->body.cpu.proximity_domain_hi[2] << 24 | + srat->body.cpu.proximity_domain_hi[1] << 16 | + srat->body.cpu.proximity_domain_hi[0] << 0 | + srat->body.cpu.proximity_domain_lo, srat->body.cpu.flags); + break; + case ACPI_SRAT_TYPE_MEMORY_AFFINITY: + acpi_print_srat_memory(&srat->body.mem); + break; + case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: + acpi_print_srat_cpu(srat->body.x2apic.apic_id, + srat->body.x2apic.proximity_domain, + srat->body.x2apic.flags); + break; + } +} + +static void +acpi_handle_srat(struct ACPIsdt *sdp) +{ + struct SRATbody *sratp; + struct SRATentry *entry; + + printf(BEGIN_COMMENT); + acpi_print_sdt(sdp); + sratp = (struct SRATbody *)sdp->body; + printf("\tTable Revision=%d\n", sratp->table_revision); + entry = sratp->body; + while (((uintptr_t)entry) - ((uintptr_t)sdp) < sdp->len) { + printf("\n"); + acpi_print_srat(entry); + entry = (struct SRATentry *)((char *)entry + entry->len); } printf(END_COMMENT); } @@ -710,6 +798,8 @@ acpi_handle_rsdt(struct ACPIsdt *rsdp) acpi_handle_ecdt(sdp); else if (!memcmp(sdp->signature, "MCFG", 4)) acpi_handle_mcfg(sdp); + else if (!memcmp(sdp->signature, "SRAT", 4)) + acpi_handle_srat(sdp); else { printf(BEGIN_COMMENT); acpi_print_sdt(sdp); Modified: head/usr.sbin/acpi/acpidump/acpidump.h ============================================================================== --- head/usr.sbin/acpi/acpidump/acpidump.h Wed Jul 29 18:42:14 2009 (r195946) +++ head/usr.sbin/acpi/acpidump/acpidump.h Wed Jul 29 19:07:24 2009 (r195947) @@ -304,6 +304,56 @@ struct MCFGbody { } s[1] __packed; } __packed; +/* System Resource Affinity Table */ +struct SRAT_cpu { + uint8_t proximity_domain_lo; + uint8_t apic_id; + uint32_t flags; +#define ACPI_SRAT_CPU_ENABLED 0x00000001 + uint8_t sapic_eid; + uint8_t proximity_domain_hi[3]; + uint32_t reserved; +} __packed; + +struct SRAT_memory { + uint32_t proximity_domain; + uint16_t reserved; + uint64_t base_address; + uint64_t length; + uint32_t reserved1; + uint32_t flags; +#define ACPI_SRAT_MEM_ENABLED 0x00000001 +#define ACPI_SRAT_MEM_HOT_PLUGGABLE 0x00000002 +#define ACPI_SRAT_MEM_NON_VOLATILE 0x00000002 + uint64_t reserved2; +} __packed; + +struct SRAT_x2apic { + uint16_t reserved; + uint32_t proximity_domain; + uint32_t apic_id; + uint32_t flags; +} __packed; + +struct SRATentry { + uint8_t type; +#define ACPI_SRAT_TYPE_CPU_AFFINITY 0 +#define ACPI_SRAT_TYPE_MEMORY_AFFINITY 1 +#define ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY 2 + uint8_t len; + union { + struct SRAT_cpu cpu; + struct SRAT_memory mem; + struct SRAT_x2apic x2apic; + } body; +} __packed; + +struct SRATbody { + uint32_t table_revision; + uint64_t reserved; + struct SRATentry body[0]; +} __packed; + /* * Addresses to scan on ia32 for the RSD PTR. According to section 5.2.2 * of the ACPI spec, we only consider two regions for the base address: From owner-svn-src-all@FreeBSD.ORG Wed Jul 29 19:38:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C82610657CA; Wed, 29 Jul 2009 19:38:37 +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 AC5E28FC1A; Wed, 29 Jul 2009 19:38:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6TJcXtP080410; Wed, 29 Jul 2009 19:38:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6TJcXMP080408; Wed, 29 Jul 2009 19:38:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907291938.n6TJcXMP080408@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Jul 2009 19:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195949 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 19:38:39 -0000 Author: kib Date: Wed Jul 29 19:38:33 2009 New Revision: 195949 URL: http://svn.freebsd.org/changeset/base/195949 Log: Fix XEN build breakage, by implementing pmap_invalidate_cache_range() and using it when appropriate. Merge analogue of the r195836 optimization to XEN. Approved by: re (kensmith) Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Wed Jul 29 19:19:13 2009 (r195948) +++ head/sys/i386/xen/pmap.c Wed Jul 29 19:38:33 2009 (r195949) @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -759,7 +760,7 @@ pmap_init(void) * Determine the appropriate bits to set in a PTE or PDE for a specified * caching mode. */ -static int +int pmap_cache_bits(int mode, boolean_t is_pde) { int pat_flag, pat_index, cache_bits; @@ -988,6 +989,40 @@ pmap_invalidate_cache(void) } #endif /* !SMP */ +void +pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva) +{ + + KASSERT((sva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: sva not page-aligned")); + KASSERT((eva & PAGE_MASK) == 0, + ("pmap_invalidate_cache_range: eva not page-aligned")); + + if (cpu_feature & CPUID_SS) + ; /* If "Self Snoop" is supported, do nothing. */ + else if (cpu_feature & CPUID_CLFSH) { + + /* + * Otherwise, do per-cache line flush. Use the mfence + * instruction to insure that previous stores are + * included in the write-back. The processor + * propagates flush to other processors in the cache + * coherence domain. + */ + mfence(); + for (; eva < sva; eva += cpu_clflush_line_size) + clflush(eva); + mfence(); + } else { + + /* + * No targeted cache flush methods are supported by CPU, + * globally invalidate cache as a last resort. + */ + pmap_invalidate_cache(); + } +} + /* * Are we current address space or kernel? N.B. We return FALSE when * a pmap's page table is in use because a kernel thread is borrowing @@ -3865,7 +3900,8 @@ pmap_clear_reference(vm_page_t m) void * pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mode) { - vm_offset_t va, tmpva, offset; + vm_offset_t va, offset; + vm_size_t tmpsize; offset = pa & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); @@ -3878,14 +3914,10 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_ if (!va) panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); - for (tmpva = va; size > 0; ) { - pmap_kenter_attr(tmpva, pa, mode); - size -= PAGE_SIZE; - tmpva += PAGE_SIZE; - pa += PAGE_SIZE; - } - pmap_invalidate_range(kernel_pmap, va, tmpva); - pmap_invalidate_cache(); + for (tmpsize = 0; tmpsize < size; tmpsize += PAGE_SIZE) + pmap_kenter_attr(va + tmpsize, pa + tmpsize, mode); + pmap_invalidate_range(kernel_pmap, va, va + tmpsize); + pmap_invalidate_cache_range(va, va + size); return ((void *)(va + offset)); } @@ -3927,16 +3959,49 @@ pmap_unmapdev(vm_offset_t va, vm_size_t void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + struct sysmaps *sysmaps; + vm_offset_t sva, eva; m->md.pat_mode = ma; + if ((m->flags & PG_FICTITIOUS) != 0) + return; /* * If "m" is a normal page, flush it from the cache. + * See pmap_invalidate_cache_range(). + * + * First, try to find an existing mapping of the page by sf + * buffer. sf_buf_invalidate_cache() modifies mapping and + * flushes the cache. */ - if ((m->flags & PG_FICTITIOUS) == 0) { - /* If "Self Snoop" is supported, do nothing. */ - if (!(cpu_feature & CPUID_SS)) - pmap_invalidate_cache(); + if (sf_buf_invalidate_cache(m)) + return; + + /* + * If page is not mapped by sf buffer, but CPU does not + * support self snoop, map the page transient and do + * invalidation. In the worst case, whole cache is flushed by + * pmap_invalidate_cache_range(). + */ + if ((cpu_feature & (CPUID_SS|CPUID_CLFSH)) == CPUID_CLFSH) { + sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)]; + mtx_lock(&sysmaps->lock); + if (*sysmaps->CMAP2) + panic("pmap_page_set_memattr: CMAP2 busy"); + sched_pin(); + PT_SET_MA(sysmaps->CADDR2, PG_V | PG_RW | + xpmap_ptom(VM_PAGE_TO_PHYS(m)) | PG_A | PG_M | + pmap_cache_bits(m->md.pat_mode, 0)); + invlcaddr(sysmaps->CADDR2); + sva = (vm_offset_t)sysmaps->CADDR2; + eva = sva + PAGE_SIZE; + } else + sva = eva = 0; /* gcc */ + pmap_invalidate_cache_range(sva, eva); + if (sva != 0) { + PT_SET_MA(sysmaps->CADDR2, 0); + sched_unpin(); + mtx_unlock(&sysmaps->lock); } } @@ -3950,6 +4015,7 @@ pmap_change_attr(va, size, mode) pt_entry_t *pte; u_int opte, npte; pd_entry_t *pde; + boolean_t changed; base = trunc_page(va); offset = va & PAGE_MASK; @@ -3971,6 +4037,8 @@ pmap_change_attr(va, size, mode) return (EINVAL); } + changed = FALSE; + /* * Ok, all the pages exist and are 4k, so run through them updating * their cache mode. @@ -3988,6 +4056,8 @@ pmap_change_attr(va, size, mode) npte |= pmap_cache_bits(mode, 0); PT_SET_VA_MA(pte, npte, TRUE); } while (npte != opte && (*pte != npte)); + if (npte != opte) + changed = TRUE; tmpva += PAGE_SIZE; size -= PAGE_SIZE; } @@ -3996,8 +4066,10 @@ pmap_change_attr(va, size, mode) * Flush CPU caches to make sure any data isn't cached that shouldn't * be, etc. */ - pmap_invalidate_range(kernel_pmap, base, tmpva); - pmap_invalidate_cache(); + if (changed) { + pmap_invalidate_range(kernel_pmap, base, tmpva); + pmap_invalidate_cache_range(base, tmpva); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:11:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF25106564A; Thu, 30 Jul 2009 00:11:42 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF9908FC17; Thu, 30 Jul 2009 00:11:41 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0BfK2086177; Thu, 30 Jul 2009 00:11:41 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0BffM086172; Thu, 30 Jul 2009 00:11:41 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300011.n6U0BffM086172@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195957 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:11:42 -0000 Author: alfred Date: Thu Jul 30 00:11:41 2009 New Revision: 195957 URL: http://svn.freebsd.org/changeset/base/195957 Log: LibUSB v1.0: - Significantly improve libusb10 support. - Many minor issues fixed. - P4 ID: 166189, 165853, 165991, 166052, 166069 Submitted by: hps Approved by: re Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb10.h head/lib/libusb/libusb10_desc.c head/lib/libusb/libusb10_io.c head/lib/libusb/libusb20.3 head/lib/libusb/libusb20_compat01.c head/lib/libusb/libusb20_int.h Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Wed Jul 29 22:19:52 2009 (r195956) +++ head/lib/libusb/libusb.3 Thu Jul 30 00:11:41 2009 (r195957) @@ -294,7 +294,7 @@ LIBUSB_ERROR code on failure. . .Pp .Ft void -.Fn libusb_free_config_descriptor "libusb_config_descriptor *config`" +.Fn libusb_free_config_descriptor "libusb_config_descriptor *config" Free a configuration descriptor. . .Pp Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Wed Jul 29 22:19:52 2009 (r195956) +++ head/lib/libusb/libusb.h Thu Jul 30 00:11:41 2009 (r195957) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -181,95 +180,25 @@ enum libusb_debug_level { LIBUSB_DEBUG_TRANSFER=2, }; -/* internal structures */ +/* libusb structures */ + +struct libusb_context; +struct libusb_device; +struct libusb_transfer; +struct libusb20_device; -typedef struct libusb_pollfd { +struct libusb_pollfd { int fd; short events; -} libusb_pollfd; - -struct usb_pollfd { - TAILQ_ENTRY(usb_pollfd) list; - struct libusb_pollfd pollfd; -}; - -struct usb_transfer { - TAILQ_ENTRY(usb_transfer) list; - int num_iso_packets; - struct timeval timeout; - int transferred; - uint8_t flags; -}; - -struct usb_ep_tr { - TAILQ_ENTRY(usb_ep_tr) list; - uint8_t addr; - uint8_t idx; - uint8_t flags; - void *os_priv; }; -/* libusb structures */ +typedef struct libusb_context libusb_context; +typedef struct libusb_device libusb_device; +typedef struct libusb20_device libusb_device_handle; +typedef struct libusb_pollfd libusb_pollfd; typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data); typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data); -typedef struct libusb_context { - int debug; - int debug_fixed; - - int ctrl_pipe[2]; - - TAILQ_HEAD(usb_devs_list, libusb_device) usb_devs; - pthread_mutex_t usb_devs_lock; - - TAILQ_HEAD(open_devs_list, libusb_device_handle) open_devs; - pthread_mutex_t open_devs_lock; - - TAILQ_HEAD(flying_transfers_list, usb_transfer) flying_transfers; - pthread_mutex_t flying_transfers_lock; - - TAILQ_HEAD(pollfds_list, usb_pollfd) pollfds; - pthread_mutex_t pollfds_lock; - - unsigned int pollfd_modify; - pthread_mutex_t pollfd_modify_lock; - - libusb_pollfd_added_cb fd_added_cb; - libusb_pollfd_removed_cb fd_removed_cb; - void *fd_cb_user_data; - - pthread_mutex_t events_lock; - int event_handler_active; - - pthread_mutex_t event_waiters_lock; - pthread_cond_t event_waiters_cond; -} libusb_context; - -typedef struct libusb_device { - pthread_mutex_t lock; - int refcnt; - - struct libusb_context *ctx; - - uint8_t bus_number; - uint8_t device_address; - uint8_t num_configurations; - - TAILQ_ENTRY(libusb_device) list; - unsigned long session_data; - void *os_priv; -} libusb_device; - -typedef struct libusb_device_handle { - pthread_mutex_t lock; - unsigned long claimed_interfaces; - - TAILQ_ENTRY(libusb_device_handle) list; - struct libusb_device *dev; - void *os_priv; - TAILQ_HEAD(ep_list, usb_ep_tr) ep_list; -} libusb_device_handle; - typedef struct libusb_device_descriptor { uint8_t bLength; uint8_t bDescriptorType; @@ -296,7 +225,7 @@ typedef struct libusb_endpoint_descripto uint8_t bInterval; uint8_t bRefresh; uint8_t bSynchAddress; - unsigned char *extra; + uint8_t *extra; int extra_length; } libusb_endpoint_descriptor __aligned(sizeof(void *)); @@ -311,7 +240,7 @@ typedef struct libusb_interface_descript uint8_t bInterfaceProtocol; uint8_t iInterface; struct libusb_endpoint_descriptor *endpoint; - unsigned char *extra; + uint8_t *extra; int extra_length; } libusb_interface_descriptor __aligned(sizeof(void *)); @@ -330,7 +259,7 @@ typedef struct libusb_config_descriptor uint8_t bmAttributes; uint8_t MaxPower; struct libusb_interface *interface; - unsigned char *extra; + uint8_t *extra; int extra_length; } libusb_config_descriptor __aligned(sizeof(void *)); @@ -348,22 +277,20 @@ typedef struct libusb_iso_packet_descrip enum libusb_transfer_status status; } libusb_iso_packet_descriptor __aligned(sizeof(void *)); -struct libusb_transfer; - typedef void (*libusb_transfer_cb_fn) (struct libusb_transfer *transfer); typedef struct libusb_transfer { libusb_device_handle *dev_handle; uint8_t flags; unsigned int endpoint; - unsigned char type; + uint8_t type; unsigned int timeout; enum libusb_transfer_status status; int length; int actual_length; libusb_transfer_cb_fn callback; void *user_data; - unsigned char *buffer; + uint8_t *buffer; void *os_priv; int num_iso_packets; struct libusb_iso_packet_descriptor iso_packet_desc[0]; @@ -381,8 +308,8 @@ ssize_t libusb_get_device_list(libusb_co void libusb_free_device_list(libusb_device ** list, int unref_devices); uint8_t libusb_get_bus_number(libusb_device * dev); uint8_t libusb_get_device_address(libusb_device * dev); -int libusb_clear_halt(libusb_device_handle *devh, unsigned char endpoint); -int libusb_get_max_packet_size(libusb_device * dev, unsigned char endpoint); +int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint); +int libusb_get_max_packet_size(libusb_device * dev, uint8_t endpoint); libusb_device *libusb_ref_device(libusb_device * dev); void libusb_unref_device(libusb_device * dev); int libusb_open(libusb_device * dev, libusb_device_handle ** devh); @@ -393,6 +320,7 @@ int libusb_get_configuration(libusb_devi int libusb_set_configuration(libusb_device_handle * devh, int configuration); int libusb_claim_interface(libusb_device_handle * devh, int interface_number); int libusb_release_interface(libusb_device_handle * devh, int interface_number); +int libusb_reset_device(libusb_device_handle * dev); int libusb_kernel_driver_active(libusb_device_handle * devh, int interface); int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface); @@ -405,15 +333,15 @@ int libusb_get_active_config_descriptor( int libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config); int libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config); void libusb_free_config_descriptor(struct libusb_config_descriptor *config); -int libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, unsigned char *data, int length); +int libusb_get_string_descriptor_ascii(libusb_device_handle * dev, uint8_t desc_index, uint8_t *data, int length); -/* Asynchronous device I/O*/ +/* Asynchronous device I/O */ struct libusb_transfer *libusb_alloc_transfer(int iso_packets); void libusb_free_transfer(struct libusb_transfer *transfer); int libusb_submit_transfer(struct libusb_transfer *transfer); int libusb_cancel_transfer(struct libusb_transfer *transfer); -unsigned char *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet); +uint8_t *libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet); /* Polling and timing */ @@ -434,9 +362,9 @@ struct libusb_pollfd **libusb_get_pollfd /* Synchronous device I/O */ -int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout); -int libusb_bulk_transfer(struct libusb_device_handle *devh, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); -int libusb_interrupt_transfer(struct libusb_device_handle *devh, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout); +int libusb_control_transfer(libusb_device_handle * devh, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength, unsigned int timeout); +int libusb_bulk_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout); +int libusb_interrupt_transfer(libusb_device_handle *devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, unsigned int timeout); #if 0 { /* indent fix */ Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Wed Jul 29 22:19:52 2009 (r195956) +++ head/lib/libusb/libusb10.c Thu Jul 30 00:11:41 2009 (r195957) @@ -1,6 +1,7 @@ /* $FreeBSD$ */ /*- * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. + * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include #include #include @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include "libusb20.h" #include "libusb20_desc.h" @@ -41,23 +44,34 @@ static pthread_mutex_t default_context_lock = PTHREAD_MUTEX_INITIALIZER; struct libusb_context *usbi_default_context = NULL; -pthread_mutex_t libusb20_lock = PTHREAD_MUTEX_INITIALIZER; + +/* Prototypes */ + +static struct libusb20_transfer *libusb10_get_transfer(struct libusb20_device *, uint8_t, uint8_t); +static int libusb10_get_maxframe(struct libusb20_device *, libusb_transfer *); +static int libusb10_get_buffsize(struct libusb20_device *, libusb_transfer *); +static int libusb10_convert_error(uint8_t status); +static void libusb10_complete_transfer(struct libusb20_transfer *, struct libusb_super_transfer *, int); +static void libusb10_isoc_proxy(struct libusb20_transfer *); +static void libusb10_bulk_intr_proxy(struct libusb20_transfer *); +static void libusb10_ctrl_proxy(struct libusb20_transfer *); +static void libusb10_submit_transfer_sub(struct libusb20_device *, uint8_t); /* Library initialisation / deinitialisation */ void -libusb_set_debug(libusb_context * ctx, int level) +libusb_set_debug(libusb_context *ctx, int level) { - GET_CONTEXT(ctx); + ctx = GET_CONTEXT(ctx); if (ctx) ctx->debug = level; } int -libusb_init(libusb_context ** context) +libusb_init(libusb_context **context) { struct libusb_context *ctx; - char * debug; + char *debug; int ret; ctx = malloc(sizeof(*ctx)); @@ -72,39 +86,28 @@ libusb_init(libusb_context ** context) if (ctx->debug != 0) ctx->debug_fixed = 1; } + TAILQ_INIT(&ctx->pollfds); + TAILQ_INIT(&ctx->tr_done); - pthread_mutex_init(&ctx->usb_devs_lock, NULL); - pthread_mutex_init(&ctx->open_devs_lock, NULL); - TAILQ_INIT(&ctx->usb_devs); - TAILQ_INIT(&ctx->open_devs); - - pthread_mutex_init(&ctx->flying_transfers_lock, NULL); - pthread_mutex_init(&ctx->pollfds_lock, NULL); - pthread_mutex_init(&ctx->pollfd_modify_lock, NULL); - pthread_mutex_init(&ctx->events_lock, NULL); - pthread_mutex_init(&ctx->event_waiters_lock, NULL); - pthread_cond_init(&ctx->event_waiters_cond, NULL); + pthread_mutex_init(&ctx->ctx_lock, NULL); + pthread_cond_init(&ctx->ctx_cond, NULL); - TAILQ_INIT(&ctx->flying_transfers); - TAILQ_INIT(&ctx->pollfds); + ctx->ctx_handler = NO_THREAD; ret = pipe(ctx->ctrl_pipe); if (ret < 0) { - usb_remove_pollfd(ctx, ctx->ctrl_pipe[0]); - close(ctx->ctrl_pipe[0]); - close(ctx->ctrl_pipe[1]); + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_cond_destroy(&ctx->ctx_cond); free(ctx); return (LIBUSB_ERROR_OTHER); } + /* set non-blocking mode on the control pipe to avoid deadlock */ + ret = 1; + ioctl(ctx->ctrl_pipe[0], FIONBIO, &ret); + ret = 1; + ioctl(ctx->ctrl_pipe[1], FIONBIO, &ret); - ret = usb_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN); - if (ret < 0) { - usb_remove_pollfd(ctx, ctx->ctrl_pipe[0]); - close(ctx->ctrl_pipe[0]); - close(ctx->ctrl_pipe[1]); - free(ctx); - return ret; - } + libusb10_add_pollfd(ctx, &ctx->ctx_poll, NULL, ctx->ctrl_pipe[0], POLLIN); pthread_mutex_lock(&default_context_lock); if (usbi_default_context == NULL) { @@ -115,18 +118,26 @@ libusb_init(libusb_context ** context) if (context) *context = ctx; + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_init complete"); + return (0); } void -libusb_exit(libusb_context * ctx) +libusb_exit(libusb_context *ctx) { - GET_CONTEXT(ctx); + ctx = GET_CONTEXT(ctx); + + if (ctx == NULL) + return; - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_exit enter"); - usb_remove_pollfd(ctx, ctx->ctrl_pipe[0]); + /* XXX cleanup devices */ + + libusb10_remove_pollfd(ctx, &ctx->ctx_poll); close(ctx->ctrl_pipe[0]); close(ctx->ctrl_pipe[1]); + pthread_mutex_destroy(&ctx->ctx_lock); + pthread_cond_destroy(&ctx->ctx_cond); pthread_mutex_lock(&default_context_lock); if (ctx == usbi_default_context) { @@ -135,47 +146,48 @@ libusb_exit(libusb_context * ctx) pthread_mutex_unlock(&default_context_lock); free(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_exit leave"); } /* Device handling and initialisation. */ ssize_t -libusb_get_device_list(libusb_context * ctx, libusb_device *** list) +libusb_get_device_list(libusb_context *ctx, libusb_device ***list) { + struct libusb20_backend *usb_backend; struct libusb20_device *pdev; - struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; struct libusb_device *dev; - struct libusb20_backend *usb_backend; int i; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_list enter"); + ctx = GET_CONTEXT(ctx); + + if (ctx == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (list == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); usb_backend = libusb20_be_alloc_default(); if (usb_backend == NULL) - return (-1); + return (LIBUSB_ERROR_NO_MEM); + /* figure out how many USB devices are present */ pdev = NULL; i = 0; while ((pdev = libusb20_be_device_foreach(usb_backend, pdev))) i++; - if (list == NULL) { - libusb20_be_free(usb_backend); - return (LIBUSB_ERROR_INVALID_PARAM); - } + /* allocate device pointer list */ *list = malloc((i + 1) * sizeof(void *)); if (*list == NULL) { libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } + /* create libusb v1.0 compliant devices */ i = 0; while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) { /* get device into libUSB v1.0 list */ libusb20_be_dequeue_device(usb_backend, pdev); - ddesc = libusb20_dev_get_device_desc(pdev); dev = malloc(sizeof(*dev)); if (dev == NULL) { while (i != 0) { @@ -183,23 +195,21 @@ libusb_get_device_list(libusb_context * i--; } free(*list); + *list = NULL; libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } memset(dev, 0, sizeof(*dev)); - pthread_mutex_init(&dev->lock, NULL); + /* init transfer queues */ + TAILQ_INIT(&dev->tr_head); + + /* set context we belong to */ dev->ctx = ctx; - dev->bus_number = pdev->bus_number; - dev->device_address = pdev->device_address; - dev->num_configurations = ddesc->bNumConfigurations; /* link together the two structures */ dev->os_priv = pdev; - - pthread_mutex_lock(&ctx->usb_devs_lock); - TAILQ_INSERT_HEAD(&ctx->usb_devs, dev, list); - pthread_mutex_unlock(&ctx->usb_devs_lock); + pdev->privLuData = dev; (*list)[i] = libusb_ref_device(dev); i++; @@ -207,91 +217,65 @@ libusb_get_device_list(libusb_context * (*list)[i] = NULL; libusb20_be_free(usb_backend); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_list leave"); return (i); } -/* - * In this function we cant free all the device contained into list because - * open_with_pid_vid use some node of list after the free_device_list. - */ void libusb_free_device_list(libusb_device **list, int unref_devices) { int i; - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_free_device_list enter"); if (list == NULL) - return ; + return; /* be NULL safe */ if (unref_devices) { for (i = 0; list[i] != NULL; i++) libusb_unref_device(list[i]); } free(list); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_free_device_list leave"); } uint8_t -libusb_get_bus_number(libusb_device * dev) +libusb_get_bus_number(libusb_device *dev) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_bus_number enter"); - if (dev == NULL) - return (LIBUSB_ERROR_NO_DEVICE); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_bus_number leave"); - return (dev->bus_number); + return (0); /* should not happen */ + return (libusb20_dev_get_bus_number(dev->os_priv)); } uint8_t -libusb_get_device_address(libusb_device * dev) +libusb_get_device_address(libusb_device *dev) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_address enter"); - if (dev == NULL) - return (LIBUSB_ERROR_NO_DEVICE); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device_address leave"); - return (dev->device_address); + return (0); /* should not happen */ + return (libusb20_dev_get_address(dev->os_priv)); } int -libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint) +libusb_get_max_packet_size(libusb_device *dev, uint8_t endpoint) { struct libusb_config_descriptor *pdconf; struct libusb_interface *pinf; struct libusb_interface_descriptor *pdinf; struct libusb_endpoint_descriptor *pdend; - libusb_context *ctx; - int i, j, k, ret; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_max_packet_size enter"); + int i; + int j; + int k; + int ret; if (dev == NULL) return (LIBUSB_ERROR_NO_DEVICE); - if (libusb_get_active_config_descriptor(dev, &pdconf) < 0) - return (LIBUSB_ERROR_OTHER); - + ret = libusb_get_active_config_descriptor(dev, &pdconf); + if (ret < 0) + return (ret); + ret = LIBUSB_ERROR_NOT_FOUND; - for (i = 0 ; i < pdconf->bNumInterfaces ; i++) { + for (i = 0; i < pdconf->bNumInterfaces; i++) { pinf = &pdconf->interface[i]; - for (j = 0 ; j < pinf->num_altsetting ; j++) { + for (j = 0; j < pinf->num_altsetting; j++) { pdinf = &pinf->altsetting[j]; - for (k = 0 ; k < pdinf->bNumEndpoints ; k++) { + for (k = 0; k < pdinf->bNumEndpoints; k++) { pdend = &pdinf->endpoint[k]; if (pdend->bEndpointAddress == endpoint) { ret = pdend->wMaxPacketSize; @@ -303,485 +287,401 @@ libusb_get_max_packet_size(libusb_device out: libusb_free_config_descriptor(pdconf); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_max_packet_size leave"); return (ret); } libusb_device * -libusb_ref_device(libusb_device * dev) +libusb_ref_device(libusb_device *dev) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_ref_device enter"); - if (dev == NULL) - return (NULL); + return (NULL); /* be NULL safe */ - pthread_mutex_lock(&dev->lock); + CTX_LOCK(dev->ctx); dev->refcnt++; - pthread_mutex_unlock(&dev->lock); + CTX_UNLOCK(dev->ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_ref_device leave"); return (dev); } void -libusb_unref_device(libusb_device * dev) +libusb_unref_device(libusb_device *dev) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_unref_device enter"); - if (dev == NULL) - return; + return; /* be NULL safe */ - pthread_mutex_lock(&dev->lock); + CTX_LOCK(dev->ctx); dev->refcnt--; - pthread_mutex_unlock(&dev->lock); + CTX_UNLOCK(dev->ctx); if (dev->refcnt == 0) { - pthread_mutex_lock(&dev->ctx->usb_devs_lock); - TAILQ_REMOVE(&ctx->usb_devs, dev, list); - pthread_mutex_unlock(&dev->ctx->usb_devs_lock); - libusb20_dev_free(dev->os_priv); free(dev); } - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_unref_device leave"); } int -libusb_open(libusb_device * dev, libusb_device_handle **devh) +libusb_open(libusb_device *dev, libusb_device_handle **devh) { libusb_context *ctx = dev->ctx; struct libusb20_device *pdev = dev->os_priv; - libusb_device_handle *hdl; - unsigned char dummy; + uint8_t dummy; int err; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open enter"); - - dummy = 1; if (devh == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - hdl = malloc(sizeof(*hdl)); - if (hdl == NULL) - return (LIBUSB_ERROR_NO_MEM); + /* set default device handle value */ + *devh = NULL; + + dev = libusb_ref_device(dev); + if (dev == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); err = libusb20_dev_open(pdev, 16 * 4 /* number of endpoints */ ); if (err) { - free(hdl); + libusb_unref_device(dev); return (LIBUSB_ERROR_NO_MEM); } - memset(hdl, 0, sizeof(*hdl)); - pthread_mutex_init(&hdl->lock, NULL); - - TAILQ_INIT(&hdl->ep_list); - hdl->dev = libusb_ref_device(dev); - hdl->claimed_interfaces = 0; - hdl->os_priv = dev->os_priv; - err = usb_add_pollfd(ctx, libusb20_dev_get_fd(pdev), POLLIN | + libusb10_add_pollfd(ctx, &dev->dev_poll, pdev, libusb20_dev_get_fd(pdev), POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM); - if (err < 0) { - libusb_unref_device(dev); - free(hdl); - return (err); - } - - pthread_mutex_lock(&ctx->open_devs_lock); - TAILQ_INSERT_HEAD(&ctx->open_devs, hdl, list); - pthread_mutex_unlock(&ctx->open_devs_lock); - - *devh = hdl; - - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify++; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); + /* make sure our event loop detects the new device */ + dummy = 0; err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err <= 0) { - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify--; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); - return 0; + if (err < sizeof(dummy)) { + /* ignore error, if any */ + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open write failed!"); } + *devh = pdev; - libusb_lock_events(ctx); - read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify--; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); - libusb_unlock_events(ctx); - - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open leave"); return (0); } libusb_device_handle * -libusb_open_device_with_vid_pid(libusb_context * ctx, uint16_t vendor_id, +libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, uint16_t product_id) { struct libusb_device **devs; - struct libusb_device_handle *devh; struct libusb20_device *pdev; struct LIBUSB20_DEVICE_DESC_DECODED *pdesc; - int i, j; + int i; + int j; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid enter"); + ctx = GET_CONTEXT(ctx); + if (ctx == NULL) + return (NULL); /* be NULL safe */ - devh = NULL; + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid enter"); if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); + pdev = NULL; + for (j = 0; j < i; j++) { - pdev = (struct libusb20_device *)devs[j]->os_priv; + pdev = devs[j]->os_priv; pdesc = libusb20_dev_get_device_desc(pdev); + /* + * NOTE: The USB library will automatically swap the + * fields in the device descriptor to be of host + * endian type! + */ if (pdesc->idVendor == vendor_id && pdesc->idProduct == product_id) { - if (libusb_open(devs[j], &devh) < 0) - devh = NULL; - break ; + if (libusb_open(devs[j], &pdev) < 0) + pdev = NULL; + break; } } libusb_free_device_list(devs, 1); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid leave"); - return (devh); + return (pdev); } void -libusb_close(libusb_device_handle * devh) +libusb_close(struct libusb20_device *pdev) { libusb_context *ctx; - struct libusb20_device *pdev; - struct usb_ep_tr *eptr; - unsigned char dummy = 1; + struct libusb_device *dev; + uint8_t dummy; int err; - if (devh == NULL) - return ; + if (pdev == NULL) + return; /* be NULL safe */ - ctx = devh->dev->ctx; - pdev = devh->os_priv; + dev = libusb_get_device(pdev); + ctx = dev->ctx; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close enter"); + libusb10_remove_pollfd(ctx, &dev->dev_poll); - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify++; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); + libusb20_dev_close(pdev); + libusb_unref_device(dev); + /* make sure our event loop detects the closed device */ + dummy = 0; err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - - if (err <= 0) { - pthread_mutex_lock(&ctx->open_devs_lock); - TAILQ_REMOVE(&ctx->open_devs, devh, list); - pthread_mutex_unlock(&ctx->open_devs_lock); - - usb_remove_pollfd(ctx, libusb20_dev_get_fd(pdev)); - libusb20_dev_close(pdev); - libusb_unref_device(devh->dev); - TAILQ_FOREACH(eptr, &devh->ep_list, list) { - TAILQ_REMOVE(&devh->ep_list, eptr, list); - libusb20_tr_close(((struct libusb20_transfer **) - eptr->os_priv)[0]); - if (eptr->flags) - libusb20_tr_close(((struct libusb20_transfer **) - eptr->os_priv)[1]); - free((struct libusb20_transfer **)eptr->os_priv); - } - free(devh); - - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify--; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); - return ; + if (err < sizeof(dummy)) { + /* ignore error, if any */ + DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close write failed!"); } - libusb_lock_events(ctx); - - read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); - pthread_mutex_lock(&ctx->open_devs_lock); - TAILQ_REMOVE(&ctx->open_devs, devh, list); - pthread_mutex_unlock(&ctx->open_devs_lock); - - usb_remove_pollfd(ctx, libusb20_dev_get_fd(pdev)); - libusb20_dev_close(pdev); - libusb_unref_device(devh->dev); - TAILQ_FOREACH(eptr, &devh->ep_list, list) { - TAILQ_REMOVE(&devh->ep_list, eptr, list); - libusb20_tr_close(((struct libusb20_transfer **) - eptr->os_priv)[0]); - if (eptr->flags) - libusb20_tr_close(((struct libusb20_transfer **) - eptr->os_priv)[1]); - free((struct libusb20_transfer **)eptr->os_priv); - } - free(devh); - - pthread_mutex_lock(&ctx->pollfd_modify_lock); - ctx->pollfd_modify--; - pthread_mutex_unlock(&ctx->pollfd_modify_lock); - - libusb_unlock_events(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close leave"); } libusb_device * -libusb_get_device(libusb_device_handle * devh) +libusb_get_device(struct libusb20_device *pdev) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device enter"); - - if (devh == NULL) + if (pdev == NULL) return (NULL); - - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_device leave"); - return (devh->dev); + return ((libusb_device *)pdev->privLuData); } int -libusb_get_configuration(libusb_device_handle * devh, int *config) +libusb_get_configuration(struct libusb20_device *pdev, int *config) { - libusb_context *ctx; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_configuration enter"); + struct libusb20_config *pconf; - if (devh == NULL || config == NULL) + if (pdev == NULL || config == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - *config = libusb20_dev_get_config_index((struct libusb20_device *) - devh->dev->os_priv); + pconf = libusb20_dev_alloc_config(pdev, libusb20_dev_get_config_index(pdev)); + if (pconf == NULL) + return (LIBUSB_ERROR_NO_MEM); + + *config = pconf->desc.bConfigurationValue; + + free(pconf); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_get_configuration leave"); return (0); } int -libusb_set_configuration(libusb_device_handle * devh, int configuration) +libusb_set_configuration(struct libusb20_device *pdev, int configuration) { - struct libusb20_device *pdev; - libusb_context *ctx; + struct libusb20_config *pconf; + struct libusb_device *dev; + int err; + uint8_t i; - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_set_configuration enter"); + dev = libusb_get_device(pdev); - if (devh == NULL) + if (dev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - pdev = (struct libusb20_device *)devh->dev->os_priv; + if (configuration < 1) { + /* unconfigure */ + i = 255; + } else { + for (i = 0; i != 255; i++) { + uint8_t found; + + pconf = libusb20_dev_alloc_config(pdev, i); + if (pconf == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + found = (pconf->desc.bConfigurationValue + == configuration); + free(pconf); - libusb20_dev_set_config_index(pdev, configuration); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_set_configuration leave"); - return (0); + if (found) + goto set_config; + } + return (LIBUSB_ERROR_INVALID_PARAM); + } + +set_config: + + libusb10_cancel_all_transfer(dev); + + libusb10_remove_pollfd(dev->ctx, &dev->dev_poll); + + err = libusb20_dev_set_config_index(pdev, i); + + libusb10_add_pollfd(dev->ctx, &dev->dev_poll, pdev, libusb20_dev_get_fd(pdev), POLLIN | + POLLOUT | POLLRDNORM | POLLWRNORM); + + return (err ? LIBUSB_ERROR_INVALID_PARAM : 0); } int -libusb_claim_interface(libusb_device_handle * dev, int interface_number) +libusb_claim_interface(struct libusb20_device *pdev, int interface_number) { - libusb_context *ctx; - int ret = 0; - - ctx = NULL; - GET_CONTEXT(ctx); - DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_claim_interface enter"); + libusb_device *dev; + int err = 0; + dev = libusb_get_device(pdev); if (dev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:12:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F13E4106566C; Thu, 30 Jul 2009 00:12:47 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1B48FC0A; Thu, 30 Jul 2009 00:12:47 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0Cl9d086232; Thu, 30 Jul 2009 00:12:47 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0CluL086228; Thu, 30 Jul 2009 00:12:47 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300012.n6U0CluL086228@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195958 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:12:48 -0000 Author: alfred Date: Thu Jul 30 00:12:47 2009 New Revision: 195958 URL: http://svn.freebsd.org/changeset/base/195958 Log: USB controller: - patch from Alexander Motin - add more ID's - P4 ID: 165805 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Thu Jul 30 00:11:41 2009 (r195957) +++ head/sys/dev/usb/controller/ehci_pci.c Thu Jul 30 00:12:47 2009 (r195958) @@ -206,6 +206,8 @@ ehci_pci_match(device_t self) return "NVIDIA nForce3 250 USB 2.0 controller"; case 0x005b10de: return "NVIDIA nForce4 USB 2.0 controller"; + case 0x03f210de: + return "NVIDIA nForce MCP61 USB 2.0 controller"; case 0x15621131: return "Philips ISP156x USB 2.0 controller"; Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Thu Jul 30 00:11:41 2009 (r195957) +++ head/sys/dev/usb/controller/ohci_pci.c Thu Jul 30 00:12:47 2009 (r195958) @@ -172,6 +172,9 @@ ohci_pci_match(device_t self) case 0x00d710de: return ("nVidia nForce3 USB Controller"); + case 0x03f110de: + return ("nVidia nForce MCP61 USB Controller"); + case 0x70011039: return ("SiS 5571 USB controller"); Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Thu Jul 30 00:11:41 2009 (r195957) +++ head/sys/dev/usb/controller/uhci_pci.c Thu Jul 30 00:12:47 2009 (r195958) @@ -200,6 +200,15 @@ uhci_pci_match(device_t self) case 0x265b8086: return ("Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D"); + case 0x27c88086: + return ("Intel 82801G (ICH7) USB controller USB-A"); + case 0x27c98086: + return ("Intel 82801G (ICH7) USB controller USB-B"); + case 0x27ca8086: + return ("Intel 82801G (ICH7) USB controller USB-C"); + case 0x27cb8086: + return ("Intel 82801G (ICH7) USB controller USB-D"); + case 0x28308086: return ("Intel 82801H (ICH8) USB controller USB-A"); case 0x28318086: From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:13:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB222106566C; Thu, 30 Jul 2009 00:13:09 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF258FC1C; Thu, 30 Jul 2009 00:13:09 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0D9NJ086277; Thu, 30 Jul 2009 00:13:09 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0D9x7086275; Thu, 30 Jul 2009 00:13:09 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300013.n6U0D9x7086275@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195959 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:13:10 -0000 Author: alfred Date: Thu Jul 30 00:13:09 2009 New Revision: 195959 URL: http://svn.freebsd.org/changeset/base/195959 Log: USB input - add support for setting the UMS polling rate through -F option passed to moused. - requested by Alexander Best - P4 ID: 166075 PR: usb/125264 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Thu Jul 30 00:12:47 2009 (r195958) +++ head/sys/dev/usb/input/ums.c Thu Jul 30 00:13:09 2009 (r195959) @@ -140,6 +140,8 @@ struct ums_softc { struct usb_xfer *sc_xfer[UMS_N_TRANSFER]; + int sc_pollrate; + uint8_t sc_buttons; uint8_t sc_iid; uint8_t sc_temp[64]; @@ -188,6 +190,7 @@ ums_intr_callback(struct usb_xfer *xfer, struct usb_page_cache *pc; uint8_t *buf = sc->sc_temp; int32_t buttons = 0; + int32_t buttons_found = 0; int32_t dw = 0; int32_t dx = 0; int32_t dy = 0; @@ -263,16 +266,24 @@ ums_intr_callback(struct usb_xfer *xfer, dt -= hid_get_data(buf, len, &info->sc_loc_t); for (i = 0; i < info->sc_buttons; i++) { + uint32_t mask; + mask = 1UL << UMS_BUT(i); + /* check for correct button ID */ if (id != info->sc_iid_btn[i]) continue; - if (hid_get_data(buf, len, &info->sc_loc_btn[i])) { - buttons |= (1 << UMS_BUT(i)); - } + /* check for button pressed */ + if (hid_get_data(buf, len, &info->sc_loc_btn[i])) + buttons |= mask; + /* register button mask */ + buttons_found |= mask; } if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; + /* keep old button value(s) for non-detected buttons */ + buttons |= sc->sc_status.button & ~buttons_found; + if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) { @@ -514,6 +525,8 @@ ums_attach(device_t dev) DPRINTF("error=%s\n", usbd_errstr(err)); goto detach; } + + /* Get HID descriptor */ err = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -531,6 +544,9 @@ ums_attach(device_t dev) * it has two addional buttons and a tilt wheel. */ if (usb_test_quirk(uaa, UQ_MS_BAD_CLASS)) { + + sc->sc_iid = 0; + info = &sc->sc_info[0]; info->sc_flags = (UMS_FLAG_X_AXIS | UMS_FLAG_Y_AXIS | @@ -540,11 +556,17 @@ ums_attach(device_t dev) isize = 5; /* 1st byte of descriptor report contains garbage */ info->sc_loc_x.pos = 16; + info->sc_loc_x.size = 8; info->sc_loc_y.pos = 24; + info->sc_loc_y.size = 8; info->sc_loc_z.pos = 32; + info->sc_loc_z.size = 8; info->sc_loc_btn[0].pos = 8; + info->sc_loc_btn[0].size = 1; info->sc_loc_btn[1].pos = 9; + info->sc_loc_btn[1].size = 1; info->sc_loc_btn[2].pos = 10; + info->sc_loc_btn[2].size = 1; /* Announce device */ device_printf(dev, "3 buttons and [XYZ] " @@ -653,6 +675,23 @@ static void ums_start_read(struct usb_fifo *fifo) { struct ums_softc *sc = usb_fifo_softc(fifo); + int rate; + + /* Check if we should override the default polling interval */ + rate = sc->sc_pollrate; + /* Range check rate */ + if (rate > 1000) + rate = 1000; + /* Check for set rate */ + if ((rate > 0) && (sc->sc_xfer[UMS_INTR_DT] != NULL)) { + DPRINTF("Setting pollrate = %d\n", rate); + /* Stop current transfer, if any */ + usbd_transfer_stop(sc->sc_xfer[UMS_INTR_DT]); + /* Set new interval */ + usbd_xfer_set_interval(sc->sc_xfer[UMS_INTR_DT], 1000 / rate); + /* Only set pollrate once */ + sc->sc_pollrate = 0; + } usbd_transfer_start(sc->sc_xfer[UMS_INTR_DT]); } @@ -791,6 +830,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long sc->sc_mode.level = mode.level; } + /* store polling rate */ + sc->sc_pollrate = mode.rate; + if (sc->sc_mode.level == 0) { if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:14:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582571065676; Thu, 30 Jul 2009 00:14:35 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44D158FC20; Thu, 30 Jul 2009 00:14:35 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0EZLj086353; Thu, 30 Jul 2009 00:14:35 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0EZ77086341; Thu, 30 Jul 2009 00:14:35 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300014.n6U0EZ77086341@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:14:35 -0000 Author: alfred Date: Thu Jul 30 00:14:34 2009 New Revision: 195960 URL: http://svn.freebsd.org/changeset/base/195960 Log: USB CORE: - Add minimum polling support to drive UMASS and UKBD in case of panic. - Add extra check to ukbd probe to fix problem about mouse devices attaching like keyboards. - P4 ID: 166148 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/at91dci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2326,4 +2326,5 @@ struct usb_bus_methods at91dci_bus_metho .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, .roothub_exec = &at91dci_roothub_exec, + .xfer_poll = &at91dci_do_poll, }; Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/atmegadci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2143,4 +2143,5 @@ struct usb_bus_methods atmegadci_bus_met .set_stall = &atmegadci_set_stall, .clear_stall = &atmegadci_clear_stall, .roothub_exec = &atmegadci_roothub_exec, + .xfer_poll = &atmegadci_do_poll, }; Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/avr32dci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2081,4 +2081,5 @@ struct usb_bus_methods avr32dci_bus_meth .set_stall = &avr32dci_set_stall, .clear_stall = &avr32dci_clear_stall, .roothub_exec = &avr32dci_roothub_exec, + .xfer_poll = &avr32dci_do_poll, }; Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/ehci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -3828,4 +3828,5 @@ struct usb_bus_methods ehci_bus_methods .device_suspend = ehci_device_suspend, .set_hw_power = ehci_set_hw_power, .roothub_exec = ehci_roothub_exec, + .xfer_poll = ehci_do_poll, }; Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/musb_otg.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2736,4 +2736,5 @@ struct usb_bus_methods musbotg_bus_metho .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, .roothub_exec = &musbotg_roothub_exec, + .xfer_poll = &musbotg_do_poll, }; Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/ohci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2756,4 +2756,5 @@ struct usb_bus_methods ohci_bus_methods .device_suspend = ohci_device_suspend, .set_hw_power = ohci_set_hw_power, .roothub_exec = ohci_roothub_exec, + .xfer_poll = ohci_do_poll, }; Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/uhci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -3251,4 +3251,5 @@ struct usb_bus_methods uhci_bus_methods .device_suspend = uhci_device_suspend, .set_hw_power = uhci_set_hw_power, .roothub_exec = uhci_roothub_exec, + .xfer_poll = uhci_do_poll, }; Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/controller/uss820dci.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2360,4 +2360,5 @@ struct usb_bus_methods uss820dci_bus_met .set_stall = &uss820dci_set_stall, .clear_stall = &uss820dci_clear_stall, .roothub_exec = &uss820dci_roothub_exec, + .xfer_poll = &uss820dci_do_poll, }; Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/input/ukbd.c Thu Jul 30 00:14:34 2009 (r195960) @@ -299,6 +299,28 @@ ukbd_put_key(struct ukbd_softc *sc, uint } } +static void +ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait) +{ + DPRINTFN(2, "polling\n"); + + while (sc->sc_inputs == 0) { + + usbd_transfer_poll(sc->sc_xfer, UKBD_N_TRANSFER); + + DELAY(1000); /* delay 1 ms */ + + sc->sc_time_ms++; + + /* support repetition of keys: */ + + ukbd_interrupt(sc); + + if (!wait) + break; + } +} + static int32_t ukbd_get_key(struct ukbd_softc *sc, uint8_t wait) { @@ -311,24 +333,7 @@ ukbd_get_key(struct ukbd_softc *sc, uint usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); } if (sc->sc_flags & UKBD_FLAG_POLLING) { - DPRINTFN(2, "polling\n"); - - while (sc->sc_inputs == 0) { - - usbd_transfer_poll(sc->sc_xfer, UKBD_N_TRANSFER); - - DELAY(1000); /* delay 1 ms */ - - sc->sc_time_ms++; - - /* support repetition of keys: */ - - ukbd_interrupt(sc); - - if (!wait) { - break; - } - } + ukbd_do_poll(sc, wait); } if (sc->sc_inputs == 0) { c = -1; @@ -706,7 +711,15 @@ ukbd_probe(device_t dev) if (error) return (ENXIO); + /* + * NOTE: we currently don't support USB mouse and USB keyboard + * on the same USB endpoint. + */ if (hid_is_collection(d_ptr, d_len, + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) { + /* most likely a mouse */ + error = ENXIO; + } else if (hid_is_collection(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) { if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) error = ENXIO; @@ -983,6 +996,14 @@ ukbd_lock(keyboard_t *kbd, int lock) static int ukbd_enable(keyboard_t *kbd) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_enable(kbd); + mtx_unlock(&Giant); + return (retval); + } mtx_assert(&Giant, MA_OWNED); KBD_ACTIVATE(kbd); return (0); @@ -992,6 +1013,14 @@ ukbd_enable(keyboard_t *kbd) static int ukbd_disable(keyboard_t *kbd) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_disable(kbd); + mtx_unlock(&Giant); + return (retval); + } mtx_assert(&Giant, MA_OWNED); KBD_DEACTIVATE(kbd); return (0); @@ -1003,14 +1032,26 @@ ukbd_check(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - if (!mtx_owned(&Giant)) { - return (0); /* XXX */ + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + if (sc->sc_flags & UKBD_FLAG_POLLING) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_check(kbd); + mtx_unlock(&Giant); + return (retval); + } + ukbd_do_poll(sc, 0); + } else { + /* XXX the keyboard layer requires Giant */ + if (!mtx_owned(&Giant)) + return (0); } mtx_assert(&Giant, MA_OWNED); - if (!KBD_IS_ACTIVE(kbd)) { - return (0); - } #ifdef UKBD_EMULATE_ATSCANCODE if (sc->sc_buffered_char[0]) { return (1); @@ -1028,14 +1069,25 @@ ukbd_check_char(keyboard_t *kbd) { struct ukbd_softc *sc = kbd->kb_data; - if (!mtx_owned(&Giant)) { - return (0); /* XXX */ + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + if (sc->sc_flags & UKBD_FLAG_POLLING) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_check_char(kbd); + mtx_unlock(&Giant); + return (retval); + } + } else { + /* XXX the keyboard layer requires Giant */ + if (!mtx_owned(&Giant)) + return (0); } mtx_assert(&Giant, MA_OWNED); - if (!KBD_IS_ACTIVE(kbd)) { - return (0); - } if ((sc->sc_composed_char > 0) && (!(sc->sc_flags & UKBD_FLAG_COMPOSE))) { return (1); @@ -1056,9 +1108,22 @@ ukbd_read(keyboard_t *kbd, int wait) uint32_t scancode; #endif + if (!KBD_IS_ACTIVE(kbd)) + return (-1); - if (!mtx_owned(&Giant)) { - return -1; /* XXX */ + if (sc->sc_flags & UKBD_FLAG_POLLING) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_read(kbd, wait); + mtx_unlock(&Giant); + return (retval); + } + } else { + /* XXX the keyboard layer requires Giant */ + if (!mtx_owned(&Giant)) + return (-1); } mtx_assert(&Giant, MA_OWNED); @@ -1077,9 +1142,9 @@ ukbd_read(keyboard_t *kbd, int wait) /* XXX */ usbcode = ukbd_get_key(sc, (wait == FALSE) ? 0 : 1); - if (!KBD_IS_ACTIVE(kbd) || (usbcode == -1)) { - return -1; - } + if (!KBD_IS_ACTIVE(kbd) || (usbcode == -1)) + return (-1); + ++(kbd->kb_count); #ifdef UKBD_EMULATE_ATSCANCODE @@ -1107,8 +1172,23 @@ ukbd_read_char(keyboard_t *kbd, int wait uint32_t scancode; #endif - if (!mtx_owned(&Giant)) { - return (NOKEY); /* XXX */ + + if (!KBD_IS_ACTIVE(kbd)) + return (NOKEY); + + if (sc->sc_flags & UKBD_FLAG_POLLING) { + if (!mtx_owned(&Giant)) { + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_read_char(kbd, wait); + mtx_unlock(&Giant); + return (retval); + } + } else { + /* XXX the keyboard layer requires Giant */ + if (!mtx_owned(&Giant)) + return (NOKEY); } mtx_assert(&Giant, MA_OWNED); @@ -1485,7 +1565,12 @@ ukbd_poll(keyboard_t *kbd, int on) struct ukbd_softc *sc = kbd->kb_data; if (!mtx_owned(&Giant)) { - return (0); /* XXX */ + /* XXX cludge */ + int retval; + mtx_lock(&Giant); + retval = ukbd_poll(kbd, on); + mtx_unlock(&Giant); + return (retval); } mtx_assert(&Giant, MA_OWNED); Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/usb_controller.h Thu Jul 30 00:14:34 2009 (r195960) @@ -99,6 +99,9 @@ struct usb_bus_methods { void (*set_stall) (struct usb_device *udev, struct usb_xfer *xfer, struct usb_endpoint *ep, uint8_t *did_stall); void (*clear_stall) (struct usb_device *udev, struct usb_endpoint *ep); + /* Optional transfer polling support */ + + void (*xfer_poll) (struct usb_bus *); }; /* Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Thu Jul 30 00:13:09 2009 (r195959) +++ head/sys/dev/usb/usb_transfer.c Thu Jul 30 00:14:34 2009 (r195960) @@ -2853,15 +2853,99 @@ usbd_clear_stall_callback(struct usb_xfe return (1); /* Clear Stall Finished */ } +/*------------------------------------------------------------------------* + * usbd_transfer_poll + * + * The following function gets called from the USB keyboard driver and + * UMASS when the system has paniced. + * + * NOTE: It is currently not possible to resume normal operation on + * the USB controller which has been polled, due to clearing of the + * "up_dsleep" and "up_msleep" flags. + *------------------------------------------------------------------------*/ void usbd_transfer_poll(struct usb_xfer **ppxfer, uint16_t max) { - static uint8_t once = 0; - /* polling is currently not supported */ - if (!once) { - once = 1; - printf("usbd_transfer_poll: USB polling is " - "not supported!\n"); + struct usb_xfer *xfer; + struct usb_xfer_root *xroot; + struct usb_device *udev; + struct usb_proc_msg *pm; + uint16_t n; + uint16_t drop_bus; + uint16_t drop_xfer; + + for (n = 0; n != max; n++) { + /* Extra checks to avoid panic */ + xfer = ppxfer[n]; + if (xfer == NULL) + continue; /* no USB transfer */ + xroot = xfer->xroot; + if (xroot == NULL) + continue; /* no USB root */ + udev = xroot->udev; + if (udev == NULL) + continue; /* no USB device */ + if (udev->bus == NULL) + continue; /* no BUS structure */ + if (udev->bus->methods == NULL) + continue; /* no BUS methods */ + if (udev->bus->methods->xfer_poll == NULL) + continue; /* no poll method */ + + /* make sure that the BUS mutex is not locked */ + drop_bus = 0; + while (mtx_owned(&xroot->udev->bus->bus_mtx)) { + mtx_unlock(&xroot->udev->bus->bus_mtx); + drop_bus++; + } + + /* make sure that the transfer mutex is not locked */ + drop_xfer = 0; + while (mtx_owned(xroot->xfer_mtx)) { + mtx_unlock(xroot->xfer_mtx); + drop_xfer++; + } + + /* Make sure cv_signal() and cv_broadcast() is not called */ + udev->bus->control_xfer_proc.up_dsleep = 0; + udev->bus->control_xfer_proc.up_msleep = 0; + udev->bus->explore_proc.up_dsleep = 0; + udev->bus->explore_proc.up_msleep = 0; + udev->bus->giant_callback_proc.up_dsleep = 0; + udev->bus->giant_callback_proc.up_msleep = 0; + udev->bus->non_giant_callback_proc.up_dsleep = 0; + udev->bus->non_giant_callback_proc.up_msleep = 0; + + /* poll USB hardware */ + (udev->bus->methods->xfer_poll) (udev->bus); + + USB_BUS_LOCK(xroot->bus); + + /* check for clear stall */ + if (udev->default_xfer[1] != NULL) { + + /* poll clear stall start */ + pm = &udev->cs_msg[0].hdr; + (pm->pm_callback) (pm); + /* poll clear stall done thread */ + pm = &udev->default_xfer[1]-> + xroot->done_m[0].hdr; + (pm->pm_callback) (pm); + } + + /* poll done thread */ + pm = &xroot->done_m[0].hdr; + (pm->pm_callback) (pm); + + USB_BUS_UNLOCK(xroot->bus); + + /* restore transfer mutex */ + while (drop_xfer--) + mtx_lock(xroot->xfer_mtx); + + /* restore BUS mutex */ + while (drop_bus--) + mtx_lock(&xroot->udev->bus->bus_mtx); } } From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:14:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA1371065672; Thu, 30 Jul 2009 00:14:56 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7C3E8FC14; Thu, 30 Jul 2009 00:14:56 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0Eu0q086395; Thu, 30 Jul 2009 00:14:56 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0Euos086393; Thu, 30 Jul 2009 00:14:56 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300014.n6U0Euos086393@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195961 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:14:57 -0000 Author: alfred Date: Thu Jul 30 00:14:56 2009 New Revision: 195961 URL: http://svn.freebsd.org/changeset/base/195961 Log: USB audio: - code factoring patch from "Eygene Ryabinkin" - P4 ID: 166149 Submitted by: hps Approved by: re Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Jul 30 00:14:34 2009 (r195960) +++ head/sys/dev/sound/usb/uaudio.c Thu Jul 30 00:14:56 2009 (r195961) @@ -108,6 +108,7 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #define UAUDIO_MINFRAMES 16 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_MINFRAMES_ALIGN(x) ((x) & ~(UAUDIO_MINFRAMES - 1)) #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) @@ -1113,6 +1114,41 @@ done: } } +/* + * The following function sets up data size and block count for the + * next audio transfer. + */ +static void +uaudio_setup_blockcount(struct uaudio_chan *ch, usb_frcount_t max_frames, + uint32_t *total, uint32_t *blockcount) +{ + uint32_t temp; + uint32_t isiz; + + /* allow dynamic sizing of play buffer */ + isiz = ch->intr_size; + + /* allow dynamic sizing of play buffer */ + temp = isiz / ch->bytes_per_frame; + + /* align units */ + temp = UAUDIO_MINFRAMES_ALIGN(temp); + + /* range check - min */ + if (temp == 0) + temp = UAUDIO_MINFRAMES; + + /* range check - max */ + if (temp > max_frames) + temp = max_frames; + + /* store blockcount */ + *blockcount = temp; + + /* compute the total length */ + *total = temp * ch->bytes_per_frame; +} + static void uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -1126,25 +1162,8 @@ uaudio_chan_play_callback(struct usb_xfe usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); - /* allow dynamic sizing of play buffer */ - total = ch->intr_size; - - /* allow dynamic sizing of play buffer */ - blockcount = total / ch->bytes_per_frame; - - /* align units */ - blockcount -= (blockcount % UAUDIO_MINFRAMES); - - /* range check - min */ - if (blockcount == 0) { - blockcount = UAUDIO_MINFRAMES; - } - /* range check - max */ - if (blockcount > usbd_xfer_max_frames(xfer)) { - blockcount = usbd_xfer_max_frames(xfer); - } - /* compute the total length */ - total = blockcount * ch->bytes_per_frame; + uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), + &total, &blockcount); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1221,25 +1240,8 @@ uaudio_chan_record_callback(struct usb_x usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); - /* allow dynamic sizing of play buffer */ - total = ch->intr_size; - - /* allow dynamic sizing of play buffer */ - blockcount = total / ch->bytes_per_frame; - - /* align units */ - blockcount -= (blockcount % UAUDIO_MINFRAMES); - - /* range check - min */ - if (blockcount == 0) { - blockcount = UAUDIO_MINFRAMES; - } - /* range check - max */ - if (blockcount > usbd_xfer_max_frames(xfer)) { - blockcount = usbd_xfer_max_frames(xfer); - } - /* compute the total length */ - total = blockcount * ch->bytes_per_frame; + uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), + &total, &blockcount); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:15:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C5510656C1; Thu, 30 Jul 2009 00:15:17 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAEA8FC14; Thu, 30 Jul 2009 00:15:17 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0FHJo086451; Thu, 30 Jul 2009 00:15:17 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0FHXL086447; Thu, 30 Jul 2009 00:15:17 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300015.n6U0FHXL086447@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195962 - in head: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:15:18 -0000 Author: alfred Date: Thu Jul 30 00:15:17 2009 New Revision: 195962 URL: http://svn.freebsd.org/changeset/base/195962 Log: USB serial: - add new ID for Huawei - P4 ID: 166150 PR: usb/136761 Submitted by: hps Approved by: re Modified: head/share/man/man4/u3g.4 head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Thu Jul 30 00:14:56 2009 (r195961) +++ head/share/man/man4/u3g.4 Thu Jul 30 00:15:17 2009 (r195962) @@ -64,7 +64,7 @@ Vodafone Mobile Connect Card 3G .It Qualcomm Inc. CDMA MSM .It -Huawei B190, E220 ('') +Huawei B190, E180v, E220 ('') .It Novatel U740, MC950D, X950D, etc. .It Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Jul 30 00:14:56 2009 (r195961) +++ head/sys/dev/usb/serial/u3g.c Thu Jul 30 00:15:17 2009 (r195962) @@ -186,6 +186,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), /* OEM: Huawei */ U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), /* OEM: Novatel */ U3G_DEV(NOVATEL, CDMA_MODEM, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jul 30 00:14:56 2009 (r195961) +++ head/sys/dev/usb/usbdevs Thu Jul 30 00:15:17 2009 (r195962) @@ -1115,6 +1115,8 @@ product CYPRESS THERMO 0x0002 thermomet product CYPRESS WISPY1A 0x0bad MetaGeek Wi-Spy product CYPRESS KBDHUB 0x0101 Keyboard/Hub product CYPRESS FMRADIO 0x1002 FM Radio +product CYPRESS IKARILASER 0x121f Ikari Laser SteelSeries ApS + product CYPRESS USBRS232 0x5500 USB-RS232 Interface product CYPRESS SLIM_HUB 0x6560 Slim Hub product CYPRESS XX6830XX 0x6830 PATA Storage Device @@ -1475,6 +1477,7 @@ product HTC SMARTPHONE 0x0a51 SmartPhon /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile product HUAWEI E220 0x1003 Huawei HSDPA modem +product HUAWEI E180V 0x140c Huawei Mobile E180V /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:15:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA3E31065673; Thu, 30 Jul 2009 00:15:50 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75E18FC26; Thu, 30 Jul 2009 00:15:50 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0FoGk086506; Thu, 30 Jul 2009 00:15:50 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0FoxE086498; Thu, 30 Jul 2009 00:15:50 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300015.n6U0FoxE086498@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195963 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:15:51 -0000 Author: alfred Date: Thu Jul 30 00:15:50 2009 New Revision: 195963 URL: http://svn.freebsd.org/changeset/base/195963 Log: USB core: - add support for defragging of written device data. - improve handling of alternate settings in device side mode. - correct return value from usbd_get_no_alts() function. - reported by: HPS - P4 ID: 166156, 166168 - report USB device release information to devd and pnpinfo. - reported by: MIHIRA Sanpei Yoshiro - P4 ID: 166221 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_dev.c Thu Jul 30 00:15:50 2009 (r195963) @@ -740,6 +740,8 @@ usb_fifo_reset(struct usb_fifo *f) break; } } + /* reset have fragment flag */ + f->flag_have_fragment = 0; } /*------------------------------------------------------------------------* @@ -783,6 +785,16 @@ usb_fifo_close(struct usb_fifo *f, int f /* set flushing flag */ f->flag_flushing = 1; + /* get the last packet in */ + if (f->flag_have_fragment) { + struct usb_mbuf *m; + f->flag_have_fragment = 0; + USB_IF_DEQUEUE(&f->free_q, m); + if (m) { + USB_IF_ENQUEUE(&f->used_q, m); + } + } + /* start write transfer, if not already started */ (f->methods->f_start_write) (f); @@ -1303,6 +1315,7 @@ usb_write(struct cdev *dev, struct uio * struct usb_cdev_privdata* cpd; struct usb_fifo *f; struct usb_mbuf *m; + uint8_t *pdata; int fflags; int resid; int io_len; @@ -1373,33 +1386,59 @@ usb_write(struct cdev *dev, struct uio * } tr_data = 1; - USB_MBUF_RESET(m); - - io_len = MIN(m->cur_data_len, uio->uio_resid); - - m->cur_data_len = io_len; + if (f->flag_have_fragment == 0) { + USB_MBUF_RESET(m); + io_len = m->cur_data_len; + pdata = m->cur_data_ptr; + if (io_len > uio->uio_resid) + io_len = uio->uio_resid; + m->cur_data_len = io_len; + } else { + io_len = m->max_data_len - m->cur_data_len; + pdata = m->cur_data_ptr + m->cur_data_len; + if (io_len > uio->uio_resid) + io_len = uio->uio_resid; + m->cur_data_len += io_len; + } DPRINTFN(2, "transfer %d bytes to %p\n", - io_len, m->cur_data_ptr); + io_len, pdata); - err = usb_fifo_uiomove(f, - m->cur_data_ptr, io_len, uio); + err = usb_fifo_uiomove(f, pdata, io_len, uio); if (err) { + f->flag_have_fragment = 0; USB_IF_ENQUEUE(&f->free_q, m); break; } - if (f->methods->f_filter_write) { + + /* check if the buffer is ready to be transmitted */ + + if ((f->flag_write_defrag == 0) || + (m->cur_data_len == m->max_data_len)) { + f->flag_have_fragment = 0; + /* - * Sometimes it is convenient to process data at the - * expense of a userland process instead of a kernel - * process. + * Check for write filter: + * + * Sometimes it is convenient to process data + * at the expense of a userland process + * instead of a kernel process. */ - (f->methods->f_filter_write) (f, m); - } - USB_IF_ENQUEUE(&f->used_q, m); + if (f->methods->f_filter_write) { + (f->methods->f_filter_write) (f, m); + } - (f->methods->f_start_write) (f); + /* Put USB mbuf in the used queue */ + USB_IF_ENQUEUE(&f->used_q, m); + + /* Start writing data, if not already started */ + (f->methods->f_start_write) (f); + } else { + /* Wait for more data or close */ + f->flag_have_fragment = 1; + USB_IF_PREPEND(&f->free_q, m); + } } while (uio->uio_resid > 0); done: @@ -2220,6 +2259,18 @@ usb_fifo_set_close_zlp(struct usb_fifo * f->flag_short = onoff; } +void +usb_fifo_set_write_defrag(struct usb_fifo *f, uint8_t onoff) +{ + if (f == NULL) + return; + + /* defrag written data */ + f->flag_write_defrag = onoff; + /* reset defrag state */ + f->flag_have_fragment = 0; +} + void * usb_fifo_softc(struct usb_fifo *f) { Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_dev.h Thu Jul 30 00:15:50 2009 (r195963) @@ -130,6 +130,8 @@ struct usb_fifo { uint8_t flag_short; /* set if short_ok or force_short * transfer flags should be set */ uint8_t flag_stall; /* set if clear stall should be run */ + uint8_t flag_write_defrag; /* set to defrag written data */ + uint8_t flag_have_fragment; /* set if defragging */ uint8_t iface_index; /* set to the interface we belong to */ uint8_t fifo_index; /* set to the FIFO index in "struct * usb_device" */ @@ -144,11 +146,9 @@ extern struct cdevsw usb_devsw; int usb_fifo_wait(struct usb_fifo *fifo); void usb_fifo_signal(struct usb_fifo *fifo); uint8_t usb_fifo_opened(struct usb_fifo *fifo); -void usb_fifo_free(struct usb_fifo *f); struct usb_symlink *usb_alloc_symlink(const char *target); void usb_free_symlink(struct usb_symlink *ps); int usb_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len); -void usb_fifo_set_close_zlp(struct usb_fifo *, uint8_t); #endif /* _USB_DEV_H_ */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_device.c Thu Jul 30 00:15:50 2009 (r195963) @@ -833,18 +833,13 @@ usbd_set_alt_interface_index(struct usb_ err = USB_ERR_INVAL; goto done; } - if (udev->flags.usb_mode == USB_MODE_DEVICE) { - usb_detach_device(udev, iface_index, - USB_UNCFG_FLAG_FREE_SUBDEV); - } else { - if (iface->alt_index == alt_index) { - /* - * Optimise away duplicate setting of - * alternate setting in USB Host Mode! - */ - err = 0; - goto done; - } + if (iface->alt_index == alt_index) { + /* + * Optimise away duplicate setting of + * alternate setting in USB Host Mode! + */ + err = 0; + goto done; } #if USB_HAVE_UGEN /* @@ -858,6 +853,12 @@ usbd_set_alt_interface_index(struct usb_ if (err) { goto done; } + if (iface->alt_index != alt_index) { + /* the alternate setting does not exist */ + err = USB_ERR_INVAL; + goto done; + } + err = usbd_req_set_alt_interface_no(udev, NULL, iface_index, iface->idesc->bAlternateSetting); @@ -959,7 +960,6 @@ usb_reset_iface_endpoints(struct usb_dev { struct usb_endpoint *ep; struct usb_endpoint *ep_end; - usb_error_t err; ep = udev->endpoints; ep_end = udev->endpoints + udev->endpoints_max; @@ -971,10 +971,7 @@ usb_reset_iface_endpoints(struct usb_dev continue; } /* simulate a clear stall from the peer */ - err = usbd_set_endpoint_stall(udev, ep, 0); - if (err) { - /* just ignore */ - } + usbd_set_endpoint_stall(udev, ep, 0); } return (0); } @@ -1286,6 +1283,7 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceNum = iface->idesc->bInterfaceNumber; uaa.use_generic = 0; + uaa.driver_info = 0; /* reset driver_info */ DPRINTFN(2, "iclass=%u/%u/%u iindex=%u/%u\n", uaa.info.bInterfaceClass, @@ -1302,6 +1300,7 @@ usb_probe_and_attach(struct usb_device * /* try generic interface drivers last */ uaa.use_generic = 1; + uaa.driver_info = 0; /* reset driver_info */ if (usb_probe_and_attach_sub(udev, &uaa)) { /* ignore */ @@ -2334,6 +2333,7 @@ usb_notify_addq(const char *type, struct "devclass=0x%02x " "devsubclass=0x%02x " "sernum=\"%s\" " + "release=0x%04x " "at " "port=%u " "on " @@ -2345,6 +2345,7 @@ usb_notify_addq(const char *type, struct udev->ddesc.bDeviceClass, udev->ddesc.bDeviceSubClass, udev->serial, + UGETW(udev->ddesc.bcdDevice), udev->port_no, udev->parent_hub != NULL ? udev->parent_hub->ugen_name : Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_handle_request.c Thu Jul 30 00:15:50 2009 (r195963) @@ -46,6 +46,7 @@ #include #include +#include #include "usb_if.h" #define USB_DEBUG_VAR usb_debug @@ -181,6 +182,30 @@ done: return (err); } +static usb_error_t +usb_check_alt_setting(struct usb_device *udev, + struct usb_interface *iface, uint8_t alt_index) +{ + uint8_t do_unlock; + usb_error_t err = 0; + + /* automatic locking */ + if (sx_xlocked(udev->default_sx + 1)) { + do_unlock = 0; + } else { + do_unlock = 1; + sx_xlock(udev->default_sx + 1); + } + + if (alt_index >= usbd_get_no_alts(udev->cdesc, iface->idesc)) + err = USB_ERR_INVAL; + + if (do_unlock) { + sx_unlock(udev->default_sx + 1); + } + return (err); +} + /*------------------------------------------------------------------------* * usb_handle_iface_request * @@ -285,42 +310,29 @@ tr_repeat: switch (req.bRequest) { case UR_SET_INTERFACE: /* - * Handle special case. If we have parent interface - * we just reset the endpoints, because this is a - * multi interface device and re-attaching only a - * part of the device is not possible. Also if the - * alternate setting is the same like before we just - * reset the interface endoints. - */ - if ((iface_parent != NULL) || - (iface->alt_index == req.wValue[0])) { - error = usb_reset_iface_endpoints(udev, - iface_index); - if (error) { - DPRINTF("alt setting failed %s\n", - usbd_errstr(error)); - goto tr_stalled; - } - break; - } - /* - * Doing the alternate setting will detach the - * interface aswell: + * We assume that the endpoints are the same + * accross the alternate settings. + * + * Reset the endpoints, because re-attaching + * only a part of the device is not possible. */ - error = usbd_set_alt_interface_index(udev, - iface_index, req.wValue[0]); + error = usb_check_alt_setting(udev, + iface, req.wValue[0]); if (error) { - DPRINTF("alt setting failed %s\n", + DPRINTF("alt setting does not exist %s\n", usbd_errstr(error)); goto tr_stalled; } - error = usb_probe_and_attach(udev, - iface_index); + error = usb_reset_iface_endpoints(udev, iface_index); if (error) { - DPRINTF("alt setting probe failed\n"); + DPRINTF("alt setting failed %s\n", + usbd_errstr(error)); goto tr_stalled; } + /* update the current alternate setting */ + iface->alt_index = req.wValue[0]; break; + default: goto tr_stalled; } Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_hub.c Thu Jul 30 00:15:50 2009 (r195963) @@ -1020,12 +1020,14 @@ uhub_child_pnpinfo_string(device_t paren snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "sernum=\"%s\" " + "release=0x%04x " "intclass=0x%02x intsubclass=0x%02x", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, res.udev->ddesc.bDeviceSubClass, res.udev->serial, + UGETW(res.udev->ddesc.bcdDevice), iface->idesc->bInterfaceClass, iface->idesc->bInterfaceSubClass); } else { Modified: head/sys/dev/usb/usb_parse.c ============================================================================== --- head/sys/dev/usb/usb_parse.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_parse.c Thu Jul 30 00:15:50 2009 (r195963) @@ -215,20 +215,29 @@ usbd_get_no_descriptors(struct usb_confi * usbd_get_no_alts * * Return value: - * Number of alternate settings for the given interface descriptor pointer. + * Number of alternate settings for the given interface descriptor + * pointer. If the USB descriptor is corrupt, the returned value can + * be greater than the actual number of alternate settings. *------------------------------------------------------------------------*/ uint8_t usbd_get_no_alts(struct usb_config_descriptor *cd, struct usb_interface_descriptor *id) { struct usb_descriptor *desc; - uint8_t n = 0; + uint8_t n; uint8_t ifaceno; + /* Reset interface count */ + + n = 0; + + /* Get the interface number */ + ifaceno = id->bInterfaceNumber; - desc = (struct usb_descriptor *)id; + /* Iterate all the USB descriptors */ + desc = NULL; while ((desc = usb_desc_foreach(cd, desc))) { if ((desc->bDescriptorType == UDESC_INTERFACE) && (desc->bLength >= sizeof(*id))) { @@ -237,8 +246,7 @@ usbd_get_no_alts(struct usb_config_descr n++; if (n == 0xFF) break; /* crazy */ - } else - break; /* end */ + } } } return (n); Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Jul 30 00:15:17 2009 (r195962) +++ head/sys/dev/usb/usb_request.c Thu Jul 30 00:15:50 2009 (r195963) @@ -1059,9 +1059,9 @@ usbd_req_get_alt_interface_no(struct usb struct usb_interface *iface = usbd_get_iface(udev, iface_index); struct usb_device_request req; - if ((iface == NULL) || (iface->idesc == NULL)) { + if ((iface == NULL) || (iface->idesc == NULL)) return (USB_ERR_INVAL); - } + req.bmRequestType = UT_READ_INTERFACE; req.bRequest = UR_GET_INTERFACE; USETW(req.wValue, 0); @@ -1085,9 +1085,9 @@ usbd_req_set_alt_interface_no(struct usb struct usb_interface *iface = usbd_get_iface(udev, iface_index); struct usb_device_request req; - if ((iface == NULL) || (iface->idesc == NULL)) { + if ((iface == NULL) || (iface->idesc == NULL)) return (USB_ERR_INVAL); - } + req.bmRequestType = UT_WRITE_INTERFACE; req.bRequest = UR_SET_INTERFACE; req.wValue[0] = alt_no; From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:16:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6971065673; Thu, 30 Jul 2009 00:16:06 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD9948FC26; Thu, 30 Jul 2009 00:16:06 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0G69L086549; Thu, 30 Jul 2009 00:16:06 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0G6H8086547; Thu, 30 Jul 2009 00:16:06 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300016.n6U0G6H8086547@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195964 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:16:07 -0000 Author: alfred Date: Thu Jul 30 00:16:06 2009 New Revision: 195964 URL: http://svn.freebsd.org/changeset/base/195964 Log: ULPT: - add conditional printer status checking - P4 ID: 166176 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/serial/ulpt.c Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Thu Jul 30 00:15:50 2009 (r195963) +++ head/sys/dev/usb/serial/ulpt.c Thu Jul 30 00:16:06 2009 (r195964) @@ -426,6 +426,9 @@ ulpt_open(struct usb_fifo *fifo, int ffl /* we assume that open is a serial process */ if (sc->sc_fflags == 0) { + + /* reset USB paralell port */ + ulpt_reset(sc); } return (unlpt_open(fifo, fflags)); @@ -720,7 +723,12 @@ ulpt_watchdog(void *arg) mtx_assert(&sc->sc_mtx, MA_OWNED); - usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]); + /* + * Only read status while the device is not opened, due to + * possible hardware or firmware bug in some printers. + */ + if (sc->sc_fflags == 0) + usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]); usb_callout_reset(&sc->sc_watchdog, hz, &ulpt_watchdog, sc); From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:16:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD9710656A4; Thu, 30 Jul 2009 00:16:32 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B54B8FC28; Thu, 30 Jul 2009 00:16:32 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0GWi8086594; Thu, 30 Jul 2009 00:16:32 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0GWjh086592; Thu, 30 Jul 2009 00:16:32 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300016.n6U0GWjh086592@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195965 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:16:34 -0000 Author: alfred Date: Thu Jul 30 00:16:32 2009 New Revision: 195965 URL: http://svn.freebsd.org/changeset/base/195965 Log: USB controller: - allow disabling "root_mount_hold()" by setting "hw.usb.no_boot_wait" sysctl Submitted by: hps Approved by: re Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Thu Jul 30 00:16:06 2009 (r195964) +++ head/sys/dev/usb/controller/usb_controller.c Thu Jul 30 00:16:32 2009 (r195965) @@ -79,6 +79,11 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug "Debug level"); #endif +static int usb_no_boot_wait = 0; +TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, + "No device enumerate waiting at boot."); + static uint8_t usb_post_init_called = 0; static devclass_t usb_devclass; @@ -132,8 +137,10 @@ usb_attach(device_t dev) return (ENXIO); } - /* delay vfs_mountroot until the bus is explored */ - bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + if (usb_no_boot_wait == 0) { + /* delay vfs_mountroot until the bus is explored */ + bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + } if (usb_post_init_called) { mtx_lock(&Giant); From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:16:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F3F1065678; Thu, 30 Jul 2009 00:16:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA8A8FC13; Thu, 30 Jul 2009 00:16:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0Gpal086636; Thu, 30 Jul 2009 00:16:51 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0Gp9X086633; Thu, 30 Jul 2009 00:16:51 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300016.n6U0Gp9X086633@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195966 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:16:52 -0000 Author: alfred Date: Thu Jul 30 00:16:50 2009 New Revision: 195966 URL: http://svn.freebsd.org/changeset/base/195966 Log: USB CORE - compat Linux: - Patch request from Tim Borgeaud: - add automatic locking - add refcount for killing URB's Submitted by: hps Approved by: re Modified: head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_compat_linux.h Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Thu Jul 30 00:16:32 2009 (r195965) +++ head/sys/dev/usb/usb_compat_linux.c Thu Jul 30 00:16:50 2009 (r195966) @@ -398,15 +398,32 @@ int usb_submit_urb(struct urb *urb, uint16_t mem_flags) { struct usb_host_endpoint *uhe; + uint8_t do_unlock; + int err; - if (urb == NULL) { + if (urb == NULL) return (-EINVAL); - } - mtx_assert(&Giant, MA_OWNED); + + do_unlock = mtx_owned(&Giant) ? 0 : 1; + if (do_unlock) + mtx_lock(&Giant); if (urb->endpoint == NULL) { - return (-EINVAL); + err = -EINVAL; + goto done; } + + /* + * Check to see if the urb is in the process of being killed + * and stop a urb that is in the process of being killed from + * being re-submitted (e.g. from its completion callback + * function). + */ + if (urb->kill_count != 0) { + err = -EPERM; + goto done; + } + uhe = urb->endpoint; /* @@ -424,12 +441,16 @@ usb_submit_urb(struct urb *urb, uint16_t usbd_transfer_start(uhe->bsd_xfer[0]); usbd_transfer_start(uhe->bsd_xfer[1]); + err = 0; } else { /* no pipes have been setup yet! */ urb->status = -EINVAL; - return (-EINVAL); + err = -EINVAL; } - return (0); +done: + if (do_unlock) + mtx_unlock(&Giant); + return (err); } /*------------------------------------------------------------------------* @@ -448,9 +469,11 @@ static void usb_unlink_bsd(struct usb_xfer *xfer, struct urb *urb, uint8_t drain) { - if (xfer && - usbd_transfer_pending(xfer) && - (xfer->priv_fifo == (void *)urb)) { + if (xfer == NULL) + return; + if (!usbd_transfer_pending(xfer)) + return; + if (xfer->priv_fifo == (void *)urb) { if (drain) { mtx_unlock(&Giant); usbd_transfer_drain(xfer); @@ -467,14 +490,21 @@ usb_unlink_urb_sub(struct urb *urb, uint { struct usb_host_endpoint *uhe; uint16_t x; + uint8_t do_unlock; + int err; - if (urb == NULL) { + if (urb == NULL) return (-EINVAL); - } - mtx_assert(&Giant, MA_OWNED); + + do_unlock = mtx_owned(&Giant) ? 0 : 1; + if (do_unlock) + mtx_lock(&Giant); + if (drain) + urb->kill_count++; if (urb->endpoint == NULL) { - return (-EINVAL); + err = -EINVAL; + goto done; } uhe = urb->endpoint; @@ -504,7 +534,13 @@ usb_unlink_urb_sub(struct urb *urb, uint usb_unlink_bsd(uhe->bsd_xfer[0], urb, drain); usb_unlink_bsd(uhe->bsd_xfer[1], urb, drain); } - return (0); + err = 0; +done: + if (drain) + urb->kill_count--; + if (do_unlock) + mtx_unlock(&Giant); + return (err); } /*------------------------------------------------------------------------* @@ -555,6 +591,7 @@ static int usb_start_wait_urb(struct urb *urb, usb_timeout_t timeout, uint16_t *p_actlen) { int err; + uint8_t do_unlock; /* you must have a timeout! */ if (timeout == 0) { @@ -565,6 +602,9 @@ usb_start_wait_urb(struct urb *urb, usb_ urb->transfer_flags |= URB_WAIT_WAKEUP; urb->transfer_flags &= ~URB_IS_SLEEPING; + do_unlock = mtx_owned(&Giant) ? 0 : 1; + if (do_unlock) + mtx_lock(&Giant); err = usb_submit_urb(urb, 0); if (err) goto done; @@ -582,6 +622,8 @@ usb_start_wait_urb(struct urb *urb, usb_ err = urb->status; done: + if (do_unlock) + mtx_unlock(&Giant); if (err) { *p_actlen = 0; } else { @@ -638,7 +680,7 @@ usb_control_msg(struct usb_device *dev, * transfers on control endpoint zero: */ err = usbd_do_request_flags(dev, - &Giant, &req, data, USB_SHORT_XFER_OK, + NULL, &req, data, USB_SHORT_XFER_OK, &actlen, timeout); if (err) { err = -EPIPE; @@ -1216,9 +1258,7 @@ usb_init_urb(struct urb *urb) void usb_kill_urb(struct urb *urb) { - if (usb_unlink_urb_sub(urb, 1)) { - /* ignore */ - } + usb_unlink_urb_sub(urb, 1); } /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/usb_compat_linux.h ============================================================================== --- head/sys/dev/usb/usb_compat_linux.h Thu Jul 30 00:16:32 2009 (r195965) +++ head/sys/dev/usb/usb_compat_linux.h Thu Jul 30 00:16:50 2009 (r195966) @@ -262,6 +262,7 @@ struct urb { uint8_t setup_dma; /* (in) not used on FreeBSD */ uint8_t transfer_dma; /* (in) not used on FreeBSD */ uint8_t bsd_isread; + uint8_t kill_count; /* FreeBSD specific */ struct usb_iso_packet_descriptor iso_frame_desc[]; /* (in) ISO ONLY */ }; From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:17:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70771065710; Thu, 30 Jul 2009 00:17:08 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AC4F8FC19; Thu, 30 Jul 2009 00:17:08 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0H8Ig086682; Thu, 30 Jul 2009 00:17:08 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0H8ZZ086680; Thu, 30 Jul 2009 00:17:08 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300017.n6U0H8ZZ086680@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195967 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:17:09 -0000 Author: alfred Date: Thu Jul 30 00:17:08 2009 New Revision: 195967 URL: http://svn.freebsd.org/changeset/base/195967 Log: USB CORE - Improve HID parsing See PR description for more info. Patch is implemented differently than suggested, but having the same result. PR: usb/137188 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/usb_hid.c Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Thu Jul 30 00:16:50 2009 (r195966) +++ head/sys/dev/usb/usb_hid.c Thu Jul 30 00:17:08 2009 (r195967) @@ -78,11 +78,19 @@ static uint8_t hid_get_byte(struct hid_d #define MAXUSAGE 64 #define MAXPUSH 4 +#define MAXID 16 + +struct hid_pos_data { + int32_t rid; + uint32_t pos; +}; + struct hid_data { const uint8_t *start; const uint8_t *end; const uint8_t *p; struct hid_item cur[MAXPUSH]; + struct hid_pos_data last_pos[MAXID]; int32_t usages_min[MAXUSAGE]; int32_t usages_max[MAXUSAGE]; int32_t usage_last; /* last seen usage */ @@ -119,6 +127,58 @@ hid_clear_local(struct hid_item *c) c->set_delimiter = 0; } +static void +hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) +{ + uint8_t i; + + /* check for same report ID - optimise */ + + if (c->report_ID == next_rID) + return; + + /* save current position for current rID */ + + if (c->report_ID == 0) { + i = 0; + } else { + for (i = 1; i != MAXID; i++) { + if (s->last_pos[i].rid == c->report_ID) + break; + if (s->last_pos[i].rid == 0) + break; + } + } + if (i != MAXID) { + s->last_pos[i].rid = c->report_ID; + s->last_pos[i].pos = c->loc.pos; + } + + /* store next report ID */ + + c->report_ID = next_rID; + + /* lookup last position for next rID */ + + if (next_rID == 0) { + i = 0; + } else { + for (i = 1; i != MAXID; i++) { + if (s->last_pos[i].rid == next_rID) + break; + if (s->last_pos[i].rid == 0) + break; + } + } + if (i != MAXID) { + s->last_pos[i].rid = next_rID; + c->loc.pos = s->last_pos[i].pos; + } else { + DPRINTF("Out of RID entries, position is set to zero!\n"); + c->loc.pos = 0; + } +} + /*------------------------------------------------------------------------* * hid_start_parse *------------------------------------------------------------------------*/ @@ -373,9 +433,7 @@ hid_get_item(struct hid_data *s, struct s->loc_size = dval & mask; break; case 8: - c->report_ID = dval; - /* new report - reset position */ - c->loc.pos = 0; + hid_switch_rid(s, c, dval); break; case 9: /* mask because value is unsigned */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:36:06 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB47F106564A; Thu, 30 Jul 2009 00:36:06 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0DD8FC1D; Thu, 30 Jul 2009 00:36:06 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 5FB625C026; Thu, 30 Jul 2009 08:36:05 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 32F8E55CD7D4; Thu, 30 Jul 2009 08:36:05 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id XDOj5oPW-KHg; Thu, 30 Jul 2009 08:35:11 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id CD9B955CD990; Thu, 30 Jul 2009 08:35:04 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=NFMIfEvWcPNoIVWWCkFe/YoFEpWWwNUAOkC3Fm8lhY/hde2lZKZL08os9iaaNw1wT V+xlL/tivybPrywApl3eg== Message-ID: <4A70EAA6.1080301@delphij.net> Date: Wed, 29 Jul 2009 17:34:46 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: Qing Li References: <200907281716.n6SHGtGC038664@svn.freebsd.org> In-Reply-To: <200907281716.n6SHGtGC038664@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r195921 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:36:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for taking time analyzing the problem, and thanks bz@ for pointing out the problem with my original patch! Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkpw6qYACgkQi+vbBBjt66A2IwCghPngwzEXFPsPH5bVKAmQPDBI ivIAn20xft94vv3NxUtFtc36z0pHmrnT =StDa -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 00:57:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F22BB106564A; Thu, 30 Jul 2009 00:57:54 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E02278FC0C; Thu, 30 Jul 2009 00:57:54 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U0vs4N087551; Thu, 30 Jul 2009 00:57:54 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U0vsGu087549; Thu, 30 Jul 2009 00:57:54 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200907300057.n6U0vsGu087549@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 30 Jul 2009 00:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195968 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 00:57:55 -0000 Author: alfred Date: Thu Jul 30 00:57:54 2009 New Revision: 195968 URL: http://svn.freebsd.org/changeset/base/195968 Log: Missed this file for r195963: USB core: - add support for defragging of written device data. - improve handling of alternate settings in device side mode. - correct return value from usbd_get_no_alts() function. - reported by: HPS - P4 ID: 166156, 166168 - report USB device release information to devd and pnpinfo. - reported by: MIHIRA Sanpei Yoshiro - P4 ID: 166221 Submitted by: hps Approved by: re Modified: head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Jul 30 00:17:08 2009 (r195967) +++ head/sys/dev/usb/usbdi.h Thu Jul 30 00:57:54 2009 (r195968) @@ -531,5 +531,8 @@ void usb_fifo_reset(struct usb_fifo *f); void usb_fifo_wakeup(struct usb_fifo *f); void usb_fifo_get_data_error(struct usb_fifo *fifo); void *usb_fifo_softc(struct usb_fifo *fifo); +void usb_fifo_set_close_zlp(struct usb_fifo *, uint8_t); +void usb_fifo_set_write_defrag(struct usb_fifo *, uint8_t); +void usb_fifo_free(struct usb_fifo *f); #endif /* _KERNEL */ #endif /* _USB_USBDI_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 05:36:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26BDD106564A; Thu, 30 Jul 2009 05:36:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 141B98FC16; Thu, 30 Jul 2009 05:36:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U5aVaD093285; Thu, 30 Jul 2009 05:36:31 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U5aVrM093284; Thu, 30 Jul 2009 05:36:31 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907300536.n6U5aVrM093284@svn.freebsd.org> From: Jamie Gritton Date: Thu, 30 Jul 2009 05:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195969 - stable/7/usr.sbin/jexec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 05:36:32 -0000 Author: jamie Date: Thu Jul 30 05:36:31 2009 New Revision: 195969 URL: http://svn.freebsd.org/changeset/base/195969 Log: Preset errno to zero before calling strtol(), so the check afterwards will be valid. This is required since the malloc call from r195859 leaves errno in an unknown state. For STABLE-7 only, as CURRENT doesn't make this strtol call. Reported by: Michael Butler Approved by: bz (mentor) Modified: stable/7/usr.sbin/jexec/jexec.c Modified: stable/7/usr.sbin/jexec/jexec.c ============================================================================== --- stable/7/usr.sbin/jexec/jexec.c Thu Jul 30 00:57:54 2009 (r195968) +++ stable/7/usr.sbin/jexec/jexec.c Thu Jul 30 05:36:31 2009 (r195969) @@ -248,6 +248,7 @@ main(int argc, char *argv[]) if (argc < 2) usage(); if (strlen(argv[0]) > 0) { + errno = 0; jid = (int)strtol(argv[0], NULL, 10); if (errno) err(1, "Unable to parse jail ID."); From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 08:41:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8D71065672; Thu, 30 Jul 2009 08:41:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65DA8FC3A; Thu, 30 Jul 2009 08:41:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U8f6gX097017; Thu, 30 Jul 2009 08:41:06 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U8f6EL097015; Thu, 30 Jul 2009 08:41:06 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907300841.n6U8f6EL097015@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Jul 2009 08:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195970 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 08:41:08 -0000 Author: rwatson Date: Thu Jul 30 08:41:06 2009 New Revision: 195970 URL: http://svn.freebsd.org/changeset/base/195970 Log: Add two new privileges for use by OpenAFS, which will be supported for FreeBSD 8.x. MFC after: 3 days Submitted by: Benjamin Kaduk Approved by: re (kib) Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Thu Jul 30 05:36:31 2009 (r195969) +++ head/sys/sys/priv.h Thu Jul 30 08:41:06 2009 (r195970) @@ -476,9 +476,15 @@ #define PRIV_C4B_TRACE 651 /* Unrestricted CAPI message tracing. */ /* + * OpenAFS privileges. + */ +#define PRIV_AFS_ADMIN 660 /* Can change AFS client settings. */ +#define PRIV_AFS_DAEMON 661 /* Can become the AFS daemon. */ + +/* * Track end of privilege list. */ -#define _PRIV_HIGHEST 652 +#define _PRIV_HIGHEST 662 /* * Validate that a named privilege is known by the privilege system. Invalid From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 09:51:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7176106564A; Thu, 30 Jul 2009 09:51:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 952308FC15; Thu, 30 Jul 2009 09:51:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6U9p4mQ098395; Thu, 30 Jul 2009 09:51:04 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6U9p46a098393; Thu, 30 Jul 2009 09:51:04 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907300951.n6U9p46a098393@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Jul 2009 09:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195971 - head/usr.sbin/getpmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 09:51:05 -0000 Author: rwatson Date: Thu Jul 30 09:51:04 2009 New Revision: 195971 URL: http://svn.freebsd.org/changeset/base/195971 Log: Style tweak. Approved by: re (kib) MFC after: 3 days Modified: head/usr.sbin/getpmac/getpmac.c Modified: head/usr.sbin/getpmac/getpmac.c ============================================================================== --- head/usr.sbin/getpmac/getpmac.c Thu Jul 30 08:41:06 2009 (r195970) +++ head/usr.sbin/getpmac/getpmac.c Thu Jul 30 09:51:04 2009 (r195971) @@ -103,8 +103,7 @@ main(int argc, char *argv[]) error = mac_get_pid(pid, label); if (error) perror("mac_get_pid"); - } - else { + } else { error = mac_get_proc(label); if (error) perror("mac_get_proc"); From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 10:11:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F3E01065673; Thu, 30 Jul 2009 10:11:15 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3458FC12; Thu, 30 Jul 2009 10:11:14 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2D72B.dip.t-dialin.net [217.226.215.43]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 3E84C84435F; Thu, 30 Jul 2009 11:54:16 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id CB66D247025; Thu, 30 Jul 2009 11:54:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1248947652; bh=sw1g39NQcOogiBTmenhCJrtGJOvoBQtY+2ypD/XXrbQ=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=XK7wATu45rS4vJ+nmus5YSSk1K2GMPUwpV1BuQ9R+xixUhGDidutj6JPNtRyBb/kU 5W/UmcrBHnFxcDee4PDUioOa18gLtvIycRnyQAnjqMCD+4bpNSNPcOGY78vTZuUcKK 022pxOtTHkhz8JWgvGDc+4noNoWDGbx6y7Ukf8xFd6/PFaXUr0AhbUWMbBlHWeQ9Bq SdODajmNFBf11fP6FVBa8ENpFlAnLfgDkD2oNP4H+85oCyeP3X4hBF6k12nwUC48SZ krBio3WoaJL6OFajkCs+fmjuZkUSKZD3AIQ+4YnJrMY+KZlG0FEn0E98fpm3DVMsW1 o+OgYSW4kYBWQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n6U9sB9h012734; Thu, 30 Jul 2009 11:54:11 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 30 Jul 2009 11:54:11 +0200 Message-ID: <20090730115411.14014mob2x7q8dus@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 30 Jul 2009 11:54:11 +0200 From: Alexander Leidinger To: Jamie Gritton References: <200907291641.n6TGf2mb076622@svn.freebsd.org> <4A707DF5.5050108@errno.com> <4A70813A.6020502@FreeBSD.org> <20090729181634.E245@maildrop.int.zabbadoz.net> In-Reply-To: <20090729181634.E245@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 3E84C84435F.723AB X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.286, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08, TW_TV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1249552457.01095@Q8OiaR0f00nJeDLPOd096A X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, Sam Leffler , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r195944 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 10:11:16 -0000 Quoting "Bjoern A. Zeeb" (from Wed, 29 Jul 2009 18:24:02 +0000 (UTC)): > this. In case you know anything that doesn't work as expected, now > would be a good time to tell us. Jamie, is the default for statvfs back to what is was before now? Bye, Alexander. -- A yawn is a silent shout. -- G. K. Chesterton http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 12:41:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99E31106567A; Thu, 30 Jul 2009 12:41:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86B138FC1F; Thu, 30 Jul 2009 12:41:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UCfJ33013947; Thu, 30 Jul 2009 12:41:19 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6UCfJbK013946; Thu, 30 Jul 2009 12:41:19 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200907301241.n6UCfJbK013946@svn.freebsd.org> From: Robert Watson Date: Thu, 30 Jul 2009 12:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195972 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 12:41:20 -0000 Author: rwatson Date: Thu Jul 30 12:41:19 2009 New Revision: 195972 URL: http://svn.freebsd.org/changeset/base/195972 Log: Reorder and recomment vnet.c and vnet.h on the basis that they are no longer solely about the virtual network stack memory allocator. Approved by: re (vimage blanket) Modified: head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Thu Jul 30 09:51:04 2009 (r195971) +++ head/sys/net/vnet.c Thu Jul 30 12:41:19 2009 (r195972) @@ -43,11 +43,20 @@ __FBSDID("$FreeBSD$"); #include /*- - * This is the virtual network stack allocator, which provides storage for - * virtualized global variables. These variables are defined/declared using - * the VNET_DEFINE()/VNET_DECLARE() macros, which place them in the - * 'set_vnet' linker set. The details of the implementation are somewhat - * subtle, but allow the majority of most network subsystems to maintain + * This file implements core functions for virtual network stacks: + * + * - Virtual network stack memory allocator, which virtualized global + * variables in the network stack + * + * - Virtualized SYSINIT's/SYSUNINIT's, which allow network stack subsystems + * to register startup/shutdown events to be run for each virtual network + * stack instance. + * + * The virtual network stack allocator provides storage for virtualized + * global variables. These variables are defined/declared using the + * VNET_DEFINE()/VNET_DECLARE() macros, which place them in the 'set_vnet' + * linker set. The details of the implementation are somewhat subtle, but + * allow the majority of most network subsystems to maintain * virtualization-agnostic. * * The virtual network stack allocator handles variables in the base kernel Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Thu Jul 30 09:51:04 2009 (r195971) +++ head/sys/net/vnet.h Thu Jul 30 12:41:19 2009 (r195972) @@ -27,66 +27,36 @@ * $FreeBSD$ */ -/* - * This header file defines two sets of interfaces supporting virtualized - * network stacks: a virtual network stack memory allocator, which provides - * support for virtualized global variables via a special linker set, - * set_vnet, and virtualized sysinits/sysuninits, which allow constructors - * and destructors to be run for each network stack subsystem as virtual - * instances are created and destroyed. If VIMAGE isn't compiled into the - * kernel, virtualized global variables compile to normal global variables, - * and virtualized sysinits to regular sysinits. +/*- + * This header file defines several sets of interfaces supporting virtualized + * network stacks: + * + * - A virtual network stack memory allocator, which provides support for + * virtualized global variables via a special linker set, set_vnet. + * + * - Virtualized sysinits/sysuninits, which allow constructors and + * destructors to be run for each network stack subsystem as virtual + * instances are created and destroyed. + * + * If VIMAGE isn't compiled into the kernel, virtualized global variables + * compile to normal global variables, and virtualized sysinits to regular + * sysinits. */ #ifndef _NET_VNET_H_ #define _NET_VNET_H_ +/* + * Virtual network stack memory allocator, which allows global variables to + * be automatically instantiated for each network stack instance. + */ #if defined(_KERNEL) || defined(_WANT_VNET) - #define VNET_SETNAME "set_vnet" #define VNET_SYMPREFIX "vnet_entry_" - #endif #ifdef _KERNEL #ifdef VIMAGE -#include - -/* - * SYSINIT/SYSUNINIT variants that provide per-vnet constructors and - * destructors. - */ -struct vnet_sysinit { - enum sysinit_sub_id subsystem; - enum sysinit_elem_order order; - sysinit_cfunc_t func; - const void *arg; - TAILQ_ENTRY(vnet_sysinit) link; -}; - -#define VNET_SYSINIT(ident, subsystem, order, func, arg) \ - static struct vnet_sysinit ident ## _vnet_init = { \ - subsystem, \ - order, \ - (sysinit_cfunc_t)(sysinit_nfunc_t)func, \ - (arg) \ - }; \ - SYSINIT(vnet_init_ ## ident, subsystem, order, \ - vnet_register_sysinit, &ident ## _vnet_init); \ - SYSUNINIT(vnet_init_ ## ident, subsystem, order, \ - vnet_deregister_sysinit, &ident ## _vnet_init) - -#define VNET_SYSUNINIT(ident, subsystem, order, func, arg) \ - static struct vnet_sysinit ident ## _vnet_uninit = { \ - subsystem, \ - order, \ - (sysinit_cfunc_t)(sysinit_nfunc_t)func, \ - (arg) \ - }; \ - SYSINIT(vnet_uninit_ ## ident, subsystem, order, \ - vnet_register_sysuninit, &ident ## _vnet_uninit); \ - SYSUNINIT(vnet_uninit_ ## ident, subsystem, order, \ - vnet_deregister_sysuninit, &ident ## _vnet_uninit) #if defined(__arm__) __asm__(".section " VNET_SETNAME ", \"aw\", %progbits"); @@ -113,6 +83,20 @@ __asm__(".previous"); #define VNET(n) VNET_VNET(curvnet, n) /* + * Virtual network stack allocator interfaces from the kernel linker. + */ +void *vnet_data_alloc(int size); +void vnet_data_copy(void *start, int size); +void vnet_data_free(void *start_arg, int size); + +/* + * Virtual network stack allocator interfaces for vnet setup/teardown. + */ +struct vnet; +void vnet_data_init(struct vnet *vnet); +void vnet_data_destroy(struct vnet *vnet); + +/* * Sysctl variants for vnet-virtualized global variables. Include * to expose these definitions. * @@ -150,18 +134,51 @@ int vnet_sysctl_handle_uint(SYSCTL_HANDL #endif /* SYSCTL_OID */ /* - * Interfaces from the kernel linker. + * Virtual sysinit mechanism, allowing network stack components to declare + * startup and shutdown methods to be run when virtual network stack + * instances are created and destroyed. */ -void *vnet_data_alloc(int size); -void vnet_data_copy(void *start, int size); -void vnet_data_free(void *start_arg, int size); +#include + +/* + * SYSINIT/SYSUNINIT variants that provide per-vnet constructors and + * destructors. + */ +struct vnet_sysinit { + enum sysinit_sub_id subsystem; + enum sysinit_elem_order order; + sysinit_cfunc_t func; + const void *arg; + TAILQ_ENTRY(vnet_sysinit) link; +}; + +#define VNET_SYSINIT(ident, subsystem, order, func, arg) \ + static struct vnet_sysinit ident ## _vnet_init = { \ + subsystem, \ + order, \ + (sysinit_cfunc_t)(sysinit_nfunc_t)func, \ + (arg) \ + }; \ + SYSINIT(vnet_init_ ## ident, subsystem, order, \ + vnet_register_sysinit, &ident ## _vnet_init); \ + SYSUNINIT(vnet_init_ ## ident, subsystem, order, \ + vnet_deregister_sysinit, &ident ## _vnet_init) + +#define VNET_SYSUNINIT(ident, subsystem, order, func, arg) \ + static struct vnet_sysinit ident ## _vnet_uninit = { \ + subsystem, \ + order, \ + (sysinit_cfunc_t)(sysinit_nfunc_t)func, \ + (arg) \ + }; \ + SYSINIT(vnet_uninit_ ## ident, subsystem, order, \ + vnet_register_sysuninit, &ident ## _vnet_uninit); \ + SYSUNINIT(vnet_uninit_ ## ident, subsystem, order, \ + vnet_deregister_sysuninit, &ident ## _vnet_uninit) /* - * Interfaces for vnet setup/teardown. + * Run per-vnet sysinits or sysuninits during vnet creation/destruction. */ -struct vnet; -void vnet_data_init(struct vnet *vnet); -void vnet_data_destroy(struct vnet *vnet); void vnet_sysinit(void); void vnet_sysuninit(void); @@ -183,11 +200,20 @@ void vnet_deregister_sysuninit(void *arg #define VNET_DECLARE(t, n) extern t n #define VNET_DEFINE(t, n) t n #define _VNET_PTR(b, n) &VNET_NAME(n) -#define VNET_SYSINIT(ident, subsystem, order, func, arg) \ - SYSINIT(ident, subsystem, order, func, arg) -#define VNET_SYSUNINIT(ident, subsystem, order, func, arg) \ - SYSUNINIT(ident, subsystem, order, func, arg) +/* + * Virtualized global variable accessor macros. + */ +#define VNET_VNET_PTR(vnet, n) (&(n)) +#define VNET_VNET(vnet, n) (n) + +#define VNET_PTR(n) (&(n)) +#define VNET(n) (n) + +/* + * When VIMAGE isn't compiled into the kernel, virtaulized SYSCTLs simply + * become normal SYSCTLs. + */ #ifdef SYSCTL_OID #define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) @@ -205,16 +231,15 @@ void vnet_deregister_sysuninit(void *arg #endif /* SYSCTL_OID */ /* - * Virtualized global variable accessor macros. + * When VIMAGE isn't compiled into the kernel, VNET_SYSINIT/VNET_SYSUNINIT + * map into normal sysinits, which have the same ordering properties. */ -#define VNET_VNET_PTR(vnet, n) (&(n)) -#define VNET_VNET(vnet, n) (n) - -#define VNET_PTR(n) (&(n)) -#define VNET(n) (n) +#define VNET_SYSINIT(ident, subsystem, order, func, arg) \ + SYSINIT(ident, subsystem, order, func, arg) +#define VNET_SYSUNINIT(ident, subsystem, order, func, arg) \ + SYSUNINIT(ident, subsystem, order, func, arg) #endif /* VIMAGE */ - #endif /* _KERNEL */ #endif /* !_NET_VNET_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 13:19:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665951065670; Thu, 30 Jul 2009 13:19:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E3598FC0A; Thu, 30 Jul 2009 13:19:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UDJCYC014745; Thu, 30 Jul 2009 13:19:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6UDJC6B014743; Thu, 30 Jul 2009 13:19:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907301319.n6UDJC6B014743@svn.freebsd.org> From: Alexander Motin Date: Thu, 30 Jul 2009 13:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195973 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 13:19:14 -0000 Author: mav Date: Thu Jul 30 13:19:12 2009 New Revision: 195973 URL: http://svn.freebsd.org/changeset/base/195973 Log: MFC rev. 195724: Limit IOCATAREQUEST ioctl data size to controller's maximum I/O size. It fixes kernel panic when requested size is too large (0xffffffff). PR: kern/136726 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/ata-all.c Modified: stable/7/sys/dev/ata/ata-all.c ============================================================================== --- stable/7/sys/dev/ata/ata-all.c Thu Jul 30 12:41:19 2009 (r195972) +++ stable/7/sys/dev/ata/ata-all.c Thu Jul 30 13:19:12 2009 (r195973) @@ -440,6 +440,7 @@ int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) { struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_ioc_request *ioc_request = (struct ata_ioc_request *)data; struct ata_params *params = (struct ata_params *)data; int *mode = (int *)data; @@ -449,6 +450,10 @@ ata_device_ioctl(device_t dev, u_long cm switch (cmd) { case IOCATAREQUEST: + if (ioc_request->count > + (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) { + return (EFBIG); + } if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) { return ENOMEM; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 14:28:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A948106564A; Thu, 30 Jul 2009 14:28:57 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0807B8FC0C; Thu, 30 Jul 2009 14:28:57 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UESvBX016144; Thu, 30 Jul 2009 14:28:57 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6UESuc3016142; Thu, 30 Jul 2009 14:28:56 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907301428.n6UESuc3016142@svn.freebsd.org> From: Jamie Gritton Date: Thu, 30 Jul 2009 14:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195974 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 14:28:57 -0000 Author: jamie Date: Thu Jul 30 14:28:56 2009 New Revision: 195974 URL: http://svn.freebsd.org/changeset/base/195974 Log: Remove a LOR, where the the sleepable allprison_lock was being obtained in prison_equal_ip4/6 while an inp mutex was held. Locking allprison_lock can be avoided by making a restriction on the IP addresses associated with jails: Don't allow the "ip4" and "ip6" parameters to be changed after a jail is created. Setting the "ip4.addr" and "ip6.addr" parameters is allowed, but only if the jail was already created with either ip4/6=new or ip4/6=disable. With this restriction, the prison flags in question (PR_IP4_USER and PR_IP6_USER) become read-only and can be checked without locking. This also allows the simplification of a messy code path that was needed to handle an existing prison gaining an IP address list. PR: kern/136899 Reported by: Dirk Meyer Approved by: re (kib), bz (mentor) Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Jul 30 13:19:12 2009 (r195973) +++ head/sys/kern/kern_jail.c Thu Jul 30 14:28:56 2009 (r195974) @@ -484,10 +484,10 @@ kern_jail_set(struct thread *td, struct int ii, ij; #endif #ifdef INET - int ip4s, ip4a, redo_ip4; + int ip4s, redo_ip4; #endif #ifdef INET6 - int ip6s, ip6a, redo_ip6; + int ip6s, redo_ip6; #endif unsigned pr_flags, ch_flags; unsigned pr_allow, ch_allow, tallow; @@ -518,17 +518,12 @@ kern_jail_set(struct thread *td, struct if (error) return (error); #ifdef INET - ip4a = 0; ip4 = NULL; #endif #ifdef INET6 - ip6a = 0; ip6 = NULL; #endif -#if defined(INET) || defined(INET6) - again: -#endif error = vfs_copyopt(opts, "jid", &jid, sizeof(jid)); if (error == ENOENT) jid = 0; @@ -610,6 +605,20 @@ kern_jail_set(struct thread *td, struct goto done_errmsg; } #endif +#ifdef INET + if ((flags & JAIL_UPDATE) && (ch_flags & PR_IP4_USER)) { + error = EINVAL; + vfs_opterror(opts, "ip4 cannot be changed after creation"); + goto done_errmsg; + } +#endif +#ifdef INET6 + if ((flags & JAIL_UPDATE) && (ch_flags & PR_IP6_USER)) { + error = EINVAL; + vfs_opterror(opts, "ip6 cannot be changed after creation"); + goto done_errmsg; + } +#endif pr_allow = ch_allow = 0; for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); @@ -708,7 +717,6 @@ kern_jail_set(struct thread *td, struct pr_flags |= PR_HOST; } - /* This might be the second time around for this option. */ #ifdef INET error = vfs_getopt(opts, "ip4.addr", &op, &ip4s); if (error == ENOENT) @@ -730,14 +738,7 @@ kern_jail_set(struct thread *td, struct vfs_opterror(opts, "too many IPv4 addresses"); goto done_errmsg; } - if (ip4a < ip4s) { - ip4a = ip4s; - free(ip4, M_PRISON); - ip4 = NULL; - } - if (ip4 == NULL) - ip4 = malloc(ip4a * sizeof(*ip4), M_PRISON, - M_WAITOK); + ip4 = malloc(ip4s * sizeof(*ip4), M_PRISON, M_WAITOK); bcopy(op, ip4, ip4s * sizeof(*ip4)); /* * IP addresses are all sorted but ip[0] to preserve @@ -793,14 +794,7 @@ kern_jail_set(struct thread *td, struct vfs_opterror(opts, "too many IPv6 addresses"); goto done_errmsg; } - if (ip6a < ip6s) { - ip6a = ip6s; - free(ip6, M_PRISON); - ip6 = NULL; - } - if (ip6 == NULL) - ip6 = malloc(ip6a * sizeof(*ip6), M_PRISON, - M_WAITOK); + ip6 = malloc(ip6s * sizeof(*ip6), M_PRISON, M_WAITOK); bcopy(op, ip6, ip6s * sizeof(*ip6)); if (ip6s > 1) qsort(ip6 + 1, ip6s - 1, sizeof(*ip6), qcmp_v6); @@ -1152,10 +1146,36 @@ kern_jail_set(struct thread *td, struct #endif { #ifdef INET - pr->pr_flags |= PR_IP4 | PR_IP4_USER | PR_IP4_DISABLE; + if (!(ch_flags & PR_IP4_USER)) + pr->pr_flags |= + PR_IP4 | PR_IP4_USER | PR_IP4_DISABLE; + else if (!(pr_flags & PR_IP4_USER)) { + pr->pr_flags |= ppr->pr_flags & PR_IP4; + if (ppr->pr_ip4 != NULL) { + pr->pr_ip4s = ppr->pr_ip4s; + pr->pr_ip4 = malloc(pr->pr_ip4s * + sizeof(struct in_addr), M_PRISON, + M_WAITOK); + bcopy(ppr->pr_ip4, pr->pr_ip4, + pr->pr_ip4s * sizeof(*pr->pr_ip4)); + } + } #endif #ifdef INET6 - pr->pr_flags |= PR_IP6 | PR_IP6_USER | PR_IP6_DISABLE; + if (!(ch_flags & PR_IP6_USER)) + pr->pr_flags |= + PR_IP6 | PR_IP6_USER | PR_IP6_DISABLE; + else if (!(pr_flags & PR_IP6_USER)) { + pr->pr_flags |= ppr->pr_flags & PR_IP6; + if (ppr->pr_ip6 != NULL) { + pr->pr_ip6s = ppr->pr_ip6s; + pr->pr_ip6 = malloc(pr->pr_ip6s * + sizeof(struct in6_addr), M_PRISON, + M_WAITOK); + bcopy(ppr->pr_ip6, pr->pr_ip6, + pr->pr_ip6s * sizeof(*pr->pr_ip6)); + } + } #endif } #endif @@ -1189,6 +1209,11 @@ kern_jail_set(struct thread *td, struct */ } else { created = 0; + /* + * Grab a reference for existing prisons, to ensure they + * continue to exist for the duration of the call. + */ + pr->pr_ref++; #if defined(VIMAGE) && (defined(INET) || defined(INET6)) if ((pr->pr_flags & PR_VNET) && (ch_flags & (PR_IP4_USER | PR_IP6_USER))) { @@ -1198,11 +1223,22 @@ kern_jail_set(struct thread *td, struct goto done_deref_locked; } #endif - /* - * Grab a reference for existing prisons, to ensure they - * continue to exist for the duration of the call. - */ - pr->pr_ref++; +#ifdef INET + if (PR_IP4_USER & ch_flags & (pr_flags ^ pr->pr_flags)) { + error = EINVAL; + vfs_opterror(opts, + "ip4 cannot be changed after creation"); + goto done_deref_locked; + } +#endif +#ifdef INET6 + if (PR_IP6_USER & ch_flags & (pr_flags ^ pr->pr_flags)) { + error = EINVAL; + vfs_opterror(opts, + "ip6 cannot be changed after creation"); + goto done_deref_locked; + } +#endif } /* Do final error checking before setting anything. */ @@ -1225,254 +1261,138 @@ kern_jail_set(struct thread *td, struct } } #ifdef INET - if (ch_flags & PR_IP4_USER) { + if (ip4s > 0) { if (ppr->pr_flags & PR_IP4) { - if (!(pr_flags & PR_IP4_USER)) { - /* - * Silently ignore attempts to make the IP - * addresses unrestricted when the parent is - * restricted; in other words, interpret - * "unrestricted" as "as unrestricted as - * possible". - */ - ip4s = ppr->pr_ip4s; - if (ip4s == 0) { - free(ip4, M_PRISON); - ip4 = NULL; - } else if (ip4s <= ip4a) { - /* Inherit the parent's address(es). */ - bcopy(ppr->pr_ip4, ip4, - ip4s * sizeof(*ip4)); - } else { - /* - * There's no room for the parent's - * address list. Allocate some more. - */ - ip4a = ip4s; - free(ip4, M_PRISON); - ip4 = malloc(ip4a * sizeof(*ip4), - M_PRISON, M_NOWAIT); - if (ip4 != NULL) - bcopy(ppr->pr_ip4, ip4, - ip4s * sizeof(*ip4)); - else { - /* Allocation failed without - * sleeping. Unlocking the - * prison now will invalidate - * some checks and prematurely - * show an unfinished new jail. - * So let go of everything and - * start over. - */ - prison_deref(pr, created - ? PD_LOCKED | - PD_LIST_XLOCKED - : PD_DEREF | PD_LOCKED | - PD_LIST_XLOCKED); - if (root != NULL) { - vfslocked = - VFS_LOCK_GIANT( - root->v_mount); - vrele(root); - VFS_UNLOCK_GIANT( - vfslocked); - } - ip4 = malloc(ip4a * - sizeof(*ip4), M_PRISON, - M_WAITOK); - goto again; - } - } - } else if (ip4s > 0) { - /* - * Make sure the new set of IP addresses is a - * subset of the parent's list. Don't worry - * about the parent being unlocked, as any - * setting is done with allprison_lock held. - */ - for (ij = 0; ij < ppr->pr_ip4s; ij++) - if (ip4[0].s_addr == - ppr->pr_ip4[ij].s_addr) + /* + * Make sure the new set of IP addresses is a + * subset of the parent's list. Don't worry + * about the parent being unlocked, as any + * setting is done with allprison_lock held. + */ + for (ij = 0; ij < ppr->pr_ip4s; ij++) + if (ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) + break; + if (ij == ppr->pr_ip4s) { + error = EPERM; + goto done_deref_locked; + } + if (ip4s > 1) { + for (ii = ij = 1; ii < ip4s; ii++) { + if (ip4[ii].s_addr == + ppr->pr_ip4[0].s_addr) + continue; + for (; ij < ppr->pr_ip4s; ij++) + if (ip4[ii].s_addr == + ppr->pr_ip4[ij].s_addr) + break; + if (ij == ppr->pr_ip4s) break; + } if (ij == ppr->pr_ip4s) { error = EPERM; goto done_deref_locked; } - if (ip4s > 1) { - for (ii = ij = 1; ii < ip4s; ii++) { - if (ip4[ii].s_addr == - ppr->pr_ip4[0].s_addr) - continue; - for (; ij < ppr->pr_ip4s; ij++) - if (ip4[ii].s_addr == - ppr->pr_ip4[ij].s_addr) - break; - if (ij == ppr->pr_ip4s) - break; - } - if (ij == ppr->pr_ip4s) { - error = EPERM; - goto done_deref_locked; - } - } } } - if (ip4s > 0) { - /* - * Check for conflicting IP addresses. We permit them - * if there is no more than one IP on each jail. If - * there is a duplicate on a jail with more than one - * IP stop checking and return error. - */ - tppr = ppr; + /* + * Check for conflicting IP addresses. We permit them + * if there is no more than one IP on each jail. If + * there is a duplicate on a jail with more than one + * IP stop checking and return error. + */ + tppr = ppr; #ifdef VIMAGE - for (; tppr != &prison0; tppr = tppr->pr_parent) - if (tppr->pr_flags & PR_VNET) - break; + for (; tppr != &prison0; tppr = tppr->pr_parent) + if (tppr->pr_flags & PR_VNET) + break; #endif - FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { - if (tpr == pr || + FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { + if (tpr == pr || #ifdef VIMAGE - (tpr != tppr && - (tpr->pr_flags & PR_VNET)) || + (tpr != tppr && (tpr->pr_flags & PR_VNET)) || #endif - tpr->pr_uref == 0) { - descend = 0; - continue; - } - if (!(tpr->pr_flags & PR_IP4_USER)) - continue; + tpr->pr_uref == 0) { descend = 0; - if (tpr->pr_ip4 == NULL || - (ip4s == 1 && tpr->pr_ip4s == 1)) - continue; - for (ii = 0; ii < ip4s; ii++) { - if (_prison_check_ip4(tpr, - &ip4[ii]) == 0) { - error = EADDRINUSE; - vfs_opterror(opts, - "IPv4 addresses clash"); - goto done_deref_locked; - } + continue; + } + if (!(tpr->pr_flags & PR_IP4_USER)) + continue; + descend = 0; + if (tpr->pr_ip4 == NULL || + (ip4s == 1 && tpr->pr_ip4s == 1)) + continue; + for (ii = 0; ii < ip4s; ii++) { + if (_prison_check_ip4(tpr, &ip4[ii]) == 0) { + error = EADDRINUSE; + vfs_opterror(opts, + "IPv4 addresses clash"); + goto done_deref_locked; } } } } #endif #ifdef INET6 - if (ch_flags & PR_IP6_USER) { + if (ip6s > 0) { if (ppr->pr_flags & PR_IP6) { - if (!(pr_flags & PR_IP6_USER)) { - /* - * Silently ignore attempts to make the IP - * addresses unrestricted when the parent is - * restricted. - */ - ip6s = ppr->pr_ip6s; - if (ip6s == 0) { - free(ip6, M_PRISON); - ip6 = NULL; - } else if (ip6s <= ip6a) { - /* Inherit the parent's address(es). */ - bcopy(ppr->pr_ip6, ip6, - ip6s * sizeof(*ip6)); - } else { - /* - * There's no room for the parent's - * address list. - */ - ip6a = ip6s; - free(ip6, M_PRISON); - ip6 = malloc(ip6a * sizeof(*ip6), - M_PRISON, M_NOWAIT); - if (ip6 != NULL) - bcopy(ppr->pr_ip6, ip6, - ip6s * sizeof(*ip6)); - else { - prison_deref(pr, created - ? PD_LOCKED | - PD_LIST_XLOCKED - : PD_DEREF | PD_LOCKED | - PD_LIST_XLOCKED); - if (root != NULL) { - vfslocked = - VFS_LOCK_GIANT( - root->v_mount); - vrele(root); - VFS_UNLOCK_GIANT( - vfslocked); - } - ip6 = malloc(ip6a * - sizeof(*ip6), M_PRISON, - M_WAITOK); - goto again; - } - } - } else if (ip6s > 0) { - /* - * Make sure the new set of IP addresses is a - * subset of the parent's list. - */ - for (ij = 0; ij < ppr->pr_ip6s; ij++) - if (IN6_ARE_ADDR_EQUAL(&ip6[0], - &ppr->pr_ip6[ij])) + /* + * Make sure the new set of IP addresses is a + * subset of the parent's list. + */ + for (ij = 0; ij < ppr->pr_ip6s; ij++) + if (IN6_ARE_ADDR_EQUAL(&ip6[0], + &ppr->pr_ip6[ij])) + break; + if (ij == ppr->pr_ip6s) { + error = EPERM; + goto done_deref_locked; + } + if (ip6s > 1) { + for (ii = ij = 1; ii < ip6s; ii++) { + if (IN6_ARE_ADDR_EQUAL(&ip6[ii], + &ppr->pr_ip6[0])) + continue; + for (; ij < ppr->pr_ip6s; ij++) + if (IN6_ARE_ADDR_EQUAL( + &ip6[ii], &ppr->pr_ip6[ij])) + break; + if (ij == ppr->pr_ip6s) break; + } if (ij == ppr->pr_ip6s) { error = EPERM; goto done_deref_locked; } - if (ip6s > 1) { - for (ii = ij = 1; ii < ip6s; ii++) { - if (IN6_ARE_ADDR_EQUAL(&ip6[ii], - &ppr->pr_ip6[0])) - continue; - for (; ij < ppr->pr_ip6s; ij++) - if (IN6_ARE_ADDR_EQUAL( - &ip6[ii], - &ppr->pr_ip6[ij])) - break; - if (ij == ppr->pr_ip6s) - break; - } - if (ij == ppr->pr_ip6s) { - error = EPERM; - goto done_deref_locked; - } - } } } - if (ip6s > 0) { - /* Check for conflicting IP addresses. */ - tppr = ppr; + /* Check for conflicting IP addresses. */ + tppr = ppr; #ifdef VIMAGE - for (; tppr != &prison0; tppr = tppr->pr_parent) - if (tppr->pr_flags & PR_VNET) - break; + for (; tppr != &prison0; tppr = tppr->pr_parent) + if (tppr->pr_flags & PR_VNET) + break; #endif - FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { - if (tpr == pr || + FOREACH_PRISON_DESCENDANT(tppr, tpr, descend) { + if (tpr == pr || #ifdef VIMAGE - (tpr != tppr && - (tpr->pr_flags & PR_VNET)) || + (tpr != tppr && (tpr->pr_flags & PR_VNET)) || #endif - tpr->pr_uref == 0) { - descend = 0; - continue; - } - if (!(tpr->pr_flags & PR_IP6_USER)) - continue; + tpr->pr_uref == 0) { descend = 0; - if (tpr->pr_ip6 == NULL || - (ip6s == 1 && tpr->pr_ip6s == 1)) - continue; - for (ii = 0; ii < ip6s; ii++) { - if (_prison_check_ip6(tpr, - &ip6[ii]) == 0) { - error = EADDRINUSE; - vfs_opterror(opts, - "IPv6 addresses clash"); - goto done_deref_locked; - } + continue; + } + if (!(tpr->pr_flags & PR_IP6_USER)) + continue; + descend = 0; + if (tpr->pr_ip6 == NULL || + (ip6s == 1 && tpr->pr_ip6s == 1)) + continue; + for (ii = 0; ii < ip6s; ii++) { + if (_prison_check_ip6(tpr, &ip6[ii]) == 0) { + error = EADDRINUSE; + vfs_opterror(opts, + "IPv6 addresses clash"); + goto done_deref_locked; } } } @@ -1514,28 +1434,12 @@ kern_jail_set(struct thread *td, struct /* Set the parameters of the prison. */ #ifdef INET redo_ip4 = 0; - if (ch_flags & PR_IP4_USER) { - if (pr_flags & PR_IP4_USER) { - /* Some restriction set. */ - pr->pr_flags |= PR_IP4; - if (ip4s >= 0) { - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4s = ip4s; - pr->pr_ip4 = ip4; - ip4 = NULL; - } - } else if (ppr->pr_flags & PR_IP4) { - /* This restriction cleared, but keep inherited. */ - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4s = ip4s; - pr->pr_ip4 = ip4; - ip4 = NULL; - } else { - /* Restriction cleared, now unrestricted. */ - pr->pr_flags &= ~PR_IP4; - free(pr->pr_ip4, M_PRISON); - pr->pr_ip4s = 0; - } + if (pr_flags & PR_IP4_USER) { + pr->pr_flags |= PR_IP4; + free(pr->pr_ip4, M_PRISON); + pr->pr_ip4s = ip4s; + pr->pr_ip4 = ip4; + ip4 = NULL; FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { #ifdef VIMAGE if (tpr->pr_flags & PR_VNET) { @@ -1552,28 +1456,12 @@ kern_jail_set(struct thread *td, struct #endif #ifdef INET6 redo_ip6 = 0; - if (ch_flags & PR_IP6_USER) { - if (pr_flags & PR_IP6_USER) { - /* Some restriction set. */ - pr->pr_flags |= PR_IP6; - if (ip6s >= 0) { - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6s = ip6s; - pr->pr_ip6 = ip6; - ip6 = NULL; - } - } else if (ppr->pr_flags & PR_IP6) { - /* This restriction cleared, but keep inherited. */ - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6s = ip6s; - pr->pr_ip6 = ip6; - ip6 = NULL; - } else { - /* Restriction cleared, now unrestricted. */ - pr->pr_flags &= ~PR_IP6; - free(pr->pr_ip6, M_PRISON); - pr->pr_ip6s = 0; - } + if (pr_flags & PR_IP6_USER) { + pr->pr_flags |= PR_IP6; + free(pr->pr_ip6, M_PRISON); + pr->pr_ip6s = ip6s; + pr->pr_ip6 = ip6; + ip6 = NULL; FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { #ifdef VIMAGE if (tpr->pr_flags & PR_VNET) { @@ -2661,7 +2549,6 @@ prison_restrict_ip4(struct prison *pr, s free(pr->pr_ip4, M_PRISON); pr->pr_ip4 = newip4; pr->pr_ip4s = ppr->pr_ip4s; - pr->pr_flags |= PR_IP4; } return (used); } @@ -2673,9 +2560,7 @@ prison_restrict_ip4(struct prison *pr, s free(pr->pr_ip4, M_PRISON); pr->pr_ip4 = NULL; } - pr->pr_flags = - (pr->pr_flags & ~PR_IP4) | (ppr->pr_flags & PR_IP4); - } else if (pr->pr_ip4s > 0 && (ppr->pr_flags & PR_IP4)) { + } else if (pr->pr_ip4s > 0) { /* Remove addresses that aren't in the parent. */ for (ij = 0; ij < ppr->pr_ip4s; ij++) if (pr->pr_ip4[0].s_addr == ppr->pr_ip4[ij].s_addr) @@ -2762,12 +2647,9 @@ prison_equal_ip4(struct prison *pr1, str return (1); /* - * jail_set maintains an exclusive hold on allprison_lock while it - * changes the IP addresses, so only a shared hold is needed. This is - * easier than locking the two prisons which would require finding the - * proper locking order and end up needing allprison_lock anyway. + * No need to lock since the PR_IP4_USER flag can't be altered for + * existing prisons. */ - sx_slock(&allprison_lock); while (pr1 != &prison0 && #ifdef VIMAGE !(pr1->pr_flags & PR_VNET) && @@ -2780,7 +2662,6 @@ prison_equal_ip4(struct prison *pr1, str #endif !(pr2->pr_flags & PR_IP4_USER)) pr2 = pr2->pr_parent; - sx_sunlock(&allprison_lock); return (pr1 == pr2); } @@ -2972,7 +2853,6 @@ prison_restrict_ip6(struct prison *pr, s free(pr->pr_ip6, M_PRISON); pr->pr_ip6 = newip6; pr->pr_ip6s = ppr->pr_ip6s; - pr->pr_flags |= PR_IP6; } return (used); } @@ -2984,9 +2864,7 @@ prison_restrict_ip6(struct prison *pr, s free(pr->pr_ip6, M_PRISON); pr->pr_ip6 = NULL; } - pr->pr_flags = - (pr->pr_flags & ~PR_IP6) | (ppr->pr_flags & PR_IP6); - } else if (pr->pr_ip6s > 0 && (ppr->pr_flags & PR_IP6)) { + } else if (pr->pr_ip6s > 0) { /* Remove addresses that aren't in the parent. */ for (ij = 0; ij < ppr->pr_ip6s; ij++) if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], @@ -3073,7 +2951,6 @@ prison_equal_ip6(struct prison *pr1, str if (pr1 == pr2) return (1); - sx_slock(&allprison_lock); while (pr1 != &prison0 && #ifdef VIMAGE !(pr1->pr_flags & PR_VNET) && @@ -3086,7 +2963,6 @@ prison_equal_ip6(struct prison *pr1, str #endif !(pr2->pr_flags & PR_IP6_USER)) pr2 = pr2->pr_parent; - sx_sunlock(&allprison_lock); return (pr1 == pr2); } @@ -4172,12 +4048,14 @@ SYSCTL_JAIL_PARAM_NODE(cpuset, "Jail cpu SYSCTL_JAIL_PARAM(_cpuset, id, CTLTYPE_INT | CTLFLAG_RD, "I", "Jail cpuset ID"); #ifdef INET -SYSCTL_JAIL_PARAM_SYS_NODE(ip4, CTLFLAG_RW, "Jail IPv4 address virtualization"); +SYSCTL_JAIL_PARAM_SYS_NODE(ip4, CTLFLAG_RDTUN, + "Jail IPv4 address virtualization"); SYSCTL_JAIL_PARAM_STRUCT(_ip4, addr, CTLFLAG_RW, sizeof(struct in_addr), "S,in_addr,a", "Jail IPv4 addresses"); #endif #ifdef INET6 -SYSCTL_JAIL_PARAM_SYS_NODE(ip6, CTLFLAG_RW, "Jail IPv6 address virtualization"); +SYSCTL_JAIL_PARAM_SYS_NODE(ip6, CTLFLAG_RDTUN, + "Jail IPv6 address virtualization"); SYSCTL_JAIL_PARAM_STRUCT(_ip6, addr, CTLFLAG_RW, sizeof(struct in6_addr), "S,in6_addr,a", "Jail IPv6 addresses"); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 17:40:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F0BA1065670; Thu, 30 Jul 2009 17:40:48 +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 6DA378FC15; Thu, 30 Jul 2009 17:40:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UHem00029159; Thu, 30 Jul 2009 17:40:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6UHemYb029157; Thu, 30 Jul 2009 17:40:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907301740.n6UHemYb029157@svn.freebsd.org> From: Xin LI Date: Thu, 30 Jul 2009 17:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195976 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 17:40:48 -0000 Author: delphij Date: Thu Jul 30 17:40:47 2009 New Revision: 195976 URL: http://svn.freebsd.org/changeset/base/195976 Log: Show interface name which received short CARP packet (e.g. a VRRP packet), in order to match other codepaths nearby. This makes troubleshooting easier. Approved by: re (kib) MFC after: 1 month Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Jul 30 17:36:13 2009 (r195975) +++ head/sys/netinet/ip_carp.c Thu Jul 30 17:40:47 2009 (r195976) @@ -572,8 +572,9 @@ carp_input(struct mbuf *m, int hlen) if (m->m_pkthdr.len < iplen + sizeof(*ch)) { CARPSTATS_INC(carps_badlen); CARP_LOG("carp_input: received len %zd < " - "sizeof(struct carp_header)\n", - m->m_len - sizeof(struct ip)); + "sizeof(struct carp_header) on %s\n", + m->m_len - sizeof(struct ip), + m->m_pkthdr.rcvif->if_xname); m_freem(m); return; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 30 18:53:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0424106566C; Thu, 30 Jul 2009 18:53:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E95A8FC17; Thu, 30 Jul 2009 18:53:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6UIr6V0035797; Thu, 30 Jul 2009 18:53:06 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6UIr6s7035795; Thu, 30 Jul 2009 18:53:06 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200907301853.n6UIr6s7035795@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 30 Jul 2009 18:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195978 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2009 18:53:07 -0000 Author: weongyo Date: Thu Jul 30 18:53:06 2009 New Revision: 195978 URL: http://svn.freebsd.org/changeset/base/195978 Log: fixes a typo for DWA120 device ID. Reported by: Alexander Kuznetsov Approved by: re (kib) Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jul 30 18:28:00 2009 (r195977) +++ head/sys/dev/usb/usbdevs Thu Jul 30 18:53:06 2009 (r195978) @@ -1177,12 +1177,12 @@ product DLINK DSB650TX_PNA 0x4003 1/10/1 product DLINK DSB650TX3 0x400b 10/100 Ethernet product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet +product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) +product DLINK2 DWA120 0x3a0e DWA-120 product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 product DLINK2 DWA110 0x3c07 DWA-110 -product DLINK2 DWA120_NF 0x3c0d DWA-120 (no firmware) -product DLINK2 DWA120 0x3c0e DWA-120 /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 04:37:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D3E6106566B; Fri, 31 Jul 2009 04:37:53 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 642CA8FC0C; Fri, 31 Jul 2009 04:37:52 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so27811fgb.12 for ; Thu, 30 Jul 2009 21:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=/iOuqgYHckQLqV60RO68nwHTU7Wi6wquWXBAzj9MtXk=; b=I/50Wo61k4xxdiIlejM8HoOkHhJ+PsqpN90zcpW3kSWFy/8yRWKNeq0jyp/ai6Y7j7 N7JL2iqIRZ8h64Q55HyGTA+gaeq/W2918yvinguqtoCvpLK+FN+JblH8u/FeYdgcngz5 koHbQYSGsCr+iOD0I+EgP/WzSMbDoEnZF40G8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=hoG2eGjuXkgW+x0l6xlc2Rjky5O1pfRgPpR9sfBZbEMBOI156seE4Ho+H6wywC2Gct Op0GSLmO9VNj9q4y+F8Fa2Gx7rGx+FO9SXBTF8aaJnGg6gOtQlN0v37k/GYq9pxvZA2H 65oG1a5+F37EhvEgBr1FTnCdzfe1YwCssbn/0= MIME-Version: 1.0 Received: by 10.86.87.1 with SMTP id k1mr675934fgb.74.1249013666728; Thu, 30 Jul 2009 21:14:26 -0700 (PDT) In-Reply-To: <200907301319.n6UDJC6B014743@svn.freebsd.org> References: <200907301319.n6UDJC6B014743@svn.freebsd.org> Date: Fri, 31 Jul 2009 06:14:26 +0200 Message-ID: <6101e8c40907302114l46e6a0f2wa783384a80504a0@mail.gmail.com> From: Oliver Pinter To: Alexander Motin Content-Type: multipart/mixed; boundary=000e0cd2a030eccac7046ff8a7ed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195973 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 04:37:54 -0000 --000e0cd2a030eccac7046ff8a7ed Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit fix complie error, tested, booted, used On 7/30/09, Alexander Motin wrote: > Author: mav > Date: Thu Jul 30 13:19:12 2009 > New Revision: 195973 > URL: http://svn.freebsd.org/changeset/base/195973 > > Log: > MFC rev. 195724: > > Limit IOCATAREQUEST ioctl data size to controller's maximum I/O size. > It fixes kernel panic when requested size is too large (0xffffffff). > > PR: kern/136726 > > Modified: > stable/7/sys/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > stable/7/sys/dev/ata/ata-all.c > > Modified: stable/7/sys/dev/ata/ata-all.c > ============================================================================== > --- stable/7/sys/dev/ata/ata-all.c Thu Jul 30 12:41:19 2009 (r195972) > +++ stable/7/sys/dev/ata/ata-all.c Thu Jul 30 13:19:12 2009 (r195973) > @@ -440,6 +440,7 @@ int > ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) > { > struct ata_device *atadev = device_get_softc(dev); > + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); > struct ata_ioc_request *ioc_request = (struct ata_ioc_request *)data; > struct ata_params *params = (struct ata_params *)data; > int *mode = (int *)data; > @@ -449,6 +450,10 @@ ata_device_ioctl(device_t dev, u_long cm > > switch (cmd) { > case IOCATAREQUEST: > + if (ioc_request->count > > + (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) { > + return (EFBIG); > + } > if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) { > return ENOMEM; > } > _______________________________________________ > svn-src-stable-7@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-7 > To unsubscribe, send any mail to "svn-src-stable-7-unsubscribe@freebsd.org" > --000e0cd2a030eccac7046ff8a7ed Content-Type: text/x-diff; charset=US-ASCII; name="ata_compile_fix.diff" Content-Disposition: attachment; filename="ata_compile_fix.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 Y29tbWl0IDVmNDkyMGI5MWU5MTUxNDA5OWQxYTMyMWU3ZWQ4MjcwMDc2MDIxYjUKQXV0aG9yOiBv cHYgPG9wdkBvbGl2ZXJwLnRldGVueS5ibWUuaHU+CkRhdGU6ICAgRnJpIEp1bCAzMSAwNTo1Njoy MyAyMDA5ICswMjAwCgogICAgYXRhIGNvbXBsaWUgZml4IC0gd2FzIHN2biBjb21taXQ6IHIxOTU5 NzMgZml4CgogICAgL3Vzci9zcmMvc3lzL2Rldi9hdGEvYXRhLWFsbC5jOiBJbiBmdW5jdGlvbiAn YXRhX2RldmljZV9pb2N0bCc6CiAgICAvdXNyL3NyYy9zeXMvZGV2L2F0YS9hdGEtYWxsLmM6NDU0 OiBlcnJvcjogcmVxdWVzdCBmb3IgbWVtYmVyICdtYXhfaW9zaXplJwogICAgaW4gc29tZXRoaW5n IG5vdCBhIHN0cnVjdHVyZSBvciB1bmlvbgoKICAgIFNpZ25lZC1vZmYtYnk6IE9saXZlciBQaW50 ZXIgPG9saXZlci5wbnRyQGdtYWlsLmNvbT4KCgpkaWZmIC0tZ2l0IGEvc3lzL2Rldi9hdGEvYXRh LWFsbC5jIGIvc3lzL2Rldi9hdGEvYXRhLWFsbC5jCmluZGV4IGM1OGU2NzUuLjc5ZTBiYzQgMTAw NjQ0Ci0tLSBhL3N5cy9kZXYvYXRhL2F0YS1hbGwuYworKysgYi9zeXMvZGV2L2F0YS9hdGEtYWxs LmMKQEAgLTQ1MSw3ICs0NTEsNyBAQCBhdGFfZGV2aWNlX2lvY3RsKGRldmljZV90IGRldiwgdV9s b25nIGNtZCwgY2FkZHJfdCBkYXRhKQogICAgIHN3aXRjaCAoY21kKSB7CiAgICAgY2FzZSBJT0NB VEFSRVFVRVNUOgogCWlmIChpb2NfcmVxdWVzdC0+Y291bnQgPgotCSAgICAoY2gtPmRtYS5tYXhf aW9zaXplID8gY2gtPmRtYS5tYXhfaW9zaXplIDogREZMVFBIWVMpKSB7CisJICAgIChjaC0+ZG1h LT5tYXhfaW9zaXplID8gY2gtPmRtYS0+bWF4X2lvc2l6ZSA6IERGTFRQSFlTKSkgewogCQlyZXR1 cm4gKEVGQklHKTsKIAl9CiAJaWYgKCEoYnVmID0gbWFsbG9jKGlvY19yZXF1ZXN0LT5jb3VudCwg TV9BVEEsIE1fTk9XQUlUKSkpIHsK --000e0cd2a030eccac7046ff8a7ed-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 07:45:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E7B106564A; Fri, 31 Jul 2009 07:45:19 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.211.181]) by mx1.freebsd.org (Postfix) with ESMTP id 986968FC1F; Fri, 31 Jul 2009 07:45:18 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by ywh11 with SMTP id 11so1525468ywh.14 for ; Fri, 31 Jul 2009 00:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/RZwtt+qQkSl8g+uEv2rgvBw4qBLXipfoDV/AJyzVHE=; b=tV2qn2E59998Bcl9yr7eY3rnrsjojtkhSMzlAbqe8OdnVuwAnjsmsNr3eEiySNCr0a 3ZJ2Ptxde/sYR6pwIxMfjr4qGj2ganeC+bW2DUFWCewSDbfZ/RLiM82ROrD8jlV3GXYe B/hYfULeAHWuIP88wboqF94Gnn1+ELQyrulPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dzf7reJeq6ucvTheqs8RPLdQWmanpxkHyW0anD5QsLXcEFYt2Fs8Njc6MYBjl46OFH culIIZ8EqIrldlY81Zr19apiO5OTikZjO79u/KoCsVker+4rdTpSuTxU23XcDzWTznKE kWlbtehc5Tyr9seqtUpacFaXw3t7rqUr0hFxs= MIME-Version: 1.0 Received: by 10.150.11.18 with SMTP id 18mr2746704ybk.229.1249026318102; Fri, 31 Jul 2009 00:45:18 -0700 (PDT) In-Reply-To: <200907300014.n6U0EZ77086341@svn.freebsd.org> References: <200907300014.n6U0EZ77086341@svn.freebsd.org> Date: Fri, 31 Jul 2009 00:45:18 -0700 Message-ID: From: Navdeep Parhar To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 07:45:19 -0000 On Wed, Jul 29, 2009 at 5:14 PM, Alfred Perlstein wrote= : > Author: alfred > Date: Thu Jul 30 00:14:34 2009 > New Revision: 195960 > URL: http://svn.freebsd.org/changeset/base/195960 > > Log: > =A0USB CORE: > =A0- Add minimum polling support to drive UMASS > =A0 =A0and UKBD in case of panic. > =A0- Add extra check to ukbd probe to fix problem about > =A0 =A0mouse devices attaching like keyboards. > =A0- P4 ID: 166148 > > =A0Submitted by: hps > =A0Approved by: =A0re This has slowed down core dumps very significantly. What used to take 10-1= 5s on my system now takes around 3 minutes. A simple test is to break into ddb a= nd "call doadump" with or without this rev. I have a serial console on this machine and so I can use ddb whether the attached USB keyboard works or not. Here is the usbconfig from the machine: ugen0.1: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12M= bps) pwr=3DON ugen1.1: at usbus1, cfg=3D0 md=3DHOST spd=3DFULL (12M= bps) pwr=3DON ugen2.1: at usbus2, cfg=3D0 md=3DHOST spd=3DFULL (12M= bps) pwr=3DON ugen3.1: at usbus3, cfg=3D0 md=3DHOST spd=3DFULL (12M= bps) pwr=3DON ugen4.1: at usbus4, cfg=3D0 md=3DHOST spd=3DHIGH (480Mbps) pwr=3DON ugen1.2: at usbus1, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DSAVE ugen1.3: at usbus1, cfg=3D0 md=3DHOST spd=3DLOW (1.5Mbps) pwr=3DON ugen1.4: at usbus1, cfg=3D0 md=3DHOST spd=3DLOW (1.5Mbps) pwr=3DON Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 07:53:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B445E1065672; Fri, 31 Jul 2009 07:53:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A20468FC1A; Fri, 31 Jul 2009 07:53:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6V7rAFY059806; Fri, 31 Jul 2009 07:53:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6V7rAeg059805; Fri, 31 Jul 2009 07:53:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907310753.n6V7rAeg059805@svn.freebsd.org> From: Alexander Motin Date: Fri, 31 Jul 2009 07:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195987 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 07:53:11 -0000 Author: mav Date: Fri Jul 31 07:53:09 2009 New Revision: 195987 URL: http://svn.freebsd.org/changeset/base/195987 Log: Fix build breakage introduced by rev. 195973 due to difference from HEAD, Submitted by: Oliver Pinter Modified: stable/7/sys/dev/ata/ata-all.c Modified: stable/7/sys/dev/ata/ata-all.c ============================================================================== --- stable/7/sys/dev/ata/ata-all.c Fri Jul 31 01:04:35 2009 (r195986) +++ stable/7/sys/dev/ata/ata-all.c Fri Jul 31 07:53:09 2009 (r195987) @@ -451,7 +451,7 @@ ata_device_ioctl(device_t dev, u_long cm switch (cmd) { case IOCATAREQUEST: if (ioc_request->count > - (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) { + (ch->dma->max_iosize ? ch->dma->max_iosize : DFLTPHYS)) { return (EFBIG); } if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 07:54:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5CE8106564A; Fri, 31 Jul 2009 07:54:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id A4D418FC15; Fri, 31 Jul 2009 07:54:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from [78.111.215.165] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 250274661; Fri, 31 Jul 2009 10:54:06 +0300 Message-ID: <4A72A31D.3030103@FreeBSD.org> Date: Fri, 31 Jul 2009 10:54:05 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: Oliver Pinter References: <200907301319.n6UDJC6B014743@svn.freebsd.org> <6101e8c40907302114l46e6a0f2wa783384a80504a0@mail.gmail.com> In-Reply-To: <6101e8c40907302114l46e6a0f2wa783384a80504a0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195973 - in stable/7/sys: . contrib/pf dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 07:54:11 -0000 Oliver Pinter wrote: > fix complie error, tested, booted, used Fixed. Thanks. Sorry. > On 7/30/09, Alexander Motin wrote: >> Author: mav >> Date: Thu Jul 30 13:19:12 2009 >> New Revision: 195973 >> URL: http://svn.freebsd.org/changeset/base/195973 >> >> Log: >> MFC rev. 195724: >> >> Limit IOCATAREQUEST ioctl data size to controller's maximum I/O size. >> It fixes kernel panic when requested size is too large (0xffffffff). >> >> PR: kern/136726 -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 08:37:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE05106566B; Fri, 31 Jul 2009 08:37:27 +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 69C818FC16; Fri, 31 Jul 2009 08:37:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6V8bRMR060853; Fri, 31 Jul 2009 08:37:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6V8bREd060851; Fri, 31 Jul 2009 08:37:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907310837.n6V8bREd060851@svn.freebsd.org> From: Xin LI Date: Fri, 31 Jul 2009 08:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195988 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 08:37:28 -0000 Author: delphij Date: Fri Jul 31 08:37:27 2009 New Revision: 195988 URL: http://svn.freebsd.org/changeset/base/195988 Log: Correct a stack underflow in gzip: - Limit suffix to be no more than 30 bytes long. This matches GNU behavior. - Correct usage of memcpy(). Note that this commit only corrects the stack underflow issue, we still need some other fixes to cover other edges. [1] Reported by: Ron Jude Discussed with: Matthew Green (original NetBSD gzip author), Eygene Ryabinkin [1] Approved by: re (kib) Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Fri Jul 31 07:53:09 2009 (r195987) +++ head/usr.bin/gzip/gzip.c Fri Jul 31 08:37:27 2009 (r195988) @@ -150,6 +150,8 @@ static suffixes_t suffixes[] = { }; #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) +#define SUFFIX_MAXLEN 30 + static const char gzip_version[] = "FreeBSD gzip 20090621"; #ifndef SMALL @@ -372,6 +374,8 @@ main(int argc, char **argv) case 'S': len = strlen(optarg); if (len != 0) { + if (len > SUFFIX_MAXLEN) + errx(1, "incorrect suffix: '%s': too long", optarg); suffixes[0].zipped = optarg; suffixes[0].ziplen = len; } else { @@ -1236,7 +1240,7 @@ file_compress(char *file, char *outfile, /* Add (usually) .gz to filename */ if ((size_t)snprintf(outfile, outsize, "%s%s", file, suffixes[0].zipped) >= outsize) - memcpy(outfile - suffixes[0].ziplen - 1, + memcpy(outfile + outsize - suffixes[0].ziplen - 1, suffixes[0].zipped, suffixes[0].ziplen + 1); #ifndef SMALL From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 09:57:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A62C106566B; Fri, 31 Jul 2009 09:57:42 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78A118FC08; Fri, 31 Jul 2009 09:57:42 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6V9vgd4062532; Fri, 31 Jul 2009 09:57:42 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6V9vg5g062530; Fri, 31 Jul 2009 09:57:42 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <200907310957.n6V9vg5g062530@svn.freebsd.org> From: Kevin Lo Date: Fri, 31 Jul 2009 09:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195989 - head/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 09:57:43 -0000 Author: kevlo Date: Fri Jul 31 09:57:42 2009 New Revision: 195989 URL: http://svn.freebsd.org/changeset/base/195989 Log: Free allocated Rx ring dma memory/tags. Reviewed by: yongari@ Approved by: re (kib) Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Jul 31 08:37:27 2009 (r195988) +++ head/sys/dev/alc/if_alc.c Fri Jul 31 09:57:42 2009 (r195989) @@ -1501,6 +1501,21 @@ alc_dma_free(struct alc_softc *sc) bus_dma_tag_destroy(sc->alc_cdata.alc_tx_ring_tag); sc->alc_cdata.alc_tx_ring_tag = NULL; } + /* Rx ring. */ + if (sc->alc_cdata.alc_rx_ring_tag != NULL) { + if (sc->alc_cdata.alc_rx_ring_map != NULL) + bus_dmamap_unload(sc->alc_cdata.alc_rx_ring_tag, + sc->alc_cdata.alc_rx_ring_map); + if (sc->alc_cdata.alc_rx_ring_map != NULL && + sc->alc_rdata.alc_rx_ring != NULL) + bus_dmamem_free(sc->alc_cdata.alc_rx_ring_tag, + sc->alc_rdata.alc_rx_ring, + sc->alc_cdata.alc_rx_ring_map); + sc->alc_rdata.alc_rx_ring = NULL; + sc->alc_cdata.alc_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->alc_cdata.alc_rx_ring_tag); + sc->alc_cdata.alc_rx_ring_tag = NULL; + } /* Rx return ring. */ if (sc->alc_cdata.alc_rr_ring_tag != NULL) { if (sc->alc_cdata.alc_rr_ring_map != NULL) From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 13:40:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 586111065673; Fri, 31 Jul 2009 13:40:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C619A8FC0A; Fri, 31 Jul 2009 13:40:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VDe69i070636; Fri, 31 Jul 2009 13:40:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VDe69W070631; Fri, 31 Jul 2009 13:40:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907311340.n6VDe69W070631@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Jul 2009 13:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195995 - in head/sys: fs/unionfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 13:40:07 -0000 Author: jhb Date: Fri Jul 31 13:40:06 2009 New Revision: 195995 URL: http://svn.freebsd.org/changeset/base/195995 Log: Fix some LORs between vnode locks and filedescriptor table locks. - Don't grab the filedesc lock just to read fd_cmask. - Drop vnode locks earlier when mounting the root filesystem and before sanitizing stdin/out/err file descriptors during execve(). Submitted by: kib Approved by: re (rwatson) MFC after: 1 week Modified: head/sys/fs/unionfs/union_subr.c head/sys/kern/kern_exec.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_syscalls.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Fri Jul 31 12:52:32 2009 (r195994) +++ head/sys/fs/unionfs/union_subr.c Fri Jul 31 13:40:06 2009 (r195995) @@ -486,9 +486,7 @@ unionfs_create_uppervattr_core(struct un } break; default: /* UNIONFS_TRADITIONAL */ - FILEDESC_SLOCK(td->td_proc->p_fd); uva->va_mode = 0777 & ~td->td_proc->p_fd->fd_cmask; - FILEDESC_SUNLOCK(td->td_proc->p_fd); uva->va_uid = ump->um_uid; uva->va_gid = ump->um_gid; break; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Jul 31 12:52:32 2009 (r195994) +++ head/sys/kern/kern_exec.c Fri Jul 31 13:40:06 2009 (r195995) @@ -673,8 +673,8 @@ interpret: * allocate memory, so temporarily drop the process lock. */ PROC_UNLOCK(p); - setugidsafety(td); VOP_UNLOCK(imgp->vp, 0); + setugidsafety(td); error = fdcheckstd(td); vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Jul 31 12:52:32 2009 (r195994) +++ head/sys/kern/vfs_mount.c Fri Jul 31 13:40:06 2009 (r195995) @@ -1069,9 +1069,10 @@ vfs_domount( vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) panic("mount: lost mount"); - mountcheckdirs(vp, newdp); - vput(newdp); + VOP_UNLOCK(newdp, 0); VOP_UNLOCK(vp, 0); + mountcheckdirs(vp, newdp); + vrele(newdp); if ((mp->mnt_flag & MNT_RDONLY) == 0) error = vfs_allocate_syncvnode(mp); vfs_unbusy(mp); @@ -1480,6 +1481,8 @@ set_rootvnode() if (VFS_ROOT(TAILQ_FIRST(&mountlist), LK_EXCLUSIVE, &rootvnode)) panic("Cannot find root vnode"); + VOP_UNLOCK(rootvnode, 0); + p = curthread->td_proc; FILEDESC_XLOCK(p->p_fd); @@ -1495,8 +1498,6 @@ set_rootvnode() FILEDESC_XUNLOCK(p->p_fd); - VOP_UNLOCK(rootvnode, 0); - EVENTHANDLER_INVOKE(mountroot); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Jul 31 12:52:32 2009 (r195994) +++ head/sys/kern/vfs_syscalls.c Fri Jul 31 13:40:06 2009 (r195995) @@ -1307,10 +1307,8 @@ restart: return (EEXIST); } else { VATTR_NULL(&vattr); - FILEDESC_SLOCK(td->td_proc->p_fd); vattr.va_mode = (mode & ALLPERMS) & ~td->td_proc->p_fd->fd_cmask; - FILEDESC_SUNLOCK(td->td_proc->p_fd); vattr.va_rdev = dev; whiteout = 0; @@ -1442,9 +1440,7 @@ restart: } VATTR_NULL(&vattr); vattr.va_type = VFIFO; - FILEDESC_SLOCK(td->td_proc->p_fd); vattr.va_mode = (mode & ALLPERMS) & ~td->td_proc->p_fd->fd_cmask; - FILEDESC_SUNLOCK(td->td_proc->p_fd); #ifdef MAC error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd, &vattr); @@ -1705,9 +1701,7 @@ restart: goto restart; } VATTR_NULL(&vattr); - FILEDESC_SLOCK(td->td_proc->p_fd); vattr.va_mode = ACCESSPERMS &~ td->td_proc->p_fd->fd_cmask; - FILEDESC_SUNLOCK(td->td_proc->p_fd); #ifdef MAC vattr.va_type = VLNK; error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd, @@ -3773,9 +3767,7 @@ restart: } VATTR_NULL(&vattr); vattr.va_type = VDIR; - FILEDESC_SLOCK(td->td_proc->p_fd); vattr.va_mode = (mode & ACCESSPERMS) &~ td->td_proc->p_fd->fd_cmask; - FILEDESC_SUNLOCK(td->td_proc->p_fd); #ifdef MAC error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd, &vattr); From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 14:30:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0F01065670; Fri, 31 Jul 2009 14:30:06 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50B458FC1A; Fri, 31 Jul 2009 14:30:06 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VEU6qU071839; Fri, 31 Jul 2009 14:30:06 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VEU6Hm071837; Fri, 31 Jul 2009 14:30:06 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907311430.n6VEU6Hm071837@svn.freebsd.org> From: Jamie Gritton Date: Fri, 31 Jul 2009 14:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195998 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 14:30:06 -0000 Author: jamie Date: Fri Jul 31 14:30:06 2009 New Revision: 195998 URL: http://svn.freebsd.org/changeset/base/195998 Log: Handle kernels that don't have IPv6 by not sending an "ip6.addr" parameter unless a (numeric) IPv6 address is given. Even the default binaries built with -DINET6 will work with IPv6-less kernels. With an eye to the future, similarly handle the possibility of an IPv4-less kernel. Approved by: re (kib), bz (mentor) Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Fri Jul 31 14:19:57 2009 (r195997) +++ head/usr.sbin/jail/jail.c Fri Jul 31 14:30:06 2009 (r195998) @@ -231,10 +231,11 @@ main(int argc, char **argv) set_param("host.hostname", argv[1]); if (hflag) add_ip_addrinfo(0, argv[1]); + if (argv[2][0] != '\0') #ifdef INET6 - add_ip_addr46(argv[2]); + add_ip_addr46(argv[2]); #else - add_ip_addr(&ip4_addr, argv[2]); + add_ip_addr(&ip4_addr, argv[2]); #endif cmdarg = 3; /* Emulate the defaults from security.jail.* sysctls */ @@ -374,11 +375,6 @@ add_ip_addr46(char *value) { char *p, *np; - if (!value[0]) { - add_ip_addr(&ip4_addr, value); - add_ip_addr(&ip6_addr, value); - return; - } for (p = value;; p = np + 1) { np = strchr(p, ','); @@ -396,10 +392,13 @@ add_ip_addrinfo(int ai_flags, char *valu { struct addrinfo hints, *ai0, *ai; struct in_addr addr4; - int error; + size_t size; + int error, ip4ok; + int mib[4]; char avalue4[INET_ADDRSTRLEN]; #ifdef INET6 struct in6_addr addr6; + int ip6ok; char avalue6[INET6_ADDRSTRLEN]; #endif @@ -415,11 +414,34 @@ add_ip_addrinfo(int ai_flags, char *valu error = getaddrinfo(value, NULL, &hints, &ai0); if (error != 0) errx(1, "hostname %s: %s", value, gai_strerror(error)); + + /* + * Silently ignore unsupported address families from DNS lookups. + * But if this is a numeric address, let the kernel give the error. + */ + if (ai_flags & AI_NUMERICHOST) + ip4ok = +#ifdef INET6 + ip6ok = +#endif + 1; + else { + size = 4; + ip4ok = (sysctlnametomib("security.jail.param.ip4", mib, + &size) == 0); +#ifdef INET6 + size = 4; + ip6ok = (sysctlnametomib("security.jail.param.ip6", mib, + &size) == 0); +#endif + } /* Convert the addresses to ASCII so set_param can convert them back. */ for (ai = ai0; ai; ai = ai->ai_next) switch (ai->ai_family) { case AF_INET: + if (!ip4ok) + break; memcpy(&addr4, &((struct sockaddr_in *) (void *)ai->ai_addr)->sin_addr, sizeof(addr4)); if (inet_ntop(AF_INET, &addr4, avalue4, @@ -429,6 +451,8 @@ add_ip_addrinfo(int ai_flags, char *valu break; #ifdef INET6 case AF_INET6: + if (!ip6ok) + break; memcpy(&addr6, &((struct sockaddr_in6 *) (void *)ai->ai_addr)->sin6_addr, sizeof(addr6)); if (inet_ntop(AF_INET6, &addr6, avalue6, From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:03:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4DF106564A; Fri, 31 Jul 2009 15:03:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 90D378FC0A; Fri, 31 Jul 2009 15:03:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id D70FE1CEF3; Fri, 31 Jul 2009 17:03:28 +0200 (CEST) Date: Fri, 31 Jul 2009 17:03:28 +0200 From: Ed Schouten To: Rui Paulo Message-ID: <20090731150328.GN1292@hoeg.nl> References: <200907271351.n6RDptNX002239@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CqfQkoYPE/jGoa5Q" Content-Disposition: inline In-Reply-To: <200907271351.n6RDptNX002239@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:03:30 -0000 --CqfQkoYPE/jGoa5Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Rui Paulo wrote: > Refine the MacBook hack to only match early models that have Intel ICH. =2E.. > - if (strncmp(sysenv, "MacBook", 7) =3D=3D 0) { > + if (strncmp(sysenv, "MacBook1,1", 10) =3D=3D 0 || > + strncmp(sysenv, "MacBookPro1,1", 13) =3D=3D 0 || > + strncmp(sysenv, "MacBookPro1,2", 13) =3D=3D 0 || > + strncmp(sysenv, "Macmini1,1", 10) =3D=3D 0) { Yay -- this change broke FreeBSD on my MacBook3,1. Could we please add MacBook3,1 to this list before releasing 8.0? --=20 Ed Schouten WWW: http://80386.nl/ --CqfQkoYPE/jGoa5Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpzB8AACgkQ52SDGA2eCwWBiACbBePQ+lrjb36uf3aaY0ZWWE7/ WJ8AniaZuGYsOQNjNnAiV6DqsSYMe4e4 =aK8o -----END PGP SIGNATURE----- --CqfQkoYPE/jGoa5Q-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:04:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AF3106566B; Fri, 31 Jul 2009 15:04:34 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id AE4A38FC1F; Fri, 31 Jul 2009 15:04:34 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 289061CF05; Fri, 31 Jul 2009 17:04:34 +0200 (CEST) Date: Fri, 31 Jul 2009 17:04:34 +0200 From: Ed Schouten To: Rui Paulo Message-ID: <20090731150434.GO1292@hoeg.nl> References: <200907271351.n6RDptNX002239@svn.freebsd.org> <20090731150328.GN1292@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x38akuY2VS0PywU3" Content-Disposition: inline In-Reply-To: <20090731150328.GN1292@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:04:35 -0000 --x38akuY2VS0PywU3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > Yay -- this change broke FreeBSD on my MacBook3,1. Could we please add > MacBook3,1 to this list before releasing 8.0? By the way, there is no reason to list MacBook1,1 and friends in sys/amd64. Those models don't have a Core 2 Duo yet, right? --=20 Ed Schouten WWW: http://80386.nl/ --x38akuY2VS0PywU3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpzCAIACgkQ52SDGA2eCwXsrgCfRIceKeN681QDE9AvAeLqyHWt dygAni871qjwfo7h3sCTj1CMxMazVkve =RJ0I -----END PGP SIGNATURE----- --x38akuY2VS0PywU3-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:25:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00758106566B; Fri, 31 Jul 2009 15:25: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 DED038FC1E; Fri, 31 Jul 2009 15:25:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VFPdji073196; Fri, 31 Jul 2009 15:25:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VFPdvn073189; Fri, 31 Jul 2009 15:25:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907311525.n6VFPdvn073189@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 Jul 2009 15:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196000 - in vendor-sys/acpica/dist: . common compiler dispatcher executer hardware include namespace parser tools/acpiexec tools/acpisrc utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:25:40 -0000 Author: jkim Date: Fri Jul 31 15:25:39 2009 New Revision: 196000 URL: http://svn.freebsd.org/changeset/base/196000 Log: Import ACPICA 20090730 Added: vendor-sys/acpica/dist/namespace/nsrepair.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/dmrestag.c vendor-sys/acpica/dist/common/dmtable.c vendor-sys/acpica/dist/common/dmtbdump.c vendor-sys/acpica/dist/common/dmtbinfo.c vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslstubs.c vendor-sys/acpica/dist/dispatcher/dsfield.c vendor-sys/acpica/dist/dispatcher/dsmethod.c vendor-sys/acpica/dist/dispatcher/dswload.c vendor-sys/acpica/dist/executer/exconfig.c vendor-sys/acpica/dist/hardware/hwsleep.c vendor-sys/acpica/dist/hardware/hwxface.c vendor-sys/acpica/dist/include/acdisasm.h vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/acnamesp.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acparser.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/acpredef.h vendor-sys/acpica/dist/include/actbl.h vendor-sys/acpica/dist/include/actbl1.h vendor-sys/acpica/dist/include/actbl2.h vendor-sys/acpica/dist/namespace/nseval.c vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsxfeval.c vendor-sys/acpica/dist/parser/psloop.c vendor-sys/acpica/dist/parser/psxface.c vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/utilities/utglobal.c vendor-sys/acpica/dist/utilities/utinit.c vendor-sys/acpica/dist/utilities/utxface.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/changes.txt Fri Jul 31 15:25:39 2009 (r196000) @@ -1,4 +1,76 @@ ---------------------------------------- +30 July 2009. Summary of changes for version 20090730: + +This release is available at www.acpica.org/downloads + +The ACPI 4.0 implementation for ACPICA is complete with this release. + +1) ACPI CA Core Subsystem: + +ACPI 4.0: Added header file support for all new and changed ACPI tables. +Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are new +for ACPI 4.0, but have previously been supported in ACPICA are: CPEP, BERT, +EINJ, ERST, and HEST. Other newly supported tables are: UEFI and WDAT. There +have been some ACPI 4.0 changes to other existing tables. Split the large +actbl1.h header into the existing actbl2.h header. ACPICA BZ 774. + +ACPI 4.0: Implemented predefined name validation for all new names. There are +31 new names in ACPI 4.0. The predefined validation module was split into two +files. The new file is namespace/nsrepair.c. ACPICA BZ 770. + +Implemented support for so-called "module-level executable code". This is +executable AML code that exists outside of any control method and is intended +to be executed at table load time. Although illegal since ACPI 2.0, this type +of code still exists and is apparently still being created. Blocks of this +code are now detected and executed as intended. Currently, the code blocks +must exist under either an If, Else, or While construct; these are the +typical cases seen in the field. ACPICA BZ 762. Lin Ming. + +Implemented an automatic dynamic repair for predefined names that return +nested Package objects. This applies to predefined names that are defined to +return a variable-length Package of sub-packages. If the number of sub- +packages is one, BIOS code is occasionally seen that creates a simple single +package with no sub-packages. This code attempts to fix the problem by +wrapping a new package object around the existing package. These methods can +be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA BZ +790. + +Fixed a regression introduced in 20090625 for the AcpiGetDevices interface. +The _HID/_CID matching was broken and no longer matched IDs correctly. ACPICA +BZ 793. + +Fixed a problem with AcpiReset where the reset would silently fail if the +register was one of the protected I/O ports. AcpiReset now bypasses the port +validation mechanism. This may eventually be driven into the AcpiRead/Write +interfaces. + +Fixed a regression related to the recent update of the AcpiRead/Write +interfaces. A sleep/suspend could fail if the optional PM2 Control register +does not exist during an attempt to write the Bus Master Arbitration bit. +(However, some hosts already delete the code that writes this bit, and the +code may in fact be obsolete at this date.) ACPICA BZ 799. + +Fixed a problem where AcpiTerminate could fault if inadvertently called twice +in succession. ACPICA BZ 795. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total + Debug Version: 160.5K Code, 50.6K Data, 211.1K Total + Current Release: + Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total + Debug Version: 161.6K Code, 50.9K Data, 212.5K Total + +2) iASL Compiler/Disassembler and Tools: + +ACPI 4.0: Implemented disassembler support for all new ACPI tables and +changes to existing tables. ACPICA BZ 775. + +---------------------------------------- 25 June 2009. Summary of changes for version 20090625: This release is available at www.acpica.org/downloads Modified: vendor-sys/acpica/dist/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/common/dmrestag.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmrestag.c Fri Jul 31 15:25:39 2009 (r196000) @@ -387,7 +387,7 @@ static ACPI_RESOURCE_TAG *AcpiGbl static UINT32 AcpiGbl_NextResourceId = 0; static UINT8 AcpiGbl_NextPrefix = 0; -static UINT8 AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = +static char AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = {'Y','Z','J','K','X'}; Modified: vendor-sys/acpica/dist/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtable.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtable.c Fri Jul 31 15:25:39 2009 (r196000) @@ -132,6 +132,7 @@ AcpiDmGetTableData ( static void AcpiDmCheckAscii ( UINT8 *Target, + char *RepairedName, UINT32 Count); UINT8 @@ -156,17 +157,18 @@ static const char *AcpiDmDmarS "Hardware Unit Definition", "Reserved Memory Region", "Root Port ATS Capability", + "Remapping Hardware Static Affinity", "Unknown SubTable Type" /* Reserved */ }; static const char *AcpiDmHestSubnames[] = { - "XPF Machine Check Exception", - "XPF Corrected Machine Check", - "NOT USED???", - "XPF Non-Maskable Interrupt", - "IPF Corrected Machine Check", - "IPF Corrected Platform Error", + "IA-32 Machine Check Exception", + "IA-32 Corrected Machine Check", + "IA-32 Non-Maskable Interrupt", + "Unknown SubTable Type", /* 3 - Reserved */ + "Unknown SubTable Type", /* 4 - Reserved */ + "Unknown SubTable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -208,6 +210,14 @@ static const char *AcpiDmSratS "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmIvrsSubnames[] = +{ + "Hardware Definition Block", + "Memory Definition Block", + "Unknown SubTable Type" /* Reserved */ +}; + + #define ACPI_FADT_PM_RESERVED 8 @@ -224,11 +234,12 @@ static const char *AcpiDmFadtP "Unknown Profile Type" }; - /******************************************************************************* * * ACPI Table Data, indexed by signature. * + * Each entry contains: Signature, Table Info, Handler, Description + * * Simple tables have only a TableInfo structure, complex tables have a handler. * This table must be NULL terminated. RSDP and FACS are special-cased * elsewhere. @@ -249,8 +260,10 @@ static ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"}, @@ -259,6 +272,9 @@ static ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"}, {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, {NULL, NULL, NULL, NULL} @@ -511,7 +527,9 @@ AcpiDmDumpTable ( UINT8 Temp8; UINT16 Temp16; ACPI_DMTABLE_DATA *TableData; + const char *Name; BOOLEAN LastOutputBlankLine = FALSE; + char RepairedName[8]; if (!Info) @@ -547,6 +565,7 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: @@ -577,6 +596,9 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME8: ByteLength = 8; break; + case ACPI_DMT_BUF16: + ByteLength = 16; + break; case ACPI_DMT_STRING: ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; break; @@ -677,17 +699,28 @@ AcpiDmDumpTable ( ACPI_FORMAT_UINT64 (ACPI_GET64 (Target))); break; + case ACPI_DMT_BUF16: + + /* Buffer of length 16 */ + + for (Temp8 = 0; Temp8 < 16; Temp8++) + { + AcpiOsPrintf ("%2.2X,", Target[Temp8]); + } + AcpiOsPrintf ("\n"); + break; + case ACPI_DMT_STRING: - AcpiOsPrintf ("%s\n", ACPI_CAST_PTR (char, Target)); + AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target)); break; /* Fixed length ASCII name fields */ case ACPI_DMT_SIG: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\" ", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\" ", RepairedName); TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); if (TableData) { @@ -698,20 +731,20 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\"\n", RepairedName); break; case ACPI_DMT_NAME6: - AcpiDmCheckAscii (Target, 6); - AcpiOsPrintf ("\"%6.6s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 6); + AcpiOsPrintf ("\"%.6s\"\n", RepairedName); break; case ACPI_DMT_NAME8: - AcpiDmCheckAscii (Target, 8); - AcpiOsPrintf ("\"%8.8s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 8); + AcpiOsPrintf ("\"%.8s\"\n", RepairedName); break; /* Special Data Types */ @@ -742,8 +775,8 @@ AcpiDmDumpTable ( /* Generic Address Structure */ AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -790,8 +823,8 @@ AcpiDmDumpTable ( case ACPI_DMT_HESTNTFY: AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -849,6 +882,31 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]); break; + case ACPI_DMT_IVRS: + + /* IVRS subtable types */ + + Temp8 = *Target; + switch (Temp8) + { + case ACPI_IVRS_TYPE_HARDWARE: + Name = AcpiDmIvrsSubnames[0]; + break; + + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + Name = AcpiDmIvrsSubnames[1]; + break; + + default: + Name = AcpiDmIvrsSubnames[2]; + break; + } + + AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name); + break; + case ACPI_DMT_EXIT: return (AE_OK); @@ -888,6 +946,7 @@ AcpiDmDumpTable ( static void AcpiDmCheckAscii ( UINT8 *Name, + char *RepairedName, UINT32 Count) { UINT32 i; @@ -895,9 +954,15 @@ AcpiDmCheckAscii ( for (i = 0; i < Count; i++) { - if (!Name[i] || !isprint (Name[i])) + RepairedName[i] = Name[i]; + + if (!Name[i]) + { + return; + } + if (!isprint (Name[i])) { - Name[i] = ' '; + RepairedName[i] = ' '; } } } Modified: vendor-sys/acpica/dist/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbdump.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtbdump.c Fri Jul 31 15:25:39 2009 (r196000) @@ -306,6 +306,7 @@ AcpiDmDumpAsf ( UINT32 DataLength = 0; UINT32 DataOffset = 0; UINT32 i; + UINT8 Type; /* No main table, only sub-tables */ @@ -322,7 +323,11 @@ AcpiDmDumpAsf ( return; } - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + /* The actual type is the lower 7 bits of Type */ + + Type = (UINT8) (SubTable->Header.Type & 0x7F); + + switch (Type) { case ACPI_ASF_TYPE_INFO: InfoTable = AcpiDmTableInfoAsf0; @@ -332,8 +337,8 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); - DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts; - DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -341,8 +346,8 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls; - DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -353,7 +358,7 @@ AcpiDmDumpAsf ( case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; @@ -371,7 +376,7 @@ AcpiDmDumpAsf ( /* Dump variable-length extra data */ - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + switch (Type) { case ACPI_ASF_TYPE_ALERT: case ACPI_ASF_TYPE_CONTROL: @@ -471,7 +476,7 @@ AcpiDmDumpCpep ( { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoCpep0); + SubTable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -479,8 +484,9 @@ AcpiDmDumpCpep ( /* Point to next sub-table */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length); + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, + SubTable->Header.Length); } } @@ -550,6 +556,10 @@ AcpiDmDumpDmar ( InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; + case ACPI_DMAR_HARDWARE_AFFINITY: + InfoTable = AcpiDmTableInfoDmar3; + ScopeOffset = sizeof (ACPI_DMAR_RHSA); + break; default: AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); return; @@ -754,29 +764,19 @@ AcpiDmDumpHest ( { switch (SubTable->Type) { - case ACPI_HEST_TYPE_XPF_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CHECK: InfoTable = AcpiDmTableInfoHest0; - SubTableLength = sizeof (ACPI_HEST_XPF_MACHINE_CHECK); + SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); break; - case ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: InfoTable = AcpiDmTableInfoHest1; - SubTableLength = sizeof (ACPI_HEST_XPF_CORRECTED); - break; - - case ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT: - InfoTable = AcpiDmTableInfoHest3; - SubTableLength = sizeof (ACPI_HEST_XPF_NMI); - break; - - case ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK: - InfoTable = AcpiDmTableInfoHest4; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED); + SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED); break; - case ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR: - InfoTable = AcpiDmTableInfoHest5; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED_PLATFORM); + case ACPI_HEST_TYPE_IA32_NMI: + InfoTable = AcpiDmTableInfoHest2; + SubTableLength = sizeof (ACPI_HEST_IA_NMI); break; case ACPI_HEST_TYPE_AER_ROOT_PORT: @@ -794,7 +794,7 @@ AcpiDmDumpHest ( SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE); break; - case ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE: + case ACPI_HEST_TYPE_GENERIC_ERROR: InfoTable = AcpiDmTableInfoHest9; SubTableLength = sizeof (ACPI_HEST_GENERIC); break; @@ -824,6 +824,179 @@ AcpiDmDumpHest ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpIvrs + * + * PARAMETERS: Table - A IVRS table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a IVRS + * + ******************************************************************************/ + +static UINT8 EntrySizes[] = {4,8,16,32}; + +void +AcpiDmDumpIvrs ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_IVRS); + UINT32 EntryOffset; + UINT32 EntryLength; + UINT32 EntryType; + ACPI_IVRS_DE_HEADER *DeviceEntry; + ACPI_IVRS_HEADER *SubTable; + ACPI_DMTABLE_INFO *InfoTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoIvrsHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_IVRS_TYPE_HARDWARE: + InfoTable = AcpiDmTableInfoIvrs0; + break; + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + InfoTable = AcpiDmTableInfoIvrs1; + break; + default: + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n", + SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubTable; + } + + /* Dump the subtable */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* The hardware subtable can contain multiple device entries */ + + if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE) + { + EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE); + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable, + sizeof (ACPI_IVRS_HARDWARE)); + + while (EntryOffset < (Offset + SubTable->Length)) + { + AcpiOsPrintf ("\n"); + /* + * Upper 2 bits of Type encode the length of the device entry + * + * 00 = 4 byte + * 01 = 8 byte + * 10 = 16 byte - currently no entries defined + * 11 = 32 byte - currently no entries defined + */ + EntryType = DeviceEntry->Type; + EntryLength = EntrySizes [EntryType >> 6]; + + switch (EntryType) + { + /* 4-byte device entries */ + + case ACPI_IVRS_TYPE_PAD4: + case ACPI_IVRS_TYPE_ALL: + case ACPI_IVRS_TYPE_SELECT: + case ACPI_IVRS_TYPE_START: + case ACPI_IVRS_TYPE_END: + + InfoTable = AcpiDmTableInfoIvrs4; + break; + + /* 8-byte entries, type A */ + + case ACPI_IVRS_TYPE_ALIAS_SELECT: + case ACPI_IVRS_TYPE_ALIAS_START: + + InfoTable = AcpiDmTableInfoIvrs8a; + break; + + /* 8-byte entries, type B */ + + case ACPI_IVRS_TYPE_PAD8: + case ACPI_IVRS_TYPE_EXT_SELECT: + case ACPI_IVRS_TYPE_EXT_START: + + InfoTable = AcpiDmTableInfoIvrs8b; + break; + + /* 8-byte entries, type C */ + + case ACPI_IVRS_TYPE_SPECIAL: + + InfoTable = AcpiDmTableInfoIvrs8c; + break; + + default: + InfoTable = AcpiDmTableInfoIvrs4; + AcpiOsPrintf ( + "\n**** Unknown IVRS device entry type/length: " + "%.2X/%X at offset %.4X: (header below)\n", + EntryType, EntryLength, EntryOffset); + break; + } + + /* Dump the Device Entry */ + + Status = AcpiDmDumpTable (Table->Length, EntryOffset, + DeviceEntry, EntryLength, InfoTable); + + EntryOffset += EntryLength; + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, + EntryLength); + } + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpMadt * * PARAMETERS: Table - A MADT table @@ -993,6 +1166,58 @@ AcpiDmDumpMcfg ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpMsct + * + * PARAMETERS: Table - A MSCT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a MSCT + * + ******************************************************************************/ + +void +AcpiDmDumpMsct ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_MSCT); + ACPI_MSCT_PROXIMITY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_MSCT_PROXIMITY); + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY)); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpSlit * * PARAMETERS: Table - An SLIT @@ -1149,3 +1374,54 @@ NextSubTable: } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpWdat + * + * PARAMETERS: Table - A WDAT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a WDAT + * + ******************************************************************************/ + +void +AcpiDmDumpWdat ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_WDAT); + ACPI_WDAT_ENTRY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_WDAT_ENTRY); + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY)); + } +} Modified: vendor-sys/acpica/dist/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbinfo.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtbinfo.c Fri Jul 31 15:25:39 2009 (r196000) @@ -139,14 +139,19 @@ #define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) #define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) #define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) +#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) +#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) #define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ @@ -163,17 +168,23 @@ #define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) #define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) #define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) +#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_MACHINE_CHECK,f) -#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_CORRECTED,f) -#define ACPI_HEST3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_NMI,f) -#define ACPI_HEST4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED,f) -#define ACPI_HEST5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED_PLATFORM,f) +#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) +#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) +#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) #define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) #define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) +#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f) +#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) +#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) +#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) +#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) +#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) +#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) #define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) #define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) #define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) @@ -187,10 +198,12 @@ #define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) #define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) #define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) #define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) +#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes @@ -306,7 +319,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)"}, {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector"}, {ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version"}, - {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)"}, {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)"}, {ACPI_DMT_EXIT, 0, NULL} @@ -458,9 +471,9 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] = { {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value"}, - {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Polling Interval"}, + {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval"}, {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID"}, - {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (SystemId), "Manufacturer ID"}, + {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID"}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} @@ -583,8 +596,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] = { - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Type), "Subtable Type"}, - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Length), "Length"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID"}, {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval"}, @@ -675,6 +688,16 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_EXIT, 0, NULL} }; +/* 3: Remapping Hardware Static Affinity Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] = +{ + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address"}, + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + /******************************************************************************* * @@ -702,7 +725,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] = { {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length"}, - {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved"}, {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -747,97 +771,84 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_EXIT, 0, NULL} }; +/* Common HEST structures for subtables */ + +#define ACPI_DM_HEST_HEADER \ + {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, \ + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id"} + +#define ACPI_DM_HEST_AER \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities"} + + /* HEST Subtables */ -/* 0: XPF Machine Check Exception */ +/* 0: IA32 Machine Check Exception */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = { - {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled"}, + {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved2), "Reserved"}, + {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 1: XPF Corrected Machine Check */ +/* 1: IA32 Corrected Machine Check */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = { - {ACPI_DMT_HEST, ACPI_HEST1_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 3: XPF Non-Maskable Interrupt */ +/* 2: IA32 Non-Maskable Interrupt */ -ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[] = +ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] = { - {ACPI_DMT_HEST, ACPI_HEST3_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST3_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 4: IPF Corrected Machine Check */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[] = -{ - {ACPI_DMT_HEST, ACPI_HEST4_OFFSET (Header.Type), "Subtable Type"}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:25:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C8DF106566C; Fri, 31 Jul 2009 15:25: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 066408FC1F; Fri, 31 Jul 2009 15:25:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VFPeQg073207; Fri, 31 Jul 2009 15:25:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VFPdcj073200; Fri, 31 Jul 2009 15:25:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907311525.n6VFPdcj073200@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 Jul 2009 15:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196000 - in vendor-sys/acpica/dist: . common compiler dispatcher executer hardware include namespace parser tools/acpiexec tools/acpisrc utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:25:41 -0000 Author: jkim Date: Fri Jul 31 15:25:39 2009 New Revision: 196000 URL: http://svn.freebsd.org/changeset/base/196000 Log: Import ACPICA 20090730 Added: vendor-sys/acpica/dist/namespace/nsrepair.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/dmrestag.c vendor-sys/acpica/dist/common/dmtable.c vendor-sys/acpica/dist/common/dmtbdump.c vendor-sys/acpica/dist/common/dmtbinfo.c vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslstubs.c vendor-sys/acpica/dist/dispatcher/dsfield.c vendor-sys/acpica/dist/dispatcher/dsmethod.c vendor-sys/acpica/dist/dispatcher/dswload.c vendor-sys/acpica/dist/executer/exconfig.c vendor-sys/acpica/dist/hardware/hwsleep.c vendor-sys/acpica/dist/hardware/hwxface.c vendor-sys/acpica/dist/include/acdisasm.h vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/acnamesp.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acparser.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/acpredef.h vendor-sys/acpica/dist/include/actbl.h vendor-sys/acpica/dist/include/actbl1.h vendor-sys/acpica/dist/include/actbl2.h vendor-sys/acpica/dist/namespace/nseval.c vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsxfeval.c vendor-sys/acpica/dist/parser/psloop.c vendor-sys/acpica/dist/parser/psxface.c vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/utilities/utglobal.c vendor-sys/acpica/dist/utilities/utinit.c vendor-sys/acpica/dist/utilities/utxface.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/changes.txt Fri Jul 31 15:25:39 2009 (r196000) @@ -1,4 +1,76 @@ ---------------------------------------- +30 July 2009. Summary of changes for version 20090730: + +This release is available at www.acpica.org/downloads + +The ACPI 4.0 implementation for ACPICA is complete with this release. + +1) ACPI CA Core Subsystem: + +ACPI 4.0: Added header file support for all new and changed ACPI tables. +Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are new +for ACPI 4.0, but have previously been supported in ACPICA are: CPEP, BERT, +EINJ, ERST, and HEST. Other newly supported tables are: UEFI and WDAT. There +have been some ACPI 4.0 changes to other existing tables. Split the large +actbl1.h header into the existing actbl2.h header. ACPICA BZ 774. + +ACPI 4.0: Implemented predefined name validation for all new names. There are +31 new names in ACPI 4.0. The predefined validation module was split into two +files. The new file is namespace/nsrepair.c. ACPICA BZ 770. + +Implemented support for so-called "module-level executable code". This is +executable AML code that exists outside of any control method and is intended +to be executed at table load time. Although illegal since ACPI 2.0, this type +of code still exists and is apparently still being created. Blocks of this +code are now detected and executed as intended. Currently, the code blocks +must exist under either an If, Else, or While construct; these are the +typical cases seen in the field. ACPICA BZ 762. Lin Ming. + +Implemented an automatic dynamic repair for predefined names that return +nested Package objects. This applies to predefined names that are defined to +return a variable-length Package of sub-packages. If the number of sub- +packages is one, BIOS code is occasionally seen that creates a simple single +package with no sub-packages. This code attempts to fix the problem by +wrapping a new package object around the existing package. These methods can +be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA BZ +790. + +Fixed a regression introduced in 20090625 for the AcpiGetDevices interface. +The _HID/_CID matching was broken and no longer matched IDs correctly. ACPICA +BZ 793. + +Fixed a problem with AcpiReset where the reset would silently fail if the +register was one of the protected I/O ports. AcpiReset now bypasses the port +validation mechanism. This may eventually be driven into the AcpiRead/Write +interfaces. + +Fixed a regression related to the recent update of the AcpiRead/Write +interfaces. A sleep/suspend could fail if the optional PM2 Control register +does not exist during an attempt to write the Bus Master Arbitration bit. +(However, some hosts already delete the code that writes this bit, and the +code may in fact be obsolete at this date.) ACPICA BZ 799. + +Fixed a problem where AcpiTerminate could fault if inadvertently called twice +in succession. ACPICA BZ 795. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total + Debug Version: 160.5K Code, 50.6K Data, 211.1K Total + Current Release: + Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total + Debug Version: 161.6K Code, 50.9K Data, 212.5K Total + +2) iASL Compiler/Disassembler and Tools: + +ACPI 4.0: Implemented disassembler support for all new ACPI tables and +changes to existing tables. ACPICA BZ 775. + +---------------------------------------- 25 June 2009. Summary of changes for version 20090625: This release is available at www.acpica.org/downloads Modified: vendor-sys/acpica/dist/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/common/dmrestag.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmrestag.c Fri Jul 31 15:25:39 2009 (r196000) @@ -387,7 +387,7 @@ static ACPI_RESOURCE_TAG *AcpiGbl static UINT32 AcpiGbl_NextResourceId = 0; static UINT8 AcpiGbl_NextPrefix = 0; -static UINT8 AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = +static char AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = {'Y','Z','J','K','X'}; Modified: vendor-sys/acpica/dist/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtable.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtable.c Fri Jul 31 15:25:39 2009 (r196000) @@ -132,6 +132,7 @@ AcpiDmGetTableData ( static void AcpiDmCheckAscii ( UINT8 *Target, + char *RepairedName, UINT32 Count); UINT8 @@ -156,17 +157,18 @@ static const char *AcpiDmDmarS "Hardware Unit Definition", "Reserved Memory Region", "Root Port ATS Capability", + "Remapping Hardware Static Affinity", "Unknown SubTable Type" /* Reserved */ }; static const char *AcpiDmHestSubnames[] = { - "XPF Machine Check Exception", - "XPF Corrected Machine Check", - "NOT USED???", - "XPF Non-Maskable Interrupt", - "IPF Corrected Machine Check", - "IPF Corrected Platform Error", + "IA-32 Machine Check Exception", + "IA-32 Corrected Machine Check", + "IA-32 Non-Maskable Interrupt", + "Unknown SubTable Type", /* 3 - Reserved */ + "Unknown SubTable Type", /* 4 - Reserved */ + "Unknown SubTable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -208,6 +210,14 @@ static const char *AcpiDmSratS "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmIvrsSubnames[] = +{ + "Hardware Definition Block", + "Memory Definition Block", + "Unknown SubTable Type" /* Reserved */ +}; + + #define ACPI_FADT_PM_RESERVED 8 @@ -224,11 +234,12 @@ static const char *AcpiDmFadtP "Unknown Profile Type" }; - /******************************************************************************* * * ACPI Table Data, indexed by signature. * + * Each entry contains: Signature, Table Info, Handler, Description + * * Simple tables have only a TableInfo structure, complex tables have a handler. * This table must be NULL terminated. RSDP and FACS are special-cased * elsewhere. @@ -249,8 +260,10 @@ static ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"}, @@ -259,6 +272,9 @@ static ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"}, {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, {NULL, NULL, NULL, NULL} @@ -511,7 +527,9 @@ AcpiDmDumpTable ( UINT8 Temp8; UINT16 Temp16; ACPI_DMTABLE_DATA *TableData; + const char *Name; BOOLEAN LastOutputBlankLine = FALSE; + char RepairedName[8]; if (!Info) @@ -547,6 +565,7 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: @@ -577,6 +596,9 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME8: ByteLength = 8; break; + case ACPI_DMT_BUF16: + ByteLength = 16; + break; case ACPI_DMT_STRING: ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; break; @@ -677,17 +699,28 @@ AcpiDmDumpTable ( ACPI_FORMAT_UINT64 (ACPI_GET64 (Target))); break; + case ACPI_DMT_BUF16: + + /* Buffer of length 16 */ + + for (Temp8 = 0; Temp8 < 16; Temp8++) + { + AcpiOsPrintf ("%2.2X,", Target[Temp8]); + } + AcpiOsPrintf ("\n"); + break; + case ACPI_DMT_STRING: - AcpiOsPrintf ("%s\n", ACPI_CAST_PTR (char, Target)); + AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target)); break; /* Fixed length ASCII name fields */ case ACPI_DMT_SIG: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\" ", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\" ", RepairedName); TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); if (TableData) { @@ -698,20 +731,20 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\"\n", RepairedName); break; case ACPI_DMT_NAME6: - AcpiDmCheckAscii (Target, 6); - AcpiOsPrintf ("\"%6.6s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 6); + AcpiOsPrintf ("\"%.6s\"\n", RepairedName); break; case ACPI_DMT_NAME8: - AcpiDmCheckAscii (Target, 8); - AcpiOsPrintf ("\"%8.8s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 8); + AcpiOsPrintf ("\"%.8s\"\n", RepairedName); break; /* Special Data Types */ @@ -742,8 +775,8 @@ AcpiDmDumpTable ( /* Generic Address Structure */ AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -790,8 +823,8 @@ AcpiDmDumpTable ( case ACPI_DMT_HESTNTFY: AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -849,6 +882,31 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]); break; + case ACPI_DMT_IVRS: + + /* IVRS subtable types */ + + Temp8 = *Target; + switch (Temp8) + { + case ACPI_IVRS_TYPE_HARDWARE: + Name = AcpiDmIvrsSubnames[0]; + break; + + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + Name = AcpiDmIvrsSubnames[1]; + break; + + default: + Name = AcpiDmIvrsSubnames[2]; + break; + } + + AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name); + break; + case ACPI_DMT_EXIT: return (AE_OK); @@ -888,6 +946,7 @@ AcpiDmDumpTable ( static void AcpiDmCheckAscii ( UINT8 *Name, + char *RepairedName, UINT32 Count) { UINT32 i; @@ -895,9 +954,15 @@ AcpiDmCheckAscii ( for (i = 0; i < Count; i++) { - if (!Name[i] || !isprint (Name[i])) + RepairedName[i] = Name[i]; + + if (!Name[i]) + { + return; + } + if (!isprint (Name[i])) { - Name[i] = ' '; + RepairedName[i] = ' '; } } } Modified: vendor-sys/acpica/dist/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbdump.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtbdump.c Fri Jul 31 15:25:39 2009 (r196000) @@ -306,6 +306,7 @@ AcpiDmDumpAsf ( UINT32 DataLength = 0; UINT32 DataOffset = 0; UINT32 i; + UINT8 Type; /* No main table, only sub-tables */ @@ -322,7 +323,11 @@ AcpiDmDumpAsf ( return; } - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + /* The actual type is the lower 7 bits of Type */ + + Type = (UINT8) (SubTable->Header.Type & 0x7F); + + switch (Type) { case ACPI_ASF_TYPE_INFO: InfoTable = AcpiDmTableInfoAsf0; @@ -332,8 +337,8 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); - DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts; - DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -341,8 +346,8 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls; - DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -353,7 +358,7 @@ AcpiDmDumpAsf ( case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; @@ -371,7 +376,7 @@ AcpiDmDumpAsf ( /* Dump variable-length extra data */ - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + switch (Type) { case ACPI_ASF_TYPE_ALERT: case ACPI_ASF_TYPE_CONTROL: @@ -471,7 +476,7 @@ AcpiDmDumpCpep ( { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoCpep0); + SubTable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -479,8 +484,9 @@ AcpiDmDumpCpep ( /* Point to next sub-table */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length); + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, + SubTable->Header.Length); } } @@ -550,6 +556,10 @@ AcpiDmDumpDmar ( InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; + case ACPI_DMAR_HARDWARE_AFFINITY: + InfoTable = AcpiDmTableInfoDmar3; + ScopeOffset = sizeof (ACPI_DMAR_RHSA); + break; default: AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); return; @@ -754,29 +764,19 @@ AcpiDmDumpHest ( { switch (SubTable->Type) { - case ACPI_HEST_TYPE_XPF_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CHECK: InfoTable = AcpiDmTableInfoHest0; - SubTableLength = sizeof (ACPI_HEST_XPF_MACHINE_CHECK); + SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); break; - case ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: InfoTable = AcpiDmTableInfoHest1; - SubTableLength = sizeof (ACPI_HEST_XPF_CORRECTED); - break; - - case ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT: - InfoTable = AcpiDmTableInfoHest3; - SubTableLength = sizeof (ACPI_HEST_XPF_NMI); - break; - - case ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK: - InfoTable = AcpiDmTableInfoHest4; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED); + SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED); break; - case ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR: - InfoTable = AcpiDmTableInfoHest5; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED_PLATFORM); + case ACPI_HEST_TYPE_IA32_NMI: + InfoTable = AcpiDmTableInfoHest2; + SubTableLength = sizeof (ACPI_HEST_IA_NMI); break; case ACPI_HEST_TYPE_AER_ROOT_PORT: @@ -794,7 +794,7 @@ AcpiDmDumpHest ( SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE); break; - case ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE: + case ACPI_HEST_TYPE_GENERIC_ERROR: InfoTable = AcpiDmTableInfoHest9; SubTableLength = sizeof (ACPI_HEST_GENERIC); break; @@ -824,6 +824,179 @@ AcpiDmDumpHest ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpIvrs + * + * PARAMETERS: Table - A IVRS table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a IVRS + * + ******************************************************************************/ + +static UINT8 EntrySizes[] = {4,8,16,32}; + +void +AcpiDmDumpIvrs ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_IVRS); + UINT32 EntryOffset; + UINT32 EntryLength; + UINT32 EntryType; + ACPI_IVRS_DE_HEADER *DeviceEntry; + ACPI_IVRS_HEADER *SubTable; + ACPI_DMTABLE_INFO *InfoTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoIvrsHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_IVRS_TYPE_HARDWARE: + InfoTable = AcpiDmTableInfoIvrs0; + break; + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + InfoTable = AcpiDmTableInfoIvrs1; + break; + default: + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n", + SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubTable; + } + + /* Dump the subtable */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* The hardware subtable can contain multiple device entries */ + + if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE) + { + EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE); + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable, + sizeof (ACPI_IVRS_HARDWARE)); + + while (EntryOffset < (Offset + SubTable->Length)) + { + AcpiOsPrintf ("\n"); + /* + * Upper 2 bits of Type encode the length of the device entry + * + * 00 = 4 byte + * 01 = 8 byte + * 10 = 16 byte - currently no entries defined + * 11 = 32 byte - currently no entries defined + */ + EntryType = DeviceEntry->Type; + EntryLength = EntrySizes [EntryType >> 6]; + + switch (EntryType) + { + /* 4-byte device entries */ + + case ACPI_IVRS_TYPE_PAD4: + case ACPI_IVRS_TYPE_ALL: + case ACPI_IVRS_TYPE_SELECT: + case ACPI_IVRS_TYPE_START: + case ACPI_IVRS_TYPE_END: + + InfoTable = AcpiDmTableInfoIvrs4; + break; + + /* 8-byte entries, type A */ + + case ACPI_IVRS_TYPE_ALIAS_SELECT: + case ACPI_IVRS_TYPE_ALIAS_START: + + InfoTable = AcpiDmTableInfoIvrs8a; + break; + + /* 8-byte entries, type B */ + + case ACPI_IVRS_TYPE_PAD8: + case ACPI_IVRS_TYPE_EXT_SELECT: + case ACPI_IVRS_TYPE_EXT_START: + + InfoTable = AcpiDmTableInfoIvrs8b; + break; + + /* 8-byte entries, type C */ + + case ACPI_IVRS_TYPE_SPECIAL: + + InfoTable = AcpiDmTableInfoIvrs8c; + break; + + default: + InfoTable = AcpiDmTableInfoIvrs4; + AcpiOsPrintf ( + "\n**** Unknown IVRS device entry type/length: " + "%.2X/%X at offset %.4X: (header below)\n", + EntryType, EntryLength, EntryOffset); + break; + } + + /* Dump the Device Entry */ + + Status = AcpiDmDumpTable (Table->Length, EntryOffset, + DeviceEntry, EntryLength, InfoTable); + + EntryOffset += EntryLength; + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, + EntryLength); + } + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpMadt * * PARAMETERS: Table - A MADT table @@ -993,6 +1166,58 @@ AcpiDmDumpMcfg ( /******************************************************************************* * + * FUNCTION: AcpiDmDumpMsct + * + * PARAMETERS: Table - A MSCT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a MSCT + * + ******************************************************************************/ + +void +AcpiDmDumpMsct ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_MSCT); + ACPI_MSCT_PROXIMITY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_MSCT_PROXIMITY); + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY)); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpSlit * * PARAMETERS: Table - An SLIT @@ -1149,3 +1374,54 @@ NextSubTable: } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpWdat + * + * PARAMETERS: Table - A WDAT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a WDAT + * + ******************************************************************************/ + +void +AcpiDmDumpWdat ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_WDAT); + ACPI_WDAT_ENTRY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_WDAT_ENTRY); + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY)); + } +} Modified: vendor-sys/acpica/dist/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbinfo.c Fri Jul 31 14:43:05 2009 (r195999) +++ vendor-sys/acpica/dist/common/dmtbinfo.c Fri Jul 31 15:25:39 2009 (r196000) @@ -139,14 +139,19 @@ #define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) #define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) #define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) +#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) +#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) #define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ @@ -163,17 +168,23 @@ #define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) #define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) #define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) +#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_MACHINE_CHECK,f) -#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_CORRECTED,f) -#define ACPI_HEST3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_NMI,f) -#define ACPI_HEST4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED,f) -#define ACPI_HEST5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED_PLATFORM,f) +#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) +#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) +#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) #define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) #define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) +#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f) +#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) +#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) +#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) +#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) +#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) +#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) #define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) #define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) #define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) @@ -187,10 +198,12 @@ #define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) #define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) #define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) #define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) +#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes @@ -306,7 +319,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)"}, {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector"}, {ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version"}, - {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)"}, {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)"}, {ACPI_DMT_EXIT, 0, NULL} @@ -458,9 +471,9 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] = { {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value"}, - {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Polling Interval"}, + {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval"}, {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID"}, - {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (SystemId), "Manufacturer ID"}, + {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID"}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} @@ -583,8 +596,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] = { - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Type), "Subtable Type"}, - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Length), "Length"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID"}, {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval"}, @@ -675,6 +688,16 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_EXIT, 0, NULL} }; +/* 3: Remapping Hardware Static Affinity Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] = +{ + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address"}, + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + /******************************************************************************* * @@ -702,7 +725,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] = { {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length"}, - {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved"}, {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -747,97 +771,84 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_EXIT, 0, NULL} }; +/* Common HEST structures for subtables */ + +#define ACPI_DM_HEST_HEADER \ + {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, \ + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id"} + +#define ACPI_DM_HEST_AER \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities"} + + /* HEST Subtables */ -/* 0: XPF Machine Check Exception */ +/* 0: IA32 Machine Check Exception */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = { - {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled"}, + {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved2), "Reserved"}, + {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 1: XPF Corrected Machine Check */ +/* 1: IA32 Corrected Machine Check */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = { - {ACPI_DMT_HEST, ACPI_HEST1_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 3: XPF Non-Maskable Interrupt */ +/* 2: IA32 Non-Maskable Interrupt */ -ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[] = +ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] = { - {ACPI_DMT_HEST, ACPI_HEST3_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST3_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 4: IPF Corrected Machine Check */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[] = -{ - {ACPI_DMT_HEST, ACPI_HEST4_OFFSET (Header.Type), "Subtable Type"}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:27:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E533F1065707; Fri, 31 Jul 2009 15:27:14 +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 B8AC68FC15; Fri, 31 Jul 2009 15:27:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VFREPZ073290; Fri, 31 Jul 2009 15:27:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VFRETl073289; Fri, 31 Jul 2009 15:27:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907311527.n6VFRETl073289@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 Jul 2009 15:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196001 - vendor-sys/acpica/20090730 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:27:15 -0000 Author: jkim Date: Fri Jul 31 15:27:14 2009 New Revision: 196001 URL: http://svn.freebsd.org/changeset/base/196001 Log: Tag ACPICA 20090730 Added: vendor-sys/acpica/20090730/ - copied from r196000, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:27:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E603106570E; Fri, 31 Jul 2009 15:27:15 +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 E3E958FC16; Fri, 31 Jul 2009 15:27:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VFREug073295; Fri, 31 Jul 2009 15:27:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VFREEH073294; Fri, 31 Jul 2009 15:27:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907311527.n6VFREEH073294@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 31 Jul 2009 15:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196001 - vendor-sys/acpica/20090730 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:27:17 -0000 Author: jkim Date: Fri Jul 31 15:27:14 2009 New Revision: 196001 URL: http://svn.freebsd.org/changeset/base/196001 Log: Tag ACPICA 20090730 Added: vendor-sys/acpica/20090730/ - copied from r196000, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 15:43:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F367106564A; Fri, 31 Jul 2009 15:43:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 454BE8FC18; Fri, 31 Jul 2009 15:43:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:42474 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1MWuCM-0006W9-3V; Fri, 31 Jul 2009 17:39:11 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 87DA8323A7; Fri, 31 Jul 2009 17:38:48 +0200 (CEST) Message-Id: <1D4AD92D-F9F7-4759-9693-D11ED6BF95BC@exscape.org> From: Thomas Backman To: Ed Schouten In-Reply-To: <20090731150434.GO1292@hoeg.nl> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Fri, 31 Jul 2009 17:38:45 +0200 References: <200907271351.n6RDptNX002239@svn.freebsd.org> <20090731150328.GN1292@hoeg.nl> <20090731150434.GO1292@hoeg.nl> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1MWuCM-0006W9-3V. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MWuCM-0006W9-3V 0d20497765e3e1abc2bf4f32543b6426 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 15:43:02 -0000 On Jul 31, 2009, at 17:04, Ed Schouten wrote: > * Ed Schouten wrote: >> Yay -- this change broke FreeBSD on my MacBook3,1. Could we please >> add >> MacBook3,1 to this list before releasing 8.0? > > By the way, there is no reason to list MacBook1,1 and friends in > sys/amd64. Those models don't have a Core 2 Duo yet, right? The *MacBookPro*1,1 is most certainly a Core Duo (32-bit only), and I'm pretty sure the MacBook1,1 is too. Now, I don't know what the second number means; all I know is that I have a "MacBookPro2,2", which is the first generation to feature a Core 2 Duo (2.16 GHz), released in October 2006. (Which, as I said, also features an ICH7M chipset.) Regards, Thomas From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 16:00:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB901065672; Fri, 31 Jul 2009 16:00:41 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88E088FC1B; Fri, 31 Jul 2009 16:00:41 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VG0fCY074161; Fri, 31 Jul 2009 16:00:41 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VG0fJ0074159; Fri, 31 Jul 2009 16:00:41 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200907311600.n6VG0fJ0074159@svn.freebsd.org> From: Jamie Gritton Date: Fri, 31 Jul 2009 16:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196002 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 16:00:42 -0000 Author: jamie Date: Fri Jul 31 16:00:41 2009 New Revision: 196002 URL: http://svn.freebsd.org/changeset/base/196002 Log: Make the "enforce_statfs" default 2 (most restrictive) in jail_set(2), instead of whatever the parent/system has (which is generally 0). This mirrors the old-style default used for jail(2) in conjunction with the security.jail.enforce_statfs sysctl. Approved by: re (kib), bz (mentor) Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Jul 31 15:27:14 2009 (r196001) +++ head/sys/kern/kern_jail.c Fri Jul 31 16:00:41 2009 (r196002) @@ -165,9 +165,10 @@ static char *pr_allow_nonames[] = { "allow.nosocket_af", }; -#define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME +#define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME +#define JAIL_DEFAULT_ENFORCE_STATFS 2 static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; -static int jail_default_enforce_statfs = 2; +static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; #if defined(INET) || defined(INET6) static unsigned jail_max_af_ips = 255; #endif @@ -1181,7 +1182,7 @@ kern_jail_set(struct thread *td, struct #endif pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; - pr->pr_enforce_statfs = ppr->pr_enforce_statfs; + pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 16:20:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE51106566C; Fri, 31 Jul 2009 16:20:49 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 9F68E8FC15; Fri, 31 Jul 2009 16:20:48 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from gidgate.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id n6VG6Hfq048682; Fri, 31 Jul 2009 17:06:17 +0100 (BST) (envelope-from rb@gid.co.uk) Received: from [194.32.164.28] ([194.32.164.6]) by gidgate.gid.co.uk (8.13.8/8.13.8) with ESMTP id n6VG6COG097969; Fri, 31 Jul 2009 17:06:12 +0100 (BST) (envelope-from rb@gid.co.uk) Message-Id: <1C4B71BF-20B2-4DC7-BE31-F41498EEABA3@gid.co.uk> From: Bob Bishop To: Thomas Backman In-Reply-To: <1D4AD92D-F9F7-4759-9693-D11ED6BF95BC@exscape.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Fri, 31 Jul 2009 17:06:12 +0100 References: <200907271351.n6RDptNX002239@svn.freebsd.org> <20090731150328.GN1292@hoeg.nl> <20090731150434.GO1292@hoeg.nl> <1D4AD92D-F9F7-4759-9693-D11ED6BF95BC@exscape.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 16:20:49 -0000 Hi, On 31 Jul 2009, at 16:38, Thomas Backman wrote: > Now, I don't know what the second number means; all I know is that I > have a "MacBookPro2,2", which is the first generation to feature a > Core 2 Duo (2.16 GHz), released in October 2006. The second digit identifies the particular variant, eg mine is: Model Name: MacBook Pro 17" Model Identifier: MacBookPro2,1 Processor Name: Intel Core 2 Duo Processor Speed: 2.33 GHz The following list is sometimes useful: http://www.everymac.com/systems/by_capability/macs-by-machine-model-machine-id.html -- Bob Bishop rb@gid.co.uk From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 17:00:52 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D18106570E; Fri, 31 Jul 2009 17:00:52 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 25C468FC28; Fri, 31 Jul 2009 17:00:51 +0000 (UTC) (envelope-from sam@errno.com) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n6VH0TSs090846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 31 Jul 2009 10:00:29 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <4A73232D.8050605@errno.com> Date: Fri, 31 Jul 2009 10:00:29 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Ed Schouten References: <200907271351.n6RDptNX002239@svn.freebsd.org> <20090731150328.GN1292@hoeg.nl> In-Reply-To: <20090731150328.GN1292@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Rui Paulo Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 17:00:53 -0000 Ed Schouten wrote: > * Rui Paulo wrote: >> Refine the MacBook hack to only match early models that have Intel ICH. > ... >> - if (strncmp(sysenv, "MacBook", 7) == 0) { >> + if (strncmp(sysenv, "MacBook1,1", 10) == 0 || >> + strncmp(sysenv, "MacBookPro1,1", 13) == 0 || >> + strncmp(sysenv, "MacBookPro1,2", 13) == 0 || >> + strncmp(sysenv, "Macmini1,1", 10) == 0) { > > Yay -- this change broke FreeBSD on my MacBook3,1. Could we please add > MacBook3,1 to this list before releasing 8.0? > A hack like this deserves a loader tunable to set the list or, perhaps easier, an extra model ID to allow workaround w/o rebuilding (e.g. for doing an install). Sam From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 17:30:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D557B106566C; Fri, 31 Jul 2009 17:30:20 +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 A5DE78FC1D; Fri, 31 Jul 2009 17:30:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5B7F346B46; Fri, 31 Jul 2009 13:30:20 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id ACE2E8A0A5; Fri, 31 Jul 2009 13:30:19 -0400 (EDT) From: John Baldwin To: Sam Leffler Date: Fri, 31 Jul 2009 13:28:27 -0400 User-Agent: KMail/1.9.7 References: <200907271351.n6RDptNX002239@svn.freebsd.org> <20090731150328.GN1292@hoeg.nl> <4A73232D.8050605@errno.com> In-Reply-To: <4A73232D.8050605@errno.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907311328.28681.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 31 Jul 2009 13:30:19 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r195907 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 17:30:21 -0000 On Friday 31 July 2009 1:00:29 pm Sam Leffler wrote: > Ed Schouten wrote: > > * Rui Paulo wrote: > >> Refine the MacBook hack to only match early models that have Intel ICH. > > ... > >> - if (strncmp(sysenv, "MacBook", 7) == 0) { > >> + if (strncmp(sysenv, "MacBook1,1", 10) == 0 || > >> + strncmp(sysenv, "MacBookPro1,1", 13) == 0 || > >> + strncmp(sysenv, "MacBookPro1,2", 13) == 0 || > >> + strncmp(sysenv, "Macmini1,1", 10) == 0) { > > > > Yay -- this change broke FreeBSD on my MacBook3,1. Could we please add > > MacBook3,1 to this list before releasing 8.0? > > > > A hack like this deserves a loader tunable to set the list or, perhaps > easier, an extra model ID to allow workaround w/o rebuilding (e.g. for > doing an install). Or just a tunable to force it on: 'machdep.disable_ich_smi' or some such. Note that different ICH store PMBASE in different places. It's in a different register in the ICH10 for example (PCI config register 0x44 vs 0x40 on older ICHs). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 17:57:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293A8106566B; Fri, 31 Jul 2009 17:57:17 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 175A18FC1F; Fri, 31 Jul 2009 17:57:17 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VHvGDL076665; Fri, 31 Jul 2009 17:57:16 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VHvGZf076664; Fri, 31 Jul 2009 17:57:16 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200907311757.n6VHvGZf076664@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 31 Jul 2009 17:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196003 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 17:57:17 -0000 Author: weongyo Date: Fri Jul 31 17:57:16 2009 New Revision: 196003 URL: http://svn.freebsd.org/changeset/base/196003 Log: add upgt Approved by: re (kib) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jul 31 16:00:41 2009 (r196002) +++ head/sys/conf/files Fri Jul 31 17:57:16 2009 (r196003) @@ -1627,6 +1627,7 @@ dev/usb/net/usb_ethernet.c \ # dev/usb/wlan/if_rum.c optional rum dev/usb/wlan/if_uath.c optional uath +dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural dev/usb/wlan/if_urtw.c optional urtw dev/usb/wlan/if_zyd.c optional zyd From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 19:12:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B89D106566B; Fri, 31 Jul 2009 19:12:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A5C28FC08; Fri, 31 Jul 2009 19:12:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VJCJDZ078351; Fri, 31 Jul 2009 19:12:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VJCJSX078349; Fri, 31 Jul 2009 19:12:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907311912.n6VJCJSX078349@svn.freebsd.org> From: Sam Leffler Date: Fri, 31 Jul 2009 19:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196004 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 19:12:20 -0000 Author: sam Date: Fri Jul 31 19:12:19 2009 New Revision: 196004 URL: http://svn.freebsd.org/changeset/base/196004 Log: Filter setting IFF_PROMISC on tdma vaps; we don't want the underyling device to be in promiscuous mode as we have a h/w bssid. Approved by: re (kib) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Jul 31 17:57:16 2009 (r196003) +++ head/sys/net80211/ieee80211.c Fri Jul 31 19:12:19 2009 (r196004) @@ -638,7 +638,8 @@ ieee80211_syncifflag_locked(struct ieee8 */ if (flag == IFF_PROMISC && !(vap->iv_opmode == IEEE80211_M_MONITOR || - vap->iv_opmode == IEEE80211_M_AHDEMO)) + (vap->iv_opmode == IEEE80211_M_AHDEMO && + (vap->iv_caps & IEEE80211_C_TDMA) == 0))) continue; bit = 1; break; From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 19:13:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC3E1065692; Fri, 31 Jul 2009 19:13:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3AD8FC25; Fri, 31 Jul 2009 19:13:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VJDGME078404; Fri, 31 Jul 2009 19:13:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VJDGRR078402; Fri, 31 Jul 2009 19:13:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907311913.n6VJDGRR078402@svn.freebsd.org> From: Sam Leffler Date: Fri, 31 Jul 2009 19:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196005 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 19:13:17 -0000 Author: sam Date: Fri Jul 31 19:13:16 2009 New Revision: 196005 URL: http://svn.freebsd.org/changeset/base/196005 Log: fix misplaced #endif that caused tdma handling to be merged with ESS handling (causing tdma scanning to break) Approved by: re (kib) Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Fri Jul 31 19:12:19 2009 (r196004) +++ head/sys/net80211/ieee80211_scan_sta.c Fri Jul 31 19:13:16 2009 (r196005) @@ -1018,8 +1018,8 @@ match_bss(struct ieee80211vap *vap, else if (ms->ms_idlen != 0 && match_id(se->se_meshid, ms->ms_id, ms->ms_idlen)) fail |= MATCH_MESHID; - } else { #endif + } else { if ((se->se_capinfo & IEEE80211_CAPINFO_ESS) == 0) fail |= MATCH_CAPINFO; /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 20:32:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C5F1106566C; Fri, 31 Jul 2009 20:32:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 062348FC12; Fri, 31 Jul 2009 20:32:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6VKWuOP080070; Fri, 31 Jul 2009 20:32:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6VKWtZG080053; Fri, 31 Jul 2009 20:32:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907312032.n6VKWtZG080053@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Jul 2009 20:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196006 - in stable/7: . lib/libc lib/libc/gen lib/libc/include lib/libc/sys sys sys/compat/freebsd32 sys/compat/linux sys/compat/svr4 sys/contrib/pf sys/i386/ibcs2 sys/kern sys/sys usr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 20:32:56 -0000 Author: jhb Date: Fri Jul 31 20:32:55 2009 New Revision: 196006 URL: http://svn.freebsd.org/changeset/base/196006 Log: MFC: Change the ABI of some of the structures used by the SYSV IPC API: - Various members of struct ipc_perm use appropriate types instead of unsigned short. - The shm_segsz member of struct shmid_ds is now a size_t instead of an int which should allow for complete support of SYSV SHM regions >= 2GB. - The shm_nattch member of struct shmid_ds is now an int instead of a short. - The existing versions of the __semctl(), msgctl(), and shmctl() system calls have been renamed to freebsd7_*() and implement the old ABI. New versions of these system calls provide the new ABI. The new system calls also use newer symbol versions in libc so old and new binaries will both work under new kernels. - Specific to 7.x: the kern_msgctl(), kern_semctl(), and kern_shmctl() functions now use ABI shims that transparently "rename" the functions to kern_new_*() for all new modules. Existing compat functions under the old names remain to provide compatibility for older kernel modules. Added: stable/7/lib/libc/include/compat.h - copied unchanged from r194910, head/lib/libc/include/compat.h Modified: stable/7/UPDATING stable/7/lib/libc/ (props changed) stable/7/lib/libc/gen/Symbol.map stable/7/lib/libc/gen/msgctl.3 stable/7/lib/libc/gen/semctl.c stable/7/lib/libc/sys/Makefile.inc stable/7/lib/libc/sys/Symbol.map stable/7/lib/libc/sys/semctl.2 stable/7/lib/libc/sys/shmctl.2 stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/freebsd32_ipc.h stable/7/sys/compat/freebsd32/freebsd32_misc.c stable/7/sys/compat/freebsd32/syscalls.master stable/7/sys/compat/linux/linux_ipc.c stable/7/sys/compat/svr4/svr4_ipc.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/ibcs2/ibcs2_ipc.c stable/7/sys/kern/syscalls.master stable/7/sys/kern/sysv_ipc.c stable/7/sys/kern/sysv_msg.c stable/7/sys/kern/sysv_sem.c stable/7/sys/kern/sysv_shm.c stable/7/sys/sys/ipc.h stable/7/sys/sys/msg.h stable/7/sys/sys/param.h stable/7/sys/sys/sem.h stable/7/sys/sys/shm.h stable/7/sys/sys/syscallsubr.h stable/7/usr.bin/ipcs/ (props changed) stable/7/usr.bin/ipcs/ipcs.c Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/UPDATING Fri Jul 31 20:32:55 2009 (r196006) @@ -8,6 +8,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090731: + The ABI of various structures related to the SYSV IPC API have + been changed. Bump __FreeBSD_version to 702105. + 20090606: The components of PmcTools have been upgraded. Please update world and the kernel. Modified: stable/7/lib/libc/gen/Symbol.map ============================================================================== --- stable/7/lib/libc/gen/Symbol.map Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/gen/Symbol.map Fri Jul 31 20:32:55 2009 (r196006) @@ -257,7 +257,6 @@ FBSD_1.0 { sem_timedwait; sem_post; sem_getvalue; - semctl; setdomainname; sethostname; longjmperror; @@ -339,6 +338,7 @@ FBSD_1.0 { FBSD_1.1 { fdopendir; feature_present; + semctl; }; FBSDprivate_1.0 { Modified: stable/7/lib/libc/gen/msgctl.3 ============================================================================== --- stable/7/lib/libc/gen/msgctl.3 Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/gen/msgctl.3 Fri Jul 31 20:32:55 2009 (r196006) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd November 24, 1997 +.Dd April 3, 2008 .Dt MSGCTL 3 .Os .Sh NAME @@ -65,18 +65,14 @@ struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ struct msg *msg_first; /* first message in the queue */ struct msg *msg_last; /* last message in the queue */ - u_long msg_cbytes; /* number of bytes in use on the queue */ - u_long msg_qnum; /* number of msgs in the queue */ - u_long msg_qbytes; /* max # of bytes on the queue */ + msglen_t msg_cbytes; /* number of bytes in use on the queue */ + msgqnum_t msg_qnum; /* number of msgs in the queue */ + msglen_t msg_qbytes; /* max # of bytes on the queue */ pid_t msg_lspid; /* pid of last msgsnd() */ pid_t msg_lrpid; /* pid of last msgrcv() */ time_t msg_stime; /* time of last msgsnd() */ - long msg_pad1; time_t msg_rtime; /* time of last msgrcv() */ - long msg_pad2; time_t msg_ctime; /* time of last msgctl() */ - long msg_pad3; - long msg_pad4[4]; }; .Ed .Pp @@ -89,13 +85,13 @@ structure is defined in and looks like this: .Bd -literal struct ipc_perm { - ushort cuid; /* creator user id */ - ushort cgid; /* creator group id */ - ushort uid; /* user id */ - ushort gid; /* group id */ - ushort mode; /* r/w permission */ - ushort seq; /* sequence # (to generate unique msg/sem/shm id) */ - key_t key; /* user specified msg/sem/shm key */ + uid_t cuid; /* creator user id */ + gid_t cgid; /* creator group id */ + uid_t uid; /* user id */ + gid_t gid; /* group id */ + mode_t mode; /* r/w permission */ + unsigned short seq; /* sequence # (to generate unique ipcid) */ + key_t key; /* user specified msg/sem/shm key */ }; .Ed .Pp Modified: stable/7/lib/libc/gen/semctl.c ============================================================================== --- stable/7/lib/libc/gen/semctl.c Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/gen/semctl.c Fri Jul 31 20:32:55 2009 (r196006) @@ -29,15 +29,19 @@ #include __FBSDID("$FreeBSD$"); +#define _WANT_SEMUN_OLD + #include #include #include #include #include -extern int __semctl(int semid, int semnum, int cmd, union semun *arg); +int __semctl(int semid, int semnum, int cmd, union semun *arg); +int freebsd7___semctl(int semid, int semnum, int cmd, union semun_old *arg); -int semctl(int semid, int semnum, int cmd, ...) +int +semctl(int semid, int semnum, int cmd, ...) { va_list ap; union semun semun; @@ -55,3 +59,25 @@ int semctl(int semid, int semnum, int cm return (__semctl(semid, semnum, cmd, semun_ptr)); } + +int +freebsd7_semctl(int semid, int semnum, int cmd, ...) +{ + va_list ap; + union semun_old semun; + union semun_old *semun_ptr; + + va_start(ap, cmd); + if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL + || cmd == SETVAL || cmd == SETALL) { + semun = va_arg(ap, union semun_old); + semun_ptr = &semun; + } else { + semun_ptr = NULL; + } + va_end(ap); + + return (freebsd7___semctl(semid, semnum, cmd, semun_ptr)); +} + +__sym_compat(semctl, freebsd7_semctl, FBSD_1.0); Copied: stable/7/lib/libc/include/compat.h (from r194910, head/lib/libc/include/compat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libc/include/compat.h Fri Jul 31 20:32:55 2009 (r196006, copy of r194910, head/lib/libc/include/compat.h) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2009 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This file defines compatiblity symbol versions for old system calls. It + * is included in all generated system call files. + */ + +#ifndef __LIBC_COMPAT_H__ +#define __LIBC_COMPAT_H__ + +#define __sym_compat(sym,impl,verid) \ + .symver impl , sym @ verid + +__sym_compat(__semctl, freebsd7___semctl, FBSD_1.0); +__sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0); +__sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0); + +#undef __sym_compat + +#endif /* __LIBC_COMPAT_H__ */ + Modified: stable/7/lib/libc/sys/Makefile.inc ============================================================================== --- stable/7/lib/libc/sys/Makefile.inc Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/sys/Makefile.inc Fri Jul 31 20:32:55 2009 (r196006) @@ -53,11 +53,13 @@ SYM_MAPS+= ${.CURDIR}/sys/Symbol.map CLEANFILES+= ${SASM} ${SPSEUDO} ${SASM}: - printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET} + printf '#include "compat.h"\n' > ${.TARGET} + printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET} ${SPSEUDO}: + printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \ - > ${.TARGET} + >> ${.TARGET} MAN+= _exit.2 abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ Modified: stable/7/lib/libc/sys/Symbol.map ============================================================================== --- stable/7/lib/libc/sys/Symbol.map Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/sys/Symbol.map Fri Jul 31 20:32:55 2009 (r196006) @@ -31,7 +31,6 @@ FBSD_1.0 { __mac_set_file; __mac_set_link; __mac_set_proc; - __semctl; __setugid; __syscall; __sysctl; @@ -190,7 +189,6 @@ FBSD_1.0 { modstat; mount; mprotect; - msgctl; msgget; msgrcv; msgsnd; @@ -271,7 +269,6 @@ FBSD_1.0 { settimeofday; setuid; shmat; - shmctl; shmdt; shmget; shmsys; @@ -336,13 +333,16 @@ FBSD_1.0 { }; FBSD_1.1 { + __semctl; closefrom; cpuset; cpuset_getid; cpuset_setid; cpuset_getaffinity; cpuset_setaffinity; + msgctl; setfib; + shmctl; }; FBSDprivate_1.0 { Modified: stable/7/lib/libc/sys/semctl.2 ============================================================================== --- stable/7/lib/libc/sys/semctl.2 Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/sys/semctl.2 Fri Jul 31 20:32:55 2009 (r196006) @@ -148,12 +148,9 @@ struct semid_ds { struct sem *sem_base; /* pointer to first semaphore in set */ u_short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ - long sem_pad1; /* SVABI/386 says I need this here */ time_t sem_ctime; /* last change time */ /* Times measured in secs since */ /* 00:00:00 GMT, Jan. 1, 1970 */ - long sem_pad2; /* SVABI/386 says I need this here */ - long sem_pad3[4]; /* SVABI/386 says I need this here */ }; .Ed .Sh RETURN VALUES Modified: stable/7/lib/libc/sys/shmctl.2 ============================================================================== --- stable/7/lib/libc/sys/shmctl.2 Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/lib/libc/sys/shmctl.2 Fri Jul 31 20:32:55 2009 (r196006) @@ -100,14 +100,13 @@ structure is defined as follows: .Bd -literal struct shmid_ds { struct ipc_perm shm_perm; /* operation permission structure */ - int shm_segsz; /* size of segment in bytes */ + size_t shm_segsz; /* size of segment in bytes */ pid_t shm_lpid; /* process ID of last shared memory op */ pid_t shm_cpid; /* process ID of creator */ - short shm_nattch; /* number of current attaches */ + int shm_nattch; /* number of current attaches */ time_t shm_atime; /* time of last shmat() */ time_t shm_dtime; /* time of last shmdt() */ time_t shm_ctime; /* time of last change by shmctl() */ - void *shm_internal; /* sysv stupidity */ }; .Ed .Sh RETURN VALUES @@ -133,16 +132,6 @@ the shared memory segment's owner or cre Permission denied due to mismatch between operation and mode of shared memory segment. .El -.Sh "BUGS" -The segment size has size_t type. -The shm_segsz member of the -.Vt shmid_ds -structure has type int, which is too short to represent the full range -of values for a segment size. -If shared memory limits are raised to allow segments with size > 2 GB -to be created, be aware that IPC_STAT call may return a truncated value -for shm_segsz. -.El .Sh "SEE ALSO" .Xr shmat 2 , .Xr shmdt 2 , Modified: stable/7/sys/compat/freebsd32/freebsd32_ipc.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_ipc.h Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/compat/freebsd32/freebsd32_ipc.h Fri Jul 31 20:32:55 2009 (r196006) @@ -30,11 +30,11 @@ #define _COMPAT_FREEBSD32_FREEBSD32_IPC_H_ struct ipc_perm32 { - uint16_t cuid; - uint16_t cgid; - uint16_t uid; - uint16_t gid; - uint16_t mode; + uid_t cuid; + gid_t cgid; + uid_t uid; + gid_t gid; + mode_t mode; uint16_t seq; uint32_t key; }; @@ -44,10 +44,7 @@ struct semid_ds32 { uint32_t sem_base; unsigned short sem_nsems; int32_t sem_otime; - int32_t sem_pad1; int32_t sem_ctime; - int32_t sem_pad2; - int32_t sem_pad3[4]; }; union semun32 { @@ -66,24 +63,19 @@ struct msqid_ds32 { pid_t msg_lspid; pid_t msg_lrpid; int32_t msg_stime; - int32_t msg_pad1; int32_t msg_rtime; - int32_t msg_pad2; int32_t msg_ctime; - int32_t msg_pad3; - int32_t msg_pad4[4]; }; struct shmid_ds32 { struct ipc_perm32 shm_perm; int32_t shm_segsz; - int32_t shm_lpid; - int32_t shm_cpid; - int16_t shm_nattch; + pid_t shm_lpid; + pid_t shm_cpid; + int shm_nattch; int32_t shm_atime; int32_t shm_dtime; int32_t shm_ctime; - uint32_t shm_internal; }; struct shm_info32 { @@ -103,4 +95,55 @@ struct shminfo32 { uint32_t shmall; }; +struct ipc_perm32_old { + uint16_t cuid; + uint16_t cgid; + uint16_t uid; + uint16_t gid; + uint16_t mode; + uint16_t seq; + uint32_t key; +}; + +struct semid_ds32_old { + struct ipc_perm32_old sem_perm; + uint32_t sem_base; + unsigned short sem_nsems; + int32_t sem_otime; + int32_t sem_pad1; + int32_t sem_ctime; + int32_t sem_pad2; + int32_t sem_pad3[4]; +}; + +struct msqid_ds32_old { + struct ipc_perm32_old msg_perm; + uint32_t msg_first; + uint32_t msg_last; + uint32_t msg_cbytes; + uint32_t msg_qnum; + uint32_t msg_qbytes; + pid_t msg_lspid; + pid_t msg_lrpid; + int32_t msg_stime; + int32_t msg_pad1; + int32_t msg_rtime; + int32_t msg_pad2; + int32_t msg_ctime; + int32_t msg_pad3; + int32_t msg_pad4[4]; +}; + +struct shmid_ds32_old { + struct ipc_perm32_old shm_perm; + int32_t shm_segsz; + pid_t shm_lpid; + pid_t shm_cpid; + int16_t shm_nattch; + int32_t shm_atime; + int32_t shm_dtime; + int32_t shm_ctime; + uint32_t shm_internal; +}; + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_IPC_H_ */ Modified: stable/7/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_misc.c Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/compat/freebsd32/freebsd32_misc.c Fri Jul 31 20:32:55 2009 (r196006) @@ -1310,6 +1310,32 @@ freebsd4_freebsd32_fhstatfs(struct threa #endif static void +freebsd32_ipcperm_old_in(struct ipc_perm32_old *ip32, struct ipc_perm *ip) +{ + + CP(*ip32, *ip, cuid); + CP(*ip32, *ip, cgid); + CP(*ip32, *ip, uid); + CP(*ip32, *ip, gid); + CP(*ip32, *ip, mode); + CP(*ip32, *ip, seq); + CP(*ip32, *ip, key); +} + +static void +freebsd32_ipcperm_old_out(struct ipc_perm *ip, struct ipc_perm32_old *ip32) +{ + + CP(*ip, *ip32, cuid); + CP(*ip, *ip32, cgid); + CP(*ip, *ip32, uid); + CP(*ip, *ip32, gid); + CP(*ip, *ip32, mode); + CP(*ip, *ip32, seq); + CP(*ip, *ip32, key); +} + +static void freebsd32_ipcperm_in(struct ipc_perm32 *ip32, struct ipc_perm *ip) { @@ -1341,14 +1367,86 @@ freebsd32_semsys(struct thread *td, stru switch (uap->which) { case 0: - return (freebsd32_semctl(td, - (struct freebsd32_semctl_args *)&uap->a2)); + return (freebsd7_freebsd32_semctl(td, + (struct freebsd7_freebsd32_semctl_args *)&uap->a2)); default: return (semsys(td, (struct semsys_args *)uap)); } } int +freebsd7_freebsd32_semctl(struct thread *td, + struct freebsd7_freebsd32_semctl_args *uap) +{ + struct semid_ds32_old dsbuf32; + struct semid_ds dsbuf; + union semun semun; + union semun32 arg; + register_t rval; + int error; + + switch (uap->cmd) { + case SEM_STAT: + case IPC_SET: + case IPC_STAT: + case GETALL: + case SETVAL: + case SETALL: + error = copyin(uap->arg, &arg, sizeof(arg)); + if (error) + return (error); + break; + } + + switch (uap->cmd) { + case SEM_STAT: + case IPC_STAT: + semun.buf = &dsbuf; + break; + case IPC_SET: + error = copyin(PTRIN(arg.buf), &dsbuf32, sizeof(dsbuf32)); + if (error) + return (error); + freebsd32_ipcperm_old_in(&dsbuf32.sem_perm, &dsbuf.sem_perm); + PTRIN_CP(dsbuf32, dsbuf, sem_base); + CP(dsbuf32, dsbuf, sem_nsems); + CP(dsbuf32, dsbuf, sem_otime); + CP(dsbuf32, dsbuf, sem_ctime); + semun.buf = &dsbuf; + break; + case GETALL: + case SETALL: + semun.array = PTRIN(arg.array); + break; + case SETVAL: + semun.val = arg.val; + break; + } + + error = kern_semctl(td, uap->semid, uap->semnum, uap->cmd, &semun, + &rval); + if (error) + return (error); + + switch (uap->cmd) { + case SEM_STAT: + case IPC_STAT: + bzero(&dsbuf32, sizeof(dsbuf32)); + freebsd32_ipcperm_old_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); + PTROUT_CP(dsbuf, dsbuf32, sem_base); + CP(dsbuf, dsbuf32, sem_nsems); + CP(dsbuf, dsbuf32, sem_otime); + CP(dsbuf, dsbuf32, sem_ctime); + error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32)); + break; + } + + if (error == 0) + td->td_retval[0] = rval; + return (error); +} + +int freebsd32_semctl(struct thread *td, struct freebsd32_semctl_args *uap) { struct semid_ds32 dsbuf32; @@ -1384,13 +1482,7 @@ freebsd32_semctl(struct thread *td, stru PTRIN_CP(dsbuf32, dsbuf, sem_base); CP(dsbuf32, dsbuf, sem_nsems); CP(dsbuf32, dsbuf, sem_otime); - CP(dsbuf32, dsbuf, sem_pad1); CP(dsbuf32, dsbuf, sem_ctime); - CP(dsbuf32, dsbuf, sem_pad2); - CP(dsbuf32, dsbuf, sem_pad3[0]); - CP(dsbuf32, dsbuf, sem_pad3[1]); - CP(dsbuf32, dsbuf, sem_pad3[2]); - CP(dsbuf32, dsbuf, sem_pad3[3]); semun.buf = &dsbuf; break; case GETALL: @@ -1410,17 +1502,12 @@ freebsd32_semctl(struct thread *td, stru switch (uap->cmd) { case SEM_STAT: case IPC_STAT: + bzero(&dsbuf32, sizeof(dsbuf32)); freebsd32_ipcperm_out(&dsbuf.sem_perm, &dsbuf32.sem_perm); PTROUT_CP(dsbuf, dsbuf32, sem_base); CP(dsbuf, dsbuf32, sem_nsems); CP(dsbuf, dsbuf32, sem_otime); - CP(dsbuf, dsbuf32, sem_pad1); CP(dsbuf, dsbuf32, sem_ctime); - CP(dsbuf, dsbuf32, sem_pad2); - CP(dsbuf, dsbuf32, sem_pad3[0]); - CP(dsbuf, dsbuf32, sem_pad3[1]); - CP(dsbuf, dsbuf32, sem_pad3[2]); - CP(dsbuf, dsbuf32, sem_pad3[3]); error = copyout(&dsbuf32, PTRIN(arg.buf), sizeof(dsbuf32)); break; } @@ -1436,8 +1523,8 @@ freebsd32_msgsys(struct thread *td, stru switch (uap->which) { case 0: - return (freebsd32_msgctl(td, - (struct freebsd32_msgctl_args *)&uap->a2)); + return (freebsd7_freebsd32_msgctl(td, + (struct freebsd7_freebsd32_msgctl_args *)&uap->a2)); case 2: return (freebsd32_msgsnd(td, (struct freebsd32_msgsnd_args *)&uap->a2)); @@ -1450,6 +1537,51 @@ freebsd32_msgsys(struct thread *td, stru } int +freebsd7_freebsd32_msgctl(struct thread *td, + struct freebsd7_freebsd32_msgctl_args *uap) +{ + struct msqid_ds msqbuf; + struct msqid_ds32_old msqbuf32; + int error; + + if (uap->cmd == IPC_SET) { + error = copyin(uap->buf, &msqbuf32, sizeof(msqbuf32)); + if (error) + return (error); + freebsd32_ipcperm_old_in(&msqbuf32.msg_perm, &msqbuf.msg_perm); + PTRIN_CP(msqbuf32, msqbuf, msg_first); + PTRIN_CP(msqbuf32, msqbuf, msg_last); + CP(msqbuf32, msqbuf, msg_cbytes); + CP(msqbuf32, msqbuf, msg_qnum); + CP(msqbuf32, msqbuf, msg_qbytes); + CP(msqbuf32, msqbuf, msg_lspid); + CP(msqbuf32, msqbuf, msg_lrpid); + CP(msqbuf32, msqbuf, msg_stime); + CP(msqbuf32, msqbuf, msg_rtime); + CP(msqbuf32, msqbuf, msg_ctime); + } + error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf); + if (error) + return (error); + if (uap->cmd == IPC_STAT) { + bzero(&msqbuf32, sizeof(msqbuf32)); + freebsd32_ipcperm_old_out(&msqbuf.msg_perm, &msqbuf32.msg_perm); + PTROUT_CP(msqbuf, msqbuf32, msg_first); + PTROUT_CP(msqbuf, msqbuf32, msg_last); + CP(msqbuf, msqbuf32, msg_cbytes); + CP(msqbuf, msqbuf32, msg_qnum); + CP(msqbuf, msqbuf32, msg_qbytes); + CP(msqbuf, msqbuf32, msg_lspid); + CP(msqbuf, msqbuf32, msg_lrpid); + CP(msqbuf, msqbuf32, msg_stime); + CP(msqbuf, msqbuf32, msg_rtime); + CP(msqbuf, msqbuf32, msg_ctime); + error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32)); + } + return (error); +} + +int freebsd32_msgctl(struct thread *td, struct freebsd32_msgctl_args *uap) { struct msqid_ds msqbuf; @@ -1469,15 +1601,8 @@ freebsd32_msgctl(struct thread *td, stru CP(msqbuf32, msqbuf, msg_lspid); CP(msqbuf32, msqbuf, msg_lrpid); CP(msqbuf32, msqbuf, msg_stime); - CP(msqbuf32, msqbuf, msg_pad1); CP(msqbuf32, msqbuf, msg_rtime); - CP(msqbuf32, msqbuf, msg_pad2); CP(msqbuf32, msqbuf, msg_ctime); - CP(msqbuf32, msqbuf, msg_pad3); - CP(msqbuf32, msqbuf, msg_pad4[0]); - CP(msqbuf32, msqbuf, msg_pad4[1]); - CP(msqbuf32, msqbuf, msg_pad4[2]); - CP(msqbuf32, msqbuf, msg_pad4[3]); } error = kern_msgctl(td, uap->msqid, uap->cmd, &msqbuf); if (error) @@ -1492,15 +1617,8 @@ freebsd32_msgctl(struct thread *td, stru CP(msqbuf, msqbuf32, msg_lspid); CP(msqbuf, msqbuf32, msg_lrpid); CP(msqbuf, msqbuf32, msg_stime); - CP(msqbuf, msqbuf32, msg_pad1); CP(msqbuf, msqbuf32, msg_rtime); - CP(msqbuf, msqbuf32, msg_pad2); CP(msqbuf, msqbuf32, msg_ctime); - CP(msqbuf, msqbuf32, msg_pad3); - CP(msqbuf, msqbuf32, msg_pad4[0]); - CP(msqbuf, msqbuf32, msg_pad4[1]); - CP(msqbuf, msqbuf32, msg_pad4[2]); - CP(msqbuf, msqbuf32, msg_pad4[3]); error = copyout(&msqbuf32, uap->buf, sizeof(struct msqid_ds32)); } return (error); @@ -1568,12 +1686,12 @@ freebsd32_shmsys(struct thread *td, stru return (sysent[SYS_shmget].sy_call(td, &ap)); } case 4: { /* shmctl */ - struct freebsd32_shmctl_args ap; + struct freebsd7_freebsd32_shmctl_args ap; ap.shmid = uap->a2; ap.cmd = uap->a3; ap.buf = PTRIN(uap->a4); - return (freebsd32_shmctl(td, &ap)); + return (freebsd7_freebsd32_shmctl(td, &ap)); } case 1: /* oshmctl */ default: @@ -1582,6 +1700,91 @@ freebsd32_shmsys(struct thread *td, stru } int +freebsd7_freebsd32_shmctl(struct thread *td, + struct freebsd7_freebsd32_shmctl_args *uap) +{ + int error = 0; + union { + struct shmid_ds shmid_ds; + struct shm_info shm_info; + struct shminfo shminfo; + } u; + union { + struct shmid_ds32_old shmid_ds32; + struct shm_info32 shm_info32; + struct shminfo32 shminfo32; + } u32; + size_t sz; + + if (uap->cmd == IPC_SET) { + if ((error = copyin(uap->buf, &u32.shmid_ds32, + sizeof(u32.shmid_ds32)))) + goto done; + freebsd32_ipcperm_old_in(&u32.shmid_ds32.shm_perm, + &u.shmid_ds.shm_perm); + CP(u32.shmid_ds32, u.shmid_ds, shm_segsz); + CP(u32.shmid_ds32, u.shmid_ds, shm_lpid); + CP(u32.shmid_ds32, u.shmid_ds, shm_cpid); + CP(u32.shmid_ds32, u.shmid_ds, shm_nattch); + CP(u32.shmid_ds32, u.shmid_ds, shm_atime); + CP(u32.shmid_ds32, u.shmid_ds, shm_dtime); + CP(u32.shmid_ds32, u.shmid_ds, shm_ctime); + } + + error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz); + if (error) + goto done; + + /* Cases in which we need to copyout */ + switch (uap->cmd) { + case IPC_INFO: + CP(u.shminfo, u32.shminfo32, shmmax); + CP(u.shminfo, u32.shminfo32, shmmin); + CP(u.shminfo, u32.shminfo32, shmmni); + CP(u.shminfo, u32.shminfo32, shmseg); + CP(u.shminfo, u32.shminfo32, shmall); + error = copyout(&u32.shminfo32, uap->buf, + sizeof(u32.shminfo32)); + break; + case SHM_INFO: + CP(u.shm_info, u32.shm_info32, used_ids); + CP(u.shm_info, u32.shm_info32, shm_rss); + CP(u.shm_info, u32.shm_info32, shm_tot); + CP(u.shm_info, u32.shm_info32, shm_swp); + CP(u.shm_info, u32.shm_info32, swap_attempts); + CP(u.shm_info, u32.shm_info32, swap_successes); + error = copyout(&u32.shm_info32, uap->buf, + sizeof(u32.shm_info32)); + break; + case SHM_STAT: + case IPC_STAT: + freebsd32_ipcperm_old_out(&u.shmid_ds.shm_perm, + &u32.shmid_ds32.shm_perm); + if (u.shmid_ds.shm_segsz > INT32_MAX) + u32.shmid_ds32.shm_segsz = INT32_MAX; + else + CP(u.shmid_ds, u32.shmid_ds32, shm_segsz); + CP(u.shmid_ds, u32.shmid_ds32, shm_lpid); + CP(u.shmid_ds, u32.shmid_ds32, shm_cpid); + CP(u.shmid_ds, u32.shmid_ds32, shm_nattch); + CP(u.shmid_ds, u32.shmid_ds32, shm_atime); + CP(u.shmid_ds, u32.shmid_ds32, shm_dtime); + CP(u.shmid_ds, u32.shmid_ds32, shm_ctime); + u32.shmid_ds32.shm_internal = 0; + error = copyout(&u32.shmid_ds32, uap->buf, + sizeof(u32.shmid_ds32)); + break; + } + +done: + if (error) { + /* Invalidate the return value */ + td->td_retval[0] = -1; + } + return (error); +} + +int freebsd32_shmctl(struct thread *td, struct freebsd32_shmctl_args *uap) { int error = 0; @@ -1610,7 +1813,6 @@ freebsd32_shmctl(struct thread *td, stru CP(u32.shmid_ds32, u.shmid_ds, shm_atime); CP(u32.shmid_ds32, u.shmid_ds, shm_dtime); CP(u32.shmid_ds32, u.shmid_ds, shm_ctime); - PTRIN_CP(u32.shmid_ds32, u.shmid_ds, shm_internal); } error = kern_shmctl(td, uap->shmid, uap->cmd, (void *)&u, &sz); @@ -1642,14 +1844,16 @@ freebsd32_shmctl(struct thread *td, stru case IPC_STAT: freebsd32_ipcperm_out(&u.shmid_ds.shm_perm, &u32.shmid_ds32.shm_perm); - CP(u.shmid_ds, u32.shmid_ds32, shm_segsz); + if (u.shmid_ds.shm_segsz > INT32_MAX) + u32.shmid_ds32.shm_segsz = INT32_MAX; + else + CP(u.shmid_ds, u32.shmid_ds32, shm_segsz); CP(u.shmid_ds, u32.shmid_ds32, shm_lpid); CP(u.shmid_ds, u32.shmid_ds32, shm_cpid); CP(u.shmid_ds, u32.shmid_ds32, shm_nattch); CP(u.shmid_ds, u32.shmid_ds32, shm_atime); CP(u.shmid_ds, u32.shmid_ds32, shm_dtime); CP(u.shmid_ds, u32.shmid_ds32, shm_ctime); - PTROUT_CP(u.shmid_ds, u32.shmid_ds32, shm_internal); error = copyout(&u32.shmid_ds32, uap->buf, sizeof(u32.shmid_ds32)); break; Modified: stable/7/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/7/sys/compat/freebsd32/syscalls.master Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/compat/freebsd32/syscalls.master Fri Jul 31 20:32:55 2009 (r196006) @@ -406,15 +406,15 @@ ; The following were introduced with NetBSD/4.4Lite-2 ; They are initialized by thier respective modules/sysinits ; XXX PROBLEM!! -220 AUE_SEMCTL STD { int freebsd32_semctl(int semid, int semnum, \ - int cmd, union semun32 *arg); } +220 AUE_SEMCTL STD { int freebsd7_freebsd32_semctl(int semid, \ + int semnum, int cmd, union semun32 *arg); } 221 AUE_SEMGET NOPROTO { int semget(key_t key, int nsems, \ int semflg); } 222 AUE_SEMOP NOPROTO { int semop(int semid, struct sembuf *sops, \ u_int nsops); } 223 AUE_NULL UNIMPL semconfig -224 AUE_MSGCTL STD { int freebsd32_msgctl(int msqid, int cmd, \ - struct msqid_ds32 *buf); } +224 AUE_MSGCTL STD { int freebsd7_freebsd32_msgctl(int msqid, \ + int cmd, struct msqid_ds32_old *buf); } 225 AUE_MSGGET NOPROTO { int msgget(key_t key, int msgflg); } 226 AUE_MSGSND STD { int freebsd32_msgsnd(int msqid, void *msgp, \ size_t msgsz, int msgflg); } @@ -422,8 +422,8 @@ size_t msgsz, long msgtyp, int msgflg); } 228 AUE_SHMAT NOPROTO { int shmat(int shmid, void *shmaddr, \ int shmflg); } -229 AUE_SHMCTL STD { int freebsd32_shmctl(int shmid, int cmd, \ - struct shmid_ds *buf); } +229 AUE_SHMCTL STD { int freebsd7_freebsd32_shmctl(int shmid, \ + int cmd, struct shmid_ds32_old *buf); } 230 AUE_SHMDT NOPROTO { int shmdt(void *shmaddr); } 231 AUE_SHMGET NOPROTO { int shmget(key_t key, int size, \ int shmflg); } @@ -878,3 +878,9 @@ 507 AUE_NULL UNIMPL freebsd32_jail_set 508 AUE_NULL UNIMPL jail_remove 509 AUE_CLOSEFROM NOPROTO { int closefrom(int lowfd); } +510 AUE_SEMCTL STD { int freebsd32_semctl(int semid, int semnum, \ + int cmd, union semun32 *arg); } +511 AUE_MSGCTL STD { int freebsd32_msgctl(int msqid, int cmd, \ + struct msqid_ds32 *buf); } +512 AUE_SHMCTL STD { int freebsd32_shmctl(int shmid, int cmd, \ + struct shmid_ds32 *buf); } Modified: stable/7/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/7/sys/compat/linux/linux_ipc.c Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/compat/linux/linux_ipc.c Fri Jul 31 20:32:55 2009 (r196006) @@ -230,23 +230,26 @@ linux_to_bsd_shmid_ds(struct l_shmid_ds bsp->shm_atime = lsp->shm_atime; bsp->shm_dtime = lsp->shm_dtime; bsp->shm_ctime = lsp->shm_ctime; - /* this goes (yet) SOS */ - bsp->shm_internal = PTRIN(lsp->private3); } static void bsd_to_linux_shmid_ds(struct shmid_ds *bsp, struct l_shmid_ds *lsp) { bsd_to_linux_ipc_perm(&bsp->shm_perm, &lsp->shm_perm); - lsp->shm_segsz = bsp->shm_segsz; + if (bsp->shm_segsz > INT_MAX) + lsp->shm_segsz = INT_MAX; + else + lsp->shm_segsz = bsp->shm_segsz; lsp->shm_lpid = bsp->shm_lpid; lsp->shm_cpid = bsp->shm_cpid; - lsp->shm_nattch = bsp->shm_nattch; + if (bsp->shm_nattch > SHRT_MAX) + lsp->shm_nattch = SHRT_MAX; + else + lsp->shm_nattch = bsp->shm_nattch; lsp->shm_atime = bsp->shm_atime; lsp->shm_dtime = bsp->shm_dtime; lsp->shm_ctime = bsp->shm_ctime; - /* this goes (yet) SOS */ - lsp->private3 = PTROUT(bsp->shm_internal); + lsp->private3 = 0; } static void @@ -424,6 +427,15 @@ linux_shmid_pushdown(l_int ver, struct l { struct l_shmid64_ds linux_shmid64; + /* + * XXX: This is backwards and loses information in shm_nattch + * and shm_segsz. We should probably either expose the BSD + * shmid structure directly and convert it to either the + * non-64 or 64 variant directly or the code should always + * convert to the 64 variant and then truncate values into the + * non-64 variant if needed since the 64 variant has more + * precision. + */ if (ver == LINUX_IPC_64) { bzero(&linux_shmid64, sizeof(linux_shmid64)); Modified: stable/7/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_ipc.c Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/compat/svr4/svr4_ipc.c Fri Jul 31 20:32:55 2009 (r196006) @@ -169,13 +169,12 @@ bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; struct svr4_semid_ds *sds; { + bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->sem_perm, &sds->sem_perm); sds->sem_base = (struct svr4_sem *) bds->sem_base; sds->sem_nsems = bds->sem_nsems; sds->sem_otime = bds->sem_otime; - sds->sem_pad1 = bds->sem_pad1; sds->sem_ctime = bds->sem_ctime; - sds->sem_pad2 = bds->sem_pad2; } static void @@ -187,9 +186,7 @@ svr4_to_bsd_semid_ds(sds, bds) bds->sem_base = (struct sem *) bds->sem_base; bds->sem_nsems = sds->sem_nsems; bds->sem_otime = sds->sem_otime; - bds->sem_pad1 = sds->sem_pad1; bds->sem_ctime = sds->sem_ctime; - bds->sem_pad2 = sds->sem_pad2; } struct svr4_sys_semctl_args { @@ -350,6 +347,7 @@ bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; struct svr4_msqid_ds *sds; { + bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->msg_perm, &sds->msg_perm); sds->msg_first = (struct svr4_msg *) bds->msg_first; sds->msg_last = (struct svr4_msg *) bds->msg_last; @@ -359,18 +357,8 @@ bsd_to_svr4_msqid_ds(bds, sds) sds->msg_lspid = bds->msg_lspid; sds->msg_lrpid = bds->msg_lrpid; sds->msg_stime = bds->msg_stime; - sds->msg_pad1 = bds->msg_pad1; sds->msg_rtime = bds->msg_rtime; - sds->msg_pad2 = bds->msg_pad2; sds->msg_ctime = bds->msg_ctime; - sds->msg_pad3 = bds->msg_pad3; - - /* use the padding for the rest of the fields */ - { - const short *pad = (const short *) bds->msg_pad4; - sds->msg_cv = pad[0]; - sds->msg_qnum_cv = pad[1]; - } } static void @@ -387,18 +375,8 @@ svr4_to_bsd_msqid_ds(sds, bds) bds->msg_lspid = sds->msg_lspid; bds->msg_lrpid = sds->msg_lrpid; bds->msg_stime = sds->msg_stime; - bds->msg_pad1 = sds->msg_pad1; bds->msg_rtime = sds->msg_rtime; - bds->msg_pad2 = sds->msg_pad2; bds->msg_ctime = sds->msg_ctime; - bds->msg_pad3 = sds->msg_pad3; - - /* use the padding for the rest of the fields */ - { - short *pad = (short *) bds->msg_pad4; - pad[0] = sds->msg_cv; - pad[1] = sds->msg_qnum_cv; - } } struct svr4_sys_msgsnd_args { @@ -543,20 +521,18 @@ bsd_to_svr4_shmid_ds(bds, sds) const struct shmid_ds *bds; struct svr4_shmid_ds *sds; { + bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->shm_perm, &sds->shm_perm); sds->shm_segsz = bds->shm_segsz; sds->shm_lkcnt = 0; sds->shm_lpid = bds->shm_lpid; sds->shm_cpid = bds->shm_cpid; - sds->shm_amp = bds->shm_internal; + sds->shm_amp = 0; sds->shm_nattch = bds->shm_nattch; sds->shm_cnattch = 0; sds->shm_atime = bds->shm_atime; - sds->shm_pad1 = 0; sds->shm_dtime = bds->shm_dtime; - sds->shm_pad2 = 0; sds->shm_ctime = bds->shm_ctime; - sds->shm_pad3 = 0; } static void @@ -568,7 +544,6 @@ svr4_to_bsd_shmid_ds(sds, bds) bds->shm_segsz = sds->shm_segsz; bds->shm_lpid = sds->shm_lpid; bds->shm_cpid = sds->shm_cpid; - bds->shm_internal = sds->shm_amp; bds->shm_nattch = sds->shm_nattch; bds->shm_atime = sds->shm_atime; bds->shm_dtime = sds->shm_dtime; Modified: stable/7/sys/i386/ibcs2/ibcs2_ipc.c ============================================================================== --- stable/7/sys/i386/ibcs2/ibcs2_ipc.c Fri Jul 31 19:13:16 2009 (r196005) +++ stable/7/sys/i386/ibcs2/ibcs2_ipc.c Fri Jul 31 20:32:55 2009 (r196006) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 31 21:39:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36898106566B; Fri, 31 Jul 2009 21:39:45 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2248B8FC14; Fri, 31 Jul 2009 21:39:44 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 5E9601A3C53; Fri, 31 Jul 2009 14:21:40 -0700 (PDT) Date: Fri, 31 Jul 2009 14:21:40 -0700 From: Alfred Perlstein To: Navdeep Parhar , Hans Petter Selasky Message-ID: <20090731212140.GK47463@elvis.mu.org> References: <200907300014.n6U0EZ77086341@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 21:39:45 -0000 Hans, can you please look into this issue? * Navdeep Parhar [090731 00:45] wrote: > On Wed, Jul 29, 2009 at 5:14 PM, Alfred Perlstein wrote: > > Author: alfred > > Date: Thu Jul 30 00:14:34 2009 > > New Revision: 195960 > > URL: http://svn.freebsd.org/changeset/base/195960 > > > > Log: > > ?USB CORE: > > ?- Add minimum polling support to drive UMASS > > ? ?and UKBD in case of panic. > > ?- Add extra check to ukbd probe to fix problem about > > ? ?mouse devices attaching like keyboards. > > ?- P4 ID: 166148 > > > > ?Submitted by: hps > > ?Approved by: ?re > > This has slowed down core dumps very significantly. What used to take 10-15s on > my system now takes around 3 minutes. A simple test is to break into ddb and > "call doadump" with or without this rev. I have a serial console on > this machine > and so I can use ddb whether the attached USB keyboard works or not. > > Here is the usbconfig from the machine: > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > ugen3.1: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > ugen4.1: at usbus4, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON > ugen1.2: at usbus1, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=SAVE > ugen1.3: at usbus1, cfg=0 md=HOST > spd=LOW (1.5Mbps) pwr=ON > ugen1.4: at usbus1, cfg=0 md=HOST > spd=LOW (1.5Mbps) pwr=ON > > Regards, > Navdeep -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250 .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 00:57:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB7E106568B; Sat, 1 Aug 2009 00:57:34 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 889508FC1C; Sat, 1 Aug 2009 00:57:34 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n710vYqD085716; Sat, 1 Aug 2009 00:57:34 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n710vYjb085713; Sat, 1 Aug 2009 00:57:34 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200908010057.n710vYjb085713@svn.freebsd.org> From: Matt Jacob Date: Sat, 1 Aug 2009 00:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196007 - in head/sys: dev/ispfw modules/ispfw modules/ispfw/isp_2400_multi modules/ispfw/isp_2500 modules/ispfw/isp_2500_multi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 00:57:35 -0000 Author: mjacob Date: Sat Aug 1 00:57:34 2009 New Revision: 196007 URL: http://svn.freebsd.org/changeset/base/196007 Log: Add 8Gb card firmware. Update some 2Gb and 4Gb f/w sets. Split 4Gb and 8Gb into pieces that can be either multi_id capable or not. Reviewed by: scottl, ken Approved by: re Added: head/sys/dev/ispfw/asm_2500.h (contents, props changed) head/sys/modules/ispfw/isp_2400_multi/ head/sys/modules/ispfw/isp_2400_multi/Makefile (contents, props changed) head/sys/modules/ispfw/isp_2500/ head/sys/modules/ispfw/isp_2500/Makefile (contents, props changed) head/sys/modules/ispfw/isp_2500_multi/ head/sys/modules/ispfw/isp_2500_multi/Makefile (contents, props changed) Modified: head/sys/dev/ispfw/asm_2300.h head/sys/dev/ispfw/asm_2400.h head/sys/dev/ispfw/ispfw.c head/sys/modules/ispfw/Makefile Modified: head/sys/dev/ispfw/asm_2300.h ============================================================================== --- head/sys/dev/ispfw/asm_2300.h Fri Jul 31 20:32:55 2009 (r196006) +++ head/sys/dev/ispfw/asm_2300.h Sat Aug 1 00:57:34 2009 (r196007) @@ -29,21 +29,19 @@ * * * --- ISP2300 Initiator/Target Firmware --- * * with Fabric support (Public Loop), with expanded LUN * - * addressing and 2K port logins. * + * addressing and 2K port logins. * * * - ************************************************************************ - */ + ************************************************************************/ /* - * Firmware Version 3.03.19 (09:41 Nov 30, 2005) + * Firmware Version 3.03.26 (16:54 Aug 14, 2007) */ - -static const u_int16_t isp_2300_risc_code[] = { - 0x0470, 0x0000, 0x0000, 0xcd3b, 0x0000, 0x0003, 0x0003, 0x0013, +static const uint16_t isp_2300_risc_code[] = { + 0x0470, 0x0000, 0x0000, 0xd048, 0x0000, 0x0003, 0x0003, 0x001a, 0x0107, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, - 0x332e, 0x3033, 0x2e31, 0x3920, 0x2020, 0x2020, 0x2400, 0x20a9, + 0x332e, 0x3033, 0x2e32, 0x3620, 0x2020, 0x2020, 0x2400, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000, @@ -52,2670 +50,2711 @@ static const u_int16_t isp_2300_risc_cod 0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001, 0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78, - 0x7883, 0x0004, 0x2089, 0x2b8d, 0x2051, 0x1800, 0x2a70, 0x20e1, - 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e5f, 0x2029, + 0x7883, 0x0004, 0x2089, 0x2bf2, 0x2051, 0x1800, 0x2a70, 0x20e1, + 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e53, 0x2029, 0x3500, 0x2031, 0xffff, 0x2039, 0x34c8, 0x2021, 0x0200, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756a, 0x766e, 0x7766, 0x7472, 0x7476, - 0x00e6, 0x2071, 0x1a9d, 0x2472, 0x00ee, 0x20a1, 0x1cc8, 0x716c, + 0x00e6, 0x2071, 0x1aa0, 0x2472, 0x00ee, 0x20a1, 0x1cc8, 0x716c, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x716c, 0x3400, 0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e, - 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f25, 0x080c, - 0x5dbc, 0x080c, 0x9c9e, 0x080c, 0x10dc, 0x080c, 0x12c1, 0x080c, - 0x1a82, 0x080c, 0x0d65, 0x080c, 0x1061, 0x080c, 0x3267, 0x080c, - 0x747e, 0x080c, 0x66c3, 0x080c, 0x80b6, 0x080c, 0x2345, 0x080c, - 0x839c, 0x080c, 0x7ae7, 0x080c, 0x217a, 0x080c, 0x22ae, 0x080c, - 0x233a, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880, + 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f19, 0x080c, + 0x5f04, 0x080c, 0x9eae, 0x080c, 0x10d0, 0x080c, 0x12b8, 0x080c, + 0x1a99, 0x080c, 0x0d58, 0x080c, 0x1055, 0x080c, 0x32cc, 0x080c, + 0x75f0, 0x080c, 0x6836, 0x080c, 0x8273, 0x080c, 0x235c, 0x080c, + 0x857b, 0x080c, 0x7c59, 0x080c, 0x2191, 0x080c, 0x22c5, 0x080c, + 0x2351, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, - 0x0089, 0x2004, 0xd084, 0x190c, 0x11a9, 0x2071, 0x1800, 0x7003, + 0x0089, 0x2004, 0xd084, 0x190c, 0x119d, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c, - 0x4a50, 0x080c, 0x328e, 0x080c, 0x74ef, 0x080c, 0x6be9, 0x080c, - 0x80e2, 0x080c, 0x2ad7, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941, - 0x0ae3, 0x093e, 0x0baa, 0x0d64, 0x0d64, 0x0d64, 0x080c, 0x0dd1, + 0x4b82, 0x080c, 0x32f3, 0x080c, 0x7661, 0x080c, 0x6d5c, 0x080c, + 0x829f, 0x080c, 0x2b09, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941, + 0x0ade, 0x093e, 0x0b9e, 0x0d57, 0x0d57, 0x0d57, 0x080c, 0x0dc4, 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001, - 0x1904, 0x0ab6, 0x080c, 0x5469, 0x1130, 0x0026, 0x2011, 0x0080, - 0x080c, 0x0eed, 0x002e, 0x080c, 0x7173, 0x0150, 0x080c, 0x7196, - 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0468, - 0x080c, 0x709f, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab6, 0x7094, - 0x9086, 0x0029, 0x1904, 0x0ab6, 0x080c, 0x809f, 0x080c, 0x8091, - 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827, 0xffff, - 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x7003, 0x080c, 0x81a1, - 0x2011, 0x6ff6, 0x080c, 0x826d, 0x2011, 0x5c17, 0x080c, 0x81a1, - 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x54c4, 0x2079, - 0x0100, 0x7844, 0x9005, 0x1904, 0x0ab6, 0x2011, 0x5c17, 0x080c, - 0x81a1, 0x2011, 0x7003, 0x080c, 0x81a1, 0x2011, 0x6ff6, 0x080c, - 0x826d, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840, - 0x9084, 0xfffb, 0x7842, 0x2001, 0x1980, 0x2004, 0x9005, 0x1140, - 0x00c6, 0x2061, 0x0100, 0x080c, 0x5d64, 0x00ce, 0x0804, 0x0ab6, - 0x780f, 0x006b, 0x7a28, 0x080c, 0x717b, 0x0118, 0x9295, 0x5e2f, - 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, - 0x1981, 0x2003, 0x0001, 0x080c, 0x297c, 0x080c, 0x498b, 0x7244, - 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, - 0x080c, 0x96d5, 0x2011, 0x0004, 0x080c, 0xb6b7, 0x080c, 0x64f6, - 0x080c, 0x7173, 0x1120, 0x080c, 0x29c0, 0x02e0, 0x0400, 0x080c, - 0x5d6b, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c, 0x5691, - 0x0804, 0x0ab6, 0x080c, 0x545a, 0xd094, 0x0188, 0x2011, 0x180c, - 0x2204, 0xc0cd, 0x2012, 0x080c, 0x545e, 0xd0d4, 0x1118, 0x080c, - 0x29c0, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x00a8, 0x080c, - 0x545e, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x0060, - 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x65e2, 0x1128, - 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, 0x080c, 0x65a8, 0x0120, - 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x707b, 0x0000, 0x080c, 0x7173, - 0x1130, 0x70ac, 0x9005, 0x1168, 0x080c, 0xb9d1, 0x0050, 0x080c, - 0xb9d1, 0x70d8, 0xd09c, 0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, - 0x5d41, 0x70e3, 0x0000, 0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, - 0x29c8, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, - 0x080c, 0x7173, 0x1178, 0x9016, 0x0016, 0x080c, 0x2785, 0x2019, - 0x1947, 0x211a, 0x001e, 0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, - 0x0000, 0x0020, 0x2019, 0x1947, 0x201b, 0x0000, 0x2079, 0x185b, - 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72da, 0x080c, 0x7173, 0x0118, - 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, 0x080c, 0xb6b7, 0x70a7, - 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x2079, 0x0100, 0x7827, - 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x080c, 0x2dfa, - 0x2011, 0x0005, 0x080c, 0x97e0, 0x080c, 0x8a56, 0x080c, 0x7173, - 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2785, 0x61e2, - 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, - 0x7003, 0x0002, 0x00f6, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, - 0x9085, 0x0003, 0x782a, 0x00fe, 0x2011, 0x0005, 0x080c, 0x97e0, - 0x080c, 0x8a56, 0x080c, 0x7173, 0x0148, 0x00c6, 0x2061, 0x0100, - 0x0016, 0x080c, 0x2785, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, - 0x0005, 0x00c6, 0x00b6, 0x080c, 0x7173, 0x1118, 0x20a9, 0x0800, - 0x0010, 0x20a9, 0x0782, 0x080c, 0x7173, 0x1110, 0x900e, 0x0010, - 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, - 0x0110, 0xb800, 0xd0bc, 0x090c, 0x30fd, 0x8108, 0x1f04, 0x0aca, - 0x707b, 0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, - 0x00be, 0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, - 0x9086, 0x0002, 0x1904, 0x0ba7, 0x70a8, 0x9086, 0xffff, 0x0130, - 0x080c, 0x2dfa, 0x080c, 0x8a56, 0x0804, 0x0ba7, 0x70d8, 0xd0ac, - 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, 0x0006, 0x2001, 0x0103, - 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, 0x080c, 0x3160, 0x11d0, - 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f73, 0x080c, 0x8a56, - 0x70d8, 0xd094, 0x1904, 0x0ba7, 0x2011, 0x0001, 0x080c, 0xbc4c, - 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2fad, 0x080c, 0x8a56, - 0x0804, 0x0ba7, 0x70e0, 0x9005, 0x1904, 0x0ba7, 0x70a4, 0x9005, - 0x1904, 0x0ba7, 0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba7, - 0x080c, 0x65a8, 0x1904, 0x0ba7, 0x080c, 0x65fb, 0x1904, 0x0ba7, - 0x080c, 0x65e2, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, - 0x0016, 0x080c, 0x62f0, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, - 0x8108, 0x1f04, 0x0b40, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, - 0x015e, 0x0804, 0x0ba7, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, - 0x000e, 0x2011, 0x198d, 0x080c, 0x0f95, 0x2011, 0x19a7, 0x080c, - 0x0f95, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, 0xffff, - 0x080c, 0x5469, 0x1130, 0x0026, 0x2011, 0x0040, 0x080c, 0x0eed, - 0x002e, 0x9006, 0x080c, 0x261a, 0x080c, 0x3160, 0x0118, 0x080c, - 0x4b28, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021, 0x0006, - 0x080c, 0x4b42, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, - 0x7196, 0x0150, 0x080c, 0x7173, 0x7828, 0x0118, 0x9084, 0xe1ff, - 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x2001, 0x19c2, 0x2004, - 0x9086, 0x0005, 0x1120, 0x2011, 0x0000, 0x080c, 0x97e0, 0x2011, - 0x0000, 0x080c, 0x97ea, 0x080c, 0x8a56, 0x080c, 0x8b2d, 0x012e, - 0x00be, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, - 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, - 0x080c, 0x5d2a, 0x7940, 0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, - 0x0110, 0x7827, 0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, - 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x0c37, 0x2001, 0x1981, - 0x2004, 0x9005, 0x1518, 0x080c, 0x2a43, 0x1148, 0x2001, 0x0001, - 0x080c, 0x29ab, 0x2001, 0x0001, 0x080c, 0x298e, 0x00b8, 0x080c, - 0x2a4b, 0x1138, 0x9006, 0x080c, 0x29ab, 0x9006, 0x080c, 0x298e, - 0x0068, 0x080c, 0x2a53, 0x1d50, 0x2001, 0x1971, 0x2004, 0xd0fc, - 0x0108, 0x0020, 0x080c, 0x27b9, 0x0804, 0x0d16, 0x080c, 0x7184, - 0x0148, 0x080c, 0x7196, 0x1118, 0x080c, 0x7479, 0x0050, 0x080c, - 0x717b, 0x0dd0, 0x080c, 0x7474, 0x080c, 0x746a, 0x080c, 0x709f, - 0x0058, 0x080c, 0x7173, 0x0140, 0x2009, 0x00f8, 0x080c, 0x5d2a, - 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, - 0x1138, 0x080c, 0x7173, 0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d1b, - 0x1f04, 0x0c16, 0x0070, 0x7824, 0x080c, 0x718d, 0x0118, 0xd0ac, - 0x1904, 0x0d1b, 0x9084, 0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, - 0x0d1b, 0x2001, 0x0001, 0x080c, 0x261a, 0x0804, 0x0d2e, 0x2001, - 0x1981, 0x2004, 0x9005, 0x1518, 0x080c, 0x2a43, 0x1148, 0x2001, - 0x0001, 0x080c, 0x29ab, 0x2001, 0x0001, 0x080c, 0x298e, 0x00b8, - 0x080c, 0x2a4b, 0x1138, 0x9006, 0x080c, 0x29ab, 0x9006, 0x080c, - 0x298e, 0x0068, 0x080c, 0x2a53, 0x1d50, 0x2001, 0x1971, 0x2004, - 0xd0fc, 0x0108, 0x0020, 0x080c, 0x27b9, 0x0804, 0x0d16, 0x7850, - 0x9085, 0x0040, 0x7852, 0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, - 0x080c, 0x2a5b, 0x9085, 0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, - 0x1d04, 0x0c70, 0x080c, 0x824d, 0x1f04, 0x0c70, 0x7850, 0x9085, - 0x0400, 0x9084, 0xdfbf, 0x7852, 0x793a, 0x080c, 0x7184, 0x0148, - 0x080c, 0x7196, 0x1118, 0x080c, 0x7479, 0x0050, 0x080c, 0x717b, - 0x0dd0, 0x080c, 0x7474, 0x080c, 0x746a, 0x080c, 0x709f, 0x0020, - 0x2009, 0x00f8, 0x080c, 0x5d2a, 0x20a9, 0x0028, 0xa001, 0x1f04, - 0x0c96, 0x7850, 0x9085, 0x1400, 0x7852, 0x080c, 0x7173, 0x0120, - 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678, 0x2019, 0xea60, - 0x0d0c, 0x824d, 0x7820, 0xd09c, 0x1580, 0x080c, 0x7173, 0x0904, - 0x0cfb, 0x7824, 0xd0ac, 0x1904, 0x0d1b, 0x080c, 0x7196, 0x1528, - 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, - 0x080c, 0x2a5b, 0x7824, 0x9084, 0x1800, 0x1160, 0x9484, 0x0fff, - 0x1138, 0x2001, 0x1810, 0x2004, 0xd0fc, 0x0110, 0x080c, 0x0d41, - 0x8421, 0x1158, 0x1d04, 0x0cd6, 0x080c, 0x824d, 0x080c, 0x7474, - 0x080c, 0x746a, 0x7003, 0x0001, 0x04f0, 0x8319, 0x1948, 0x1d04, - 0x0ce3, 0x080c, 0x824d, 0x2009, 0x1974, 0x2104, 0x9005, 0x0118, - 0x8001, 0x200a, 0x1178, 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, - 0x0002, 0x080c, 0x2a3c, 0x7924, 0x080c, 0x2a5b, 0xd19c, 0x0110, - 0x080c, 0x297c, 0x00d8, 0x080c, 0x7184, 0x1140, 0x94a2, 0x03e8, - 0x1128, 0x080c, 0x714b, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, - 0x080c, 0x2a5b, 0x7824, 0x080c, 0x718d, 0x0110, 0xd0ac, 0x1158, - 0x9084, 0x1800, 0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, - 0x080c, 0x261a, 0x0078, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, - 0x7904, 0x918d, 0x0002, 0x7906, 0x7827, 0x0048, 0x7828, 0x9085, - 0x0028, 0x782a, 0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x1981, - 0x2003, 0x0000, 0x9006, 0x78f2, 0x015e, 0x003e, 0x000e, 0x080c, - 0x5469, 0x1110, 0x080c, 0x0e70, 0x012e, 0x00fe, 0x004e, 0x001e, - 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6, 0x00d6, - 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x824d, 0x015e, 0x00fe, - 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e, 0x000e, - 0x0005, 0x00e6, 0x2071, 0x189c, 0x7004, 0x9086, 0x0001, 0x1110, - 0x080c, 0x328e, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061, 0x1985, - 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, 0x0013, 0x600f, 0x0107, - 0x2001, 0x1956, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100, 0x2004, - 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a, 0x7063, - 0xffff, 0x717a, 0x717e, 0x080c, 0xb9d1, 0x2061, 0x1946, 0x6003, - 0x0909, 0x6106, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, - 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, 0x2061, 0x194e, 0x6003, - 0x8000, 0x6106, 0x610a, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6116, - 0x601b, 0x0001, 0x611e, 0x2061, 0x1962, 0x6003, 0x514c, 0x6007, - 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0x182b, 0x2102, - 0x0005, 0x9016, 0x080c, 0x62f0, 0x1178, 0xb804, 0x90c4, 0x00ff, - 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, 0x98c6, 0x0600, 0x1120, - 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, 0x0800, 0x1d50, - 0x2208, 0x0005, 0x2091, 0x8000, 0x2079, 0x0000, 0x000e, 0x00f6, - 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dd3, 0x0006, 0x0016, 0x2001, - 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, 0x7882, 0x7836, 0x001e, - 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, 0x3900, 0x789a, 0x00d6, - 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, 0x78b2, 0x2001, 0x19e2, - 0x2004, 0x78b6, 0x2001, 0x1a5e, 0x2004, 0x78ba, 0x6808, 0x78be, - 0x00de, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156, 0x00d6, 0x0036, - 0x0026, 0x2079, 0x0300, 0x2069, 0x1a81, 0x7a08, 0x226a, 0x2069, - 0x1a82, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c, 0x2019, - 0x1a8f, 0x201a, 0x2019, 0x1a92, 0x9016, 0x7808, 0xd09c, 0x0168, - 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1a9b, 0x0108, 0x0ca8, - 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x1a90, 0x782c, - 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x1a61, 0x901e, - 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, 0x8318, 0x1f04, - 0x0e32, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079, 0x1800, 0x7803, - 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x0180, - 0x2001, 0x19f5, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, - 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001, - 0x080c, 0x5469, 0x1110, 0x080c, 0x0ea7, 0x0cd0, 0x0005, 0x918c, - 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, - 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, 0x2102, 0x0005, - 0x00f6, 0x0006, 0x2079, 0x1826, 0x2f04, 0x8000, 0x207a, 0x080c, - 0x2a53, 0x1150, 0x0006, 0x2001, 0x1971, 0x2004, 0xd0fc, 0x000e, - 0x1118, 0x9082, 0x7530, 0x0010, 0x9082, 0x000f, 0x0258, 0x9006, - 0x207a, 0x2079, 0x1829, 0x2f04, 0x9084, 0x0001, 0x9086, 0x0001, - 0x207a, 0x0090, 0x2079, 0x1829, 0x2f7c, 0x8fff, 0x1138, 0x0026, - 0x2011, 0x0080, 0x080c, 0x0eed, 0x002e, 0x0030, 0x0026, 0x2011, - 0x0000, 0x080c, 0x0eed, 0x002e, 0x000e, 0x00fe, 0x0005, 0x0026, - 0x0126, 0x2011, 0x0080, 0x080c, 0x0eed, 0x20a9, 0x0fff, 0x080c, - 0x0f0e, 0x2011, 0x0040, 0x04c9, 0x20a9, 0x0fff, 0x080c, 0x0f0e, - 0x0c80, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011, 0x0040, 0x0469, - 0x002e, 0x0005, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011, 0x0080, - 0x0421, 0x002e, 0x0005, 0x0026, 0x70eb, 0x0000, 0x0459, 0x1148, - 0x080c, 0x2a53, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, - 0x0040, 0x080c, 0x2a53, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, - 0xcac2, 0x00e9, 0x002e, 0x0005, 0xd0b4, 0x0130, 0x0006, 0x3b00, - 0x9084, 0xff3f, 0x20d8, 0x000e, 0x0005, 0x0016, 0x3b08, 0x3a00, - 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, - 0x001e, 0x0005, 0x2001, 0x1839, 0x2004, 0xd0dc, 0x0005, 0x9e86, - 0x1800, 0x190c, 0x0dd1, 0x70e4, 0xd0e4, 0x0108, 0xc2e5, 0x72e6, - 0xd0e4, 0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0f0e, - 0x2091, 0x6000, 0x1f04, 0x0f0e, 0x0005, 0x890e, 0x810e, 0x810f, - 0x9194, 0x003f, 0x918c, 0xffc0, 0x0005, 0x0006, 0x2200, 0x914d, - 0x894f, 0x894d, 0x894d, 0x000e, 0x0005, 0x01d6, 0x0146, 0x0036, - 0x0096, 0x2061, 0x188b, 0x600b, 0x0000, 0x600f, 0x0000, 0x6003, - 0x0000, 0x6007, 0x0000, 0x2009, 0xffc0, 0x2105, 0x0006, 0x2001, - 0xaaaa, 0x200f, 0x2019, 0x5555, 0x9016, 0x2049, 0x0bff, 0xab02, - 0xa001, 0xa001, 0xa800, 0x9306, 0x1138, 0x2105, 0x9306, 0x0120, - 0x8210, 0x99c8, 0x0400, 0x0c98, 0x000e, 0x200f, 0x2001, 0x189b, - 0x928a, 0x000e, 0x1638, 0x928a, 0x0006, 0x2011, 0x0006, 0x1210, - 0x2011, 0x0000, 0x2202, 0x9006, 0x2008, 0x82ff, 0x01b0, 0x8200, - 0x600a, 0x600f, 0xffff, 0x6003, 0x0002, 0x6007, 0x0000, 0x0026, - 0x2019, 0x0010, 0x9280, 0x0001, 0x20e8, 0x21a0, 0x21a8, 0x4104, - 0x8319, 0x1de0, 0x8211, 0x1da0, 0x002e, 0x009e, 0x003e, 0x014e, - 0x01de, 0x0005, 0x2011, 0x000e, 0x08e8, 0x0016, 0x0026, 0x0096, - 0x3348, 0x080c, 0x0f15, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, - 0x002e, 0x001e, 0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, - 0x4004, 0x8319, 0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b4, - 0x81ff, 0x11c0, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, - 0x0018, 0x23a0, 0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, - 0x0008, 0x23a0, 0x4001, 0x7078, 0x8007, 0x717c, 0x810f, 0x20a9, - 0x0002, 0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0db1, - 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, - 0x0140, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x103f, 0x009e, - 0x0cb0, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x10b8, 0x090c, - 0x0dd1, 0x00ee, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, - 0x0126, 0x2091, 0x8000, 0x00c9, 0x2071, 0x1800, 0x73bc, 0x702c, - 0x9016, 0x9045, 0x0158, 0x8210, 0x9906, 0x090c, 0x0dd1, 0x2300, - 0x9202, 0x0120, 0x1a0c, 0x0dd1, 0xa000, 0x0c98, 0x012e, 0x003e, - 0x002e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x0086, 0x00e6, 0x0006, - 0x0126, 0x2091, 0x8000, 0x2071, 0x190e, 0x7010, 0x9005, 0x0140, - 0x7018, 0x9045, 0x0128, 0x9906, 0x090c, 0x0dd1, 0xa000, 0x0cc8, - 0x012e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, - 0x0126, 0x2091, 0x8000, 0x70bc, 0x8001, 0x0270, 0x70be, 0x702c, - 0x2048, 0x9085, 0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, - 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, - 0x2091, 0x8000, 0x2071, 0x1800, 0x70bc, 0x90ca, 0x0040, 0x0268, - 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0xa803, 0x0000, - 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, - 0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184, - 0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, - 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, - 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8091, 0x012e, 0x00ee, - 0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400, - 0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, - 0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, - 0x2071, 0x188b, 0x7000, 0x9005, 0x11a0, 0x2001, 0x04d4, 0xa802, - 0x2048, 0x2009, 0x3500, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, - 0x0001, 0x8420, 0x9886, 0x0800, 0x0120, 0x2848, 0x9188, 0x0040, - 0x0c90, 0x2071, 0x188b, 0x7104, 0x7200, 0x82ff, 0x01d0, 0x7308, - 0x8318, 0x831f, 0x831b, 0x831b, 0x7312, 0x8319, 0x2001, 0x0800, - 0xa802, 0x2048, 0x8900, 0xa802, 0x2040, 0xa95e, 0xaa62, 0x8420, - 0x2300, 0x9906, 0x0130, 0x2848, 0x9188, 0x0040, 0x9291, 0x0000, - 0x0c88, 0xa803, 0x0000, 0x2071, 0x1800, 0x74ba, 0x74be, 0x0005, - 0x00e6, 0x0016, 0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, - 0x9982, 0x0400, 0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x04d4, - 0x0288, 0x9982, 0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, - 0x2071, 0x188b, 0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, - 0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19f4, 0x7007, - 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, - 0x9085, 0x8044, 0x7012, 0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, - 0x7022, 0x1f04, 0x10f0, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, - 0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071, 0x19f4, 0x701c, - 0x9088, 0x19fe, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120, - 0x9106, 0x090c, 0x0dd1, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, - 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, - 0x8000, 0x00e6, 0x2071, 0x19f4, 0x7004, 0x9005, 0x1128, 0x00f6, - 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, - 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1139, - 0x1137, 0x1137, 0x1137, 0x12b0, 0x12b0, 0x12b0, 0x12b0, 0x080c, - 0x0dd1, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001, - 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, - 0x19fe, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122, - 0x782b, 0x0026, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a, - 0xa898, 0x780e, 0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a, - 0xa868, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005, - 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011, - 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212, - 0x8203, 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e, - 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, - 0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, - 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, - 0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, - 0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, - 0x0005, 0x2009, 0x19f4, 0x2104, 0xc095, 0x200a, 0x080c, 0x1116, - 0x0005, 0x0016, 0x00e6, 0x2071, 0x19f4, 0x00f6, 0x2079, 0x0080, - 0x792c, 0xd1bc, 0x190c, 0x0dca, 0x782b, 0x0002, 0xd1fc, 0x0120, - 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, - 0x1127, 0x11cf, 0x1203, 0x0dd1, 0x0dd1, 0x12bc, 0x0dd1, 0x918c, - 0x0700, 0x1550, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, - 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010, - 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c, - 0x9005, 0x0578, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x116c, - 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0100, 0x009e, 0x7007, - 0x0000, 0x080c, 0x1127, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, - 0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005, - 0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x1181, 0x0005, - 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x7007, 0x0000, - 0x0080, 0x0096, 0x7008, 0x2048, 0x7800, 0xa88e, 0x7804, 0xa892, - 0x7808, 0xa896, 0x780c, 0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007, - 0x0000, 0x0096, 0x00d6, 0x7008, 0x2048, 0x2001, 0x18b7, 0x2004, - 0x9906, 0x1128, 0xa89c, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, - 0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa89c, - 0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x1116, - 0x0005, 0x00de, 0x009e, 0x080c, 0x1116, 0x0005, 0xa8a8, 0xd08c, - 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0dd1, 0xa06c, 0x908e, - 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, - 0x080c, 0x699e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, - 0x103f, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0dd1, - 0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, - 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, - 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, - 0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x10f7, - 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c, 0x699e, 0x000e, - 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, - 0x9d08, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, - 0x080c, 0x103f, 0x7007, 0x0000, 0x080c, 0x1116, 0x00ae, 0x0005, - 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, - 0xc094, 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1127, - 0x0005, 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a3e, - 0x7003, 0x0000, 0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, - 0x0003, 0x780f, 0x0000, 0x20a9, 0x025f, 0x2061, 0xd06e, 0x2c0d, - 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12d7, 0x7807, - 0x0007, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, - 0x7803, 0x0000, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, - 0x1a3f, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, - 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, - 0x7827, 0x0031, 0x782b, 0x1a61, 0x781f, 0xff00, 0x781b, 0xb700, - 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, - 0x1a61, 0x602f, 0x1cc8, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cc8, - 0x6032, 0x603b, 0x1f59, 0x2001, 0x3167, 0xd0fc, 0x190c, 0x0dd1, - 0x2001, 0x1810, 0x2004, 0xd0c4, 0x1128, 0x2001, 0x0003, 0x2004, - 0xd0d4, 0x1118, 0x783f, 0x3167, 0x0020, 0x9084, 0xc000, 0x783f, - 0xb167, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, - 0x0070, 0x190c, 0x0dca, 0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, - 0x15e8, 0x908a, 0x0024, 0x1a0c, 0x0dd1, 0x0023, 0x012e, 0x0005, - 0x012e, 0x0005, 0x136e, 0x136e, 0x1385, 0x138a, 0x138e, 0x1393, - 0x13bb, 0x13bf, 0x13cd, 0x13d1, 0x136e, 0x1454, 0x1458, 0x14c8, - 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, - 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x1395, 0x136e, 0x136e, - 0x136e, 0x136e, 0x136e, 0x136e, 0x1372, 0x1370, 0x080c, 0x0dd1, - 0x080c, 0x0dca, 0x080c, 0x14cf, 0x2009, 0x1a56, 0x2104, 0x8000, - 0x200a, 0x080c, 0x7bb0, 0x080c, 0x1984, 0x0005, 0x2009, 0x0048, - 0x2060, 0x080c, 0x9d7a, 0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, - 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x14cf, - 0x080c, 0x1628, 0x0005, 0x080c, 0x0dd1, 0x080c, 0x14cf, 0x2060, + 0x1904, 0x0ab1, 0x080c, 0x0ecd, 0x080c, 0x72e5, 0x0150, 0x080c, + 0x7308, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, + 0x0478, 0x080c, 0x7212, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab1, + 0x7094, 0x9086, 0x0029, 0x1904, 0x0ab1, 0x080c, 0x8253, 0x080c, + 0x8245, 0x2079, 0x0100, 0x782f, 0x0008, 0x2001, 0x0161, 0x2003, + 0x0001, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, + 0x7176, 0x080c, 0x835e, 0x2011, 0x7169, 0x080c, 0x8474, 0x2011, + 0x5d5f, 0x080c, 0x835e, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, + 0x080c, 0x5607, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0ab1, + 0x2011, 0x5d5f, 0x080c, 0x835e, 0x2011, 0x7176, 0x080c, 0x835e, + 0x2011, 0x7169, 0x080c, 0x8474, 0x2001, 0x0265, 0x2001, 0x0205, + 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1983, + 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5eac, + 0x00ce, 0x0804, 0x0ab1, 0x780f, 0x006b, 0x7a28, 0x080c, 0x72ed, + 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, + 0x8010, 0x73d4, 0x2001, 0x1984, 0x2003, 0x0001, 0x080c, 0x29ae, + 0x080c, 0x4abd, 0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, + 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0x98cb, 0x2011, 0x0004, 0x080c, + 0xb965, 0x080c, 0x664c, 0x080c, 0x72e5, 0x1120, 0x080c, 0x29f2, + 0x02e0, 0x0400, 0x080c, 0x5eb3, 0x0140, 0x7093, 0x0001, 0x70cf, + 0x0000, 0x080c, 0x57d9, 0x0804, 0x0ab1, 0x080c, 0x55a7, 0xd094, + 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x55ab, + 0xd0d4, 0x1118, 0x080c, 0x29f2, 0x1270, 0x2011, 0x180c, 0x2204, + 0xc0bc, 0x00a8, 0x080c, 0x55ab, 0xd0d4, 0x1db8, 0x2011, 0x180c, + 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, + 0x080c, 0x673e, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, + 0x080c, 0x6704, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x707b, + 0x0000, 0x080c, 0x72e5, 0x1130, 0x70ac, 0x9005, 0x1168, 0x080c, + 0xbc7a, 0x0050, 0x080c, 0xbc7a, 0x70d8, 0xd09c, 0x1128, 0x70ac, + 0x9005, 0x0110, 0x080c, 0x5e89, 0x70e3, 0x0000, 0x70df, 0x0000, + 0x70a3, 0x0000, 0x080c, 0x29fa, 0x0228, 0x2011, 0x0101, 0x2204, + 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x72e5, 0x1178, 0x9016, 0x0016, + 0x080c, 0x27b7, 0x2019, 0x194a, 0x211a, 0x001e, 0x705b, 0xffff, + 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019, 0x194a, 0x201b, + 0x0000, 0x2079, 0x185e, 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72da, + 0x080c, 0x72e5, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, + 0x080c, 0xb965, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, + 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, + 0x00fe, 0x080c, 0x2e5f, 0x2011, 0x0005, 0x080c, 0x99d6, 0x080c, + 0x8c37, 0x080c, 0x72e5, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, + 0x080c, 0x27b7, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a7, + 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079, 0x0100, + 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x2011, + 0x0005, 0x080c, 0x99d6, 0x080c, 0x8c37, 0x080c, 0x72e5, 0x0148, + 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x27b7, 0x61e2, 0x001e, + 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x72e5, + 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x72e5, + 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, + 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x3162, + 0x8108, 0x1f04, 0x0ac5, 0x707b, 0x0000, 0x707c, 0x9084, 0x00ff, + 0x707e, 0x70af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6, 0x0126, + 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904, 0x0b9b, 0x70a8, + 0x9086, 0xffff, 0x0130, 0x080c, 0x2e5f, 0x080c, 0x8c37, 0x0804, + 0x0b9b, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, + 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, + 0x080c, 0x31c5, 0x11d0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, + 0x2fd8, 0x080c, 0x8c37, 0x70d8, 0xd094, 0x1904, 0x0b9b, 0x2011, + 0x0001, 0x080c, 0xbef8, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, + 0x3012, 0x080c, 0x8c37, 0x0804, 0x0b9b, 0x70e0, 0x9005, 0x1904, + 0x0b9b, 0x70a4, 0x9005, 0x1904, 0x0b9b, 0x70d8, 0xd0a4, 0x0118, + 0xd0b4, 0x0904, 0x0b9b, 0x080c, 0x6704, 0x1904, 0x0b9b, 0x080c, + 0x6757, 0x1904, 0x0b9b, 0x080c, 0x673e, 0x01c0, 0x0156, 0x00c6, + 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6411, 0x1118, 0xb800, + 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x0b3b, 0x00ce, 0x015e, + 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x0b9b, 0x0006, 0x2001, + 0x0103, 0x2003, 0x006b, 0x000e, 0x2011, 0x1990, 0x080c, 0x0f89, + 0x2011, 0x19aa, 0x080c, 0x0f89, 0x7030, 0xc08c, 0x7032, 0x7003, + 0x0003, 0x70ab, 0xffff, 0x080c, 0x0ecd, 0x9006, 0x080c, 0x264c, + 0x080c, 0x31c5, 0x0118, 0x080c, 0x4c5a, 0x0050, 0x0036, 0x0046, + 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4c74, 0x004e, 0x003e, + 0x00f6, 0x2079, 0x0100, 0x080c, 0x7308, 0x0150, 0x080c, 0x72e5, + 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, + 0x00fe, 0x2001, 0x19c5, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, + 0x0000, 0x080c, 0x99d6, 0x2011, 0x0000, 0x080c, 0x99e0, 0x080c, + 0x8c37, 0x080c, 0x8d06, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046, + 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, + 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5e72, 0x7940, 0x918c, + 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c, + 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac, + 0x1904, 0x0c2b, 0x2001, 0x1984, 0x2004, 0x9005, 0x1518, 0x080c, + 0x2a75, 0x1148, 0x2001, 0x0001, 0x080c, 0x29dd, 0x2001, 0x0001, + 0x080c, 0x29c0, 0x00b8, 0x080c, 0x2a7d, 0x1138, 0x9006, 0x080c, + 0x29dd, 0x9006, 0x080c, 0x29c0, 0x0068, 0x080c, 0x2a85, 0x1d50, + 0x2001, 0x1974, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x27eb, + 0x0804, 0x0d0a, 0x080c, 0x72f6, 0x0148, 0x080c, 0x7308, 0x1118, + 0x080c, 0x75eb, 0x0050, 0x080c, 0x72ed, 0x0dd0, 0x080c, 0x75e6, + 0x080c, 0x75dc, 0x080c, 0x7212, 0x0058, 0x080c, 0x72e5, 0x0140, + 0x2009, 0x00f8, 0x080c, 0x5e72, 0x7843, 0x0090, 0x7843, 0x0010, + 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x72e5, 0x0138, + 0x7824, 0xd0ac, 0x1904, 0x0d0f, 0x1f04, 0x0c0a, 0x0070, 0x7824, + 0x080c, 0x72ff, 0x0118, 0xd0ac, 0x1904, 0x0d0f, 0x9084, 0x1800, + 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d0f, 0x2001, 0x0001, 0x080c, + 0x264c, 0x0804, 0x0d22, 0x2001, 0x1984, 0x2004, 0x9005, 0x1518, + 0x080c, 0x2a75, 0x1148, 0x2001, 0x0001, 0x080c, 0x29dd, 0x2001, + 0x0001, 0x080c, 0x29c0, 0x00b8, 0x080c, 0x2a7d, 0x1138, 0x9006, + 0x080c, 0x29dd, 0x9006, 0x080c, 0x29c0, 0x0068, 0x080c, 0x2a85, + 0x1d50, 0x2001, 0x1974, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, + 0x27eb, 0x0804, 0x0d0a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, + 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a8d, 0x9085, 0x2000, + 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c64, 0x080c, 0x8454, + 0x1f04, 0x0c64, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, + 0x793a, 0x080c, 0x72f6, 0x0148, 0x080c, 0x7308, 0x1118, 0x080c, + 0x75eb, 0x0050, 0x080c, 0x72ed, 0x0dd0, 0x080c, 0x75e6, 0x080c, + 0x75dc, 0x080c, 0x7212, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5e72, + 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c8a, 0x7850, 0x9085, 0x1400, + 0x7852, 0x080c, 0x72e5, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, + 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x8454, 0x7820, 0xd09c, + 0x1580, 0x080c, 0x72e5, 0x0904, 0x0cef, 0x7824, 0xd0ac, 0x1904, + 0x0d0f, 0x080c, 0x7308, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421, + 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2a8d, 0x7824, 0x9084, + 0x1800, 0x1160, 0x9484, 0x0fff, 0x1138, 0x2001, 0x1810, 0x2004, + 0xd0fc, 0x0110, 0x080c, 0x0d34, 0x8421, 0x1158, 0x1d04, 0x0cca, + 0x080c, 0x8454, 0x080c, 0x75e6, 0x080c, 0x75dc, 0x7003, 0x0001, + 0x04f0, 0x8319, 0x1948, 0x1d04, 0x0cd7, 0x080c, 0x8454, 0x2009, + 0x1977, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b, + 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2a6e, 0x7924, + 0x080c, 0x2a8d, 0xd19c, 0x0110, 0x080c, 0x29ae, 0x00d8, 0x080c, + 0x72f6, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x72bd, 0x7003, + 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a8d, 0x7824, 0x080c, + 0x72ff, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003, + 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x264c, 0x0078, 0x2009, + 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906, + 0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085, + 0x0400, 0x7852, 0x2001, 0x1984, 0x2003, 0x0000, 0x9006, 0x78f2, + 0x015e, 0x003e, 0x000e, 0x080c, 0x55b6, 0x090c, 0x0e64, 0x012e, + 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, + 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, + 0x8454, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, + 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189f, 0x7004, + 0x9086, 0x0001, 0x1110, 0x080c, 0x32f3, 0x00ee, 0x0005, 0x0005, + 0x2a70, 0x2061, 0x1988, 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, + 0x001a, 0x600f, 0x0107, 0x2001, 0x1959, 0x900e, 0x2102, 0x7192, + 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, + 0x0008, 0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbc7a, + 0x2061, 0x1949, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f, + 0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, + 0x2061, 0x1951, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200, + 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x1965, + 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, + 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6411, 0x1178, + 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, + 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, + 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079, + 0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dc6, + 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, + 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, + 0x3900, 0x789a, 0x00d6, 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, + 0x78b2, 0x2001, 0x19e5, 0x2004, 0x78b6, 0x2001, 0x1a61, 0x2004, + 0x78ba, 0x6808, 0x78be, 0x00de, 0x7833, 0x0012, 0x2091, 0x5000, + 0x0156, 0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1a84, + 0x7a08, 0x226a, 0x2069, 0x1a85, 0x7a18, 0x226a, 0x8d68, 0x7a1c, + 0x226a, 0x782c, 0x2019, 0x1a92, 0x201a, 0x2019, 0x1a95, 0x9016, + 0x7808, 0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, + 0x1a9e, 0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, + 0x2019, 0x1a93, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, + 0x2069, 0x1a64, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, + 0x8d68, 0x8318, 0x1f04, 0x0e25, 0x002e, 0x003e, 0x00de, 0x015e, + 0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, + 0x2004, 0xd084, 0x0188, 0x2001, 0x19f8, 0x2004, 0x9005, 0x0130, + 0x2001, 0x008b, 0x2004, 0x9084, 0x8004, 0x0dd0, 0x2001, 0x008a, + 0x2003, 0x0002, 0x2003, 0x1001, 0x080c, 0x55b6, 0x1110, 0x080c, + 0x0e9b, 0x0cd0, 0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, + 0x9084, 0x0600, 0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, + 0x2001, 0x017f, 0x2102, 0x0005, 0x00f6, 0x0006, 0x2079, 0x1826, + 0x2f04, 0x8000, 0x207a, 0x080c, 0x2a85, 0x1150, 0x0006, 0x2001, + 0x1974, 0x2004, 0xd0fc, 0x000e, 0x1118, 0x9082, 0x7530, 0x0010, + 0x9082, 0x000f, 0x0258, 0x9006, 0x207a, 0x2079, 0x1829, 0x2f04, + 0x9084, 0x0001, 0x9086, 0x0001, 0x207a, 0x0090, 0x2079, 0x1829, + 0x2f7c, 0x8fff, 0x1138, 0x0026, 0x2011, 0x0080, 0x080c, 0x0ee1, + 0x002e, 0x0030, 0x0026, 0x2011, 0x0000, 0x080c, 0x0ee1, 0x002e, + 0x000e, 0x00fe, 0x0005, 0x0026, 0x0126, 0x2011, 0x0080, 0x080c, + 0x0ee1, 0x20a9, 0x0fff, 0x080c, 0x0f02, 0x2011, 0x0040, 0x04c9, + 0x20a9, 0x0fff, 0x080c, 0x0f02, 0x0c80, 0x2011, 0x0040, 0x0488, + 0x2011, 0x0080, 0x0470, 0x0005, 0x0026, 0x70eb, 0x0000, 0x04b1, + 0x1148, 0x080c, 0x2a85, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, + 0x8282, 0x0040, 0x080c, 0x2a85, 0x1118, 0x2011, 0xcdc5, 0x0010, + 0x2011, 0xcac2, 0x0441, 0x002e, 0x0005, 0x080c, 0x55b6, 0x1140, + 0x0026, 0x2001, 0x1800, 0x2004, 0x9084, 0x0007, 0x0013, 0x002e, + 0x0005, 0x0ecc, 0x0eb0, 0x0eb0, 0x0ead, 0x0e64, 0x0eb0, 0x0eb0, + 0x0e64, 0x0016, 0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, + 0x9084, 0xff3f, 0x9205, 0x20d0, 0x001e, 0x0005, 0x2001, 0x1839, + 0x2004, 0xd0dc, 0x0005, 0x9e86, 0x1800, 0x190c, 0x0dc4, 0x70e4, + 0xd0e4, 0x0108, 0xc2e5, 0x72e6, 0xd0e4, 0x1118, 0x9294, 0x00c0, + 0x0c01, 0x0005, 0x1d04, 0x0f02, 0x2091, 0x6000, 0x1f04, 0x0f02, + 0x0005, 0x890e, 0x810e, 0x810f, 0x9194, 0x003f, 0x918c, 0xffc0, + 0x0005, 0x0006, 0x2200, 0x914d, 0x894f, 0x894d, 0x894d, 0x000e, + 0x0005, 0x01d6, 0x0146, 0x0036, 0x0096, 0x2061, 0x188e, 0x600b, + 0x0000, 0x600f, 0x0000, 0x6003, 0x0000, 0x6007, 0x0000, 0x2009, + 0xffc0, 0x2105, 0x0006, 0x2001, 0xaaaa, 0x200f, 0x2019, 0x5555, + 0x9016, 0x2049, 0x0bff, 0xab02, 0xa001, 0xa001, 0xa800, 0x9306, + 0x1138, 0x2105, 0x9306, 0x0120, 0x8210, 0x99c8, 0x0400, 0x0c98, + 0x000e, 0x200f, 0x2001, 0x189e, 0x928a, 0x000e, 0x1638, 0x928a, + 0x0006, 0x2011, 0x0006, 0x1210, 0x2011, 0x0000, 0x2202, 0x9006, + 0x2008, 0x82ff, 0x01b0, 0x8200, 0x600a, 0x600f, 0xffff, 0x6003, + 0x0002, 0x6007, 0x0000, 0x0026, 0x2019, 0x0010, 0x9280, 0x0001, + 0x20e8, 0x21a0, 0x21a8, 0x4104, 0x8319, 0x1de0, 0x8211, 0x1da0, + 0x002e, 0x009e, 0x003e, 0x014e, 0x01de, 0x0005, 0x2011, 0x000e, + 0x08e8, 0x0016, 0x0026, 0x0096, 0x3348, 0x080c, 0x0f09, 0x2100, + 0x9300, 0x2098, 0x22e0, 0x009e, 0x002e, 0x001e, 0x0036, 0x3518, + 0x20a9, 0x0001, 0x4002, 0x8007, 0x4004, 0x8319, 0x1dd8, 0x003e, + 0x0005, 0x20e9, 0x0001, 0x71b4, 0x81ff, 0x11c0, 0x9006, 0x2009, + 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0, 0x4001, 0x2009, + 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0, 0x4001, 0x7078, + 0x8007, 0x717c, 0x810f, 0x20a9, 0x0002, 0x4001, 0x9298, 0x000c, + 0x23a0, 0x900e, 0x080c, 0x0da4, 0x2001, 0x0000, 0x810f, 0x20a9, + 0x0002, 0x4001, 0x0005, 0x89ff, 0x0140, 0xa804, 0xa807, 0x0000, + 0x0006, 0x080c, 0x1033, 0x009e, 0x0cb0, 0x0005, 0x00e6, 0x2071, + 0x1800, 0x080c, 0x10ac, 0x090c, 0x0dc4, 0x00ee, 0x0005, 0x0086, + 0x00e6, 0x0006, 0x0026, 0x0036, 0x0126, 0x2091, 0x8000, 0x00c9, + 0x2071, 0x1800, 0x73bc, 0x702c, 0x9016, 0x9045, 0x0158, 0x8210, + 0x9906, 0x090c, 0x0dc4, 0x2300, 0x9202, 0x0120, 0x1a0c, 0x0dc4, + 0xa000, 0x0c98, 0x012e, 0x003e, 0x002e, 0x000e, 0x00ee, 0x008e, + 0x0005, 0x0086, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, + 0x1911, 0x7010, 0x9005, 0x0140, 0x7018, 0x9045, 0x0128, 0x9906, + 0x090c, 0x0dc4, 0xa000, 0x0cc8, 0x012e, 0x000e, 0x00ee, 0x008e, + 0x0005, 0x00e6, 0x2071, 0x1800, 0x0126, 0x2091, 0x8000, 0x70bc, + 0x8001, 0x0270, 0x70be, 0x702c, 0x2048, 0x9085, 0x0001, 0xa800, + 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, + 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, + 0x70bc, 0x90ca, 0x0040, 0x0268, 0x8001, 0x70be, 0x702c, 0x2048, + 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e, 0x00ee, + 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x0016, + 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184, 0xffc0, + 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, + 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, + 0x080c, 0x8245, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9026, + 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940, 0x2800, + 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440, 0x0120, + 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188e, 0x7000, 0x9005, + 0x11a0, 0x2001, 0x04d4, 0xa802, 0x2048, 0x2009, 0x3500, 0x8940, + 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0800, + 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188e, 0x7104, + 0x7200, 0x82ff, 0x01d0, 0x7308, 0x8318, 0x831f, 0x831b, 0x831b, + 0x7312, 0x8319, 0x2001, 0x0800, 0xa802, 0x2048, 0x8900, 0xa802, + 0x2040, 0xa95e, 0xaa62, 0x8420, 0x2300, 0x9906, 0x0130, 0x2848, + 0x9188, 0x0040, 0x9291, 0x0000, 0x0c88, 0xa803, 0x0000, 0x2071, + 0x1800, 0x74ba, 0x74be, 0x0005, 0x00e6, 0x0016, 0x9984, 0xfc00, + 0x01e8, 0x908c, 0xf800, 0x1168, 0x9982, 0x0400, 0x02b8, 0x9982, + 0x0440, 0x0278, 0x9982, 0x04d4, 0x0288, 0x9982, 0x0800, 0x1270, + 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x188e, 0x7010, 0x9902, + 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005, 0x9006, 0x0cd8, + 0x00e6, 0x2071, 0x19f7, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, + 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044, 0x7012, 0x2071, + 0x0080, 0x9006, 0x20a9, 0x0040, 0x7022, 0x1f04, 0x10e4, 0x702b, + 0x0020, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0xa073, + 0x0000, 0x2071, 0x19f7, 0x701c, 0x9088, 0x1a01, 0x280a, 0x8000, + 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0dc4, 0x7004, + 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee, + 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x19f7, + 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe, + 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007, + 0x0006, 0x7000, 0x0002, 0x112d, 0x112b, 0x112b, 0x112b, 0x12a7, + 0x12a7, 0x12a7, 0x12a7, 0x080c, 0x0dc4, 0x701c, 0x7120, 0x9106, + 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007, + 0x0000, 0x0005, 0x0096, 0x9180, 0x1a01, 0x2004, 0x700a, 0x2048, + 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026, 0xa890, 0x7802, + 0xa894, 0x7806, 0xa898, 0x780a, 0xa89c, 0x780e, 0xa87c, 0x700e, + 0xa874, 0x7016, 0xa878, 0x701a, 0xa86c, 0x009e, 0xd084, 0x0120, + 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1, 0x0005, + 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, + 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, 0x7812, 0x782b, 0x0020, + 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0136, + 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098, 0x20e9, 0x0000, + 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, + 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8, 0x4006, 0x8203, + 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b, 0x0001, 0x015e, + 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x0016, 0x2009, 0x19f7, + 0x2104, 0xc095, 0x200a, 0x080c, 0x110a, 0x001e, 0x0005, 0x0016, + 0x00e6, 0x2071, 0x19f7, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, + 0x190c, 0x0dbd, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, + 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x111b, 0x11c5, + 0x11f9, 0x0dc4, 0x0dc4, 0x12b3, 0x0dc4, 0x918c, 0x0700, 0x1550, + 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, + 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, + 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c, 0x9005, 0x0578, + 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x1160, 0x0005, 0x7008, + 0x0096, 0x2048, 0xa873, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, + 0x111b, 0x0005, 0x7008, 0x0096, 0x2048, 0xa873, 0x0200, 0x009e, + 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, + 0x7802, 0x7804, 0x7806, 0x080c, 0x1175, 0x0005, 0x7008, 0x0096, + 0x2048, 0xa873, 0x0200, 0x009e, 0x7007, 0x0000, 0x0080, 0x0096, + 0x7008, 0x2048, 0x7800, 0xa892, 0x7804, 0xa896, 0x7808, 0xa89a, + 0x780c, 0xa89e, 0xa873, 0x0100, 0x009e, 0x7007, 0x0000, 0x0096, + 0x00d6, 0x7008, 0x2048, 0x2001, 0x18ba, 0x2004, 0x9906, 0x1128, + 0xa8a0, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, + 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa8a0, 0x0086, 0x2940, + 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x110a, 0x0005, 0x00de, + 0x009e, 0x080c, 0x110a, 0x0005, 0xa8ac, 0xd08c, 0x0005, 0x0096, + 0xa0a4, 0x904d, 0x090c, 0x0dc4, 0xa070, 0x908e, 0x0100, 0x0130, + 0xa87f, 0x0030, 0xa887, 0x0000, 0xa89b, 0x4002, 0xa898, 0x908e, + 0x006b, 0x090c, 0x469d, 0x080c, 0x6b11, 0xa0a3, 0x0000, 0xa0a7, + 0x0000, 0x2848, 0x080c, 0x1033, 0x009e, 0x0005, 0x00a6, 0xa0a4, + 0x904d, 0x090c, 0x0dc4, 0xa070, 0x908e, 0x0100, 0x0128, 0xa87f, + 0x0001, 0xa887, 0x0000, 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, + 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, + 0x9084, 0xffc0, 0x9080, 0x0002, 0xa07a, 0xa176, 0xb000, 0xa07e, + 0x2810, 0x080c, 0x10eb, 0x00c8, 0xa980, 0xa898, 0x0016, 0x0006, + 0x080c, 0x6b11, 0x000e, 0x001e, 0xd1a4, 0x0128, 0x00c6, 0x2060, + 0x080c, 0x9f18, 0x00ce, 0x7008, 0x2048, 0xa8a3, 0x0000, 0xa8a7, + 0x0000, 0x080c, 0x1033, 0x080c, 0x110a, 0x00ae, 0x0005, 0x0126, + 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, + 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x111b, 0x0005, + 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a41, 0x7003, + 0x0000, 0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, + 0x780f, 0x0000, 0x20a9, 0x0259, 0x2061, 0xd387, 0x2c0d, 0x7912, + 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12ce, 0x7807, 0x0007, + 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, + 0x0000, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a42, + 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, + 0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, + 0x0031, 0x782b, 0x1a64, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, + 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a64, + 0x602f, 0x1cc8, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cc8, 0x6032, + 0x603b, 0x1f70, 0x2001, 0x31cc, 0xd0fc, 0x190c, 0x0dc4, 0x2001, + 0x1810, 0x2004, 0xd0c4, 0x1128, 0x2001, 0x0003, 0x2004, 0xd0d4, + 0x1118, 0x783f, 0x31cc, 0x0020, 0x9084, 0xc000, 0x783f, 0xb1cc, + 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0030, + 0x190c, 0x0dbd, 0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, 0x15f0, + 0x908a, 0x0024, 0x1a0c, 0x0dc4, 0x0023, 0x012e, 0x0005, 0x012e, + 0x0005, 0x1366, 0x1366, 0x137d, 0x1382, 0x1386, 0x138b, 0x13b3, + 0x13b7, 0x13c5, 0x13c9, 0x1366, 0x1452, 0x1456, 0x14c6, 0x1366, + 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, + 0x1366, 0x1366, 0x1366, 0x1366, 0x138d, 0x1366, 0x1366, 0x1366, + 0x1366, 0x1366, 0x1366, 0x136a, 0x1368, 0x1366, 0x080c, 0x0dc4, + 0x080c, 0x0dbd, 0x080c, 0x14cd, 0x2009, 0x1a59, 0x2104, 0x8000, + 0x200a, 0x080c, 0x7d22, 0x080c, 0x199b, 0x0005, 0x2009, 0x0048, + 0x2060, 0x080c, 0x9f88, 0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, + 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x14cd, + 0x080c, 0x1636, 0x0005, 0x080c, 0x0dc4, 0x080c, 0x14cd, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, - 0x080c, 0x9d7a, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, + 0x080c, 0x9f88, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, - 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14d4, 0x2001, 0x0307, + 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14d2, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, - 0x14cf, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, - 0x2009, 0x0048, 0x080c, 0x9d7a, 0x0005, 0x080c, 0x14cf, 0x080c, - 0x0dd1, 0x080c, 0x14cf, 0x080c, 0x143f, 0x7827, 0x0018, 0x79ac, + 0x14cd, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, + 0x2009, 0x0048, 0x080c, 0x9f88, 0x0005, 0x080c, 0x14cd, 0x080c, + 0x0dc4, 0x080c, 0x14cd, 0x080c, 0x143d, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b, - 0x0000, 0xd1bc, 0x090c, 0x0dd1, 0x2001, 0x020d, 0x2003, 0x0050, - 0x2003, 0x0020, 0x0448, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, - 0x1458, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0dd1, - 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x01a8, 0x080c, - 0x7bb0, 0x080c, 0x1984, 0x080c, 0xb6a7, 0x0158, 0xa9ac, 0xa936, - 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, - 0xa882, 0x080c, 0xb31a, 0x0005, 0x2029, 0x00c8, 0x8529, 0x0128, - 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd017, - 0xd5a4, 0x1118, 0x080c, 0x14d4, 0x0005, 0x080c, 0x7bb0, 0x080c, - 0x1984, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, - 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, - 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1545, 0x00fe, - 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, - 0x7104, 0x9184, 0x0004, 0x190c, 0x0dd1, 0xd184, 0x11b1, 0xd19c, - 0x0180, 0xc19c, 0x7106, 0x0016, 0x080c, 0x160b, 0x001e, 0x0148, - 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x14d4, - 0x0005, 0x81ff, 0x190c, 0x0dd1, 0x0005, 0x2100, 0xc184, 0xc1b4, - 0x7106, 0xd0b4, 0x0016, 0x00e6, 0x1904, 0x14bd, 0x2071, 0x0200, - 0x080c, 0x15ff, 0x080c, 0x160b, 0x05a8, 0x6014, 0x9005, 0x05a8, - 0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, - 0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6, - 0x2c78, 0x080c, 0x1664, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, - 0x17a8, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, - 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, - 0x0419, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12e7, - 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x080c, 0x160b, 0x0dd0, - 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0c90, - 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9d7a, 0x0005, 0x7808, - 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x143f, 0x00d6, 0x2069, - 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005, 0x0dd8, - 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528, 0x79b8, - 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, 0x1268, 0x9188, 0x0007, - 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1537, 0x6827, - 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, - 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, - 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7bb0, 0x080c, 0x1984, + 0x0000, 0xd1bc, 0x090c, 0x0dc4, 0x2001, 0x020d, 0x2003, 0x0050, + 0x2003, 0x0020, 0x0478, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, + 0x1456, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0dc4, + 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x01d8, 0x080c, + 0x7d22, 0x080c, 0x199b, 0x080c, 0xb955, 0x0158, 0xa9b0, 0xa936, + 0xa9b4, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa884, 0xc0bd, + 0xa886, 0xa984, 0x9184, 0x0020, 0x1120, 0xc1ad, 0xa986, 0x080c, + 0xb5c5, 0x0005, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, + 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd314, 0xd5a4, 0x1118, + 0x080c, 0x14d2, 0x0005, 0x080c, 0x7d22, 0x080c, 0x199b, 0x0005, + 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, + 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, + 0x0120, 0x2001, 0x0016, 0x080c, 0x1553, 0x00fe, 0x007e, 0x006e, + 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, + 0x0004, 0x190c, 0x0dc4, 0xd184, 0x11b1, 0xd19c, 0x0180, 0xc19c, + 0x7106, 0x0016, 0x080c, 0x1619, 0x001e, 0x0148, 0x2001, 0x020d, + 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x14d2, 0x0005, 0x81ff, + 0x190c, 0x0dc4, 0x0005, 0x2100, 0xc184, 0xc1b4, 0x7106, 0xd0b4, + 0x0016, 0x00e6, 0x1904, 0x14bb, 0x2071, 0x0200, 0x080c, 0x160d, + 0x080c, 0x1619, 0x05a8, 0x6014, 0x9005, 0x05a8, 0x0096, 0x2048, + 0xa868, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, + 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c, + 0x1679, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, 0x17bd, 0x00fe, + 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, + 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x0419, 0x0040, + 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12de, 0x7803, 0x0001, + 0x00ee, 0x001e, 0x0005, 0x080c, 0x1619, 0x0dd0, 0x2001, 0x020d, + 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0c90, 0x0031, 0x2060, + 0x2009, 0x0053, 0x080c, 0x9f88, 0x0005, 0x7808, 0xd09c, 0x0de8, + 0x7820, 0x0005, 0x080c, 0x143d, 0x00d6, 0x2069, 0x0200, 0x2009, + 0x01f4, 0x8109, 0x0520, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, + 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1578, 0x79b8, 0x918c, 0x0fff, + 0x0180, 0x9182, 0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, + 0x810c, 0x810c, 0x810c, 0x080c, 0x153f, 0x6827, 0x0001, 0x8109, + 0x1dd0, 0x080c, 0x153f, 0x6827, 0x0002, 0x080c, 0x153f, 0x6804, + 0x9005, 0x1170, 0x682c, 0xd0e4, 0x1540, 0x691c, 0x9184, 0x0014, + 0x0120, 0x6830, 0x9084, 0x9554, 0x15b9, 0x6804, 0x9005, 0x0da8, + 0x79b8, 0xd1ec, 0x1130, 0x0870, 0x080c, 0x7d22, 0x080c, 0x199b, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0005, 0x6824, - 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, - 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, - 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, - 0x1333, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, - 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, - 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd1, 0x2009, - 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009, 0xff00, 0x8109, 0x0904, - 0x15c3, 0x7a18, 0x9284, 0x0030, 0x0904, 0x15be, 0x9284, 0x0048, - 0x9086, 0x0008, 0x1904, 0x15be, 0x2001, 0x0109, 0x2004, 0xd08c, - 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x0126, - 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, 0x2009, 0x1a59, 0x2104, - 0x8000, 0x0208, 0x200a, 0x080c, 0x84a8, 0x001e, 0x002e, 0x00fe, - 0x012e, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x000e, 0x2001, - 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006, 0x0126, 0x01c6, 0x01d6, - 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, 0x2009, 0x1a5a, 0x2104, - 0x8000, 0x0208, 0x200a, 0x080c, 0x1d7d, 0x001e, 0x00fe, 0x015e, - 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x7818, 0xd0bc, - 0x1904, 0x156e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0f4, 0x1528, - 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284, 0x0048, 0x9086, 0x0008, - 0x11e0, 0x2001, 0x19d0, 0x2004, 0x9005, 0x01b8, 0x2001, 0x1a41, - 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, 0x1a58, 0x2104, 0x8000, - 0x0208, 0x200a, 0x080c, 0x94c6, 0x2009, 0x180c, 0x2104, 0xc0f5, - 0x200a, 0x2009, 0xff00, 0x0804, 0x156e, 0x9085, 0x0001, 0x0005, - 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1567, 0x1108, - 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd1, 0x7037, - 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, - 0x7054, 0x2060, 0x0005, 0x0006, 0x0046, 0x00e6, 0x2071, 0x0200, - 0x7037, 0x0002, 0x7058, 0x9084, 0xff00, 0x8007, 0x9086, 0x00bc, - 0x1158, 0x2021, 0x1a57, 0x2404, 0x8000, 0x0208, 0x2022, 0x080c, - 0x7bb0, 0x080c, 0x1984, 0x9006, 0x00ee, 0x004e, 0x000e, 0x0005, - 0x0c11, 0x1108, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0879, - 0x7358, 0x745c, 0x6014, 0x905d, 0x0520, 0x2b48, 0xab42, 0xac3e, - 0x2001, 0x187d, 0x2004, 0xd0b4, 0x1138, 0x601c, 0xd0e4, 0x1120, - 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1f79, 0x1190, 0x080c, - 0x1805, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, - 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, - 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, - 0x14d4, 0x0005, 0x080c, 0x0dd1, 0x2001, 0x180d, 0x2004, 0xd08c, - 0x190c, 0x66a5, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x0016, 0x00c6, - 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730, 0xa864, 0x2068, - 0xa81a, 0x9d84, 0x000f, 0x9088, 0x1f59, 0x2165, 0x0002, 0x1696, - 0x16e3, 0x1696, 0x1696, 0x1696, 0x16c5, 0x1696, 0x169a, 0x168f, - 0x16da, 0x1696, 0x1696, 0x1696, 0x17a0, 0x16ae, 0x16a4, 0xa964, - 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904, 0x16da, 0x9085, 0x0001, - 0x0804, 0x1796, 0xa87c, 0xd0bc, 0x0dc8, 0xa890, 0xa842, 0xa88c, - 0xa83e, 0xa888, 0x0804, 0x16ea, 0xa87c, 0xd0bc, 0x0d78, 0xa890, - 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1739, 0xa87c, 0xd0bc, - 0x0d28, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, - 0x0dd1, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f59, 0x2065, - 0xa888, 0xd19c, 0x1904, 0x1739, 0x0428, 0xa87c, 0xd0ac, 0x0970, - 0xa804, 0x9045, 0x090c, 0x0dd1, 0xa164, 0xa91a, 0x91ec, 0x000f, - 0x9d80, 0x1f59, 0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, - 0x1739, 0x0080, 0xa87c, 0xd0ac, 0x0904, 0x1696, 0x9006, 0xa842, - 0xa83e, 0x0804, 0x1739, 0xa87c, 0xd0ac, 0x0904, 0x1696, 0x9006, - 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd1, 0x9082, - 0x001b, 0x0002, 0x170d, 0x170d, 0x170f, 0x170d, 0x170d, 0x170d, - 0x1715, 0x170d, 0x170d, 0x170d, 0x171b, 0x170d, 0x170d, 0x170d, - 0x1721, 0x170d, 0x170d, 0x170d, 0x1727, 0x170d, 0x170d, 0x170d, - 0x172d, 0x170d, 0x170d, 0x170d, 0x1733, 0x080c, 0x0dd1, 0xa574, - 0xa478, 0xa37c, 0xa280, 0x0804, 0x177e, 0xa584, 0xa488, 0xa38c, - 0xa290, 0x0804, 0x177e, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, - 0x177e, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x177e, 0xa5b4, - 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x177e, 0xa5c4, 0xa4c8, 0xa3cc, - 0xa2d0, 0x0804, 0x177e, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, - 0x177e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd1, 0x9082, 0x001b, - 0x0002, 0x175c, 0x175a, 0x175a, 0x175a, 0x175a, 0x175a, 0x1763, - 0x175a, 0x175a, 0x175a, 0x175a, 0x175a, 0x176a, 0x175a, 0x175a, - 0x175a, 0x175a, 0x175a, 0x1771, 0x175a, 0x175a, 0x175a, 0x175a, - 0x175a, 0x1778, 0x080c, 0x0dd1, 0xa56c, 0xa470, 0xa774, 0xa678, - 0xa37c, 0xa280, 0x00d8, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, - 0xa298, 0x00a0, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, - 0x0068, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0030, - 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, - 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, - 0xaab0, 0xa836, 0xaa3a, 0x8109, 0xa916, 0x1160, 0x3e60, 0x601c, - 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x001e, - 0x012e, 0x0005, 0x2800, 0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c70, - 0x0804, 0x1696, 0x2001, 0x180d, 0x2004, 0xd08c, 0x190c, 0x66a5, - 0x2ff0, 0x0126, 0x2091, 0x2200, 0x0016, 0x00c6, 0x3e60, 0x6014, - 0x2048, 0x2940, 0xa80e, 0x2061, 0x1f54, 0xa813, 0x1f54, 0x2c05, - 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0dd1, 0x9006, - 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd1, 0xadcc, - 0xacd0, 0xafd4, 0xaed8, 0xabdc, 0xaae0, 0xab2e, 0xaa32, 0xad1e, - 0xac22, 0xaf26, 0xae2a, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0xa988, - 0xa864, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1120, 0x8109, 0xa916, - 0x0128, 0x0080, 0x918a, 0x0002, 0xa916, 0x1160, 0x3e60, 0x601c, - 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x001e, - 0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0dd1, 0xa80e, 0xa064, - 0xa81a, 0x9084, 0x000f, 0x9080, 0x1f59, 0x2015, 0x82ff, 0x090c, - 0x0dd1, 0xaa12, 0x2205, 0xa80a, 0x0c08, 0x903e, 0x2730, 0xa880, - 0xd0fc, 0x1190, 0x2d00, 0x0002, 0x18fa, 0x185c, 0x185c, 0x18fa, - 0x18fa, 0x18f4, 0x18fa, 0x185c, 0x18ab, 0x18ab, 0x18ab, 0x18fa, - 0x18fa, 0x18fa, 0x18f1, 0x18ab, 0xc0fc, 0xa882, 0xab2c, 0xaa30, - 0xad1c, 0xac20, 0xdd9c, 0x0904, 0x18fc, 0x2c05, 0x908a, 0x0034, - 0x1a0c, 0x0dd1, 0x9082, 0x001b, 0x0002, 0x1848, 0x1846, 0x1846, - 0x1846, 0x1846, 0x1846, 0x184c, 0x1846, 0x1846, 0x1846, 0x1846, - 0x1846, 0x1850, 0x1846, 0x1846, 0x1846, 0x1846, 0x1846, 0x1854, - 0x1846, 0x1846, 0x1846, 0x1846, 0x1846, 0x1858, 0x080c, 0x0dd1, - 0xa774, 0xa678, 0x0804, 0x18fc, 0xa78c, 0xa690, 0x0804, 0x18fc, - 0xa7a4, 0xa6a8, 0x0804, 0x18fc, 0xa7bc, 0xa6c0, 0x0804, 0x18fc, - 0xa7d4, 0xa6d8, 0x0804, 0x18fc, 0x2c05, 0x908a, 0x0036, 0x1a0c, - 0x0dd1, 0x9082, 0x001b, 0x0002, 0x187f, 0x187f, 0x1881, 0x187f, - 0x187f, 0x187f, 0x1887, 0x187f, 0x187f, 0x187f, 0x188d, 0x187f, - 0x187f, 0x187f, 0x1893, 0x187f, 0x187f, 0x187f, 0x1899, 0x187f, - 0x187f, 0x187f, 0x189f, 0x187f, 0x187f, 0x187f, 0x18a5, 0x080c, - 0x0dd1, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x18fc, 0xa584, - 0xa488, 0xa38c, 0xa290, 0x0804, 0x18fc, 0xa594, 0xa498, 0xa39c, - 0xa2a0, 0x0804, 0x18fc, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, - 0x18fc, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x18fc, 0xa5c4, - 0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x18fc, 0xa5d4, 0xa4d8, 0xa3dc, - 0xa2e0, 0x0804, 0x18fc, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd1, - 0x9082, 0x001b, 0x0002, 0x18ce, 0x18cc, 0x18cc, 0x18cc, 0x18cc, - 0x18cc, 0x18d5, 0x18cc, 0x18cc, 0x18cc, 0x18cc, 0x18cc, 0x18dc, - 0x18cc, 0x18cc, 0x18cc, 0x18cc, 0x18cc, 0x18e3, 0x18cc, 0x18cc, - 0x18cc, 0x18cc, 0x18cc, 0x18ea, 0x080c, 0x0dd1, 0xa56c, 0xa470, - 0xa774, 0xa678, 0xa37c, 0xa280, 0x0438, 0xa584, 0xa488, 0xa78c, - 0xa690, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, - 0xa3ac, 0xa2b0, 0x00c8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, - 0xa2c8, 0x0090, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, - 0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x1f11, 0x1904, 0x1805, - 0x900e, 0x0050, 0x080c, 0x0dd1, 0xab2e, 0xaa32, 0xad1e, 0xac22, - 0xaf26, 0xae2a, 0x080c, 0x1f11, 0x0005, 0x6014, 0x2048, 0x6118, - 0x81ff, 0x0148, 0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, - 0x0001, 0x0008, 0xa986, 0x601b, 0x0002, 0xa874, 0x9084, 0x00ff, - 0x9084, 0x0008, 0x0150, 0x00e9, 0x6000, 0x9086, 0x0004, 0x1120, - 0x2009, 0x0048, 0x080c, 0x9d7a, 0x0005, 0xa974, 0xd1dc, 0x1108, - 0x0005, 0xa934, 0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106, - 0x1138, 0x601c, 0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0x9d7a, - 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, - 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, - 0x6023, 0x0000, 0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, - 0x7808, 0xd09c, 0x0120, 0x080c, 0x1333, 0x8631, 0x1db8, 0x00ce, - 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, - 0x1333, 0x00ce, 0x2001, 0x0038, 0x080c, 0x1a14, 0x7930, 0x9186, - 0x0040, 0x0160, 0x9186, 0x0042, 0x190c, 0x0dd1, 0x2001, 0x001e, - 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1a23, 0x000e, 0x6022, - 0x012e, 0x0005, 0x080c, 0x1a10, 0x7827, 0x0015, 0x7828, 0x9c06, - 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, - 0x0000, 0x78ab, 0x0004, 0x2001, 0xf000, 0x8001, 0x090c, 0x0dd1, - 0x7aac, 0xd2ac, 0x1dd0, 0x00fe, 0x080c, 0x7173, 0x1188, 0x2001, - 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011, - 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0059, 0x0804, 0x7221, - 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, - 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2a67, 0x2009, 0x003c, - 0x080c, 0x229b, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, - 0x003c, 0x1de0, 0x080c, 0x8091, 0x70a0, 0x70a2, 0x7098, 0x709a, - 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, - 0x0300, 0x080c, 0x12e7, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, - 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, - 0x2003, 0x0000, 0x080c, 0x7173, 0x1108, 0x0005, 0x2021, 0x0260, - 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c, - 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110, - 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, 0x0005, 0x0046, - 0x2021, 0x0019, 0x2003, 0x0048, 0xa001, 0xa001, 0x201c, 0x939c, - 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, 0x0c60, 0x004e, 0x0c40, - 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08, 0x621c, 0x080c, 0x1545, - 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x15f0, 0x7930, 0x0005, - 0x8001, 0x1df0, 0x0005, 0x2031, 0x0064, 0x781c, 0x9084, 0x0007, - 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1a81, - 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0dd1, 0x781f, - 0x0202, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, 0x0dac, 0x0c01, - 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0, 0x2001, 0x0030, 0x0891, - 0x9186, 0x0040, 0x0568, 0x781c, 0xd084, 0x1da8, 0x781f, 0x0101, - 0x2001, 0x0014, 0x0869, 0x2001, 0x0037, 0x0821, 0x9186, 0x0040, - 0x0140, 0x2001, 0x0030, 0x080c, 0x1a1a, 0x9186, 0x0040, 0x190c, - 0x0dd1, 0x00d6, 0x2069, 0x0200, 0x692c, 0xd1f4, 0x1170, 0xd1c4, - 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, - 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0, 0x00de, 0x781f, 0x0100, - 0x791c, 0x9184, 0x0007, 0x090c, 0x0dd1, 0xa001, 0xa001, 0x781f, - 0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2071, 0x1a41, 0x2079, - 0x0090, 0x012e, 0x0005, 0x9280, 0x0005, 0x2004, 0x2048, 0xa97c, - 0xd1dc, 0x1904, 0x1b16, 0xa964, 0x9184, 0x0007, 0x0002, 0x1a9f, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 01:04:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C76A106564A; Sat, 1 Aug 2009 01:04:26 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793E58FC0C; Sat, 1 Aug 2009 01:04:26 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7114QWk085937; Sat, 1 Aug 2009 01:04:26 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7114Qxa085932; Sat, 1 Aug 2009 01:04:26 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200908010104.n7114Qxa085932@svn.freebsd.org> From: Matt Jacob Date: Sat, 1 Aug 2009 01:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196008 - in head/sys: cam dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 01:04:26 -0000 Author: mjacob Date: Sat Aug 1 01:04:26 2009 New Revision: 196008 URL: http://svn.freebsd.org/changeset/base/196008 Log: Add 8Gb support (isp_2500). Fix a fair number of configuration and firmware loading bugs. Target mode support has received some serious attention to make it more usable and stable. Some backward compatible additions to CAM have been made that make target mode async events easier to deal with have also been put into place. Further refinement and better support for NP-IV (N-port Virtualization) is now in place. Code for release prior to RELENG_7 has been stripped away for code clarity. Sponsored by: Copan Systems Reviewed by: scottl, ken, jung-uk kim Approved by: re Modified: head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_ioctl.h head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c head/sys/dev/isp/isp_stds.h head/sys/dev/isp/isp_target.c head/sys/dev/isp/isp_target.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispreg.h head/sys/dev/isp/ispvar.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sat Aug 1 00:57:34 2009 (r196007) +++ head/sys/cam/cam_ccb.h Sat Aug 1 01:04:26 2009 (r196008) @@ -173,6 +173,15 @@ typedef enum { XPT_ATA_IO = 0x18 | XPT_FC_DEV_QUEUED, /* Execute the requested ATA I/O operation */ + XPT_GET_SIM_KNOB = 0x18, + /* + * Get SIM specific knob values. + */ + + XPT_SET_SIM_KNOB = 0x19, + /* + * Set SIM specific knob values. + */ /* HBA engine commands 0x20->0x2F */ XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, /* HBA engine feature inquiry */ @@ -189,8 +198,12 @@ typedef enum { XPT_CONT_TARGET_IO = 0x33 | XPT_FC_DEV_QUEUED, /* Continue Host Target I/O Connection */ XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB, - /* Notify Host Target driver of event */ + /* Notify Host Target driver of event (obsolete) */ XPT_NOTIFY_ACK = 0x35, + /* Acknowledgement of event (obsolete) */ + XPT_IMMEDIATE_NOTIFY = 0x36 | XPT_FC_QUEUED | XPT_FC_USER_CCB, + /* Notify Host Target driver of event */ + XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /* Acknowledgement of event */ /* Vendor Unique codes: 0x80->0x8F */ @@ -531,12 +544,14 @@ typedef enum { struct ccb_pathinq_settings_spi { u_int8_t ppr_options; }; + struct ccb_pathinq_settings_fc { u_int64_t wwnn; /* world wide node name */ u_int64_t wwpn; /* world wide port name */ u_int32_t port; /* 24 bit port id, if known */ u_int32_t bitrate; /* Mbps */ }; + struct ccb_pathinq_settings_sas { u_int32_t bitrate; /* Mbps */ }; @@ -678,6 +693,7 @@ struct ccb_relsim { * Definitions for the asynchronous callback CCB fields. */ typedef enum { + AC_CONTRACT = 0x1000,/* A contractual callback */ AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */ AC_INQ_CHANGED = 0x400,/* Inquiry info might have changed */ AC_TRANSFER_NEG = 0x200,/* New transfer settings in effect */ @@ -694,6 +710,26 @@ typedef enum { typedef void ac_callback_t (void *softc, u_int32_t code, struct cam_path *path, void *args); +/* + * Generic Asynchronous callbacks. + * + * Generic arguments passed bac which are then interpreted between a per-system + * contract number. + */ +#define AC_CONTRACT_DATA_MAX (128 - sizeof (u_int64_t)) +struct ac_contract { + u_int64_t contract_number; + u_int8_t contract_data[AC_CONTRACT_DATA_MAX]; +}; + +#define AC_CONTRACT_DEV_CHG 1 +struct ac_device_changed { + u_int64_t wwpn; + u_int32_t port; + target_id_t target; + u_int8_t arrived; +}; + /* Set Asynchronous Callback CCB */ struct ccb_setasync { struct ccb_hdr ccb_h; @@ -823,6 +859,50 @@ struct ccb_calc_geometry { }; /* + * Set or get SIM (and transport) specific knobs + */ + +#define KNOB_VALID_ADDRESS 0x1 +#define KNOB_VALID_ROLE 0x2 + + +#define KNOB_ROLE_NONE 0x0 +#define KNOB_ROLE_INITIATOR 0x1 +#define KNOB_ROLE_TARGET 0x2 +#define KNOB_ROLE_BOTH 0x3 + +struct ccb_sim_knob_settings_spi { + u_int valid; + u_int initiator_id; + u_int role; +}; + +struct ccb_sim_knob_settings_fc { + u_int valid; + u_int64_t wwnn; /* world wide node name */ + u_int64_t wwpn; /* world wide port name */ + u_int role; +}; + +struct ccb_sim_knob_settings_sas { + u_int valid; + u_int64_t wwnn; /* world wide node name */ + u_int role; +}; +#define KNOB_SETTINGS_SIZE 128 + +struct ccb_sim_knob { + struct ccb_hdr ccb_h; + union { + u_int valid; /* Which fields to honor */ + struct ccb_sim_knob_settings_spi spi; + struct ccb_sim_knob_settings_fc fc; + struct ccb_sim_knob_settings_sas sas; + char pad[KNOB_SETTINGS_SIZE]; + } xport_specific; +}; + +/* * Rescan the given bus, or bus/target/lun */ struct ccb_rescan { @@ -847,6 +927,7 @@ struct ccb_en_lun { u_int8_t enable; }; +/* old, barely used immediate notify, binary compatibility */ struct ccb_immed_notify { struct ccb_hdr ccb_h; struct scsi_sense_data sense_data; @@ -861,6 +942,22 @@ struct ccb_notify_ack { u_int8_t event; /* Event flags */ }; +struct ccb_immediate_notify { + struct ccb_hdr ccb_h; + u_int tag_id; /* Tag for immediate notify */ + u_int seq_id; /* Tag for target of notify */ + u_int initiator_id; /* Initiator Identifier */ + u_int arg; /* Function specific */ +}; + +struct ccb_notify_acknowledge { + struct ccb_hdr ccb_h; + u_int tag_id; /* Tag for immediate notify */ + u_int seq_id; /* Tar for target of notify */ + u_int initiator_id; /* Initiator Identifier */ + u_int arg; /* Function specific */ +}; + /* HBA engine structures. */ typedef enum { @@ -935,6 +1032,7 @@ union ccb { struct ccb_dev_match cdm; struct ccb_trans_settings cts; struct ccb_calc_geometry ccg; + struct ccb_sim_knob knob; struct ccb_abort cab; struct ccb_resetbus crb; struct ccb_resetdev crd; @@ -944,6 +1042,8 @@ union ccb { struct ccb_en_lun cel; struct ccb_immed_notify cin; struct ccb_notify_ack cna; + struct ccb_immediate_notify cin1; + struct ccb_notify_acknowledge cna2; struct ccb_eng_inq cei; struct ccb_eng_exec cee; struct ccb_rescan crcn; Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sat Aug 1 00:57:34 2009 (r196007) +++ head/sys/cam/cam_xpt.c Sat Aug 1 01:04:26 2009 (r196008) @@ -2565,6 +2565,10 @@ xpt_action_default(union ccb *start_ccb) case XPT_IMMED_NOTIFY: case XPT_NOTIFY_ACK: case XPT_RESET_BUS: + case XPT_IMMEDIATE_NOTIFY: + case XPT_NOTIFY_ACKNOWLEDGE: + case XPT_GET_SIM_KNOB: + case XPT_SET_SIM_KNOB: { struct cam_sim *sim; Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Aug 1 00:57:34 2009 (r196007) +++ head/sys/dev/isp/isp.c Sat Aug 1 01:04:26 2009 (r196008) @@ -1,17 +1,17 @@ /*- - * Copyright (c) 1997-2007 by Matthew Jacob + * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -23,6 +23,7 @@ * 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. + * */ /* @@ -64,51 +65,52 @@ __FBSDID("$FreeBSD$"); */ #define MBOX_DELAY_COUNT 1000000 / 100 -#define ISP_MARK_PORTDB(a, b) \ - isp_prt(isp, ISP_LOGSANCFG, "line %d: markportdb", __LINE__); \ - isp_mark_portdb(a, b) +#define ISP_MARK_PORTDB(a, b, c) \ + isp_prt(isp, ISP_LOGSANCFG, \ + "Chan %d ISP_MARK_PORTDB@LINE %d", b, __LINE__); \ + isp_mark_portdb(a, b, c) /* * Local static data */ -static const char fconf[] = - "PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n" - " database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)"; -static const char notresp[] = - "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; -static const char xact1[] = - "HBA attempted queued transaction with disconnect not set for %d.%d.%d"; -static const char xact2[] = - "HBA attempted queued transaction to target routine %d on target %d bus %d"; -static const char xact3[] = - "HBA attempted queued cmd for %d.%d.%d when queueing disabled"; -static const char pskip[] = - "SCSI phase skipped for target %d.%d.%d"; -static const char topology[] = - "HBA PortID 0x%06x N-Port Handle %d, Connection Topology '%s'"; -static const char ourwwn[] = - "HBA WWNN 0x%08x%08x HBA WWPN 0x%08x%08x"; -static const char finmsg[] = - "%d.%d.%d: FIN dl%d resid %d STS 0x%x SKEY %c XS_ERR=0x%x"; -static const char sc0[] = - "%s CHAN %d FTHRSH %d IID %d RESETD %d RETRYC %d RETRYD %d ASD 0x%x"; -static const char sc1[] = - "%s RAAN 0x%x DLAN 0x%x DDMAB 0x%x CDMAB 0x%x SELTIME %d MQD %d"; -static const char sc2[] = "%s CHAN %d TGT %d FLAGS 0x%x 0x%x/0x%x"; -static const char sc3[] = "Generated"; +static const char fconf[] = "Chan %d PortDB[%d] changed:\n current =(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)\n database=(0x%x@0x%06x 0x%08x%08x 0x%08x%08x)"; +static const char notresp[] = "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d"; +static const char xact1[] = "HBA attempted queued transaction with disconnect not set for %d.%d.%d"; +static const char xact2[] = "HBA attempted queued transaction to target routine %d on target %d bus %d"; +static const char xact3[] = "HBA attempted queued cmd for %d.%d.%d when queueing disabled"; +static const char pskip[] = "SCSI phase skipped for target %d.%d.%d"; +static const char topology[] = "Chan %d WWPN 0x%08x%08x PortID 0x%06x N-Port Handle %d, Connection '%s'"; +static const char finmsg[] = "%d.%d.%d: FIN dl%d resid %ld STS 0x%x SKEY %c XS_ERR=0x%x"; static const char sc4[] = "NVRAM"; -static const char bun[] = - "bad underrun for %d.%d (count %d, resid %d, status %s)"; +static const char bun[] = "bad underrun for %d.%d (count %d, resid %d, status %s)"; +static const char lipd[] = "Chan %d LIP destroyed %d active commands"; +static const char sacq[] = "unable to acquire scratch area"; + +static const uint8_t alpa_map[] = { + 0xef, 0xe8, 0xe4, 0xe2, 0xe1, 0xe0, 0xdc, 0xda, + 0xd9, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd1, 0xce, + 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc7, 0xc6, 0xc5, + 0xc3, 0xbc, 0xba, 0xb9, 0xb6, 0xb5, 0xb4, 0xb3, + 0xb2, 0xb1, 0xae, 0xad, 0xac, 0xab, 0xaa, 0xa9, + 0xa7, 0xa6, 0xa5, 0xa3, 0x9f, 0x9e, 0x9d, 0x9b, + 0x98, 0x97, 0x90, 0x8f, 0x88, 0x84, 0x82, 0x81, + 0x80, 0x7c, 0x7a, 0x79, 0x76, 0x75, 0x74, 0x73, + 0x72, 0x71, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, + 0x67, 0x66, 0x65, 0x63, 0x5c, 0x5a, 0x59, 0x56, + 0x55, 0x54, 0x53, 0x52, 0x51, 0x4e, 0x4d, 0x4c, + 0x4b, 0x4a, 0x49, 0x47, 0x46, 0x45, 0x43, 0x3c, + 0x3a, 0x39, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, + 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x27, 0x26, + 0x25, 0x23, 0x1f, 0x1e, 0x1d, 0x1b, 0x18, 0x17, + 0x10, 0x0f, 0x08, 0x04, 0x02, 0x01, 0x00 +}; /* * Local function prototypes. */ static int isp_parse_async(ispsoftc_t *, uint16_t); -static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, - uint32_t *); -static void -isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); -static void +static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); +static void isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *, long *); static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *, long *); static void isp_fastpost_complete(ispsoftc_t *, uint16_t); static int isp_mbox_continue(ispsoftc_t *); @@ -116,39 +118,37 @@ static void isp_scsi_init(ispsoftc_t *); static void isp_scsi_channel_init(ispsoftc_t *, int); static void isp_fibre_init(ispsoftc_t *); static void isp_fibre_init_2400(ispsoftc_t *); -static void isp_mark_portdb(ispsoftc_t *, int); -static int isp_plogx(ispsoftc_t *, uint16_t, uint32_t, int, int); +static void isp_mark_portdb(ispsoftc_t *, int, int); +static int isp_plogx(ispsoftc_t *, int, uint16_t, uint32_t, int, int); static int isp_port_login(ispsoftc_t *, uint16_t, uint32_t); static int isp_port_logout(ispsoftc_t *, uint16_t, uint32_t); -static int isp_getpdb(ispsoftc_t *, uint16_t, isp_pdb_t *, int); -static uint64_t isp_get_portname(ispsoftc_t *, int, int); -static int isp_fclink_test(ispsoftc_t *, int); -static const char *ispfc_fw_statename(int); -static int isp_pdb_sync(ispsoftc_t *); -static int isp_scan_loop(ispsoftc_t *); -static int isp_gid_ft_sns(ispsoftc_t *); -static int isp_gid_ft_ct_passthru(ispsoftc_t *); -static int isp_scan_fabric(ispsoftc_t *); -static int isp_login_device(ispsoftc_t *, uint32_t, isp_pdb_t *, uint16_t *); -static int isp_register_fc4_type(ispsoftc_t *); -static int isp_register_fc4_type_24xx(ispsoftc_t *); -static uint16_t isp_nxt_handle(ispsoftc_t *, uint16_t); -static void isp_fw_state(ispsoftc_t *); +static int isp_getpdb(ispsoftc_t *, int, uint16_t, isp_pdb_t *, int); +static void isp_dump_chip_portdb(ispsoftc_t *, int, int); +static uint64_t isp_get_wwn(ispsoftc_t *, int, int, int); +static int isp_fclink_test(ispsoftc_t *, int, int); +static int isp_pdb_sync(ispsoftc_t *, int); +static int isp_scan_loop(ispsoftc_t *, int); +static int isp_gid_ft_sns(ispsoftc_t *, int); +static int isp_gid_ft_ct_passthru(ispsoftc_t *, int); +static int isp_scan_fabric(ispsoftc_t *, int); +static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t *); +static int isp_register_fc4_type(ispsoftc_t *, int); +static int isp_register_fc4_type_24xx(ispsoftc_t *, int); +static uint16_t isp_nxt_handle(ispsoftc_t *, int, uint16_t); +static void isp_fw_state(ispsoftc_t *, int); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *); -static void isp_update(ispsoftc_t *); -static void isp_update_bus(ispsoftc_t *, int); -static void isp_setdfltparm(ispsoftc_t *, int); -static void isp_setdfltfcparm(ispsoftc_t *); -static int isp_read_nvram(ispsoftc_t *); -static int isp_read_nvram_2400(ispsoftc_t *); +static void isp_spi_update(ispsoftc_t *, int); +static void isp_setdfltsdparm(ispsoftc_t *); +static void isp_setdfltfcparm(ispsoftc_t *, int); +static int isp_read_nvram(ispsoftc_t *, int); +static int isp_read_nvram_2400(ispsoftc_t *, uint8_t *); static void isp_rdnvram_word(ispsoftc_t *, int, uint16_t *); static void isp_rd_2400_nvram(ispsoftc_t *, uint32_t, uint32_t *); static void isp_parse_nvram_1020(ispsoftc_t *, uint8_t *); static void isp_parse_nvram_1080(ispsoftc_t *, int, uint8_t *); static void isp_parse_nvram_12160(ispsoftc_t *, int, uint8_t *); -static void isp_fix_nvram_wwns(ispsoftc_t *); static void isp_parse_nvram_2100(ispsoftc_t *, uint8_t *); static void isp_parse_nvram_2400(ispsoftc_t *, uint8_t *); @@ -161,15 +161,20 @@ static void isp_parse_nvram_2400(ispsoft */ void -isp_reset(ispsoftc_t *isp) +isp_reset(ispsoftc_t *isp, int do_load_defaults) { mbreg_t mbs; uint32_t code_org, val; int loops, i, dodnld = 1; - static const char *btype = "????"; + const char *btype = "????"; static const char dcrc[] = "Downloaded RISC Code Checksum Failure"; isp->isp_state = ISP_NILSTATE; + if (isp->isp_dead) { + isp_shutdown(isp); + ISP_DISABLE_INTS(isp); + return; + } /* * Basic types (SCSI, FibreChannel and PCI or SBus) @@ -181,51 +186,6 @@ isp_reset(ispsoftc_t *isp) * for SCSI adapters and do other settings for the 2100. */ - /* - * Get the current running firmware revision out of the - * chip before we hit it over the head (if this is our - * first time through). Note that we store this as the - * 'ROM' firmware revision- which it may not be. In any - * case, we don't really use this yet, but we may in - * the future. - */ - if (isp->isp_touched == 0) { - /* - * First see whether or not we're sitting in the ISP PROM. - * If we've just been reset, we'll have the string "ISP " - * spread through outgoing mailbox registers 1-3. We do - * this for PCI cards because otherwise we really don't - * know what state the card is in and we could hang if - * we try this command otherwise. - * - * For SBus cards, we just do this because they almost - * certainly will be running firmware by now. - */ - if (ISP_READ(isp, OUTMAILBOX1) != 0x4953 || - ISP_READ(isp, OUTMAILBOX2) != 0x5020 || - ISP_READ(isp, OUTMAILBOX3) != 0x2020) { - /* - * Just in case it was paused... - */ - if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_HCCR, - HCCR_2400_CMD_RELEASE); - } else { - ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE); - } - MEMZERO(&mbs, sizeof (mbs)); - mbs.param[0] = MBOX_ABOUT_FIRMWARE; - mbs.logval = MBLOGNONE; - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { - isp->isp_romfw_rev[0] = mbs.param[1]; - isp->isp_romfw_rev[1] = mbs.param[2]; - isp->isp_romfw_rev[2] = mbs.param[3]; - } - } - isp->isp_touched = 1; - } - ISP_DISABLE_INTS(isp); /* @@ -244,17 +204,16 @@ isp_reset(ispsoftc_t *isp) } /* - * Set up DMA for the request and result queues. + * Set up DMA for the request and response queues. * * We do this now so we can use the request queue - * for a dma + * for dma to load firmware from. */ if (ISP_MBOXDMASETUP(isp) != 0) { isp_prt(isp, ISP_LOGERR, "Cannot setup DMA"); return; } - /* * Set up default request/response queue in-pointer/out-pointer * register indices. @@ -264,8 +223,6 @@ isp_reset(ispsoftc_t *isp) isp->isp_rqstoutrp = BIU2400_REQOUTP; isp->isp_respinrp = BIU2400_RSPINP; isp->isp_respoutrp = BIU2400_RSPOUTP; - isp->isp_atioinrp = BIU2400_ATIO_RSPINP; - isp->isp_atiooutrp = BIU2400_ATIO_REQINP; } else if (IS_23XX(isp)) { isp->isp_rqstinrp = BIU_REQINP; isp->isp_rqstoutrp = BIU_REQOUTP; @@ -310,6 +267,9 @@ isp_reset(ispsoftc_t *isp) case ISP_HA_FC_2400: btype = "2422"; break; + case ISP_HA_FC_2500: + btype = "2532"; + break; default: break; } @@ -326,11 +286,13 @@ isp_reset(ispsoftc_t *isp) ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); } } else if (IS_1240(isp)) { - sdparam *sdp = isp->isp_param; + sdparam *sdp; + btype = "1240"; isp->isp_clock = 60; + sdp = SDPARAM(isp, 0); sdp->isp_ultramode = 1; - sdp++; + sdp = SDPARAM(isp, 1); sdp->isp_ultramode = 1; /* * XXX: Should probably do some bus sensing. @@ -355,7 +317,7 @@ isp_reset(ispsoftc_t *isp) } else if (IS_ULTRA2(isp)) { static const char m[] = "bus %d is in %s Mode"; uint16_t l; - sdparam *sdp = isp->isp_param; + sdparam *sdp = SDPARAM(isp, 0); isp->isp_clock = 100; @@ -387,10 +349,10 @@ isp_reset(ispsoftc_t *isp) } if (IS_DUALBUS(isp)) { - sdp++; + sdp = SDPARAM(isp, 1); l = ISP_READ(isp, SXP_PINS_DIFF|SXP_BANK1_SELECT); l &= ISP1080_MODE_MASK; - switch(l) { + switch (l) { case ISP1080_LVD_MODE: sdp->isp_lvdmode = 1; isp_prt(isp, ISP_LOGCONFIG, m, 1, "LVD"); @@ -412,7 +374,7 @@ isp_reset(ispsoftc_t *isp) } } } else { - sdparam *sdp = isp->isp_param; + sdparam *sdp = SDPARAM(isp, 0); i = ISP_READ(isp, BIU_CONF0) & BIU_CONF0_HW_MASK; switch (i) { default: @@ -509,7 +471,7 @@ isp_reset(ispsoftc_t *isp) /* * Hit the chip over the head with hammer, - * and give the ISP a chance to recover. + * and give it a chance to recover. */ if (IS_SCSI(isp)) { @@ -517,15 +479,13 @@ isp_reset(ispsoftc_t *isp) /* * A slight delay... */ - USEC_DELAY(100); + ISP_DELAY(100); /* * Clear data && control DMA engines. */ - ISP_WRITE(isp, CDMA_CONTROL, - DMA_CNTRL_CLEAR_CHAN | DMA_CNTRL_RESET_INT); - ISP_WRITE(isp, DDMA_CONTROL, - DMA_CNTRL_CLEAR_CHAN | DMA_CNTRL_RESET_INT); + ISP_WRITE(isp, CDMA_CONTROL, DMA_CNTRL_CLEAR_CHAN | DMA_CNTRL_RESET_INT); + ISP_WRITE(isp, DDMA_CONTROL, DMA_CNTRL_CLEAR_CHAN | DMA_CNTRL_RESET_INT); } else if (IS_24XX(isp)) { @@ -534,12 +494,12 @@ isp_reset(ispsoftc_t *isp) */ ISP_WRITE(isp, BIU2400_CSR, BIU2400_DMA_STOP|(3 << 4)); for (val = loops = 0; loops < 30000; loops++) { - USEC_DELAY(10); + ISP_DELAY(10); val = ISP_READ(isp, BIU2400_CSR); if ((val & BIU2400_DMA_ACTIVE) == 0) { break; } - } + } if (val & BIU2400_DMA_ACTIVE) { ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, "DMA Failed to Stop on Reset"); @@ -548,11 +508,10 @@ isp_reset(ispsoftc_t *isp) /* * Hold it in SOFT_RESET and STOP state for 100us. */ - ISP_WRITE(isp, BIU2400_CSR, - BIU2400_SOFT_RESET|BIU2400_DMA_STOP|(3 << 4)); - USEC_DELAY(100); + ISP_WRITE(isp, BIU2400_CSR, BIU2400_SOFT_RESET|BIU2400_DMA_STOP|(3 << 4)); + ISP_DELAY(100); for (loops = 0; loops < 10000; loops++) { - USEC_DELAY(5); + ISP_DELAY(5); val = ISP_READ(isp, OUTMAILBOX0); } for (val = loops = 0; loops < 500000; loops ++) { @@ -571,17 +530,14 @@ isp_reset(ispsoftc_t *isp) /* * A slight delay... */ - USEC_DELAY(100); + ISP_DELAY(100); /* * Clear data && control DMA engines. */ - ISP_WRITE(isp, CDMA2100_CONTROL, - DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); - ISP_WRITE(isp, TDMA2100_CONTROL, - DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); - ISP_WRITE(isp, RDMA2100_CONTROL, - DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); + ISP_WRITE(isp, CDMA2100_CONTROL, DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); + ISP_WRITE(isp, TDMA2100_CONTROL, DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); + ISP_WRITE(isp, RDMA2100_CONTROL, DMA_CNTRL2100_CLEAR_CHAN | DMA_CNTRL2100_RESET_INT); } /* @@ -601,7 +557,7 @@ isp_reset(ispsoftc_t *isp) if (!(ISP_READ(isp, BIU2100_CSR) & BIU2100_SOFT_RESET)) break; } - USEC_DELAY(100); + ISP_DELAY(100); if (--loops < 0) { ISP_DUMPREGS(isp, "chip reset timed out"); ISP_RESET0(isp); @@ -629,17 +585,16 @@ isp_reset(ispsoftc_t *isp) ISP_WRITE(isp, BIU2400_HCCR, HCCR_2400_CMD_CLEAR_RESET); } else { ISP_WRITE(isp, HCCR, HCCR_CMD_RESET); - USEC_DELAY(100); + ISP_DELAY(100); ISP_WRITE(isp, BIU_SEMA, 0); } - /* * Post-RISC Reset stuff. */ if (IS_24XX(isp)) { for (val = loops = 0; loops < 5000000; loops++) { - USEC_DELAY(5); + ISP_DELAY(5); val = ISP_READ(isp, OUTMAILBOX0); if (val == 0) { break; @@ -663,8 +618,8 @@ isp_reset(ispsoftc_t *isp) ISP_SETBITS(isp, CDMA_CONF, DMA_ENABLE_BURST); ISP_SETBITS(isp, DDMA_CONF, DMA_ENABLE_BURST); } - if (SDPARAM(isp)->isp_ptisp) { - if (SDPARAM(isp)->isp_ultramode) { + if (SDPARAM(isp, 0)->isp_ptisp) { + if (SDPARAM(isp, 0)->isp_ultramode) { while (ISP_READ(isp, RISC_MTR) != 0x1313) { ISP_WRITE(isp, RISC_MTR, 0x1313); ISP_WRITE(isp, HCCR, HCCR_CMD_STEP); @@ -692,7 +647,12 @@ isp_reset(ispsoftc_t *isp) ISP_WRITE(isp, isp->isp_rqstoutrp, 0); ISP_WRITE(isp, isp->isp_respinrp, 0); ISP_WRITE(isp, isp->isp_respoutrp, 0); - + if (IS_24XX(isp)) { + ISP_WRITE(isp, BIU2400_PRI_REQINP, 0); + ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0); + ISP_WRITE(isp, BIU2400_ATIO_RSPINP, 0); + ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0); + } /* * Do MD specific post initialization @@ -702,15 +662,15 @@ isp_reset(ispsoftc_t *isp) /* * Wait for everything to finish firing up. * - * Avoid doing this on the 2312 because you can generate a PCI + * Avoid doing this on early 2312s because you can generate a PCI * parity error (chip breakage). */ - if (IS_2312(isp)) { - USEC_DELAY(100); + if (IS_2312(isp) && isp->isp_revision < 2) { + ISP_DELAY(100); } else { loops = MBOX_DELAY_COUNT; while (ISP_READ(isp, OUTMAILBOX0) == MBOX_BUSY) { - USEC_DELAY(100); + ISP_DELAY(100); if (--loops < 0) { ISP_RESET0(isp); isp_prt(isp, ISP_LOGERR, @@ -727,19 +687,25 @@ isp_reset(ispsoftc_t *isp) */ /* - * Do some sanity checking. + * Do some sanity checking by running a NOP command. + * If it succeeds, the ROM firmware is now running. */ - MEMZERO(&mbs, sizeof (mbs)); + ISP_MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_NO_OP; mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + isp_prt(isp, ISP_LOGERR, "NOP ommand failed (%x)", mbs.param[0]); ISP_RESET0(isp); return; } + /* + * Do some operational tests + */ + if (IS_SCSI(isp) || IS_24XX(isp)) { - MEMZERO(&mbs, sizeof (mbs)); + ISP_MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_MAILBOX_REG_TEST; mbs.param[1] = 0xdead; mbs.param[2] = 0xbeef; @@ -758,10 +724,7 @@ isp_reset(ispsoftc_t *isp) mbs.param[3] != 0xffff || mbs.param[4] != 0x1111 || mbs.param[5] != 0xa5a5) { ISP_RESET0(isp); - isp_prt(isp, ISP_LOGERR, - "Register Test Failed (0x%x 0x%x 0x%x 0x%x 0x%x)", - mbs.param[1], mbs.param[2], mbs.param[3], - mbs.param[4], mbs.param[5]); + isp_prt(isp, ISP_LOGERR, "Register Test Failed (0x%x 0x%x 0x%x 0x%x 0x%x)", mbs.param[1], mbs.param[2], mbs.param[3], mbs.param[4], mbs.param[5]); return; } @@ -776,8 +739,7 @@ isp_reset(ispsoftc_t *isp) * whether we have f/w at all and whether a config flag * has disabled our download. */ - if ((isp->isp_mdvec->dv_ispfw == NULL) || - (isp->isp_confopts & ISP_CFG_NORELOAD)) { + if ((isp->isp_mdvec->dv_ispfw == NULL) || (isp->isp_confopts & ISP_CFG_NORELOAD)) { dodnld = 0; } @@ -793,13 +755,6 @@ isp_reset(ispsoftc_t *isp) const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; /* - * NB: Whatever you do do, do *not* issue the VERIFY FIRMWARE - * NB: command to the 2400 while loading new firmware. This - * NB: causes the new f/w to start and immediately crash back - * NB: to the ROM. - */ - - /* * Keep loading until we run out of f/w. */ code_org = ptr[2]; /* 1st load address is our start addr */ @@ -807,9 +762,7 @@ isp_reset(ispsoftc_t *isp) for (;;) { uint32_t la, wi, wl; - isp_prt(isp, ISP_LOGDEBUG0, - "load 0x%x words of code at load address 0x%x", - ptr[3], ptr[2]); + isp_prt(isp, ISP_LOGDEBUG0, "load 0x%x words of code at load address 0x%x", ptr[3], ptr[2]); wi = 0; la = ptr[2]; @@ -828,23 +781,31 @@ isp_reset(ispsoftc_t *isp) ISP_IOXPUT_32(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, - 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); - MEMZERO(&mbs, sizeof (mbs)); - mbs.param[0] = MBOX_LOAD_RISC_RAM; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw >> 16; - mbs.param[5] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - mbs.param[8] = la >> 16; + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + ISP_MEMZERO(&mbs, sizeof (mbs)); + if (la < 0x10000 && nw < 0x10000) { + mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + } else { + mbs.param[0] = MBOX_LOAD_RISC_RAM; + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw >> 16; + mbs.param[5] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + mbs.param[8] = la >> 16; + } mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, - "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); ISP_RESET0(isp); return; } @@ -855,7 +816,7 @@ isp_reset(ispsoftc_t *isp) break; } ptr += ptr[3]; - } + } isp->isp_loaded_fw = 1; } else if (dodnld && IS_23XX(isp)) { const uint16_t *ptr = isp->isp_mdvec->dv_ispfw; @@ -868,17 +829,15 @@ isp_reset(ispsoftc_t *isp) for (;;) { uint32_t nxtaddr; - isp_prt(isp, ISP_LOGDEBUG0, - "load 0x%x words of code at load address 0x%x", - ptr[3], la); + isp_prt(isp, ISP_LOGDEBUG0, "load 0x%x words of code at load address 0x%x", ptr[3], la); wi = 0; wl = ptr[3]; while (wi < ptr[3]) { uint16_t *cp; - uint32_t nw; - + uint16_t nw; + nw = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) >> 1; if (nw > wl) { nw = wl; @@ -891,22 +850,30 @@ isp_reset(ispsoftc_t *isp) ISP_IOXPUT_16(isp, ptr[wi++], &cp[i]); wl--; } - MEMORYBARRIER(isp, SYNC_REQUEST, - 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); - MEMZERO(&mbs, sizeof (mbs)); - mbs.param[0] = MBOX_LOAD_RISC_RAM; - mbs.param[1] = la; - mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); - mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); - mbs.param[4] = nw; - mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); - mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); - mbs.param[8] = la >> 16; + MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp))); + ISP_MEMZERO(&mbs, sizeof (mbs)); + if (la < 0x10000) { + mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + } else { + mbs.param[0] = MBOX_LOAD_RISC_RAM; + mbs.param[1] = la; + mbs.param[2] = DMA_WD1(isp->isp_rquest_dma); + mbs.param[3] = DMA_WD0(isp->isp_rquest_dma); + mbs.param[4] = nw; + mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); + mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + mbs.param[8] = la >> 16; + } mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, - "F/W Risc Ram Load Failed"); + isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); ISP_RESET0(isp); return; } @@ -914,19 +881,6 @@ isp_reset(ispsoftc_t *isp) } if (!IS_2322(isp)) { - /* - * Verify that it downloaded correctly. - */ - MEMZERO(&mbs, sizeof (mbs)); - mbs.param[0] = MBOX_VERIFY_CHECKSUM; - mbs.param[1] = code_org; - mbs.logval = MBLOGNONE; - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, dcrc); - ISP_RESET0(isp); - return; - } break; } @@ -951,41 +905,45 @@ isp_reset(ispsoftc_t *isp) union { const uint16_t *cp; uint16_t *np; - } u; - u.cp = isp->isp_mdvec->dv_ispfw; - isp->isp_mbxworkp = &u.np[1]; - isp->isp_mbxwrk0 = u.np[3] - 1; + } ucd; + ucd.cp = isp->isp_mdvec->dv_ispfw; + isp->isp_mbxworkp = &ucd.np[1]; + isp->isp_mbxwrk0 = ucd.np[3] - 1; isp->isp_mbxwrk1 = code_org + 1; - MEMZERO(&mbs, sizeof (mbs)); + ISP_MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_WRITE_RAM_WORD; mbs.param[1] = code_org; - mbs.param[2] = u.np[0]; + mbs.param[2] = ucd.np[0]; mbs.logval = MBLOGNONE; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGERR, - "F/W download failed at word %d", - isp->isp_mbxwrk1 - code_org); + isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); ISP_RESET0(isp); return; } - /* - * Verify that it downloaded correctly. - */ - MEMZERO(&mbs, sizeof (mbs)); + } else { + isp->isp_loaded_fw = 0; + isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download"); + } + + /* + * If we loaded firmware, verify its checksum + */ + if (isp->isp_loaded_fw) { + ISP_MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_VERIFY_CHECKSUM; - mbs.param[1] = code_org; - mbs.logval = MBLOGNONE; + if (IS_24XX(isp)) { + mbs.param[1] = code_org >> 16; + mbs.param[2] = code_org; + } else { + mbs.param[1] = code_org; + } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, dcrc); ISP_RESET0(isp); return; } - isp->isp_loaded_fw = 1; - } else { - isp->isp_loaded_fw = 0; - isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download"); } /* @@ -996,9 +954,7 @@ isp_reset(ispsoftc_t *isp) */ - MEMZERO(&mbs, sizeof (mbs)); - mbs.timeout = 1000000; - mbs.param[0] = MBOX_EXEC_FIRMWARE; + MBSINIT(&mbs, MBOX_EXEC_FIRMWARE, MBLOGALL, 1000000); if (IS_24XX(isp)) { mbs.param[1] = code_org >> 16; mbs.param[2] = code_org; @@ -1007,6 +963,9 @@ isp_reset(ispsoftc_t *isp) } else { mbs.param[3] = 1; } + if (IS_25XX(isp)) { + mbs.ibits |= 0x10; + } } else if (IS_2322(isp)) { mbs.param[1] = code_org; if (isp->isp_loaded_fw) { @@ -1017,8 +976,6 @@ isp_reset(ispsoftc_t *isp) } else { mbs.param[1] = code_org; } - - mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (IS_2322(isp) || IS_24XX(isp)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 01:54:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842E5106564A; Sat, 1 Aug 2009 01:54:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701468FC0A; Sat, 1 Aug 2009 01:54:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n711shfC087183; Sat, 1 Aug 2009 01:54:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n711shIK087172; Sat, 1 Aug 2009 01:54:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908010154.n711shIK087172@svn.freebsd.org> From: John Baldwin Date: Sat, 1 Aug 2009 01:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196009 - in stable/7/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 01:54:44 -0000 Author: jhb Date: Sat Aug 1 01:54:42 2009 New Revision: 196009 URL: http://svn.freebsd.org/changeset/base/196009 Log: Regen. Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h stable/7/sys/compat/freebsd32/freebsd32_syscall.h stable/7/sys/compat/freebsd32/freebsd32_syscalls.c stable/7/sys/compat/freebsd32/freebsd32_sysent.c stable/7/sys/kern/init_sysent.c stable/7/sys/kern/syscalls.c stable/7/sys/kern/systrace_args.c stable/7/sys/sys/syscall.h stable/7/sys/sys/syscall.mk stable/7/sys/sys/sysproto.h Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_proto.h Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/compat/freebsd32/freebsd32_proto.h Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -170,16 +170,16 @@ struct freebsd32_futimes_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; }; -struct freebsd32_semctl_args { +struct freebsd7_freebsd32_semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char arg_l_[PADL_(union semun32 *)]; union semun32 * arg; char arg_r_[PADR_(union semun32 *)]; }; -struct freebsd32_msgctl_args { +struct freebsd7_freebsd32_msgctl_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char buf_l_[PADL_(struct msqid_ds32 *)]; struct msqid_ds32 * buf; char buf_r_[PADR_(struct msqid_ds32 *)]; + char buf_l_[PADL_(struct msqid_ds32_old *)]; struct msqid_ds32_old * buf; char buf_r_[PADR_(struct msqid_ds32_old *)]; }; struct freebsd32_msgsnd_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; @@ -194,10 +194,10 @@ struct freebsd32_msgrcv_args { char msgtyp_l_[PADL_(long)]; long msgtyp; char msgtyp_r_[PADR_(long)]; char msgflg_l_[PADL_(int)]; int msgflg; char msgflg_r_[PADR_(int)]; }; -struct freebsd32_shmctl_args { +struct freebsd7_freebsd32_shmctl_args { char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)]; + char buf_l_[PADL_(struct shmid_ds32_old *)]; struct shmid_ds32_old * buf; char buf_r_[PADR_(struct shmid_ds32_old *)]; }; struct freebsd32_clock_gettime_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; @@ -423,6 +423,22 @@ struct freebsd32_cpuset_setaffinity_args char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char mask_r_[PADR_(const cpuset_t *)]; }; +struct freebsd32_semctl_args { + char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; + char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char arg_l_[PADL_(union semun32 *)]; union semun32 * arg; char arg_r_[PADR_(union semun32 *)]; +}; +struct freebsd32_msgctl_args { + char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char buf_l_[PADL_(struct msqid_ds32 *)]; struct msqid_ds32 * buf; char buf_r_[PADR_(struct msqid_ds32 *)]; +}; +struct freebsd32_shmctl_args { + char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char buf_l_[PADL_(struct shmid_ds32 *)]; struct shmid_ds32 * buf; char buf_r_[PADR_(struct shmid_ds32 *)]; +}; int freebsd32_wait4(struct thread *, struct freebsd32_wait4_args *); int freebsd32_recvmsg(struct thread *, struct freebsd32_recvmsg_args *); int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *); @@ -449,11 +465,11 @@ int freebsd32_lstat(struct thread *, str int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *); int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *); -int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); -int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); +int freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *); +int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd32_msgsnd(struct thread *, struct freebsd32_msgsnd_args *); int freebsd32_msgrcv(struct thread *, struct freebsd32_msgrcv_args *); -int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); +int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); int freebsd32_clock_gettime(struct thread *, struct freebsd32_clock_gettime_args *); int freebsd32_clock_settime(struct thread *, struct freebsd32_clock_settime_args *); int freebsd32_clock_getres(struct thread *, struct freebsd32_clock_getres_args *); @@ -500,6 +516,9 @@ int freebsd32_cpuset_setid(struct thread int freebsd32_cpuset_getid(struct thread *, struct freebsd32_cpuset_getid_args *); int freebsd32_cpuset_getaffinity(struct thread *, struct freebsd32_cpuset_getaffinity_args *); int freebsd32_cpuset_setaffinity(struct thread *, struct freebsd32_cpuset_setaffinity_args *); +int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); +int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); +int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); #ifdef COMPAT_43 @@ -689,11 +708,11 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_ftruncate AUE_FTRUNCATE #define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES -#define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL -#define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL +#define FREEBSD32_SYS_AUE_freebsd7_freebsd32_semctl AUE_SEMCTL +#define FREEBSD32_SYS_AUE_freebsd7_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_msgsnd AUE_MSGSND #define FREEBSD32_SYS_AUE_freebsd32_msgrcv AUE_MSGRCV -#define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL +#define FREEBSD32_SYS_AUE_freebsd7_freebsd32_shmctl AUE_SHMCTL #define FREEBSD32_SYS_AUE_freebsd32_clock_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_settime AUE_CLOCK_SETTIME #define FREEBSD32_SYS_AUE_freebsd32_clock_getres AUE_NULL @@ -744,6 +763,9 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getid AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getaffinity AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setaffinity AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL +#define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL +#define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #undef PAD_ #undef PADL_ Modified: stable/7/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscall.h Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/compat/freebsd32/freebsd32_syscall.h Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -190,15 +190,15 @@ #define FREEBSD32_SYS_freebsd32_futimes 206 #define FREEBSD32_SYS_getpgid 207 #define FREEBSD32_SYS_poll 209 -#define FREEBSD32_SYS_freebsd32_semctl 220 +#define FREEBSD32_SYS_freebsd7_freebsd32_semctl 220 #define FREEBSD32_SYS_semget 221 #define FREEBSD32_SYS_semop 222 -#define FREEBSD32_SYS_freebsd32_msgctl 224 +#define FREEBSD32_SYS_freebsd7_freebsd32_msgctl 224 #define FREEBSD32_SYS_msgget 225 #define FREEBSD32_SYS_freebsd32_msgsnd 226 #define FREEBSD32_SYS_freebsd32_msgrcv 227 #define FREEBSD32_SYS_shmat 228 -#define FREEBSD32_SYS_freebsd32_shmctl 229 +#define FREEBSD32_SYS_freebsd7_freebsd32_shmctl 229 #define FREEBSD32_SYS_shmdt 230 #define FREEBSD32_SYS_shmget 231 #define FREEBSD32_SYS_freebsd32_clock_gettime 232 @@ -362,4 +362,7 @@ #define FREEBSD32_SYS_freebsd32_cpuset_getaffinity 487 #define FREEBSD32_SYS_freebsd32_cpuset_setaffinity 488 #define FREEBSD32_SYS_closefrom 509 -#define FREEBSD32_SYS_MAXSYSCALL 510 +#define FREEBSD32_SYS_freebsd32_semctl 510 +#define FREEBSD32_SYS_freebsd32_msgctl 511 +#define FREEBSD32_SYS_freebsd32_shmctl 512 +#define FREEBSD32_SYS_MAXSYSCALL 513 Modified: stable/7/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ const char *freebsd32_syscallnames[] = { @@ -227,16 +227,16 @@ const char *freebsd32_syscallnames[] = { "lkmnosys", /* 217 = lkmnosys */ "lkmnosys", /* 218 = lkmnosys */ "lkmnosys", /* 219 = lkmnosys */ - "freebsd32_semctl", /* 220 = freebsd32_semctl */ + "freebsd7_freebsd32_semctl", /* 220 = freebsd7_freebsd32_semctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ "#223", /* 223 = semconfig */ - "freebsd32_msgctl", /* 224 = freebsd32_msgctl */ + "freebsd7_freebsd32_msgctl", /* 224 = freebsd7_freebsd32_msgctl */ "msgget", /* 225 = msgget */ "freebsd32_msgsnd", /* 226 = freebsd32_msgsnd */ "freebsd32_msgrcv", /* 227 = freebsd32_msgrcv */ "shmat", /* 228 = shmat */ - "freebsd32_shmctl", /* 229 = freebsd32_shmctl */ + "freebsd7_freebsd32_shmctl", /* 229 = freebsd7_freebsd32_shmctl */ "shmdt", /* 230 = shmdt */ "shmget", /* 231 = shmget */ "freebsd32_clock_gettime", /* 232 = freebsd32_clock_gettime */ @@ -517,4 +517,7 @@ const char *freebsd32_syscallnames[] = { "#507", /* 507 = freebsd32_jail_set */ "#508", /* 508 = jail_remove */ "closefrom", /* 509 = closefrom */ + "freebsd32_semctl", /* 510 = freebsd32_semctl */ + "freebsd32_msgctl", /* 511 = freebsd32_msgctl */ + "freebsd32_shmctl", /* 512 = freebsd32_shmctl */ }; Modified: stable/7/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_sysent.c Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/compat/freebsd32/freebsd32_sysent.c Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #include "opt_compat.h" @@ -258,16 +258,16 @@ struct sysent freebsd32_sysent[] = { { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 217 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 218 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 219 = lkmnosys */ - { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd32_semctl */ + { AS(freebsd7_freebsd32_semctl_args), (sy_call_t *)freebsd7_freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 220 = freebsd7_freebsd32_semctl */ { AS(semget_args), (sy_call_t *)semget, AUE_SEMGET, NULL, 0, 0 }, /* 221 = semget */ { AS(semop_args), (sy_call_t *)semop, AUE_SEMOP, NULL, 0, 0 }, /* 222 = semop */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = semconfig */ - { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = freebsd32_msgctl */ + { AS(freebsd7_freebsd32_msgctl_args), (sy_call_t *)freebsd7_freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 224 = freebsd7_freebsd32_msgctl */ { AS(msgget_args), (sy_call_t *)msgget, AUE_MSGGET, NULL, 0, 0 }, /* 225 = msgget */ { AS(freebsd32_msgsnd_args), (sy_call_t *)freebsd32_msgsnd, AUE_MSGSND, NULL, 0, 0 }, /* 226 = freebsd32_msgsnd */ { AS(freebsd32_msgrcv_args), (sy_call_t *)freebsd32_msgrcv, AUE_MSGRCV, NULL, 0, 0 }, /* 227 = freebsd32_msgrcv */ { AS(shmat_args), (sy_call_t *)shmat, AUE_SHMAT, NULL, 0, 0 }, /* 228 = shmat */ - { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0 }, /* 229 = freebsd32_shmctl */ + { AS(freebsd7_freebsd32_shmctl_args), (sy_call_t *)freebsd7_freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0 }, /* 229 = freebsd7_freebsd32_shmctl */ { AS(shmdt_args), (sy_call_t *)shmdt, AUE_SHMDT, NULL, 0, 0 }, /* 230 = shmdt */ { AS(shmget_args), (sy_call_t *)shmget, AUE_SHMGET, NULL, 0, 0 }, /* 231 = shmget */ { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 232 = freebsd32_clock_gettime */ @@ -548,4 +548,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 507 = freebsd32_jail_set */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 508 = jail_remove */ { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0 }, /* 509 = closefrom */ + { AS(freebsd32_semctl_args), (sy_call_t *)freebsd32_semctl, AUE_SEMCTL, NULL, 0, 0 }, /* 510 = freebsd32_semctl */ + { AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0 }, /* 511 = freebsd32_msgctl */ + { AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0 }, /* 512 = freebsd32_shmctl */ }; Modified: stable/7/sys/kern/init_sysent.c ============================================================================== --- stable/7/sys/kern/init_sysent.c Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/kern/init_sysent.c Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #include "opt_compat.h" @@ -248,16 +248,16 @@ struct sysent sysent[] = { { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 217 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 218 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0 }, /* 219 = lkmnosys */ - { AS(__semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 220 = __semctl */ + { AS(freebsd7___semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 220 = freebsd7___semctl */ { AS(semget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 221 = semget */ { AS(semop_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 222 = semop */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 223 = semconfig */ - { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 224 = msgctl */ + { AS(freebsd7_msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 224 = freebsd7_msgctl */ { AS(msgget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 225 = msgget */ { AS(msgsnd_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 226 = msgsnd */ { AS(msgrcv_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 227 = msgrcv */ { AS(shmat_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 228 = shmat */ - { AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 229 = shmctl */ + { AS(freebsd7_shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 229 = freebsd7_shmctl */ { AS(shmdt_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 230 = shmdt */ { AS(shmget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 231 = shmget */ { AS(clock_gettime_args), (sy_call_t *)clock_gettime, AUE_NULL, NULL, 0, 0 }, /* 232 = clock_gettime */ @@ -538,4 +538,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 507 = jail_set */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 508 = jail_remove */ { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0 }, /* 509 = closefrom */ + { AS(__semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 510 = __semctl */ + { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 511 = msgctl */ + { AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 512 = shmctl */ }; Modified: stable/7/sys/kern/syscalls.c ============================================================================== --- stable/7/sys/kern/syscalls.c Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/kern/syscalls.c Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ const char *syscallnames[] = { @@ -227,16 +227,16 @@ const char *syscallnames[] = { "lkmnosys", /* 217 = lkmnosys */ "lkmnosys", /* 218 = lkmnosys */ "lkmnosys", /* 219 = lkmnosys */ - "__semctl", /* 220 = __semctl */ + "freebsd7___semctl", /* 220 = freebsd7___semctl */ "semget", /* 221 = semget */ "semop", /* 222 = semop */ "#223", /* 223 = semconfig */ - "msgctl", /* 224 = msgctl */ + "freebsd7_msgctl", /* 224 = freebsd7_msgctl */ "msgget", /* 225 = msgget */ "msgsnd", /* 226 = msgsnd */ "msgrcv", /* 227 = msgrcv */ "shmat", /* 228 = shmat */ - "shmctl", /* 229 = shmctl */ + "freebsd7_shmctl", /* 229 = freebsd7_shmctl */ "shmdt", /* 230 = shmdt */ "shmget", /* 231 = shmget */ "clock_gettime", /* 232 = clock_gettime */ @@ -517,4 +517,7 @@ const char *syscallnames[] = { "#507", /* 507 = jail_set */ "#508", /* 508 = jail_remove */ "closefrom", /* 509 = closefrom */ + "__semctl", /* 510 = __semctl */ + "msgctl", /* 511 = msgctl */ + "shmctl", /* 512 = shmctl */ }; Modified: stable/7/sys/kern/systrace_args.c ============================================================================== --- stable/7/sys/kern/systrace_args.c Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/kern/systrace_args.c Sat Aug 1 01:54:42 2009 (r196009) @@ -1215,13 +1215,13 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* __semctl */ + /* freebsd7___semctl */ case 220: { - struct __semctl_args *p = params; + struct freebsd7___semctl_args *p = params; iarg[0] = p->semid; /* int */ iarg[1] = p->semnum; /* int */ iarg[2] = p->cmd; /* int */ - uarg[3] = (intptr_t) p->arg; /* union semun * */ + uarg[3] = (intptr_t) p->arg; /* union semun_old * */ *n_args = 4; break; } @@ -1243,12 +1243,12 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* msgctl */ + /* freebsd7_msgctl */ case 224: { - struct msgctl_args *p = params; + struct freebsd7_msgctl_args *p = params; iarg[0] = p->msqid; /* int */ iarg[1] = p->cmd; /* int */ - uarg[2] = (intptr_t) p->buf; /* struct msqid_ds * */ + uarg[2] = (intptr_t) p->buf; /* struct msqid_ds_old * */ *n_args = 3; break; } @@ -1290,12 +1290,12 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* shmctl */ + /* freebsd7_shmctl */ case 229: { - struct shmctl_args *p = params; + struct freebsd7_shmctl_args *p = params; iarg[0] = p->shmid; /* int */ iarg[1] = p->cmd; /* int */ - uarg[2] = (intptr_t) p->buf; /* struct shmid_ds * */ + uarg[2] = (intptr_t) p->buf; /* struct shmid_ds_old * */ *n_args = 3; break; } @@ -2930,6 +2930,34 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } + /* __semctl */ + case 510: { + struct __semctl_args *p = params; + iarg[0] = p->semid; /* int */ + iarg[1] = p->semnum; /* int */ + iarg[2] = p->cmd; /* int */ + uarg[3] = (intptr_t) p->arg; /* union semun * */ + *n_args = 4; + break; + } + /* msgctl */ + case 511: { + struct msgctl_args *p = params; + iarg[0] = p->msqid; /* int */ + iarg[1] = p->cmd; /* int */ + uarg[2] = (intptr_t) p->buf; /* struct msqid_ds * */ + *n_args = 3; + break; + } + /* shmctl */ + case 512: { + struct shmctl_args *p = params; + iarg[0] = p->shmid; /* int */ + iarg[1] = p->cmd; /* int */ + uarg[2] = (intptr_t) p->buf; /* struct shmid_ds * */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -4855,7 +4883,7 @@ systrace_setargdesc(int sysnum, int ndx, /* lkmnosys */ case 219: break; - /* __semctl */ + /* freebsd7___semctl */ case 220: switch(ndx) { case 0: @@ -4868,7 +4896,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 3: - p = "union semun *"; + p = "union semun_old *"; break; default: break; @@ -4906,7 +4934,7 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* msgctl */ + /* freebsd7_msgctl */ case 224: switch(ndx) { case 0: @@ -4916,7 +4944,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 2: - p = "struct msqid_ds *"; + p = "struct msqid_ds_old *"; break; default: break; @@ -4992,7 +5020,7 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* shmctl */ + /* freebsd7_shmctl */ case 229: switch(ndx) { case 0: @@ -5002,7 +5030,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 2: - p = "struct shmid_ds *"; + p = "struct shmid_ds_old *"; break; default: break; @@ -7739,6 +7767,57 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* __semctl */ + case 510: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "int"; + break; + case 3: + p = "union semun *"; + break; + default: + break; + }; + break; + /* msgctl */ + case 511: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "struct msqid_ds *"; + break; + default: + break; + }; + break; + /* shmctl */ + case 512: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "struct shmid_ds *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/7/sys/sys/syscall.h ============================================================================== --- stable/7/sys/sys/syscall.h Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/sys/syscall.h Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #define SYS_syscall 0 @@ -196,15 +196,15 @@ #define SYS_futimes 206 #define SYS_getpgid 207 #define SYS_poll 209 -#define SYS___semctl 220 +#define SYS_freebsd7___semctl 220 #define SYS_semget 221 #define SYS_semop 222 -#define SYS_msgctl 224 +#define SYS_freebsd7_msgctl 224 #define SYS_msgget 225 #define SYS_msgsnd 226 #define SYS_msgrcv 227 #define SYS_shmat 228 -#define SYS_shmctl 229 +#define SYS_freebsd7_shmctl 229 #define SYS_shmdt 230 #define SYS_shmget 231 #define SYS_clock_gettime 232 @@ -408,4 +408,7 @@ #define SYS_cpuset_getaffinity 487 #define SYS_cpuset_setaffinity 488 #define SYS_closefrom 509 -#define SYS_MAXSYSCALL 510 +#define SYS___semctl 510 +#define SYS_msgctl 511 +#define SYS_shmctl 512 +#define SYS_MAXSYSCALL 513 Modified: stable/7/sys/sys/syscall.mk ============================================================================== --- stable/7/sys/sys/syscall.mk Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/sys/syscall.mk Sat Aug 1 01:54:42 2009 (r196009) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb +# created from FreeBSD: stable/7/sys/kern/syscalls.master 196006 2009-07-31 20:32:55Z jhb MIASM = \ syscall.o \ exit.o \ @@ -148,15 +148,15 @@ MIASM = \ futimes.o \ getpgid.o \ poll.o \ - __semctl.o \ + freebsd7___semctl.o \ semget.o \ semop.o \ - msgctl.o \ + freebsd7_msgctl.o \ msgget.o \ msgsnd.o \ msgrcv.o \ shmat.o \ - shmctl.o \ + freebsd7_shmctl.o \ shmdt.o \ shmget.o \ clock_gettime.o \ @@ -356,4 +356,7 @@ MIASM = \ cpuset_getid.o \ cpuset_getaffinity.o \ cpuset_setaffinity.o \ - closefrom.o + closefrom.o \ + __semctl.o \ + msgctl.o \ + shmctl.o Modified: stable/7/sys/sys/sysproto.h ============================================================================== --- stable/7/sys/sys/sysproto.h Sat Aug 1 01:04:26 2009 (r196008) +++ stable/7/sys/sys/sysproto.h Sat Aug 1 01:54:42 2009 (r196009) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 195854 2009-07-24 19:35:06Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 196006 2009-07-31 20:32:55Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -660,11 +660,11 @@ struct poll_args { char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)]; }; -struct __semctl_args { +struct freebsd7___semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char arg_l_[PADL_(union semun *)]; union semun * arg; char arg_r_[PADR_(union semun *)]; + char arg_l_[PADL_(union semun_old *)]; union semun_old * arg; char arg_r_[PADR_(union semun_old *)]; }; struct semget_args { char key_l_[PADL_(key_t)]; key_t key; char key_r_[PADR_(key_t)]; @@ -676,10 +676,10 @@ struct semop_args { char sops_l_[PADL_(struct sembuf *)]; struct sembuf * sops; char sops_r_[PADR_(struct sembuf *)]; char nsops_l_[PADL_(size_t)]; size_t nsops; char nsops_r_[PADR_(size_t)]; }; -struct msgctl_args { +struct freebsd7_msgctl_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char buf_l_[PADL_(struct msqid_ds *)]; struct msqid_ds * buf; char buf_r_[PADR_(struct msqid_ds *)]; + char buf_l_[PADL_(struct msqid_ds_old *)]; struct msqid_ds_old * buf; char buf_r_[PADR_(struct msqid_ds_old *)]; }; struct msgget_args { char key_l_[PADL_(key_t)]; key_t key; char key_r_[PADR_(key_t)]; @@ -703,10 +703,10 @@ struct shmat_args { char shmaddr_l_[PADL_(const void *)]; const void * shmaddr; char shmaddr_r_[PADR_(const void *)]; char shmflg_l_[PADL_(int)]; int shmflg; char shmflg_r_[PADR_(int)]; }; -struct shmctl_args { +struct freebsd7_shmctl_args { char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; - char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)]; + char buf_l_[PADL_(struct shmid_ds_old *)]; struct shmid_ds_old * buf; char buf_r_[PADR_(struct shmid_ds_old *)]; }; struct shmdt_args { char shmaddr_l_[PADL_(const void *)]; const void * shmaddr; char shmaddr_r_[PADR_(const void *)]; @@ -1557,6 +1557,22 @@ struct cpuset_setaffinity_args { struct closefrom_args { char lowfd_l_[PADL_(int)]; int lowfd; char lowfd_r_[PADR_(int)]; }; +struct __semctl_args { + char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; + char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char arg_l_[PADL_(union semun *)]; union semun * arg; char arg_r_[PADR_(union semun *)]; +}; +struct msgctl_args { + char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char buf_l_[PADL_(struct msqid_ds *)]; struct msqid_ds * buf; char buf_r_[PADR_(struct msqid_ds *)]; +}; +struct shmctl_args { + char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1698,15 +1714,15 @@ int undelete(struct thread *, struct und int futimes(struct thread *, struct futimes_args *); int getpgid(struct thread *, struct getpgid_args *); int poll(struct thread *, struct poll_args *); -int __semctl(struct thread *, struct __semctl_args *); +int freebsd7___semctl(struct thread *, struct freebsd7___semctl_args *); int semget(struct thread *, struct semget_args *); int semop(struct thread *, struct semop_args *); -int msgctl(struct thread *, struct msgctl_args *); +int freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *); int msgget(struct thread *, struct msgget_args *); int msgsnd(struct thread *, struct msgsnd_args *); int msgrcv(struct thread *, struct msgrcv_args *); int shmat(struct thread *, struct shmat_args *); -int shmctl(struct thread *, struct shmctl_args *); +int freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *); int shmdt(struct thread *, struct shmdt_args *); int shmget(struct thread *, struct shmget_args *); int clock_gettime(struct thread *, struct clock_gettime_args *); @@ -1901,6 +1917,9 @@ int cpuset_getid(struct thread *, struct int cpuset_getaffinity(struct thread *, struct cpuset_getaffinity_args *); int cpuset_setaffinity(struct thread *, struct cpuset_setaffinity_args *); int closefrom(struct thread *, struct closefrom_args *); +int __semctl(struct thread *, struct __semctl_args *); +int msgctl(struct thread *, struct msgctl_args *); +int shmctl(struct thread *, struct shmctl_args *); #ifdef COMPAT_43 @@ -2307,15 +2326,15 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_futimes AUE_FUTIMES #define SYS_AUE_getpgid AUE_GETPGID #define SYS_AUE_poll AUE_POLL -#define SYS_AUE___semctl AUE_SEMCTL +#define SYS_AUE_freebsd7___semctl AUE_SEMCTL #define SYS_AUE_semget AUE_SEMGET #define SYS_AUE_semop AUE_SEMOP -#define SYS_AUE_msgctl AUE_MSGCTL +#define SYS_AUE_freebsd7_msgctl AUE_MSGCTL #define SYS_AUE_msgget AUE_MSGGET #define SYS_AUE_msgsnd AUE_MSGSND #define SYS_AUE_msgrcv AUE_MSGRCV #define SYS_AUE_shmat AUE_SHMAT -#define SYS_AUE_shmctl AUE_SHMCTL +#define SYS_AUE_freebsd7_shmctl AUE_SHMCTL #define SYS_AUE_shmdt AUE_SHMDT #define SYS_AUE_shmget AUE_SHMGET #define SYS_AUE_clock_gettime AUE_NULL @@ -2514,6 +2533,9 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_cpuset_getaffinity AUE_NULL #define SYS_AUE_cpuset_setaffinity AUE_NULL #define SYS_AUE_closefrom AUE_CLOSEFROM +#define SYS_AUE___semctl AUE_SEMCTL +#define SYS_AUE_msgctl AUE_MSGCTL +#define SYS_AUE_shmctl AUE_SHMCTL #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 02:53:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD14E106566B; Sat, 1 Aug 2009 02:53:49 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id 852778FC28; Sat, 1 Aug 2009 02:53:49 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1MX4Lh-00043y-8j; Sat, 01 Aug 2009 06:29:29 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id A7CC3B860; Sat, 1 Aug 2009 06:29:27 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 20119108842; Sat, 1 Aug 2009 06:29:14 +0400 (MSD) Date: Sat, 1 Aug 2009 06:29:14 +0400 From: Dmitry Marakasov To: Navdeep Parhar Message-ID: <20090801022914.GB93222@hades.panopticon> References: <200907300014.n6U0EZ77086341@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 02:53:50 -0000 * Navdeep Parhar (nparhar@gmail.com) wrote: > This has slowed down core dumps very significantly. What used to take 10-15s on > my system now takes around 3 minutes. Same here. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 02:58:50 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB92106564A; Sat, 1 Aug 2009 02:58:50 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6048FC16; Sat, 1 Aug 2009 02:58:49 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n712whGn079744; Fri, 31 Jul 2009 20:58:43 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A73AF67.3010508@samsco.org> Date: Fri, 31 Jul 2009 20:58:47 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Dmitry Marakasov References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090801022914.GB93222@hades.panopticon> In-Reply-To: <20090801022914.GB93222@hades.panopticon> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , Navdeep Parhar , src-committers@FreeBSD.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 02:58:50 -0000 Dmitry Marakasov wrote: > * Navdeep Parhar (nparhar@gmail.com) wrote: > >> This has slowed down core dumps very significantly. What used to take 10-15s on >> my system now takes around 3 minutes. > > Same here. > Likely because prior to polling being implemented, each i/o was done blindly and completed immediately instead of waiting for actual confirmation from the hardware. Crashdumps have been slow for a number of years, thanks to a fundamental change in how they are done. Until now, USB was cheating and making them look fast. Scott From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 04:55:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78B1106566C; Sat, 1 Aug 2009 04:55:45 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pz0-f193.google.com (mail-pz0-f193.google.com [209.85.222.193]) by mx1.freebsd.org (Postfix) with ESMTP id 67ABB8FC08; Sat, 1 Aug 2009 04:55:45 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by pzk31 with SMTP id 31so2912719pzk.3 for ; Fri, 31 Jul 2009 21:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=6SbgEA8uBT9SOBl6hcmx2dWCvgDXXyxfFuriZ70we4c=; b=LR/9gATJvsDzR/Q8fRFa9chypks8ncg3s+XTuwkjPBS4b3i/3OOXDEesMQJrs4S60Y Oxx9Gvj8BWneWea2dP4Orhdf3VsVZ2hFSjXYC3hLkcbtZAXymZmXiL8cZ76FBZWpBwmP yf49AmkFdrmT6akJRsD+fkGoKaFoWMk0h1k0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=uMenZ8AheYCMQnJSpQCeOc8kSDWrAI2wNolsTuYK5jiarMIjLe6cm/7ArVmWPxfs2w eaEG1aK5hDvdHPl84zdI5+sgQBs29QDoy9fZCzRoSjvw6TlBGylwXFH7Z7auwVjIm7TG EygiSTyeNVSS5qRt143m1afWCgtS9KgGAo2mw= Received: by 10.114.196.6 with SMTP id t6mr4818412waf.53.1249102545128; Fri, 31 Jul 2009 21:55:45 -0700 (PDT) Received: from doormat.home (c-76-126-210-244.hsd1.ca.comcast.net [76.126.210.244]) by mx.google.com with ESMTPS id j28sm6261398waf.67.2009.07.31.21.55.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 21:55:44 -0700 (PDT) Date: Fri, 31 Jul 2009 21:55:40 -0700 From: Navdeep Parhar To: Hans Petter Selasky Message-ID: <20090801045540.GA8399@doormat.home> Mail-Followup-To: Hans Petter Selasky , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090731212140.GK47463@elvis.mu.org> <200908010615.02972.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200908010615.02972.hselasky@c2i.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 04:55:46 -0000 On Sat, Aug 01, 2009 at 06:15:01AM +0200, Hans Petter Selasky wrote: > On Friday 31 July 2009 23:21:40 Alfred Perlstein wrote: > > Hans, can you please look into this issue? > > > > * Navdeep Parhar [090731 00:45] wrote: > > > This has slowed down core dumps very significantly. What used to take > > > 10-15s on my system now takes around 3 minutes. A simple test is to > > > break into ddb and "call doadump" with or without this rev. I have a > > > serial console on this machine > > > and so I can use ddb whether the attached USB keyboard works or not. > > It's because there is a DELAY(1000) in the UKBD's polling routine so that key- > repeating will work, no magic. ok. So can something be done about it or are you suggesting that we learn to live with this? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 05:00:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03D061065D3D; Sat, 1 Aug 2009 05:00:58 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-px0-f196.google.com (mail-px0-f196.google.com [209.85.216.196]) by mx1.freebsd.org (Postfix) with ESMTP id 8D51F8FC1C; Sat, 1 Aug 2009 05:00:57 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-px0-f196.google.com with SMTP id 34so4216111pxi.3 for ; Fri, 31 Jul 2009 22:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=KaDXAi4rE21oF6Ic6hlL7p9+f46e68RB3kuZh2vRz+A=; b=cyPdAW/kDNsT6cbAmedOWiC+05DWbuFJPqvUAbMi5faQHC+UPQMpZuGUq1SzKvN73L /dXJpz1oL1mu5HMJdsAxg0tpYbnArqtibm/ThOb8txsLJBrlLwObcPoWSE3HPNNqZSiI NPzu0an/Qh72AWIMECTTSBfX+XKtTvnApEdvQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=bSn9DtIGp1pWpcXhQE8TyD+lOErbx47LJ74WAnQz9VT0ak/jzWYsNr8q0Pl91sCTue GWt0iPsN6z/6KLbmxhSd08A63MeF+qT7YGj8wWeGx74JTyBzxt2FnPGP/uds+UGTMc1E w/1SXC2B864VkZS3J6DKvo5LSL3D7j7JczKhc= Received: by 10.115.46.14 with SMTP id y14mr4805461waj.165.1249102857436; Fri, 31 Jul 2009 22:00:57 -0700 (PDT) Received: from doormat.home (c-76-126-210-244.hsd1.ca.comcast.net [76.126.210.244]) by mx.google.com with ESMTPS id m31sm6291966wag.66.2009.07.31.22.00.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 22:00:56 -0700 (PDT) Date: Fri, 31 Jul 2009 22:00:53 -0700 From: Navdeep Parhar To: Scott Long Message-ID: <20090801050053.GB8399@doormat.home> Mail-Followup-To: Scott Long , Dmitry Marakasov , Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090801022914.GB93222@hades.panopticon> <4A73AF67.3010508@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A73AF67.3010508@samsco.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Dmitry Marakasov , src-committers@FreeBSD.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 05:00:58 -0000 On Fri, Jul 31, 2009 at 08:58:47PM -0600, Scott Long wrote: > Dmitry Marakasov wrote: > >* Navdeep Parhar (nparhar@gmail.com) wrote: > > > >>This has slowed down core dumps very significantly. What used to take 10-15s on > >>my system now takes around 3 minutes. > > > >Same here. > > > > Likely because prior to polling being implemented, each i/o was done > blindly and completed immediately instead of waiting for actual > confirmation from the hardware. Crashdumps have been slow for a > number of years, thanks to a fundamental change in how they are done. > Until now, USB was cheating and making them look fast. I'm afraid I did not understand your email. I was talking about crashdump time differences between yesterday and the day before, not "over a number of years." Are there any other issues involved here? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 05:12:01 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CAF21067C69; Sat, 1 Aug 2009 05:11:41 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB878FC1A; Sat, 1 Aug 2009 05:11:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n715BQrd080182; Fri, 31 Jul 2009 23:11:27 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A73CE7E.9060609@samsco.org> Date: Fri, 31 Jul 2009 23:11:26 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Scott Long , Dmitry Marakasov , Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090801022914.GB93222@hades.panopticon> <4A73AF67.3010508@samsco.org> <20090801050053.GB8399@doormat.home> In-Reply-To: <20090801050053.GB8399@doormat.home> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 05:12:01 -0000 Navdeep Parhar wrote: > On Fri, Jul 31, 2009 at 08:58:47PM -0600, Scott Long wrote: >> Dmitry Marakasov wrote: >>> * Navdeep Parhar (nparhar@gmail.com) wrote: >>> >>>> This has slowed down core dumps very significantly. What used to take 10-15s on >>>> my system now takes around 3 minutes. >>> Same here. >>> >> Likely because prior to polling being implemented, each i/o was done >> blindly and completed immediately instead of waiting for actual >> confirmation from the hardware. Crashdumps have been slow for a >> number of years, thanks to a fundamental change in how they are done. >> Until now, USB was cheating and making them look fast. > > I'm afraid I did not understand your email. I was talking about > crashdump time differences between yesterday and the day before, not > "over a number of years." Are there any other issues involved here? > Crashdumps work by the crashdump routine sending an i/o one-at-a-time to the disk driver, waiting for a completion response between each i/o. Polling in the disk driver is used to detect when the disk hardware has completed each i/o request. Since it is done completely serially and completely synchronously, it's very slow because it has to wait for the hardware to process each i/o, one at a time. Prior to yesterday, the usb2 stack did not implement polling. The umass disk driver completely ignored polling, and always immediately returned success. So instead of waiting for the hardware to complete each crashdump i/o request, it immediately returned success and allowed the crashdump routine to send a new i/o. It was short cutting the required process. Now that polling is in place, the shortcut is gone, and crashdumps on USB are back to being slow, just like on every other disk driver. The shortcut is fast, but it's also unsafe; it's bypassing the guarantee that every i/o is getting written without error and without overrunning the speed of the disk media. I mention "over a number of years" because the crashdump routine wasn't always designed to be so slow. But, that's how it is now, and there isn't much that can be done in the USB driver to fix it, short of going back to the unsafe shortcut. Scott From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 05:16:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E9E01067109; Sat, 1 Aug 2009 05:15:38 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swipnet.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id 5401D8FC19; Sat, 1 Aug 2009 05:15:37 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=GB8WYDQo1twA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=zXjrzDRwrqCWpMxJqxYA:9 a=TqOkyda1TNUwkoR2dE_4eTAkYDsA:4 a=MSl-tDqOz04A:10 a=SV7veod9ZcQA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe14.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 547650436; Sat, 01 Aug 2009 06:15:07 +0200 From: Hans Petter Selasky To: Alfred Perlstein Date: Sat, 1 Aug 2009 06:15:01 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090731212140.GK47463@elvis.mu.org> In-Reply-To: <20090731212140.GK47463@elvis.mu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908010615.02972.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Navdeep Parhar Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 05:16:04 -0000 On Friday 31 July 2009 23:21:40 Alfred Perlstein wrote: > Hans, can you please look into this issue? > > * Navdeep Parhar [090731 00:45] wrote: > > On Wed, Jul 29, 2009 at 5:14 PM, Alfred Perlstein wrote: > > > Author: alfred > > > Date: Thu Jul 30 00:14:34 2009 > > > New Revision: 195960 > > > URL: http://svn.freebsd.org/changeset/base/195960 > > > > > > Log: > > > ?USB CORE: > > > ?- Add minimum polling support to drive UMASS > > > ? ?and UKBD in case of panic. > > > ?- Add extra check to ukbd probe to fix problem about > > > ? ?mouse devices attaching like keyboards. > > > ?- P4 ID: 166148 > > > > > > ?Submitted by: hps > > > ?Approved by: ?re > > > > This has slowed down core dumps very significantly. What used to take > > 10-15s on my system now takes around 3 minutes. A simple test is to > > break into ddb and "call doadump" with or without this rev. I have a > > serial console on this machine > > and so I can use ddb whether the attached USB keyboard works or not. > > > > Here is the usbconfig from the machine: > > ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) > > pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL > > (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST > > spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 > > md=HOST spd=FULL (12Mbps) pwr=ON ugen4.1: at > > usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON > > ugen1.2: at usbus1, cfg=0 md=HOST > > spd=FULL (12Mbps) pwr=SAVE > > ugen1.3: at usbus1, cfg=0 md=HOST > > spd=LOW (1.5Mbps) pwr=ON > > ugen1.4: at usbus1, cfg=0 md=HOST > > spd=LOW (1.5Mbps) pwr=ON It's because there is a DELAY(1000) in the UKBD's polling routine so that key- repeating will work, no magic. --HPS From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 05:36:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C237106566C; Sat, 1 Aug 2009 05:36:49 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-px0-f196.google.com (mail-px0-f196.google.com [209.85.216.196]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB828FC1D; Sat, 1 Aug 2009 05:36:49 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by pxi34 with SMTP id 34so4227403pxi.3 for ; Fri, 31 Jul 2009 22:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=+kjvuD0/SUynz8GS4tOwLeQ5ftcs/xg+WJEHG/9++d0=; b=vzl+UQRay9+mVXMr8jia1cQwb5j1mwLz+SIC+VKrf2wMUOMj8KvMcjCkW3z0UhJEMP iOx1eBUtML2eipJJHITR/LFPV8VlEeIF38GU1mxqdANHU5dqh+fqgglrlK46W142/359 Jufphjve+t76FCqPoOTat+fbSqFS7XBa18L/4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=xW45zYRsvfibsT23ztTCOiG8m/8xl9u/tEHl++C/mvDkFMEziIivGZg4p1JyfUhQON Ec9AnsCbplytTeQI06wG4AZiLCOvaq+JInserhYkl/hP8KjAKzjmOkLjME1Pu4rdnDt+ 4gUJ6JOrZ7esnpl1Mxyb0K4BFGQLzFBAWOD7U= Received: by 10.114.169.5 with SMTP id r5mr989587wae.136.1249105008935; Fri, 31 Jul 2009 22:36:48 -0700 (PDT) Received: from doormat.home (c-76-126-210-244.hsd1.ca.comcast.net [76.126.210.244]) by mx.google.com with ESMTPS id g25sm6414926wag.43.2009.07.31.22.36.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Jul 2009 22:36:48 -0700 (PDT) Date: Fri, 31 Jul 2009 22:36:44 -0700 From: Navdeep Parhar To: Scott Long Message-ID: <20090801053644.GA9150@doormat.home> Mail-Followup-To: Scott Long , Dmitry Marakasov , Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090801022914.GB93222@hades.panopticon> <4A73AF67.3010508@samsco.org> <20090801050053.GB8399@doormat.home> <4A73CE7E.9060609@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A73CE7E.9060609@samsco.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Dmitry Marakasov , src-committers@FreeBSD.org Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 05:36:50 -0000 On Fri, Jul 31, 2009 at 11:11:26PM -0600, Scott Long wrote: > Navdeep Parhar wrote: > >On Fri, Jul 31, 2009 at 08:58:47PM -0600, Scott Long wrote: > >>Dmitry Marakasov wrote: > >>>* Navdeep Parhar (nparhar@gmail.com) wrote: > >>> > >>>>This has slowed down core dumps very significantly. What used to take 10-15s on > >>>>my system now takes around 3 minutes. > >>>Same here. > >>> > >>Likely because prior to polling being implemented, each i/o was done > >>blindly and completed immediately instead of waiting for actual > >>confirmation from the hardware. Crashdumps have been slow for a > >>number of years, thanks to a fundamental change in how they are done. > >>Until now, USB was cheating and making them look fast. > > > >I'm afraid I did not understand your email. I was talking about > >crashdump time differences between yesterday and the day before, not > >"over a number of years." Are there any other issues involved here? > > > > Crashdumps work by the crashdump routine sending an i/o one-at-a-time to > the disk driver, waiting for a completion response between each i/o. > Polling in the disk driver is used to detect when the disk hardware has > completed each i/o request. Since it is done completely serially and > completely synchronously, it's very slow because it has to wait for the > hardware to process each i/o, one at a time. > > Prior to yesterday, the usb2 stack did not implement polling. The umass > disk driver completely ignored polling, and always immediately returned > success. So instead of waiting for the hardware to complete each > crashdump i/o request, it immediately returned success and allowed the > crashdump routine to send a new i/o. It was short cutting the required > process. Now that polling is in place, the shortcut is gone, and > crashdumps on USB are back to being slow, just like on every other disk > driver. The shortcut is fast, but it's also unsafe; it's bypassing the > guarantee that every i/o is getting written without error and without > overrunning the speed of the disk media. > > I mention "over a number of years" because the crashdump routine wasn't > always designed to be so slow. But, that's how it is now, and there > isn't much that can be done in the USB driver to fix it, short of going > back to the unsafe shortcut. This is informative, but I think we're talking about totally different things. There is no USB storage involved - the machine has a SATA disk and that's where the core is being written to. The USB _keyboard_ polling seems to be slowing things down. Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 07:09:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C37A8106566B; Sat, 1 Aug 2009 07:09:51 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96B9E8FC16; Sat, 1 Aug 2009 07:09:51 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7179pmp094607; Sat, 1 Aug 2009 07:09:51 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7179p7Y094603; Sat, 1 Aug 2009 07:09:51 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200908010709.n7179p7Y094603@svn.freebsd.org> From: Julian Elischer Date: Sat, 1 Aug 2009 07:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196010 - in stable/7/sys: . contrib/pf kern netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 07:09:52 -0000 Author: julian Date: Sat Aug 1 07:09:50 2009 New Revision: 196010 URL: http://svn.freebsd.org/changeset/base/196010 Log: MFC #195922 Fix accept on sockets using multiple routing tables Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/uipc_socket.c stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_syncache.c Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Sat Aug 1 01:54:42 2009 (r196009) +++ stable/7/sys/kern/uipc_socket.c Sat Aug 1 07:09:50 2009 (r196010) @@ -431,6 +431,7 @@ sonewconn(struct socket *head, int conns so->so_options = head->so_options &~ SO_ACCEPTCONN; so->so_linger = head->so_linger; so->so_state = head->so_state | SS_NOFDREF; + so->so_fibnum = head->so_fibnum; so->so_proto = head->so_proto; so->so_cred = crhold(head->so_cred); #ifdef MAC Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Sat Aug 1 01:54:42 2009 (r196009) +++ stable/7/sys/netinet/tcp_input.c Sat Aug 1 07:09:50 2009 (r196010) @@ -577,6 +577,7 @@ findpcb: } inc.inc_fport = th->th_sport; inc.inc_lport = th->th_dport; + inc.inc_fibnum = so->so_fibnum; /* * Check for an existing connection attempt in syncache if Modified: stable/7/sys/netinet/tcp_syncache.c ============================================================================== --- stable/7/sys/netinet/tcp_syncache.c Sat Aug 1 01:54:42 2009 (r196009) +++ stable/7/sys/netinet/tcp_syncache.c Sat Aug 1 07:09:50 2009 (r196010) @@ -678,8 +678,7 @@ syncache_socket(struct syncache *sc, str #endif inp = sotoinpcb(so); - inp->inp_inc.inc_fibnum = sc->sc_inc.inc_fibnum; - so->so_fibnum = sc->sc_inc.inc_fibnum; + inp->inp_inc.inc_fibnum = so->so_fibnum; INP_WLOCK(inp); /* Insert new socket into PCB hash list. */ @@ -1173,8 +1172,6 @@ _syncache_add(struct in_conninfo *inc, s sc->sc_cred = cred; cred = NULL; sc->sc_ipopts = ipopts; - /* XXX-BZ this fib assignment is just useless. */ - sc->sc_inc.inc_fibnum = inp->inp_inc.inc_fibnum; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); #ifdef INET6 if (!(inc->inc_flags & INC_ISIPV6)) @@ -1438,6 +1435,7 @@ syncache_respond(struct syncache *sc) } else optlen = 0; + M_SETFIB(m, sc->sc_inc.inc_fibnum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { th->th_sum = 0; From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 09:53:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08EE6106566B; Sat, 1 Aug 2009 09:53:19 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E7CFF8FC12; Sat, 1 Aug 2009 09:53:18 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id BAC5F1A3C3C; Sat, 1 Aug 2009 02:53:18 -0700 (PDT) Date: Sat, 1 Aug 2009 02:53:18 -0700 From: Alfred Perlstein To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090801095318.GP47463@elvis.mu.org> References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090731212140.GK47463@elvis.mu.org> <200908010615.02972.hselasky@c2i.net> <20090801045540.GA8399@doormat.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090801045540.GA8399@doormat.home> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 09:53:19 -0000 * Navdeep Parhar [090731 21:55] wrote: > On Sat, Aug 01, 2009 at 06:15:01AM +0200, Hans Petter Selasky wrote: > > On Friday 31 July 2009 23:21:40 Alfred Perlstein wrote: > > > Hans, can you please look into this issue? > > > > > > * Navdeep Parhar [090731 00:45] wrote: > > > > This has slowed down core dumps very significantly. What used to take > > > > 10-15s on my system now takes around 3 minutes. A simple test is to > > > > break into ddb and "call doadump" with or without this rev. I have a > > > > serial console on this machine > > > > and so I can use ddb whether the attached USB keyboard works or not. > > > > It's because there is a DELAY(1000) in the UKBD's polling routine so that key- > > repeating will work, no magic. > > ok. So can something be done about it or are you suggesting that we learn to > live with this? Hans, I don't think this is OK. Can you look into a fix? -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250 .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 10:13:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81401065673; Sat, 1 Aug 2009 10:13:45 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 7710E8FC13; Sat, 1 Aug 2009 10:13:45 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 891372D4860; Sat, 1 Aug 2009 10:13:44 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 7716F5C0A; Sat, 1 Aug 2009 12:13:44 +0200 (CEST) Date: Sat, 1 Aug 2009 12:13:44 +0200 From: "Simon L. Nielsen" To: Matt Jacob Message-ID: <20090801101343.GA1260@arthur.nitro.dk> References: <200908010104.n7114Qxa085932@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200908010104.n7114Qxa085932@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r196008 - in head/sys: cam dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 10:13:46 -0000 On 2009.08.01 01:04:26 +0000, Matt Jacob wrote: > Author: mjacob > Date: Sat Aug 1 01:04:26 2009 > New Revision: 196008 > URL: http://svn.freebsd.org/changeset/base/196008 > > Log: > Add 8Gb support (isp_2500). Fix a fair number of configuration and > firmware loading bugs. Nice! Any chance you could update the isp(4) manual page with which adaptors are supported now, or if you prefer not to play with mdoc, just tell me which adaptors I sould add and I would be happy to update the manual page. -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 11:40:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A521065673; Sat, 1 Aug 2009 11:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 033FE8FC0A; Sat, 1 Aug 2009 11:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71Bekmc079625; Sat, 1 Aug 2009 11:40:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71Beklu079623; Sat, 1 Aug 2009 11:40:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200908011140.n71Beklu079623@svn.freebsd.org> From: John Baldwin Date: Sat, 1 Aug 2009 11:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196013 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 11:40:48 -0000 Author: jhb Date: Sat Aug 1 11:40:46 2009 New Revision: 196013 URL: http://svn.freebsd.org/changeset/base/196013 Log: Fix compile of oshmctl() with MAC. Pointy hat to: jhb Modified: stable/7/sys/kern/sysv_shm.c Modified: stable/7/sys/kern/sysv_shm.c ============================================================================== --- stable/7/sys/kern/sysv_shm.c Sat Aug 1 09:54:52 2009 (r196012) +++ stable/7/sys/kern/sysv_shm.c Sat Aug 1 11:40:46 2009 (r196013) @@ -911,7 +911,7 @@ oshmctl(struct thread *td, struct oshmct if (error) goto done2; #ifdef MAC - error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, uap->cmd); + error = mac_check_sysv_shmctl(td->td_ucred, shmseg, uap->cmd); if (error != 0) goto done2; #endif From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 19:26:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AD4B106566B; Sat, 1 Aug 2009 19:26:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33FD28FC13; Sat, 1 Aug 2009 19:26:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71JQTPY090321; Sat, 1 Aug 2009 19:26:29 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71JQSML090262; Sat, 1 Aug 2009 19:26:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908011926.n71JQSML090262@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Aug 2009 19:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196019 - in head: . lib/libkvm sys/arm/arm sys/compat/linprocfs sys/compat/linux sys/compat/svr4 sys/conf sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/contrib/pf/net sys/cont... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 19:26:29 -0000 Author: rwatson Date: Sat Aug 1 19:26:27 2009 New Revision: 196019 URL: http://svn.freebsd.org/changeset/base/196019 Log: Merge the remainder of kern_vimage.c and vimage.h into vnet.c and vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket) Deleted: head/sys/kern/kern_vimage.c head/sys/sys/vimage.h Modified: head/ObsoleteFiles.inc head/lib/libkvm/kvm_vnet.c head/sys/arm/arm/minidump_machdep.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_socket.c head/sys/compat/svr4/svr4_sockio.c head/sys/conf/files head/sys/contrib/altq/altq/altq_subr.c head/sys/contrib/ipfilter/netinet/fil.c head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/contrib/pf/net/pf.c head/sys/contrib/pf/net/pf_if.c head/sys/contrib/pf/net/pf_ioctl.c head/sys/contrib/pf/net/pf_subr.c head/sys/contrib/rdma/rdma_cma.c head/sys/ddb/db_sym.c head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/fs/nfs/nfsport.h head/sys/kern/kern_jail.c head/sys/kern/kern_linker.c head/sys/kern/kern_poll.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_uuid.c head/sys/kern/sys_socket.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/net/bpf.c head/sys/net/bridgestp.c head/sys/net/flowtable.c head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_clone.c head/sys/net/if_ef.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_ethersubr.c head/sys/net/if_faith.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_llatbl.c head/sys/net/if_loop.c head/sys/net/if_mib.c head/sys/net/if_spppsubr.c head/sys/net/if_stf.c head/sys/net/if_tun.c head/sys/net/if_vlan.c head/sys/net/netisr.c head/sys/net/raw_cb.c head/sys/net/raw_usrreq.c head/sys/net/route.c head/sys/net/rtsock.c head/sys/net/vnet.c head/sys/net/vnet.h head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/netgraph/atm/ng_atm.c head/sys/netgraph/ng_base.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_gif.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_pipe.c head/sys/netgraph/ng_source.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_gif.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/dest6.c head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/route6.c head/sys/netinet6/scope6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_mbuf.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c head/sys/netipsec/keysock.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/netipsec/xform_tcp.c head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/nfs_diskless.c head/sys/nfsclient/nfs_vnops.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Aug 1 15:40:22 2009 (r196018) +++ head/ObsoleteFiles.inc Sat Aug 1 19:26:27 2009 (r196019) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090801: vimage.h removed in favour of vnet.h +OLD_FILES+=usr/include/sys/vimage.h # 20090719: library version bump for 8.0 OLD_LIBS+=lib/libalias.so.6 OLD_LIBS+=lib/libavl.so.1 Modified: head/lib/libkvm/kvm_vnet.c ============================================================================== --- head/lib/libkvm/kvm_vnet.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/lib/libkvm/kvm_vnet.c Sat Aug 1 19:26:27 2009 (r196019) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/arm/arm/minidump_machdep.c Sat Aug 1 19:26:27 2009 (r196019) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/compat/linprocfs/linprocfs.c Sat Aug 1 19:26:27 2009 (r196019) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/compat/linux/linux_ioctl.c Sat Aug 1 19:26:27 2009 (r196019) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/compat/linux/linux_socket.c Sat Aug 1 19:26:27 2009 (r196019) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/compat/svr4/svr4_sockio.c ============================================================================== --- head/sys/compat/svr4/svr4_sockio.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/compat/svr4/svr4_sockio.c Sat Aug 1 19:26:27 2009 (r196019) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/conf/files Sat Aug 1 19:26:27 2009 (r196019) @@ -1992,7 +1992,6 @@ kern/kern_time.c standard kern/kern_timeout.c standard kern/kern_umtx.c standard kern/kern_uuid.c standard -kern/kern_vimage.c optional vimage kern/kern_xxx.c standard kern/link_elf.c standard kern/linker_if.m standard Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/altq/altq/altq_subr.c Sat Aug 1 19:26:27 2009 (r196019) @@ -47,9 +47,6 @@ #include #include #include -#ifdef __FreeBSD__ -#include -#endif #include #include Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/ipfilter/netinet/fil.c Sat Aug 1 19:26:27 2009 (r196019) @@ -33,9 +33,6 @@ # if (__FreeBSD_version == 400019) # define CSUM_DELAY_DATA # endif -# if (__FreeBSD_version >= 800044) -# include -# endif # endif # include #else Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Aug 1 19:26:27 2009 (r196019) @@ -63,7 +63,6 @@ static const char rcsid[] = "@(#)$Id: ip # include #endif #if __FreeBSD_version >= 800044 -# include # include #else #define V_path_mtu_discovery path_mtu_discovery Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/pf/net/pf.c Sat Aug 1 19:26:27 2009 (r196019) @@ -91,7 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #else #include #endif Modified: head/sys/contrib/pf/net/pf_if.c ============================================================================== --- head/sys/contrib/pf/net/pf_if.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/pf/net/pf_if.c Sat Aug 1 19:26:27 2009 (r196019) @@ -54,9 +54,6 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#ifdef __FreeBSD__ -#include -#endif #include #include Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/pf/net/pf_ioctl.c Sat Aug 1 19:26:27 2009 (r196019) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #else #include #include Modified: head/sys/contrib/pf/net/pf_subr.c ============================================================================== --- head/sys/contrib/pf/net/pf_subr.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/pf/net/pf_subr.c Sat Aug 1 19:26:27 2009 (r196019) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/contrib/rdma/rdma_cma.c ============================================================================== --- head/sys/contrib/rdma/rdma_cma.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/contrib/rdma/rdma_cma.c Sat Aug 1 19:26:27 2009 (r196019) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/ddb/db_sym.c ============================================================================== --- head/sys/ddb/db_sym.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/ddb/db_sym.c Sat Aug 1 19:26:27 2009 (r196019) @@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c Sat Aug 1 19:26:27 2009 (r196019) @@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version >= 800044 -#include -#else +#if __FreeBSD_version < 800044 #define V_ifnet ifnet #endif Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Aug 1 19:26:27 2009 (r196019) @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version >= 800044 -#include -#else +#if __FreeBSD_version < 800044 #define V_tcp_do_autosndbuf tcp_do_autosndbuf #define V_tcp_autosndbuf_max tcp_autosndbuf_max #define V_tcp_do_rfc1323 tcp_do_rfc1323 Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/fs/nfs/nfsport.h Sat Aug 1 19:26:27 2009 (r196019) @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/kern_jail.c Sat Aug 1 19:26:27 2009 (r196019) @@ -58,9 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + #include +#include + #include + #ifdef DDB #include #ifdef INET6 Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/kern_linker.c Sat Aug 1 19:26:27 2009 (r196019) @@ -51,7 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include #include Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/kern_poll.c Sat Aug 1 19:26:27 2009 (r196019) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* for IFF_* flags */ #include /* for NETISR_POLL */ Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/kern_sysctl.c Sat Aug 1 19:26:27 2009 (r196019) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef KTRACE #include #endif Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/kern_uuid.c Sat Aug 1 19:26:27 2009 (r196019) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/sys_socket.c Sat Aug 1 19:26:27 2009 (r196019) @@ -48,10 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include #include Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/uipc_domain.c Sat Aug 1 19:26:27 2009 (r196019) @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include + #include /* Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/uipc_socket.c Sat Aug 1 19:26:27 2009 (r196019) @@ -129,7 +129,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include #include Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/uipc_syscalls.c Sat Aug 1 19:26:27 2009 (r196019) @@ -64,12 +64,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef KTRACE #include #endif +#include + #include #include Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/kern/uipc_usrreq.c Sat Aug 1 19:26:27 2009 (r196019) @@ -88,7 +88,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include #ifdef DDB #include Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/bpf.c Sat Aug 1 19:26:27 2009 (r196019) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -73,6 +72,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/bridgestp.c Sat Aug 1 19:26:27 2009 (r196019) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/flowtable.c Sat Aug 1 19:26:27 2009 (r196019) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if.c Sat Aug 1 19:26:27 2009 (r196019) @@ -59,7 +59,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_bridge.c Sat Aug 1 19:26:27 2009 (r196019) @@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_clone.c Sat Aug 1 19:26:27 2009 (r196019) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_ef.c ============================================================================== --- head/sys/net/if_ef.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_ef.c Sat Aug 1 19:26:27 2009 (r196019) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_enc.c Sat Aug 1 19:26:27 2009 (r196019) @@ -38,7 +38,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_epair.c Sat Aug 1 19:26:27 2009 (r196019) @@ -38,7 +38,7 @@ /* * Things to re-think once we have more experience: * - ifp->if_reassign function once we can test with vimage. Depending on - * how if_vomve() is going to be improved. + * how if_vmove() is going to be improved. * - Real random etheraddrs that are checked to be uniquish; we would need * to re-do them in case we move the interface between network stacks * in a private if_reassign function. @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -70,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define EPAIRNAME "epair" Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_ethersubr.c Sat Aug 1 19:26:27 2009 (r196019) @@ -50,7 +50,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_faith.c Sat Aug 1 19:26:27 2009 (r196019) @@ -54,7 +54,6 @@ #include #include #include -#include #include #include @@ -62,6 +61,7 @@ #include #include #include +#include #ifdef INET #include Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_gif.c Sat Aug 1 19:26:27 2009 (r196019) @@ -49,7 +49,6 @@ #include #include #include -#include #include #include @@ -58,6 +57,7 @@ #include #include #include +#include #include #include Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_gre.c Sat Aug 1 19:26:27 2009 (r196019) @@ -64,13 +64,13 @@ #include #include #include -#include #include #include #include #include #include +#include #ifdef INET #include Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_llatbl.c Sat Aug 1 19:26:27 2009 (r196019) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -51,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_loop.c Sat Aug 1 19:26:27 2009 (r196019) @@ -49,7 +49,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_mib.c Sat Aug 1 19:26:27 2009 (r196019) @@ -34,7 +34,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_spppsubr.c Sat Aug 1 19:26:27 2009 (r196019) @@ -36,7 +36,6 @@ #include #include #include -#include #include @@ -44,6 +43,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_stf.c Sat Aug 1 19:26:27 2009 (r196019) @@ -92,7 +92,6 @@ #include #include -#include #include #include @@ -100,6 +99,7 @@ #include #include #include +#include #include #include Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_tun.c Sat Aug 1 19:26:27 2009 (r196019) @@ -43,13 +43,13 @@ #include #include #include -#include #include #include #include #include #include +#include #ifdef INET #include #endif Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/if_vlan.c Sat Aug 1 19:26:27 2009 (r196019) @@ -55,7 +55,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/netisr.c Sat Aug 1 19:26:27 2009 (r196019) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef DDB #include @@ -87,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /*- * Synchronize use and modification of the registered netisr data structures; Modified: head/sys/net/raw_cb.c ============================================================================== --- head/sys/net/raw_cb.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/raw_cb.c Sat Aug 1 19:26:27 2009 (r196019) @@ -42,7 +42,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/raw_usrreq.c Sat Aug 1 19:26:27 2009 (r196019) @@ -44,7 +44,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/route.c Sat Aug 1 19:26:27 2009 (r196019) @@ -51,11 +51,11 @@ #include #include #include -#include #include #include #include +#include #ifdef RADIX_MPATH #include Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/rtsock.c Sat Aug 1 19:26:27 2009 (r196019) @@ -50,7 +50,6 @@ #include #include #include -#include #include #include Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/vnet.c Sat Aug 1 19:26:27 2009 (r196019) @@ -1,4 +1,12 @@ /*- + * Copyright (c) 2004-2009 University of Zagreb + * Copyright (c) 2006-2009 FreeBSD Foundation + * All rights reserved. + * + * This software was developed by the University of Zagreb and the + * FreeBSD Foundation under sponsorship by the Stichting NLnet and the + * FreeBSD Foundation. + * * Copyright (c) 2009 Jeffrey Roberson * Copyright (c) 2009 Robert N. M. Watson * All rights reserved. @@ -28,30 +36,67 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include +#include #include #include #include #include #include #include +#include #include #include -#include +#ifdef DDB +#include +#endif + +#include +#include #include /*- * This file implements core functions for virtual network stacks: * + * - Core virtual network stack management functions. + * * - Virtual network stack memory allocator, which virtualized global * variables in the network stack * * - Virtualized SYSINIT's/SYSUNINIT's, which allow network stack subsystems * to register startup/shutdown events to be run for each virtual network * stack instance. - * + */ + +MALLOC_DEFINE(M_VNET, "vnet", "network stack control block"); + +/* + * The virtual network stack list has two read-write locks, one sleepable and + * the other not, so that the list can be stablized and walked in a variety + * of network stack contexts. Both must be acquired exclusively to modify + * the list. + */ +struct rwlock vnet_rwlock; +struct sx vnet_sxlock; + +#define VNET_LIST_WLOCK() do { \ + sx_xlock(&vnet_sxlock); \ + rw_wlock(&vnet_rwlock); \ +} while (0) + +#define VNET_LIST_WUNLOCK() do { \ + rw_wunlock(&vnet_rwlock); \ + sx_xunlock(&vnet_sxlock); \ +} while (0) + +struct vnet_list_head vnet_head; +struct vnet *vnet0; + +/* * The virtual network stack allocator provides storage for virtualized * global variables. These variables are defined/declared using the * VNET_DEFINE()/VNET_DECLARE() macros, which place them in the 'set_vnet' @@ -157,6 +202,114 @@ static TAILQ_HEAD(, vnet_data_free) vnet static struct sx vnet_data_free_lock; /* + * Allocate a virtual network stack. + */ +struct vnet * +vnet_alloc(void) +{ + struct vnet *vnet; + + vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); + vnet->vnet_magic_n = VNET_MAGIC_N; + vnet_data_init(vnet); + + /* Initialize / attach vnet module instances. */ + CURVNET_SET_QUIET(vnet); + + sx_xlock(&vnet_sxlock); + vnet_sysinit(); + CURVNET_RESTORE(); + + rw_wlock(&vnet_rwlock); + LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); + VNET_LIST_WUNLOCK(); + + return (vnet); +} + +/* + * Destroy a virtual network stack. + */ +void +vnet_destroy(struct vnet *vnet) +{ + struct ifnet *ifp, *nifp; + + KASSERT(vnet->vnet_sockcnt == 0, + ("%s: vnet still has sockets", __func__)); + + VNET_LIST_WLOCK(); + LIST_REMOVE(vnet, vnet_le); + rw_wunlock(&vnet_rwlock); + + CURVNET_SET_QUIET(vnet); + + /* Return all inherited interfaces to their parent vnets. */ + TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { + if (ifp->if_home_vnet != ifp->if_vnet) + if_vmove(ifp, ifp->if_home_vnet); + } + + vnet_sysuninit(); + sx_xunlock(&vnet_sxlock); + + CURVNET_RESTORE(); + + /* Hopefully, we are OK to free the vnet container itself. */ + vnet_data_destroy(vnet); + vnet->vnet_magic_n = 0xdeadbeef; + free(vnet, M_VNET); +} + +static void +vnet_foreach(void (*vnet_foreach_fn)(struct vnet *, void *), void *arg) +{ + struct vnet *vnet; + + VNET_LIST_RLOCK(); + LIST_FOREACH(vnet, &vnet_head, vnet_le) + vnet_foreach_fn(vnet, arg); + VNET_LIST_RUNLOCK(); +} + +/* + * Boot time initialization and allocation of virtual network stacks. + */ +static void +vnet_init_prelink(void *arg) +{ + + rw_init(&vnet_rwlock, "vnet_rwlock"); + sx_init(&vnet_sxlock, "vnet_sxlock"); + LIST_INIT(&vnet_head); +} +SYSINIT(vnet_init_prelink, SI_SUB_VNET_PRELINK, SI_ORDER_FIRST, + vnet_init_prelink, NULL); + +static void +vnet0_init(void *arg) +{ + + /* + * We MUST clear curvnet in vi_init_done() before going SMP, + * otherwise CURVNET_SET() macros would scream about unnecessary + * curvnet recursions. + */ + curvnet = prison0.pr_vnet = vnet0 = vnet_alloc(); +} +SYSINIT(vnet0_init, SI_SUB_VNET, SI_ORDER_FIRST, vnet0_init, NULL); + +static void +vnet_init_done(void *unused) +{ + + curvnet = NULL; +} + +SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_FIRST, vnet_init_done, + NULL); + +/* * Allocate storage for virtualized global variables in a new virtual network * stack instance, and copy in initial values from our 'master' copy. */ @@ -490,3 +643,20 @@ vnet_sysuninit(void) vs->func(vs->arg); } } + +#ifdef DDB +DB_SHOW_COMMAND(vnets, db_show_vnets) +{ + VNET_ITERATOR_DECL(vnet_iter); + +#if SIZE_MAX == UINT32_MAX /* 32-bit arch */ + db_printf(" vnet ifs socks\n"); +#else /* 64-bit arch, most probaly... */ + db_printf(" vnet ifs socks\n"); +#endif + VNET_FOREACH(vnet_iter) { + db_printf("%p %3d %5d\n", vnet_iter, vnet_iter->vnet_ifcnt, + vnet_iter->vnet_sockcnt); + } +} +#endif Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Sat Aug 1 15:40:22 2009 (r196018) +++ head/sys/net/vnet.h Sat Aug 1 19:26:27 2009 (r196019) @@ -1,4 +1,12 @@ /*- + * Copyright (c) 2006-2009 University of Zagreb + * Copyright (c) 2006-2009 FreeBSD Foundation + * All rights reserved. + * + * This software was developed by the University of Zagreb and the + * FreeBSD Foundation under sponsorship by the Stichting NLnet and the + * FreeBSD Foundation. + * * Copyright (c) 2009 Jeffrey Roberson * Copyright (c) 2009 Robert N. M. Watson * All rights reserved. @@ -31,6 +39,9 @@ * This header file defines several sets of interfaces supporting virtualized * network stacks: * + * - Definition of 'struct vnet' and functions and macros to allocate/free/ + * manipulate it. + * * - A virtual network stack memory allocator, which provides support for * virtualized global variables via a special linker set, set_vnet. * @@ -47,17 +58,133 @@ #define _NET_VNET_H_ /* - * Virtual network stack memory allocator, which allows global variables to - * be automatically instantiated for each network stack instance. + * struct vnet describes a virtualized network stack, and is primarily a + * pointer to storage for virtualized global variables. Expose to userspace + * as required for libkvm. */ #if defined(_KERNEL) || defined(_WANT_VNET) +#include + +struct vnet { + LIST_ENTRY(vnet) vnet_le; /* all vnets list */ + u_int vnet_magic_n; + u_int vnet_ifcnt; + u_int vnet_sockcnt; + void *vnet_data_mem; + uintptr_t vnet_data_base; +}; +#define VNET_MAGIC_N 0x3e0d8f29 + +/* + * These two virtual network stack allocator definitions are also required + * for libkvm so that it can evaluate virtualized global variables. + */ #define VNET_SETNAME "set_vnet" #define VNET_SYMPREFIX "vnet_entry_" #endif #ifdef _KERNEL + #ifdef VIMAGE +#include +#include /* for struct thread */ +#include +#include + +/* + * Functions to allocate and destroy virtual network stacks. + */ +struct vnet *vnet_alloc(void); +void vnet_destroy(struct vnet *vnet); +/* + * The current virtual network stack -- we may wish to move this to struct + * pcpu in the future. + */ +#define curvnet curthread->td_vnet + +/* + * Various macros -- get and set the current network stack, but also + * assertions. + */ +#ifdef INVARIANTS +#define VNET_DEBUG +#endif +#ifdef VNET_DEBUG +#define VNET_ASSERT(condition) \ + if (!(condition)) { \ + printf("VNET_ASSERT @ %s:%d %s():\n", \ + __FILE__, __LINE__, __FUNCTION__); \ + panic(#condition); \ + } + +#define CURVNET_SET_QUIET(arg) \ + VNET_ASSERT((arg)->vnet_magic_n == VNET_MAGIC_N); \ + struct vnet *saved_vnet = curvnet; \ + const char *saved_vnet_lpush = curthread->td_vnet_lpush; \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 20:24:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A215A106566B; Sat, 1 Aug 2009 20:24:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75F9B8FC08; Sat, 1 Aug 2009 20:24:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71KOkIY091650; Sat, 1 Aug 2009 20:24:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71KOkJK091649; Sat, 1 Aug 2009 20:24:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908012024.n71KOkJK091649@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Aug 2009 20:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196020 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 20:24:47 -0000 Author: rwatson Date: Sat Aug 1 20:24:45 2009 New Revision: 196020 URL: http://svn.freebsd.org/changeset/base/196020 Log: Remove vnet_foreach() utility function, which previously allowed vnet.c to iterate virtual network stacks without being aware of the implementation details previously hidden in kern_vimage.c. Now they are in the same file, so remove this added complexity. Reviewed by: bz Approved by: re (vimage blanket) Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sat Aug 1 19:26:27 2009 (r196019) +++ head/sys/net/vnet.c Sat Aug 1 20:24:45 2009 (r196020) @@ -261,17 +261,6 @@ vnet_destroy(struct vnet *vnet) free(vnet, M_VNET); } -static void -vnet_foreach(void (*vnet_foreach_fn)(struct vnet *, void *), void *arg) -{ - struct vnet *vnet; - - VNET_LIST_RLOCK(); - LIST_FOREACH(vnet, &vnet_head, vnet_le) - vnet_foreach_fn(vnet, arg); - VNET_LIST_RUNLOCK(); -} - /* * Boot time initialization and allocation of virtual network stacks. */ @@ -443,20 +432,6 @@ vnet_data_free(void *start_arg, int size sx_xunlock(&vnet_data_free_lock); } -struct vnet_data_copy_fn_arg { - void *start; - int size; -}; - -static void -vnet_data_copy_fn(struct vnet *vnet, void *arg) -{ - struct vnet_data_copy_fn_arg *varg = arg; - - memcpy((void *)((uintptr_t)vnet->vnet_data_base + - (uintptr_t)varg->start), varg->start, varg->size); -} - /* * When a new virtualized global variable has been allocated, propagate its * initial value to each already-allocated virtual network stack instance. @@ -464,11 +439,13 @@ vnet_data_copy_fn(struct vnet *vnet, voi void vnet_data_copy(void *start, int size) { - struct vnet_data_copy_fn_arg varg; + struct vnet *vnet; - varg.start = start; - varg.size = size; - vnet_foreach(vnet_data_copy_fn, &varg); + VNET_LIST_RLOCK(); + LIST_FOREACH(vnet, &vnet_head, vnet_le) + memcpy((void *)((uintptr_t)vnet->vnet_data_base + + (uintptr_t)start), start, size); + VNET_LIST_RUNLOCK(); } /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 21:54:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034A01065673; Sat, 1 Aug 2009 21:54:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC4908FC0A; Sat, 1 Aug 2009 21:54:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71LsFlY093649; Sat, 1 Aug 2009 21:54:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71LsFBT093646; Sat, 1 Aug 2009 21:54:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908012154.n71LsFBT093646@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Aug 2009 21:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196024 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 21:54:16 -0000 Author: rwatson Date: Sat Aug 1 21:54:15 2009 New Revision: 196024 URL: http://svn.freebsd.org/changeset/base/196024 Log: Make the vnet alloc/destroy paths a bit easier to followg by merging vnet_data_init/vnet_data_destroy into vnet_alloc/vnet_destroy. Reviewed by: bz, zec Approved by: re (vimage blanket) Modified: head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sat Aug 1 21:46:55 2009 (r196023) +++ head/sys/net/vnet.c Sat Aug 1 21:54:15 2009 (r196024) @@ -211,7 +211,20 @@ vnet_alloc(void) vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet->vnet_magic_n = VNET_MAGIC_N; - vnet_data_init(vnet); + + /* + * Allocate storage for virtualized global variables and copy in + * initial values form our 'master' copy. + */ + vnet->vnet_data_mem = malloc(VNET_SIZE, M_VNET_DATA, M_WAITOK); + memcpy(vnet->vnet_data_mem, (void *)VNET_START, VNET_BYTES); + + /* + * All use of vnet-specific data will immediately subtract VNET_START + * from the base memory pointer, so pre-calculate that now to avoid + * it on each use. + */ + vnet->vnet_data_base = (uintptr_t)vnet->vnet_data_mem - VNET_START; /* Initialize / attach vnet module instances. */ CURVNET_SET_QUIET(vnet); @@ -255,8 +268,12 @@ vnet_destroy(struct vnet *vnet) CURVNET_RESTORE(); - /* Hopefully, we are OK to free the vnet container itself. */ - vnet_data_destroy(vnet); + /* + * Release storage for the virtual network stack instance. + */ + free(vnet->vnet_data_mem, M_VNET_DATA); + vnet->vnet_data_mem = NULL; + vnet->vnet_data_base = 0; vnet->vnet_magic_n = 0xdeadbeef; free(vnet, M_VNET); } @@ -299,37 +316,6 @@ SYSINIT(vnet_init_done, SI_SUB_VNET_DONE NULL); /* - * Allocate storage for virtualized global variables in a new virtual network - * stack instance, and copy in initial values from our 'master' copy. - */ -void -vnet_data_init(struct vnet *vnet) -{ - - vnet->vnet_data_mem = malloc(VNET_SIZE, M_VNET_DATA, M_WAITOK); - memcpy(vnet->vnet_data_mem, (void *)VNET_START, VNET_BYTES); - - /* - * All use of vnet-specific data will immediately subtract VNET_START - * from the base memory pointer, so pre-calculate that now to avoid - * it on each use. - */ - vnet->vnet_data_base = (uintptr_t)vnet->vnet_data_mem - VNET_START; -} - -/* - * Release storage for a virtual network stack instance. - */ -void -vnet_data_destroy(struct vnet *vnet) -{ - - free(vnet->vnet_data_mem, M_VNET_DATA); - vnet->vnet_data_mem = NULL; - vnet->vnet_data_base = 0; -} - -/* * Once on boot, initialize the modspace freelist to entirely cover modspace. */ static void Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Sat Aug 1 21:46:55 2009 (r196023) +++ head/sys/net/vnet.h Sat Aug 1 21:54:15 2009 (r196024) @@ -217,13 +217,6 @@ void vnet_data_copy(void *start, int si void vnet_data_free(void *start_arg, int size); /* - * Virtual network stack allocator interfaces for vnet setup/teardown. - */ -struct vnet; -void vnet_data_init(struct vnet *vnet); -void vnet_data_destroy(struct vnet *vnet); - -/* * Sysctl variants for vnet-virtualized global variables. Include * to expose these definitions. * From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 21:58:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED5D106566B; Sat, 1 Aug 2009 21:58:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0808FC3D; Sat, 1 Aug 2009 21:58:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71LwWUd093779; Sat, 1 Aug 2009 21:58:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71LwW2C093777; Sat, 1 Aug 2009 21:58:32 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908012158.n71LwW2C093777@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Aug 2009 21:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196025 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 21:58:32 -0000 Author: rwatson Date: Sat Aug 1 21:58:32 2009 New Revision: 196025 URL: http://svn.freebsd.org/changeset/base/196025 Log: Minor style tweaks. Approved by: re (vimage blanket) Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sat Aug 1 21:54:15 2009 (r196024) +++ head/sys/net/vnet.c Sat Aug 1 21:58:32 2009 (r196025) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); /*- * This file implements core functions for virtual network stacks: * - * - Core virtual network stack management functions. + * - Virtual network stack management functions. * - * - Virtual network stack memory allocator, which virtualized global + * - Virtual network stack memory allocator, which virtualizes global * variables in the network stack * * - Virtualized SYSINIT's/SYSUNINIT's, which allow network stack subsystems @@ -78,7 +78,7 @@ MALLOC_DEFINE(M_VNET, "vnet", "network s * The virtual network stack list has two read-write locks, one sleepable and * the other not, so that the list can be stablized and walked in a variety * of network stack contexts. Both must be acquired exclusively to modify - * the list. + * the list, but a read lock of either lock is sufficient to walk the list. */ struct rwlock vnet_rwlock; struct sx vnet_sxlock; @@ -181,9 +181,9 @@ MALLOC_DEFINE(M_VNET_DATA, "vnet_data", static VNET_DEFINE(char, modspace[VNET_MODMIN]); /* - * Global lists of subsystem constructor and destructors for vnets. - * They are registered via VNET_SYSINIT() and VNET_SYSUNINIT(). The - * lists are protected by the vnet_sxlock global lock. + * Global lists of subsystem constructor and destructors for vnets. They are + * registered via VNET_SYSINIT() and VNET_SYSUNINIT(). The lists are + * protected by the vnet_sxlock global lock. */ static TAILQ_HEAD(vnet_sysinit_head, vnet_sysinit) vnet_constructors = TAILQ_HEAD_INITIALIZER(vnet_constructors); @@ -387,15 +387,16 @@ vnet_data_free(void *start_arg, int size if (df->vnd_start > end) break; /* - * If we expand at the end of an entry we may have to - * merge it with the one following it as well. + * If we expand at the end of an entry we may have to merge + * it with the one following it as well. */ if (df->vnd_start + df->vnd_len == start) { df->vnd_len += size; dn = TAILQ_NEXT(df, vnd_link); if (df->vnd_start + df->vnd_len == dn->vnd_start) { df->vnd_len += dn->vnd_len; - TAILQ_REMOVE(&vnet_data_free_head, dn, vnd_link); + TAILQ_REMOVE(&vnet_data_free_head, dn, + vnd_link); free(dn, M_VNET_DATA_FREE); } sx_xunlock(&vnet_data_free_lock); @@ -573,10 +574,9 @@ vnet_deregister_sysuninit(void *arg) } /* - * Invoke all registered vnet constructors on the current vnet. Used - * during vnet construction. The caller is responsible for ensuring - * the new vnet is the current vnet and that the vnet_sxlock lock is - * locked. + * Invoke all registered vnet constructors on the current vnet. Used during + * vnet construction. The caller is responsible for ensuring the new vnet is + * the current vnet and that the vnet_sxlock lock is locked. */ void vnet_sysinit(void) @@ -590,10 +590,9 @@ vnet_sysinit(void) } /* - * Invoke all registered vnet destructors on the current vnet. Used - * during vnet destruction. The caller is responsible for ensuring - * the dying vnet is the current vnet and that the vnet_sxlock lock is - * locked. + * Invoke all registered vnet destructors on the current vnet. Used during + * vnet destruction. The caller is responsible for ensuring the dying vnet + * is the current vnet and that the vnet_sxlock lock is locked. */ void vnet_sysuninit(void) From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 22:15:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E18EC1065674; Sat, 1 Aug 2009 22:15:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B8D288FC12; Sat, 1 Aug 2009 22:15:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6E97B46B03; Sat, 1 Aug 2009 18:15:09 -0400 (EDT) Date: Sat, 1 Aug 2009 23:15:09 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Hans Petter Selasky In-Reply-To: <200908010615.02972.hselasky@c2i.net> Message-ID: References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090731212140.GK47463@elvis.mu.org> <200908010615.02972.hselasky@c2i.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, Navdeep Parhar Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 22:15:10 -0000 On Sat, 1 Aug 2009, Hans Petter Selasky wrote: >>> This has slowed down core dumps very significantly. What used to take >>> 10-15s on my system now takes around 3 minutes. A simple test is to break >>> into ddb and "call doadump" with or without this rev. I have a serial >>> console on this machine and so I can use ddb whether the attached USB >>> keyboard works or not. > > It's because there is a DELAY(1000) in the UKBD's polling routine so that > key- repeating will work, no magic. Given a choice between dumping 10x faster and having automatic key repeat in DDB, I'd lean towards the former. :-) Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Sat Aug 1 22:22:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4821065674; Sat, 1 Aug 2009 22:22:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9048FC13; Sat, 1 Aug 2009 22:22:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n71MMji4094394; Sat, 1 Aug 2009 22:22:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n71MMjNO094392; Sat, 1 Aug 2009 22:22:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200908012222.n71MMjNO094392@svn.freebsd.org> From: Robert Watson Date: Sat, 1 Aug 2009 22:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196026 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 22:22:45 -0000 Author: rwatson Date: Sat Aug 1 22:22:45 2009 New Revision: 196026 URL: http://svn.freebsd.org/changeset/base/196026 Log: The colour was red as shall be the letters of this warning to people upon boot if the experimental VIMAGE feature was compiled into the kernel. Submitted by: bz Reviewed by: zec Approved by: re (vimage blanket) Modified: head/sys/net/vnet.c Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Sat Aug 1 21:58:32 2009 (r196025) +++ head/sys/net/vnet.c Sat Aug 1 22:22:45 2009 (r196026) @@ -296,6 +296,10 @@ static void vnet0_init(void *arg) { + /* Warn people before take off - in case we crash early. */ + printf("WARNING: VIMAGE (virtualized network stack) is a highly " + "experimental feature.\n"); + /* * We MUST clear curvnet in vi_init_done() before going SMP, * otherwise CURVNET_SET() macros would scream about unnecessary