From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 06:23:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD856C79; Sun, 31 Aug 2014 06:23:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8F8B1D52; Sun, 31 Aug 2014 06:23:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7V6Nsle041045; Sun, 31 Aug 2014 06:23:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7V6NsT3041044; Sun, 31 Aug 2014 06:23:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408310623.s7V6NsT3041044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 06:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270868 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 06:23:55 -0000 Author: glebius Date: Sun Aug 31 06:23:54 2014 New Revision: 270868 URL: http://svnweb.freebsd.org/changeset/base/270868 Log: Remove ability to write to struct if_data residing in struct ifnet via net.link.generic.IFMIB_IFDATA.*.IFDATA_GENERAL sysctl. Reasons for removal are: - No code in tree uses this possibility. - The documentation ifmib(4) doesn't say that such possibility exist. The example provided in manual page only reads data. - On many interfaces the feature simply doesn't work, since they do accounting in hardware, and overwrite if_data on tick. Sponsored by: Nginx, Inc. Modified: head/sys/net/if_mib.c Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Sun Aug 31 04:56:34 2014 (r270867) +++ head/sys/net/if_mib.c Sun Aug 31 06:23:54 2014 (r270868) @@ -109,27 +109,8 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX ifmd.ifmd_snd_drops = ifp->if_snd.ifq_drops; error = SYSCTL_OUT(req, &ifmd, sizeof ifmd); - if (error || !req->newptr) - goto out; - - error = SYSCTL_IN(req, &ifmd, sizeof ifmd); if (error) goto out; - -#define DONTCOPY(fld) ifmd.ifmd_data.ifi_##fld = ifp->if_data.ifi_##fld - DONTCOPY(type); - DONTCOPY(physical); - DONTCOPY(addrlen); - DONTCOPY(hdrlen); - DONTCOPY(mtu); - DONTCOPY(metric); - DONTCOPY(baudrate); -#undef DONTCOPY -#define COPY(fld) ifp->if_##fld = ifmd.ifmd_##fld - COPY(data); - ifp->if_snd.ifq_maxlen = ifmd.ifmd_snd_maxlen; - ifp->if_snd.ifq_drops = ifmd.ifmd_snd_drops; -#undef COPY break; case IFDATA_LINKSPECIFIC: From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 06:30:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1AF4E15; Sun, 31 Aug 2014 06:30:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD9811D76; Sun, 31 Aug 2014 06:30:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7V6Uooq044295; Sun, 31 Aug 2014 06:30:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7V6UoK2044294; Sun, 31 Aug 2014 06:30:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408310630.s7V6UoK2044294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 06:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270869 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 06:30:51 -0000 Author: glebius Date: Sun Aug 31 06:30:50 2014 New Revision: 270869 URL: http://svnweb.freebsd.org/changeset/base/270869 Log: Use macros instead of referencing struct if_data that resides in ifnet. Sponsored by: Nginx, Inc. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Aug 31 06:23:54 2014 (r270868) +++ head/sys/netinet/if_ether.c Sun Aug 31 06:30:50 2014 (r270869) @@ -258,8 +258,8 @@ arprequest(struct ifnet *ifp, const stru if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) return; - m->m_len = sizeof(*ah) + 2*sizeof(struct in_addr) + - 2*ifp->if_data.ifi_addrlen; + m->m_len = sizeof(*ah) + 2 * sizeof(struct in_addr) + + 2 * ifp->if_addrlen; m->m_pkthdr.len = m->m_len; MH_ALIGN(m, m->m_len); ah = mtod(m, struct arphdr *); From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 06:46:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2397D103; Sun, 31 Aug 2014 06:46:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EBEC1ED6; Sun, 31 Aug 2014 06:46:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7V6kMZm050683; Sun, 31 Aug 2014 06:46:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7V6kM1X050678; Sun, 31 Aug 2014 06:46:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408310646.s7V6kM1X050678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 06:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270870 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 06:46:23 -0000 Author: glebius Date: Sun Aug 31 06:46:21 2014 New Revision: 270870 URL: http://svnweb.freebsd.org/changeset/base/270870 Log: o Remove struct if_data from struct ifnet. Now it is merely API structure for route(4) socket and ifmib(4) sysctl. o Move fields from if_data to ifnet, but keep all statistic counters separate, since they should disappear later. o Provide function if_data_copy() to fill if_data, utilize it in routing socket and ifmib handler. o Provide overridable ifnet(9) method to fetch counters. If no provided, if_get_counters_compat() would be used, that returns old counters. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_mib.c head/sys/net/if_var.h head/sys/net/rtsock.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Aug 31 06:30:50 2014 (r270869) +++ head/sys/net/if.c Sun Aug 31 06:46:21 2014 (r270870) @@ -605,8 +605,7 @@ if_attach_internal(struct ifnet *ifp, in if_addgroup(ifp, IFG_ALL); getmicrotime(&ifp->if_lastchange); - ifp->if_data.ifi_epoch = time_uptime; - ifp->if_data.ifi_datalen = sizeof(struct if_data); + ifp->if_epoch = time_uptime; KASSERT((ifp->if_transmit == NULL && ifp->if_qflush == NULL) || (ifp->if_transmit != NULL && ifp->if_qflush != NULL), @@ -615,7 +614,10 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_transmit = if_transmit; ifp->if_qflush = if_qflush; } - + + if (ifp->if_get_counter == NULL) + ifp->if_get_counter = if_get_counter_compat; + if (!vmove) { #ifdef MAC mac_ifnet_create(ifp); @@ -1384,6 +1386,77 @@ if_rtdel(struct radix_node *rn, void *ar } /* + * Return counter values from old racy non-pcpu counters. + */ +uint64_t +if_get_counter_compat(struct ifnet *ifp, ifnet_counter cnt) +{ + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (ifp->if_ipackets); + case IFCOUNTER_IERRORS: + return (ifp->if_ierrors); + case IFCOUNTER_OPACKETS: + return (ifp->if_opackets); + case IFCOUNTER_OERRORS: + return (ifp->if_oerrors); + case IFCOUNTER_COLLISIONS: + return (ifp->if_collisions); + case IFCOUNTER_IBYTES: + return (ifp->if_ibytes); + case IFCOUNTER_OBYTES: + return (ifp->if_obytes); + case IFCOUNTER_IMCASTS: + return (ifp->if_imcasts); + case IFCOUNTER_OMCASTS: + return (ifp->if_omcasts); + case IFCOUNTER_IQDROPS: + return (ifp->if_iqdrops); + case IFCOUNTER_OQDROPS: + return (ifp->if_oqdrops); + case IFCOUNTER_NOPROTO: + return (ifp->if_noproto); + } + panic("%s: unknown counter %d", __func__, cnt); +} + +/* + * Copy data from ifnet to userland API structure if_data. + */ +void +if_data_copy(struct ifnet *ifp, struct if_data *ifd) +{ + + ifd->ifi_type = ifp->if_type; + ifd->ifi_physical = 0; + ifd->ifi_addrlen = ifp->if_addrlen; + ifd->ifi_hdrlen = ifp->if_hdrlen; + ifd->ifi_link_state = ifp->if_link_state; + ifd->ifi_vhid = 0; + ifd->ifi_datalen = sizeof(struct if_data); + ifd->ifi_mtu = ifp->if_mtu; + ifd->ifi_metric = ifp->if_metric; + ifd->ifi_baudrate = ifp->if_baudrate; + ifd->ifi_hwassist = ifp->if_hwassist; + ifd->ifi_epoch = ifp->if_epoch; + ifd->ifi_lastchange = ifp->if_lastchange; + + ifd->ifi_ipackets = ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS); + ifd->ifi_ierrors = ifp->if_get_counter(ifp, IFCOUNTER_IERRORS); + ifd->ifi_opackets = ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS); + ifd->ifi_oerrors = ifp->if_get_counter(ifp, IFCOUNTER_OERRORS); + ifd->ifi_collisions = ifp->if_get_counter(ifp, IFCOUNTER_COLLISIONS); + ifd->ifi_ibytes = ifp->if_get_counter(ifp, IFCOUNTER_IBYTES); + ifd->ifi_obytes = ifp->if_get_counter(ifp, IFCOUNTER_OBYTES); + ifd->ifi_imcasts = ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS); + ifd->ifi_omcasts = ifp->if_get_counter(ifp, IFCOUNTER_OMCASTS); + ifd->ifi_iqdrops = ifp->if_get_counter(ifp, IFCOUNTER_IQDROPS); + ifd->ifi_oqdrops = ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS); + ifd->ifi_noproto = ifp->if_get_counter(ifp, IFCOUNTER_NOPROTO); +} + +/* * Wrapper functions for struct ifnet address list locking macros. These are * used by kernel modules to avoid encoding programming interface or binary * interface assumptions that may be violated when kernel-internal locking @@ -2167,7 +2240,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, break; case SIOCGIFPHYS: - ifr->ifr_phys = ifp->if_physical; + /* XXXGL: did this ever worked? */ + ifr->ifr_phys = 0; break; case SIOCGIFDESCR: @@ -3915,7 +3989,7 @@ if_sendq_prepend(if_t ifp, struct mbuf * int if_setifheaderlen(if_t ifp, int len) { - ((struct ifnet *)ifp)->if_data.ifi_hdrlen = len; + ((struct ifnet *)ifp)->if_hdrlen = len; return (0); } Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Sun Aug 31 06:30:50 2014 (r270869) +++ head/sys/net/if_mib.c Sun Aug 31 06:46:21 2014 (r270870) @@ -99,10 +99,9 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX bzero(&ifmd, sizeof(ifmd)); strlcpy(ifmd.ifmd_name, ifp->if_xname, sizeof(ifmd.ifmd_name)); -#define COPY(fld) ifmd.ifmd_##fld = ifp->if_##fld - COPY(pcount); - COPY(data); -#undef COPY + ifmd.ifmd_pcount = ifp->if_pcount; + if_data_copy(ifp, &ifmd.ifmd_data); + ifmd.ifmd_flags = ifp->if_flags | ifp->if_drv_flags; ifmd.ifmd_snd_len = ifp->if_snd.ifq_len; ifmd.ifmd_snd_maxlen = ifp->if_snd.ifq_maxlen; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Aug 31 06:30:50 2014 (r270869) +++ head/sys/net/if_var.h Sun Aug 31 06:46:21 2014 (r270870) @@ -94,11 +94,27 @@ VNET_DECLARE(struct pfil_head, link_pfil #define V_link_pfil_hook VNET(link_pfil_hook) #endif /* _KERNEL */ +typedef enum { + IFCOUNTER_IPACKETS = 1, + IFCOUNTER_IERRORS, + IFCOUNTER_OPACKETS, + IFCOUNTER_OERRORS, + IFCOUNTER_COLLISIONS, + IFCOUNTER_IBYTES, + IFCOUNTER_OBYTES, + IFCOUNTER_IMCASTS, + IFCOUNTER_OMCASTS, + IFCOUNTER_IQDROPS, + IFCOUNTER_OQDROPS, + IFCOUNTER_NOPROTO, +} ifnet_counter; + typedef void (*if_start_fn_t)(struct ifnet *); typedef int (*if_ioctl_fn_t)(struct ifnet *, u_long, caddr_t); typedef void (*if_init_fn_t)(void *); typedef void (*if_qflush_fn_t)(struct ifnet *); typedef int (*if_transmit_fn_t)(struct ifnet *, struct mbuf *); +typedef uint64_t (*if_get_counter_t)(struct ifnet *, ifnet_counter); /* Opaque object pointing to interface structure (ifnet) */ typedef void *if_t; @@ -136,8 +152,21 @@ struct ifnet { size_t if_linkmiblen; /* length of above data */ int if_drv_flags; /* driver-managed status flags */ u_int if_refcount; /* reference count */ + + /* These fields are shared with struct if_data. */ + uint8_t if_type; /* ethernet, tokenring, etc */ + uint8_t if_addrlen; /* media address length */ + uint8_t if_hdrlen; /* media header length */ + uint8_t if_link_state; /* current link state */ + uint32_t if_spare32; + uint32_t if_mtu; /* maximum transmission unit */ + uint32_t if_metric; /* routing metric (external only) */ + uint64_t if_baudrate; /* linespeed */ + uint64_t if_hwassist; /* HW offload capabilities, see IFCAP */ + time_t if_epoch; /* uptime at attach or stat reset */ + struct timeval if_lastchange; /* time of last administrative change */ + struct ifaltq if_snd; /* output queue (includes altq) */ - struct if_data if_data; /* type information and statistics */ struct task if_linktask; /* task for link change events */ /* Addresses of different protocol families assigned to this if. */ @@ -190,6 +219,7 @@ struct ifnet { void (*if_reassign) /* reassign to vnet routine */ (struct ifnet *, struct vnet *, char *); + if_get_counter_t if_get_counter; /* get counter values */ /* Stuff that's only temporary and doesn't belong here. */ u_int if_hw_tsomax; /* tso burst length limit, the minimum @@ -197,45 +227,31 @@ struct ifnet { * XXXAO: Have to find a better place * for it eventually. */ /* - * Spare fields are added so that we can modify sensitive data - * structures without changing the kernel binary interface, and must - * be used with care where binary compatibility is required. + * Old, racy and expensive statistics, should not be used in + * new drivers. + */ + uint64_t if_ipackets; /* packets received on interface */ + uint64_t if_ierrors; /* input errors on interface */ + uint64_t if_opackets; /* packets sent on interface */ + uint64_t if_oerrors; /* output errors on interface */ + uint64_t if_collisions; /* collisions on csma interfaces */ + uint64_t if_ibytes; /* total number of octets received */ + uint64_t if_obytes; /* total number of octets sent */ + uint64_t if_imcasts; /* packets received via multicast */ + uint64_t if_omcasts; /* packets sent via multicast */ + uint64_t if_iqdrops; /* dropped on input */ + uint64_t if_oqdrops; /* dropped on output */ + uint64_t if_noproto; /* destined for unsupported protocol */ + + /* + * Spare fields to be added before branching a stable branch, so + * that structure can be enhanced without changing the kernel + * binary interface. */ - char if_cspare[3]; - int if_ispare[4]; - void *if_unused[2]; - void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; #include /* XXXAO: temporary unconditional include */ -/* - * XXX These aliases are terribly dangerous because they could apply - * to anything. - */ -#define if_mtu if_data.ifi_mtu -#define if_type if_data.ifi_type -#define if_physical if_data.ifi_physical -#define if_addrlen if_data.ifi_addrlen -#define if_hdrlen if_data.ifi_hdrlen -#define if_metric if_data.ifi_metric -#define if_link_state if_data.ifi_link_state -#define if_baudrate if_data.ifi_baudrate -#define if_hwassist if_data.ifi_hwassist -#define if_ipackets if_data.ifi_ipackets -#define if_ierrors if_data.ifi_ierrors -#define if_opackets if_data.ifi_opackets -#define if_oerrors if_data.ifi_oerrors -#define if_collisions if_data.ifi_collisions -#define if_ibytes if_data.ifi_ibytes -#define if_obytes if_data.ifi_obytes -#define if_imcasts if_data.ifi_imcasts -#define if_omcasts if_data.ifi_omcasts -#define if_iqdrops if_data.ifi_iqdrops -#define if_oqdrops if_data.ifi_oqdrops -#define if_noproto if_data.ifi_noproto -#define if_lastchange if_data.ifi_lastchange - /* for compatibility with other BSDs */ #define if_addrlist if_addrhead #define if_list if_link @@ -513,6 +529,8 @@ typedef void *if_com_alloc_t(u_char type typedef void if_com_free_t(void *com, u_char type); void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); void if_deregister_com_alloc(u_char type); +void if_data_copy(struct ifnet *, struct if_data *); +uint64_t if_get_counter_compat(struct ifnet *, ifnet_counter); #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Aug 31 06:30:50 2014 (r270869) +++ head/sys/net/rtsock.c Sun Aug 31 06:46:21 2014 (r270870) @@ -1252,7 +1252,7 @@ rt_ifmsg(struct ifnet *ifp) ifm = mtod(m, struct if_msghdr *); ifm->ifm_index = ifp->if_index; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; - ifm->ifm_data = ifp->if_data; + if_data_copy(ifp, &ifm->ifm_data); ifm->ifm_addrs = 0; rt_dispatch(m, AF_UNSPEC); } @@ -1574,7 +1574,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, st ifd = &ifm->ifm_data; } - *ifd = ifp->if_data; + if_data_copy(ifp, ifd); /* Some drivers still use ifqueue(9), add its stats. */ ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; @@ -1609,7 +1609,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, str ifd = &ifm->ifm_data; } - *ifd = ifp->if_data; + if_data_copy(ifp, ifd); /* Some drivers still use ifqueue(9), add its stats. */ ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 08:20:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D261E444; Sun, 31 Aug 2014 08:20:22 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54ED71870; Sun, 31 Aug 2014 08:20:22 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XNwOv-000NN1-VE; Sun, 31 Aug 2014 08:06:02 +0400 Message-ID: <5402DAB7.2040806@FreeBSD.org> Date: Sun, 31 Aug 2014 12:20:07 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r270870 - head/sys/net References: <201408310646.s7V6kM1X050678@svn.freebsd.org> In-Reply-To: <201408310646.s7V6kM1X050678@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 08:20:22 -0000 On 31.08.2014 10:46, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Aug 31 06:46:21 2014 > New Revision: 270870 > URL: http://svnweb.freebsd.org/changeset/base/270870 > > Log: > o Remove struct if_data from struct ifnet. Now it is merely API structure > for route(4) socket and ifmib(4) sysctl. > o Move fields from if_data to ifnet, but keep all statistic counters > separate, since they should disappear later. > o Provide function if_data_copy() to fill if_data, utilize it in routing > socket and ifmib handler. > o Provide overridable ifnet(9) method to fetch counters. If no provided, > if_get_counters_compat() would be used, that returns old counters. Thanks! > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/net/if.c > head/sys/net/if_mib.c > head/sys/net/if_var.h > head/sys/net/rtsock.c > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Sun Aug 31 06:30:50 2014 (r270869) > +++ head/sys/net/if.c Sun Aug 31 06:46:21 2014 (r270870) > @@ -605,8 +605,7 @@ if_attach_internal(struct ifnet *ifp, in > if_addgroup(ifp, IFG_ALL); > > getmicrotime(&ifp->if_lastchange); > - ifp->if_data.ifi_epoch = time_uptime; > - ifp->if_data.ifi_datalen = sizeof(struct if_data); > + ifp->if_epoch = time_uptime; > > KASSERT((ifp->if_transmit == NULL && ifp->if_qflush == NULL) || > (ifp->if_transmit != NULL && ifp->if_qflush != NULL), > @@ -615,7 +614,10 @@ if_attach_internal(struct ifnet *ifp, in > ifp->if_transmit = if_transmit; > ifp->if_qflush = if_qflush; > } > - > + > + if (ifp->if_get_counter == NULL) > + ifp->if_get_counter = if_get_counter_compat; > + > if (!vmove) { > #ifdef MAC > mac_ifnet_create(ifp); > @@ -1384,6 +1386,77 @@ if_rtdel(struct radix_node *rn, void *ar > } > > /* > + * Return counter values from old racy non-pcpu counters. > + */ > +uint64_t > +if_get_counter_compat(struct ifnet *ifp, ifnet_counter cnt) > +{ > + > + switch (cnt) { > + case IFCOUNTER_IPACKETS: > + return (ifp->if_ipackets); > + case IFCOUNTER_IERRORS: > + return (ifp->if_ierrors); > + case IFCOUNTER_OPACKETS: > + return (ifp->if_opackets); > + case IFCOUNTER_OERRORS: > + return (ifp->if_oerrors); > + case IFCOUNTER_COLLISIONS: > + return (ifp->if_collisions); > + case IFCOUNTER_IBYTES: > + return (ifp->if_ibytes); > + case IFCOUNTER_OBYTES: > + return (ifp->if_obytes); > + case IFCOUNTER_IMCASTS: > + return (ifp->if_imcasts); > + case IFCOUNTER_OMCASTS: > + return (ifp->if_omcasts); > + case IFCOUNTER_IQDROPS: > + return (ifp->if_iqdrops); > + case IFCOUNTER_OQDROPS: > + return (ifp->if_oqdrops); > + case IFCOUNTER_NOPROTO: > + return (ifp->if_noproto); > + } > + panic("%s: unknown counter %d", __func__, cnt); > +} > + > +/* > + * Copy data from ifnet to userland API structure if_data. > + */ > +void > +if_data_copy(struct ifnet *ifp, struct if_data *ifd) > +{ > + > + ifd->ifi_type = ifp->if_type; > + ifd->ifi_physical = 0; > + ifd->ifi_addrlen = ifp->if_addrlen; > + ifd->ifi_hdrlen = ifp->if_hdrlen; > + ifd->ifi_link_state = ifp->if_link_state; > + ifd->ifi_vhid = 0; > + ifd->ifi_datalen = sizeof(struct if_data); > + ifd->ifi_mtu = ifp->if_mtu; > + ifd->ifi_metric = ifp->if_metric; > + ifd->ifi_baudrate = ifp->if_baudrate; > + ifd->ifi_hwassist = ifp->if_hwassist; > + ifd->ifi_epoch = ifp->if_epoch; > + ifd->ifi_lastchange = ifp->if_lastchange; > + > + ifd->ifi_ipackets = ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS); > + ifd->ifi_ierrors = ifp->if_get_counter(ifp, IFCOUNTER_IERRORS); > + ifd->ifi_opackets = ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS); > + ifd->ifi_oerrors = ifp->if_get_counter(ifp, IFCOUNTER_OERRORS); > + ifd->ifi_collisions = ifp->if_get_counter(ifp, IFCOUNTER_COLLISIONS); > + ifd->ifi_ibytes = ifp->if_get_counter(ifp, IFCOUNTER_IBYTES); > + ifd->ifi_obytes = ifp->if_get_counter(ifp, IFCOUNTER_OBYTES); > + ifd->ifi_imcasts = ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS); > + ifd->ifi_omcasts = ifp->if_get_counter(ifp, IFCOUNTER_OMCASTS); > + ifd->ifi_iqdrops = ifp->if_get_counter(ifp, IFCOUNTER_IQDROPS); > + ifd->ifi_oqdrops = ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS); > + ifd->ifi_noproto = ifp->if_get_counter(ifp, IFCOUNTER_NOPROTO); > +} > + > +/* > * Wrapper functions for struct ifnet address list locking macros. These are > * used by kernel modules to avoid encoding programming interface or binary > * interface assumptions that may be violated when kernel-internal locking > @@ -2167,7 +2240,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > break; > > case SIOCGIFPHYS: > - ifr->ifr_phys = ifp->if_physical; > + /* XXXGL: did this ever worked? */ > + ifr->ifr_phys = 0; > break; > > case SIOCGIFDESCR: > @@ -3915,7 +3989,7 @@ if_sendq_prepend(if_t ifp, struct mbuf * > int > if_setifheaderlen(if_t ifp, int len) > { > - ((struct ifnet *)ifp)->if_data.ifi_hdrlen = len; > + ((struct ifnet *)ifp)->if_hdrlen = len; > return (0); > } > > > Modified: head/sys/net/if_mib.c > ============================================================================== > --- head/sys/net/if_mib.c Sun Aug 31 06:30:50 2014 (r270869) > +++ head/sys/net/if_mib.c Sun Aug 31 06:46:21 2014 (r270870) > @@ -99,10 +99,9 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX > bzero(&ifmd, sizeof(ifmd)); > strlcpy(ifmd.ifmd_name, ifp->if_xname, sizeof(ifmd.ifmd_name)); > > -#define COPY(fld) ifmd.ifmd_##fld = ifp->if_##fld > - COPY(pcount); > - COPY(data); > -#undef COPY > + ifmd.ifmd_pcount = ifp->if_pcount; > + if_data_copy(ifp, &ifmd.ifmd_data); > + > ifmd.ifmd_flags = ifp->if_flags | ifp->if_drv_flags; > ifmd.ifmd_snd_len = ifp->if_snd.ifq_len; > ifmd.ifmd_snd_maxlen = ifp->if_snd.ifq_maxlen; > > Modified: head/sys/net/if_var.h > ============================================================================== > --- head/sys/net/if_var.h Sun Aug 31 06:30:50 2014 (r270869) > +++ head/sys/net/if_var.h Sun Aug 31 06:46:21 2014 (r270870) > @@ -94,11 +94,27 @@ VNET_DECLARE(struct pfil_head, link_pfil > #define V_link_pfil_hook VNET(link_pfil_hook) > #endif /* _KERNEL */ > > +typedef enum { > + IFCOUNTER_IPACKETS = 1, > + IFCOUNTER_IERRORS, > + IFCOUNTER_OPACKETS, > + IFCOUNTER_OERRORS, > + IFCOUNTER_COLLISIONS, > + IFCOUNTER_IBYTES, > + IFCOUNTER_OBYTES, > + IFCOUNTER_IMCASTS, > + IFCOUNTER_OMCASTS, > + IFCOUNTER_IQDROPS, > + IFCOUNTER_OQDROPS, > + IFCOUNTER_NOPROTO, > +} ifnet_counter; > + > typedef void (*if_start_fn_t)(struct ifnet *); > typedef int (*if_ioctl_fn_t)(struct ifnet *, u_long, caddr_t); > typedef void (*if_init_fn_t)(void *); > typedef void (*if_qflush_fn_t)(struct ifnet *); > typedef int (*if_transmit_fn_t)(struct ifnet *, struct mbuf *); > +typedef uint64_t (*if_get_counter_t)(struct ifnet *, ifnet_counter); > > /* Opaque object pointing to interface structure (ifnet) */ > typedef void *if_t; > @@ -136,8 +152,21 @@ struct ifnet { > size_t if_linkmiblen; /* length of above data */ > int if_drv_flags; /* driver-managed status flags */ > u_int if_refcount; /* reference count */ > + > + /* These fields are shared with struct if_data. */ > + uint8_t if_type; /* ethernet, tokenring, etc */ > + uint8_t if_addrlen; /* media address length */ > + uint8_t if_hdrlen; /* media header length */ > + uint8_t if_link_state; /* current link state */ > + uint32_t if_spare32; > + uint32_t if_mtu; /* maximum transmission unit */ > + uint32_t if_metric; /* routing metric (external only) */ > + uint64_t if_baudrate; /* linespeed */ > + uint64_t if_hwassist; /* HW offload capabilities, see IFCAP */ > + time_t if_epoch; /* uptime at attach or stat reset */ > + struct timeval if_lastchange; /* time of last administrative change */ > + > struct ifaltq if_snd; /* output queue (includes altq) */ > - struct if_data if_data; /* type information and statistics */ > struct task if_linktask; /* task for link change events */ > > /* Addresses of different protocol families assigned to this if. */ > @@ -190,6 +219,7 @@ struct ifnet { > > void (*if_reassign) /* reassign to vnet routine */ > (struct ifnet *, struct vnet *, char *); > + if_get_counter_t if_get_counter; /* get counter values */ > > /* Stuff that's only temporary and doesn't belong here. */ > u_int if_hw_tsomax; /* tso burst length limit, the minimum > @@ -197,45 +227,31 @@ struct ifnet { > * XXXAO: Have to find a better place > * for it eventually. */ > /* > - * Spare fields are added so that we can modify sensitive data > - * structures without changing the kernel binary interface, and must > - * be used with care where binary compatibility is required. > + * Old, racy and expensive statistics, should not be used in > + * new drivers. > + */ > + uint64_t if_ipackets; /* packets received on interface */ > + uint64_t if_ierrors; /* input errors on interface */ > + uint64_t if_opackets; /* packets sent on interface */ > + uint64_t if_oerrors; /* output errors on interface */ > + uint64_t if_collisions; /* collisions on csma interfaces */ > + uint64_t if_ibytes; /* total number of octets received */ > + uint64_t if_obytes; /* total number of octets sent */ > + uint64_t if_imcasts; /* packets received via multicast */ > + uint64_t if_omcasts; /* packets sent via multicast */ > + uint64_t if_iqdrops; /* dropped on input */ > + uint64_t if_oqdrops; /* dropped on output */ > + uint64_t if_noproto; /* destined for unsupported protocol */ > + > + /* > + * Spare fields to be added before branching a stable branch, so > + * that structure can be enhanced without changing the kernel > + * binary interface. > */ > - char if_cspare[3]; > - int if_ispare[4]; > - void *if_unused[2]; > - void *if_pspare[8]; /* 1 netmap, 7 TDB */ > }; > > #include /* XXXAO: temporary unconditional include */ > > -/* > - * XXX These aliases are terribly dangerous because they could apply > - * to anything. > - */ > -#define if_mtu if_data.ifi_mtu > -#define if_type if_data.ifi_type > -#define if_physical if_data.ifi_physical > -#define if_addrlen if_data.ifi_addrlen > -#define if_hdrlen if_data.ifi_hdrlen > -#define if_metric if_data.ifi_metric > -#define if_link_state if_data.ifi_link_state > -#define if_baudrate if_data.ifi_baudrate > -#define if_hwassist if_data.ifi_hwassist > -#define if_ipackets if_data.ifi_ipackets > -#define if_ierrors if_data.ifi_ierrors > -#define if_opackets if_data.ifi_opackets > -#define if_oerrors if_data.ifi_oerrors > -#define if_collisions if_data.ifi_collisions > -#define if_ibytes if_data.ifi_ibytes > -#define if_obytes if_data.ifi_obytes > -#define if_imcasts if_data.ifi_imcasts > -#define if_omcasts if_data.ifi_omcasts > -#define if_iqdrops if_data.ifi_iqdrops > -#define if_oqdrops if_data.ifi_oqdrops > -#define if_noproto if_data.ifi_noproto > -#define if_lastchange if_data.ifi_lastchange > - > /* for compatibility with other BSDs */ > #define if_addrlist if_addrhead > #define if_list if_link > @@ -513,6 +529,8 @@ typedef void *if_com_alloc_t(u_char type > typedef void if_com_free_t(void *com, u_char type); > void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); > void if_deregister_com_alloc(u_char type); > +void if_data_copy(struct ifnet *, struct if_data *); > +uint64_t if_get_counter_compat(struct ifnet *, ifnet_counter); > > #define IF_LLADDR(ifp) \ > LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) > > Modified: head/sys/net/rtsock.c > ============================================================================== > --- head/sys/net/rtsock.c Sun Aug 31 06:30:50 2014 (r270869) > +++ head/sys/net/rtsock.c Sun Aug 31 06:46:21 2014 (r270870) > @@ -1252,7 +1252,7 @@ rt_ifmsg(struct ifnet *ifp) > ifm = mtod(m, struct if_msghdr *); > ifm->ifm_index = ifp->if_index; > ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; > - ifm->ifm_data = ifp->if_data; > + if_data_copy(ifp, &ifm->ifm_data); > ifm->ifm_addrs = 0; > rt_dispatch(m, AF_UNSPEC); > } > @@ -1574,7 +1574,7 @@ sysctl_iflist_ifml(struct ifnet *ifp, st > ifd = &ifm->ifm_data; > } > > - *ifd = ifp->if_data; > + if_data_copy(ifp, ifd); > > /* Some drivers still use ifqueue(9), add its stats. */ > ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; > @@ -1609,7 +1609,7 @@ sysctl_iflist_ifm(struct ifnet *ifp, str > ifd = &ifm->ifm_data; > } > > - *ifd = ifp->if_data; > + if_data_copy(ifp, ifd); > > /* Some drivers still use ifqueue(9), add its stats. */ > ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; > > From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 08:57:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06779EB; Sun, 31 Aug 2014 08:57:42 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 59A0D1BAE; Sun, 31 Aug 2014 08:57:42 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AF4E725D3A81; Sun, 31 Aug 2014 08:57:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 93BCCC770B1; Sun, 31 Aug 2014 08:57:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id jVcNHggtntel; Sun, 31 Aug 2014 08:57:36 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f] (unknown [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1ABA8C770B0; Sun, 31 Aug 2014 08:57:34 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs From: "Bjoern A. Zeeb" In-Reply-To: <201408302144.s7ULiWsX028875@svn.freebsd.org> Date: Sun, 31 Aug 2014 08:57:17 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408302144.s7ULiWsX028875@svn.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 08:57:42 -0000 On 30 Aug 2014, at 21:44 , Steven Hartland wrote: > Author: smh > Date: Sat Aug 30 21:44:32 2014 > New Revision: 270861 > URL: http://svnweb.freebsd.org/changeset/base/270861 >=20 > Log: > Ensure that ZFS ARC free memory checks include cached pages >=20 > Also restore kmem_used() check for i386 as it has KVA limits that the = raw > page counts above don=92t consider I see this on pc98 and i386 buildworld: =3D=3D=3D> cddl/usr.bin/zinject (all) = /storage/head/obj//pc98.i386/scratch/tmp/bz/head.svn/tmp/usr/lib/libzpool.= so: undefined reference to `kmem_used' cc: error: linker command failed with exit code 1 (use -v to see = invocation) --- zinject --- *** [zinject] Error code 1 >=20 > PR: 187594 > Reviewed by: peter > X-MFC-With: r270759 > Review: D700 > Sponsored by: Multiplay >=20 > Modified: > head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > head/sys/cddl/compat/opensolaris/sys/kmem.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >=20 > Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug = 30 20:26:30 2014 (r270860) > +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug = 30 21:44:32 2014 (r270861) > @@ -152,7 +152,7 @@ u_int > kmem_free_count(void) > { >=20 > - return (vm_cnt.v_free_count); > + return (vm_cnt.v_free_count + vm_cnt.v_cache_count); > } >=20 > u_int > @@ -169,6 +169,13 @@ kmem_size(void) > return (kmem_size_val); > } >=20 > +uint64_t > +kmem_used(void) > +{ > + > + return (vmem_size(kmem_arena, VMEM_ALLOC)); > +} > + > static int > kmem_std_constructor(void *mem, int size __unused, void *private, int = flags) > { >=20 > Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 = 20:26:30 2014 (r270860) > +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 = 21:44:32 2014 (r270861) > @@ -66,6 +66,7 @@ typedef struct kmem_cache { > void *zfs_kmem_alloc(size_t size, int kmflags); > void zfs_kmem_free(void *buf, size_t size); > uint64_t kmem_size(void); > +uint64_t kmem_used(void); > u_int kmem_page_count(void); >=20 > /* >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug = 30 20:26:30 2014 (r270860) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug = 30 21:44:32 2014 (r270861) > @@ -2563,6 +2563,14 @@ arc_reclaim_needed(void) > #endif /* sun */ >=20 > #else > +#ifdef __i386__ > + /* i386 has KVA limits that the raw page counts above don't = consider */ > + if (kmem_used() > (kmem_size() * 3) / 4) { > + DTRACE_PROBE2(arc__reclaim_used, uint64_t, > + kmem_used(), uint64_t, (kmem_size() * 3) / 4); > + return (1); > + } > +#endif > if (spa_get_random(100) =3D=3D 0) > return (1); > #endif >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 08:58:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A04FB38; Sun, 31 Aug 2014 08:58:55 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C55D51BB6; Sun, 31 Aug 2014 08:58:54 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B6CDE25D3A81; Sun, 31 Aug 2014 08:58:52 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 31A87C770B2; Sun, 31 Aug 2014 08:58:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ZuaHPaBPiFbI; Sun, 31 Aug 2014 08:58:50 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f] (unknown [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 47950C770B1; Sun, 31 Aug 2014 08:58:48 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270862 - head/sys/arm/arm From: "Bjoern A. Zeeb" In-Reply-To: <201408302221.s7UMLvMS003791@svn.freebsd.org> Date: Sun, 31 Aug 2014 08:58:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408302221.s7UMLvMS003791@svn.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 08:58:55 -0000 On 30 Aug 2014, at 22:21 , Ian Lepore wrote: > Author: ian > Date: Sat Aug 30 22:21:57 2014 > New Revision: 270862 > URL: http://svnweb.freebsd.org/changeset/base/270862 >=20 > Log: > Fix the handling of MMU type in the AP entry code. The ARM_MMU_V6/V7 > symbols are always #defined to 0 or 1, so use #if SYM not #if = defined(SYM). > Also, it helps if you include the header file that defines the = symbols. I can only assume it=92s been due to this commit: 22 warnings generated. linking kernel.debug locore.o: In function `mpentry': (.text+0x1ec): undefined reference to `armv6_idcache_inv_all' --- kernel.debug --- *** [kernel.debug] Error code 1 bmake: stopped in = /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/sys/ARMADAXP >=20 > Modified: > head/sys/arm/arm/locore.S >=20 > Modified: head/sys/arm/arm/locore.S > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/arm/locore.S Sat Aug 30 21:44:32 2014 = (r270861) > +++ head/sys/arm/arm/locore.S Sat Aug 30 22:21:57 2014 = (r270862) > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > #include >=20 > __FBSDID("$FreeBSD$"); > @@ -389,9 +390,9 @@ ASENTRY_NP(mpentry) > nop > CPWAIT(r0) >=20 > -#if defined(ARM_MMU_V6) > +#if ARM_MMU_V6 > bl armv6_idcache_inv_all /* Modifies r0 only */ > -#elif defined(ARM_MMU_V7) > +#elif ARM_MMU_V7 > bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ > #endif >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 09:05:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED62BEBB; Sun, 31 Aug 2014 09:05:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8B7D1C6E; Sun, 31 Aug 2014 09:05:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7V952DK014874; Sun, 31 Aug 2014 09:05:02 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7V952t6014873; Sun, 31 Aug 2014 09:05:02 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201408310905.s7V952t6014873@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sun, 31 Aug 2014 09:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270871 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 09:05:03 -0000 Author: peter Date: Sun Aug 31 09:05:02 2014 New Revision: 270871 URL: http://svnweb.freebsd.org/changeset/base/270871 Log: Move the restored #ifdef i386 test back inside the #ifdef _KERNEL block where it originally was. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 31 06:46:21 2014 (r270870) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 31 09:05:02 2014 (r270871) @@ -2560,9 +2560,7 @@ arc_reclaim_needed(void) (btop(vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)) >> 2)) return (1); #endif -#endif /* sun */ - -#else +#else /* sun */ #ifdef __i386__ /* i386 has KVA limits that the raw page counts above don't consider */ if (kmem_used() > (kmem_size() * 3) / 4) { @@ -2571,6 +2569,9 @@ arc_reclaim_needed(void) return (1); } #endif +#endif /* sun */ + +#else if (spa_get_random(100) == 0) return (1); #endif From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 09:07:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FFEDD6; Sun, 31 Aug 2014 09:07:16 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EB73D1C93; Sun, 31 Aug 2014 09:07:15 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 4E619521; Sun, 31 Aug 2014 02:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1409476034; bh=vcddLm3N1xLXn92AxxTzB0emzPKYsTBtI4AsPmD0Z0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y0IjcXMpyAQXB84HGH77/WVC1fcgrhVk5OegURy/77YZZP8WeE9I2isYx+qK5wWxF bA15rtq6qoWzCJRSEJVA5BIhH4plQvtxE2LTPQAj/sC8x5WYC9tcXycKehyi3U65Z6 wLgw7cKpZwJUxHNePfP41uRqnsq8xiSYZJYOoxWE= From: Peter Wemm To: "Bjoern A. Zeeb" Subject: Re: svn commit: r270861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs Date: Sun, 31 Aug 2014 02:07:04 -0700 Message-ID: <4971681.t0HSrHEhdJ@overcee.wemm.org> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: References: <201408302144.s7ULiWsX028875@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11904951.nD4llmVSAe"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 09:07:16 -0000 --nextPart11904951.nD4llmVSAe Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Sunday 31 August 2014 08:57:17 Bjoern A. Zeeb wrote: > On 30 Aug 2014, at 21:44 , Steven Hartland wrote: > > Author: smh > > Date: Sat Aug 30 21:44:32 2014 > > New Revision: 270861 > > URL: http://svnweb.freebsd.org/changeset/base/270861 > >=20 > > Log: > > Ensure that ZFS ARC free memory checks include cached pages > > =20 > > Also restore kmem_used() check for i386 as it has KVA limits that = the raw > > page counts above don=E2=80=99t consider >=20 > I see this on pc98 and i386 buildworld: >=20 > =3D=3D=3D> cddl/usr.bin/zinject (all) > /storage/head/obj//pc98.i386/scratch/tmp/bz/head.svn/tmp/usr/lib/libz= pool.so > : undefined reference to `kmem_used' cc: error: linker command failed= with > exit code 1 (use -v to see invocation) --- zinject --- > *** [zinject] Error code 1 Argh. The #ifdef was placed into the userland section of the file. I = just=20 moved it. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart11904951.nD4llmVSAe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJUAuXBAAoJEDXWlwnsgJ4E93kH+QEJBxGj8KUg4KRlDMLYv5tL TX9i7JIYIT7QKNsUzaYnJ1dutAn5iX+CJYlHcqeULWGREwheqAjiet7m549HiD+D DyzlBqaPv9/eTlVIgiPYfUk53WDIualawDNqJcskwNnZB3GTGq+zo61tdaj9zain EE2GQc+Exm1yITXwOnUUbwlZqSyoE//z1uQwlauqO+AOs7HoX1JDa7Vxzqv94lby 8Q7Jex1Y+4U8vkIcXVB8tBEEouUfcs1TL1CUv7HKKtPmcAAzAlAQcDH/3Nn0Ycbo 8n5+SjHVgSFSM1ESmk7uIOTiQBZT36lmvRXNlaOZNYlZ9X3FH03h8vixmnymFZw= =83jU -----END PGP SIGNATURE----- --nextPart11904951.nD4llmVSAe-- From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 10:28:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B75794D1; Sun, 31 Aug 2014 10:28:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34281472; Sun, 31 Aug 2014 10:28:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VASVPU052386; Sun, 31 Aug 2014 10:28:31 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VASVsX052385; Sun, 31 Aug 2014 10:28:31 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201408311028.s7VASVsX052385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Sun, 31 Aug 2014 10:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270872 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 10:28:31 -0000 Author: gavin Date: Sun Aug 31 10:28:31 2014 New Revision: 270872 URL: http://svnweb.freebsd.org/changeset/base/270872 Log: Fix character case in examples for "camcontrol security" - should be "-U user" not "-u user". PR: 193179 Submitted by: milios ccsys com MFC after: 3 days Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Sun Aug 31 09:05:02 2014 (r270871) +++ head/sbin/camcontrol/camcontrol.8 Sun Aug 31 10:28:31 2014 (r270872) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2013 +.Dd August 31, 2014 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1884,12 +1884,12 @@ camcontrol security ada0 .Pp Report security support and settings for ada0 .Bd -literal -offset indent -camcontrol security ada0 -u user -s MyPass +camcontrol security ada0 -U user -s MyPass .Ed .Pp Enable security on device ada0 with the password MyPass .Bd -literal -offset indent -camcontrol security ada0 -u user -e MyPass +camcontrol security ada0 -U user -e MyPass .Ed .Pp Secure erase ada0 which has had security enabled with user password MyPass From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 11:07:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A067690; Sun, 31 Aug 2014 11:07:17 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 817351955; Sun, 31 Aug 2014 11:07:17 +0000 (UTC) Received: from bender.lan (97e07ab1.skybroadband.com [151.224.122.177]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 6DF235DEBC; Sun, 31 Aug 2014 11:07:15 +0000 (UTC) Date: Sun, 31 Aug 2014 12:07:07 +0100 From: Andrew Turner To: Michael Tuexen Subject: Re: svn commit: r270858 - head/sys/arm/conf Message-ID: <20140831120707.0b049e07@bender.lan> In-Reply-To: <201408302000.s7UK0IhC024462@svn.freebsd.org> References: <201408302000.s7UK0IhC024462@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 11:07:17 -0000 On Sat, 30 Aug 2014 20:00:18 +0000 (UTC) Michael Tuexen wrote: > Author: tuexen > Date: Sat Aug 30 20:00:18 2014 > New Revision: 270858 > URL: http://svnweb.freebsd.org/changeset/base/270858 > > Log: > Remove FDT option, since it is in every file, which includes this > one. > It should be the other way around, i.e. in this file and removed from all that include it. FDT is required for armv6 and this is still a valid kernel config. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 11:33:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5336344E; Sun, 31 Aug 2014 11:33:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C72F1BAD; Sun, 31 Aug 2014 11:33:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VBXKmw084885; Sun, 31 Aug 2014 11:33:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VBXJlv084881; Sun, 31 Aug 2014 11:33:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408311133.s7VBXJlv084881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 11:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270874 - in head/sys: dev/netmap net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 11:33:20 -0000 Author: glebius Date: Sun Aug 31 11:33:19 2014 New Revision: 270874 URL: http://svnweb.freebsd.org/changeset/base/270874 Log: Provide pointer from struct ifnet to struct netmap_adapter, instead of abusing spare field. Modified: head/sys/dev/netmap/netmap_kern.h head/sys/net/if_var.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Sun Aug 31 10:42:52 2014 (r270873) +++ head/sys/dev/netmap/netmap_kern.h Sun Aug 31 11:33:19 2014 (r270874) @@ -1187,7 +1187,7 @@ extern int netmap_generic_rings; * WNA is used to write it. */ #ifndef WNA -#define WNA(_ifp) (_ifp)->if_pspare[0] +#define WNA(_ifp) (_ifp)->if_netmap #endif #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Aug 31 10:42:52 2014 (r270873) +++ head/sys/net/if_var.h Sun Aug 31 11:33:19 2014 (r270874) @@ -67,6 +67,7 @@ struct ifvlantrunk; struct route; /* if_output */ struct vnet; struct ifmedia; +struct netmap_adapter; #ifdef _KERNEL #include /* ifqueue only? */ @@ -202,6 +203,7 @@ struct ifnet { void *if_pf_kif; /* pf glue */ struct carp_if *if_carp; /* carp interface structure */ struct label *if_label; /* interface MAC label */ + struct netmap_adapter *if_netmap; /* netmap(4) softc */ /* Various procedures of the layer2 encapsulation and drivers. */ int (*if_output) /* output routine (enqueue) */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 12:48:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 442593B0; Sun, 31 Aug 2014 12:48:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBD7123E; Sun, 31 Aug 2014 12:48:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VCmFXF018776; Sun, 31 Aug 2014 12:48:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VCmEw6018764; Sun, 31 Aug 2014 12:48:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408311248.s7VCmEw6018764@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 12:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270876 - in head/sys: dev/bge dev/bxe dev/e1000 dev/fxp dev/mii dev/nfe net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 12:48:16 -0000 Author: glebius Date: Sun Aug 31 12:48:13 2014 New Revision: 270876 URL: http://svnweb.freebsd.org/changeset/base/270876 Log: It is actually possible to have if_t a typedef to non-void type, and keep both converted to drvapi and non-converted drivers compilable. o Make if_t typedef to struct ifnet *. o Remove shim functions. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bxe/bxe.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c head/sys/dev/fxp/if_fxp.c head/sys/dev/mii/mii.c head/sys/dev/nfe/if_nfe.c head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/bge/if_bge.c Sun Aug 31 12:48:13 2014 (r270876) @@ -3837,7 +3837,7 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED; if (sc->bge_flags & BGE_FLAG_TBI) { - ifmedia_init_drv(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, + ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, bge_ifmedia_sts); ifmedia_add(&sc->bge_ifmedia, IFM_ETHER | IFM_1000_SX, 0, NULL); ifmedia_add(&sc->bge_ifmedia, IFM_ETHER | IFM_1000_SX | IFM_FDX, Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/bxe/bxe.c Sun Aug 31 12:48:13 2014 (r270876) @@ -4934,7 +4934,7 @@ bxe_ioctl(if_t ifp, BLOGD(sc, DBG_IOCTL, "Received SIOCSIFMEDIA/SIOCGIFMEDIA ioctl (cmd=%lu)\n", (command & 0xff)); - error = ifmedia_ioctl_drv(ifp, ifr, &sc->ifmedia, command); + error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; case SIOCGPRIVATE_0: @@ -4970,7 +4970,7 @@ bxe_ioctl(if_t ifp, default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; } @@ -6095,7 +6095,7 @@ bxe_mq_flush(struct ifnet *ifp) } } - if_qflush_drv(ifp); + if_qflush(ifp); } #endif /* FreeBSD_version >= 800000 */ @@ -12254,7 +12254,7 @@ bxe_link_report_locked(struct bxe_softc if (bxe_test_bit(BXE_LINK_REPORT_LINK_DOWN, &cur_data.link_report_flags)) { - if_linkstate_change_drv(sc->ifp, LINK_STATE_DOWN); + if_link_state_change(sc->ifp, LINK_STATE_DOWN); BLOGI(sc, "NIC Link is Down\n"); } else { const char *duplex; @@ -12295,7 +12295,7 @@ bxe_link_report_locked(struct bxe_softc flow = "none"; } - if_linkstate_change_drv(sc->ifp, LINK_STATE_UP); + if_link_state_change(sc->ifp, LINK_STATE_UP); BLOGI(sc, "NIC Link is Up, %d Mbps %s duplex, Flow control: %s\n", cur_data.line_speed, duplex, flow); } @@ -12581,7 +12581,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else - if_addr_rlock_drv(ifp); + if_addr_rlock(ifp); #endif /* first schedule a cleanup up of old configuration */ @@ -12591,7 +12591,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock_drv(ifp); + if_addr_runlock(ifp); #endif return (rc); } @@ -12614,7 +12614,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock_drv(ifp); + if_addr_runlock(ifp); #endif return (rc); } @@ -12625,7 +12625,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock_drv(ifp); + if_addr_runlock(ifp); #endif /* Execute the pending commands */ @@ -13275,7 +13275,7 @@ bxe_init_ifnet(struct bxe_softc *sc) } if_setsoftc(ifp, sc); - if_initname_drv(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); + if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); if_setflags(ifp, (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST)); if_setioctlfn(ifp, bxe_ioctl); if_setstartfn(ifp, bxe_tx_start); @@ -13325,7 +13325,7 @@ bxe_init_ifnet(struct bxe_softc *sc) sc->ifp = ifp; /* attach to the Ethernet interface list */ - ether_ifattach_drv(ifp, sc->link_params.mac_addr); + ether_ifattach(ifp, sc->link_params.mac_addr); return (0); } @@ -16391,7 +16391,7 @@ bxe_attach(device_t dev) /* allocate device interrupts */ if (bxe_interrupt_alloc(sc) != 0) { if (sc->ifp != NULL) { - ether_ifdetach_drv(sc->ifp); + ether_ifdetach(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16404,7 +16404,7 @@ bxe_attach(device_t dev) if (bxe_alloc_ilt_mem(sc) != 0) { bxe_interrupt_free(sc); if (sc->ifp != NULL) { - ether_ifdetach_drv(sc->ifp); + ether_ifdetach(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16418,7 +16418,7 @@ bxe_attach(device_t dev) bxe_free_ilt_mem(sc); bxe_interrupt_free(sc); if (sc->ifp != NULL) { - ether_ifdetach_drv(sc->ifp); + ether_ifdetach(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16508,7 +16508,7 @@ bxe_detach(device_t dev) /* release the network interface */ if (ifp != NULL) { - ether_ifdetach_drv(ifp); + ether_ifdetach(ifp); } ifmedia_removeall(&sc->ifmedia); @@ -16531,7 +16531,7 @@ bxe_detach(device_t dev) /* Release the FreeBSD interface. */ if (sc->ifp != NULL) { - if_free_drv(sc->ifp); + if_free(sc->ifp); } pci_disable_busmaster(dev); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/e1000/if_em.c Sun Aug 31 12:48:13 2014 (r270876) @@ -751,7 +751,7 @@ err_late: em_free_receive_structures(adapter); em_release_hw_control(adapter); if (adapter->ifp != (void *)NULL) - if_free_drv(adapter->ifp); + if_free(adapter->ifp); err_pci: em_free_pci_resources(adapter); free(adapter->mta, M_DEVBUF); @@ -809,7 +809,7 @@ em_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach_drv(adapter->ifp); + ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); #ifdef DEV_NETMAP @@ -818,7 +818,7 @@ em_detach(device_t dev) em_free_pci_resources(adapter); bus_generic_detach(dev); - if_free_drv(ifp); + if_free(ifp); em_free_transmit_structures(adapter); em_free_receive_structures(adapter); @@ -1100,10 +1100,10 @@ em_ioctl(if_t ifp, u_long command, caddr em_init(adapter); #ifdef INET if (!(if_getflags(ifp) & IFF_NOARP)) - arp_ifinit_drv(ifp, ifa); + arp_ifinit(ifp, ifa); #endif } else - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; case SIOCSIFMTU: { @@ -1195,7 +1195,7 @@ em_ioctl(if_t ifp, u_long command, caddr case SIOCGIFMEDIA: IOCTL_DEBUGOUT("ioctl rcv'd: \ SIOCxIFMEDIA (Get/Set Interface Media)"); - error = ifmedia_ioctl_drv(ifp, ifr, &adapter->media, command); + error = ifmedia_ioctl(ifp, ifr, &adapter->media, command); break; case SIOCSIFCAP: { @@ -1258,7 +1258,7 @@ em_ioctl(if_t ifp, u_long command, caddr } default: - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; } @@ -2331,7 +2331,7 @@ em_update_link_status(struct adapter *ad adapter->link_active = 1; adapter->smartspeed = 0; if_setbaudrate(ifp, adapter->link_speed * 1000000); - if_linkstate_change_drv(ifp, LINK_STATE_UP); + if_link_state_change(ifp, LINK_STATE_UP); } else if (!link_check && (adapter->link_active == 1)) { if_setbaudrate(ifp, 0); adapter->link_speed = 0; @@ -2342,7 +2342,7 @@ em_update_link_status(struct adapter *ad /* Link down, disable watchdog */ for (int i = 0; i < adapter->num_queues; i++, txr++) txr->queue_status = EM_QUEUE_IDLE; - if_linkstate_change_drv(ifp, LINK_STATE_DOWN); + if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -2934,7 +2934,7 @@ em_setup_interface(device_t dev, struct device_printf(dev, "can not allocate ifnet structure\n"); return (-1); } - if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setdev(ifp, dev); if_setinitfn(ifp, em_init); if_setsoftc(ifp, adapter); @@ -2950,7 +2950,7 @@ em_setup_interface(device_t dev, struct if_setsendqready(ifp); #endif - ether_ifattach_drv(ifp, adapter->hw.mac.addr); + ether_ifattach(ifp, adapter->hw.mac.addr); if_setcapabilities(ifp, 0); if_setcapenable(ifp, 0); @@ -2991,7 +2991,7 @@ em_setup_interface(device_t dev, struct * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - ifmedia_init_drv(&adapter->media, IFM_IMASK, + ifmedia_init(&adapter->media, IFM_IMASK, em_media_change, em_media_status); if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/e1000/if_lem.c Sun Aug 31 12:48:13 2014 (r270876) @@ -752,7 +752,7 @@ err_csb: err_pci: if (adapter->ifp != (void *)NULL) - if_free_drv(adapter->ifp); + if_free(adapter->ifp); lem_free_pci_resources(adapter); free(adapter->mta, M_DEVBUF); EM_TX_LOCK_DESTROY(adapter); @@ -811,7 +811,7 @@ lem_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach_drv(adapter->ifp); + ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); callout_drain(&adapter->tx_fifo_timer); @@ -820,7 +820,7 @@ lem_detach(device_t dev) #endif /* DEV_NETMAP */ lem_free_pci_resources(adapter); bus_generic_detach(dev); - if_free_drv(ifp); + if_free(ifp); lem_free_transmit_structures(adapter); lem_free_receive_structures(adapter); @@ -1020,10 +1020,10 @@ lem_ioctl(if_t ifp, u_long command, cadd lem_init(adapter); #ifdef INET if (!(if_getflags(ifp) & IFF_NOARP)) - arp_ifinit_drv(ifp, ifa); + arp_ifinit(ifp, ifa); #endif } else - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; case SIOCSIFMTU: { @@ -1106,7 +1106,7 @@ lem_ioctl(if_t ifp, u_long command, cadd case SIOCGIFMEDIA: IOCTL_DEBUGOUT("ioctl rcv'd: \ SIOCxIFMEDIA (Get/Set Interface Media)"); - error = ifmedia_ioctl_drv(ifp, ifr, &adapter->media, command); + error = ifmedia_ioctl(ifp, ifr, &adapter->media, command); break; case SIOCSIFCAP: { @@ -1157,7 +1157,7 @@ lem_ioctl(if_t ifp, u_long command, cadd } default: - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; } @@ -2159,7 +2159,7 @@ lem_update_link_status(struct adapter *a adapter->link_active = 1; adapter->smartspeed = 0; if_setbaudrate(ifp, adapter->link_speed * 1000000); - if_linkstate_change_drv(ifp, LINK_STATE_UP); + if_link_state_change(ifp, LINK_STATE_UP); } else if (!link_check && (adapter->link_active == 1)) { if_setbaudrate(ifp, 0); adapter->link_speed = 0; @@ -2169,7 +2169,7 @@ lem_update_link_status(struct adapter *a adapter->link_active = 0; /* Link down, disable watchdog */ adapter->watchdog_check = FALSE; - if_linkstate_change_drv(ifp, LINK_STATE_DOWN); + if_link_state_change(ifp, LINK_STATE_DOWN); } } @@ -2458,7 +2458,7 @@ lem_setup_interface(device_t dev, struct device_printf(dev, "can not allocate ifnet structure\n"); return (-1); } - if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setinitfn(ifp, lem_init); if_setsoftc(ifp, adapter); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); @@ -2467,7 +2467,7 @@ lem_setup_interface(device_t dev, struct if_setsendqlen(ifp, adapter->num_tx_desc - 1); if_setsendqready(ifp); - ether_ifattach_drv(ifp, adapter->hw.mac.addr); + ether_ifattach(ifp, adapter->hw.mac.addr); if_setcapabilities(ifp, 0); @@ -2507,7 +2507,7 @@ lem_setup_interface(device_t dev, struct * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - ifmedia_init_drv(&adapter->media, IFM_IMASK, + ifmedia_init(&adapter->media, IFM_IMASK, lem_media_change, lem_media_status); if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/fxp/if_fxp.c Sun Aug 31 12:48:13 2014 (r270876) @@ -439,7 +439,7 @@ fxp_attach(device_t dev) mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->stat_ch, &sc->sc_mtx, 0); - ifmedia_init_drv(&sc->sc_media, 0, fxp_serial_ifmedia_upd, + ifmedia_init(&sc->sc_media, 0, fxp_serial_ifmedia_upd, fxp_serial_ifmedia_sts); ifp = sc->ifp = if_gethandle(IFT_ETHER); @@ -837,7 +837,7 @@ fxp_attach(device_t dev) } } - if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setdev(ifp, dev); if_setinitfn(ifp, fxp_init); if_setsoftc(ifp, sc); @@ -873,7 +873,7 @@ fxp_attach(device_t dev) /* * Attach the interface. */ - ether_ifattach_drv(ifp, eaddr); + ether_ifattach(ifp, eaddr); /* * Tell the upper layer(s) we support long frames. @@ -904,7 +904,7 @@ fxp_attach(device_t dev) NULL, fxp_intr, sc, &sc->ih); if (error) { device_printf(dev, "could not setup irq\n"); - ether_ifdetach_drv(sc->ifp); + ether_ifdetach(sc->ifp); goto fail; } @@ -993,7 +993,7 @@ fxp_release(struct fxp_softc *sc) if (sc->mcs_tag) bus_dma_tag_destroy(sc->mcs_tag); if (sc->ifp) - if_free_drv(sc->ifp); + if_free(sc->ifp); mtx_destroy(&sc->sc_mtx); } @@ -1023,7 +1023,7 @@ fxp_detach(device_t dev) /* * Close down routes etc. */ - ether_ifdetach_drv(sc->ifp); + ether_ifdetach(sc->ifp); /* * Unhook interrupt before dropping lock. This is to prevent @@ -2874,10 +2874,10 @@ fxp_ioctl(if_t ifp, u_long command, cadd case SIOCGIFMEDIA: if (sc->miibus != NULL) { mii = device_get_softc(sc->miibus); - error = ifmedia_ioctl_drv(ifp, ifr, + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); } else { - error = ifmedia_ioctl_drv(ifp, ifr, &sc->sc_media, command); + error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, command); } break; @@ -2966,7 +2966,7 @@ fxp_ioctl(if_t ifp, u_long command, cadd break; default: - error = ether_ioctl_drv(ifp, command, data); + error = ether_ioctl(ifp, command, data); } return (error); } Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/mii/mii.c Sun Aug 31 12:48:13 2014 (r270876) @@ -330,7 +330,7 @@ miibus_linkchg(device_t dev) link_state = LINK_STATE_DOWN; } else link_state = LINK_STATE_UNKNOWN; - if_linkstate_change_drv(mii->mii_ifp, link_state); + if_link_state_change(mii->mii_ifp, link_state); } static void @@ -358,7 +358,7 @@ miibus_mediainit(device_t dev) * the PHYs to the network interface driver parent. */ int -mii_attach(device_t dev, device_t *miibus, void *ifp, +mii_attach(device_t dev, device_t *miibus, if_t ifp, ifm_change_cb_t ifmedia_upd, ifm_stat_cb_t ifmedia_sts, int capmask, int phyloc, int offloc, int flags) { Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/dev/nfe/if_nfe.c Sun Aug 31 12:48:13 2014 (r270876) @@ -591,7 +591,7 @@ nfe_attach(device_t dev) nfe_sysctl_node(sc); if_setsoftc(ifp, sc); - if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setioctlfn(ifp, nfe_ioctl); if_setstartfn(ifp, nfe_start); @@ -624,8 +624,8 @@ nfe_attach(device_t dev) /* * Tell the upper layer(s) we support long frames. - * Must appear after the call to ether_ifattach_drv() because - * ether_ifattach_drv() sets ifi_hdrlen to the default value. + * Must appear after the call to ether_ifattach() because + * ether_ifattach() sets ifi_hdrlen to the default value. */ if_setifheaderlen(ifp, sizeof(struct ether_vlan_header)); @@ -649,7 +649,7 @@ nfe_attach(device_t dev) device_printf(dev, "attaching PHYs failed\n"); goto fail; } - ether_ifattach_drv(ifp, sc->eaddr); + ether_ifattach(ifp, sc->eaddr); TASK_INIT(&sc->nfe_int_task, 0, nfe_int_task, sc); sc->nfe_tq = taskqueue_create_fast("nfe_taskq", M_WAITOK, @@ -674,7 +674,7 @@ nfe_attach(device_t dev) device_printf(dev, "couldn't set up irq\n"); taskqueue_free(sc->nfe_tq); sc->nfe_tq = NULL; - ether_ifdetach_drv(ifp); + ether_ifdetach(ifp); goto fail; } @@ -708,7 +708,7 @@ nfe_detach(device_t dev) if_setflagbits(ifp, 0, IFF_UP); NFE_UNLOCK(sc); callout_drain(&sc->nfe_stat_ch); - ether_ifdetach_drv(ifp); + ether_ifdetach(ifp); } if (ifp) { @@ -720,7 +720,7 @@ nfe_detach(device_t dev) } else bcopy(sc->eaddr, eaddr, ETHER_ADDR_LEN); nfe_set_macaddr(sc, eaddr); - if_free_drv(ifp); + if_free(ifp); } if (sc->nfe_miibus) device_delete_child(dev, sc->nfe_miibus); @@ -1775,7 +1775,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t case SIOCSIFMEDIA: case SIOCGIFMEDIA: mii = device_get_softc(sc->nfe_miibus); - error = ifmedia_ioctl_drv(ifp, ifr, &mii->mii_media, cmd); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); break; case SIOCSIFCAP: mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); @@ -1853,7 +1853,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t if_vlancap(ifp); break; default: - error = ether_ioctl_drv(ifp, cmd, data); + error = ether_ioctl(ifp, cmd, data); break; } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/net/if.c Sun Aug 31 12:48:13 2014 (r270876) @@ -3529,9 +3529,8 @@ if_deregister_com_alloc(u_char type) /* API for driver access to network stack owned ifnet.*/ uint64_t -if_setbaudrate(void *arg, uint64_t baudrate) +if_setbaudrate(struct ifnet *ifp, uint64_t baudrate) { - struct ifnet *ifp = arg; uint64_t oldbrate; oldbrate = ifp->if_baudrate; @@ -4035,13 +4034,13 @@ if_setinitfn(if_t ifp, void (*init_fn)(v } void -if_setioctlfn(if_t ifp, int (*ioctl_fn)(void *, u_long, caddr_t)) +if_setioctlfn(if_t ifp, int (*ioctl_fn)(if_t, u_long, caddr_t)) { ((struct ifnet *)ifp)->if_ioctl = (void *)ioctl_fn; } void -if_setstartfn(if_t ifp, void (*start_fn)(void *)) +if_setstartfn(if_t ifp, void (*start_fn)(if_t)) { ((struct ifnet *)ifp)->if_start = (void *)start_fn; } @@ -4058,90 +4057,6 @@ void if_setqflushfn(if_t ifp, if_qflush_ } -/* These wrappers are hopefully temporary, till all drivers use drvapi */ -#ifdef INET -void -arp_ifinit_drv(if_t ifh, struct ifaddr *ifa) -{ - arp_ifinit((struct ifnet *)ifh, ifa); -} -#endif - -void -ether_ifattach_drv(if_t ifh, const u_int8_t *lla) -{ - ether_ifattach((struct ifnet *)ifh, lla); -} - -void -ether_ifdetach_drv(if_t ifh) -{ - ether_ifdetach((struct ifnet *)ifh); -} - -int -ether_ioctl_drv(if_t ifh, u_long cmd, caddr_t data) -{ - struct ifnet *ifp = (struct ifnet *)ifh; - - return (ether_ioctl(ifp, cmd, data)); -} - -int -ifmedia_ioctl_drv(if_t ifh, struct ifreq *ifr, struct ifmedia *ifm, - u_long cmd) -{ - struct ifnet *ifp = (struct ifnet *)ifh; - - return (ifmedia_ioctl(ifp, ifr, ifm, cmd)); -} - -void -if_free_drv(if_t ifh) -{ - if_free((struct ifnet *)ifh); -} - -void -if_initname_drv(if_t ifh, const char *name, int unit) -{ - if_initname((struct ifnet *)ifh, name, unit); -} - -void -if_linkstate_change_drv(if_t ifh, int link_state) -{ - if_link_state_change((struct ifnet *)ifh, link_state); -} - -void -ifmedia_init_drv(struct ifmedia *ifm, int ncmask, int (*chg_cb)(void *), - void (*sts_cb)(void *, struct ifmediareq *)) -{ - ifmedia_init(ifm, ncmask, (ifm_change_cb_t)chg_cb, - (ifm_stat_cb_t)sts_cb); -} - -void -if_addr_rlock_drv(if_t ifh) -{ - - if_addr_runlock((struct ifnet *)ifh); -} - -void -if_addr_runlock_drv(if_t ifh) -{ - if_addr_runlock((struct ifnet *)ifh); -} - -void -if_qflush_drv(if_t ifh) -{ - if_qflush((struct ifnet *)ifh); - -} - /* Revisit these - These are inline functions originally. */ int drbr_inuse_drv(if_t ifh, struct buf_ring *br) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Aug 31 12:21:40 2014 (r270875) +++ head/sys/net/if_var.h Sun Aug 31 12:48:13 2014 (r270876) @@ -110,15 +110,14 @@ typedef enum { IFCOUNTER_NOPROTO, } ifnet_counter; -typedef void (*if_start_fn_t)(struct ifnet *); -typedef int (*if_ioctl_fn_t)(struct ifnet *, u_long, caddr_t); -typedef void (*if_init_fn_t)(void *); -typedef void (*if_qflush_fn_t)(struct ifnet *); -typedef int (*if_transmit_fn_t)(struct ifnet *, struct mbuf *); -typedef uint64_t (*if_get_counter_t)(struct ifnet *, ifnet_counter); +typedef struct ifnet * if_t; -/* Opaque object pointing to interface structure (ifnet) */ -typedef void *if_t; +typedef void (*if_start_fn_t)(if_t); +typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); +typedef void (*if_init_fn_t)(void *); +typedef void (*if_qflush_fn_t)(if_t); +typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); +typedef uint64_t (*if_get_counter_t)(if_t, ifnet_counter); /* * Structure defining a network interface. @@ -585,9 +584,6 @@ int if_multiaddr_count(if_t ifp, int max int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); -/* Shim for drivers using drvapi */ -int ifmedia_ioctl_drv(if_t ifp, struct ifreq *ifr, struct ifmedia *ifm, - u_long cmd); /* Statistics */ @@ -612,29 +608,11 @@ int if_setimcasts(if_t ifp, int pkts); /* Functions */ void if_setinitfn(if_t ifp, void (*)(void *)); -void if_setioctlfn(if_t ifp, int (*)(void *, u_long, caddr_t)); -void if_setstartfn(if_t ifp, void (*)(void *)); +void if_setioctlfn(if_t ifp, int (*)(if_t, u_long, caddr_t)); +void if_setstartfn(if_t ifp, void (*)(if_t)); void if_settransmitfn(if_t ifp, if_transmit_fn_t); void if_setqflushfn(if_t ifp, if_qflush_fn_t); - -/* Shim functions till all drivers use drvapi */ -void arp_ifinit_drv(if_t ifp, struct ifaddr *ifa); -void ether_ifattach_drv(if_t ifp, const u_int8_t *lla); -void ether_ifdetach_drv(if_t ifp); -int ether_ioctl_drv(if_t ifp, u_long cmd, caddr_t data); -void if_free_drv(if_t ifp); -void if_initname_drv(if_t ifp, const char *name, int unit); -void if_linkstate_change_drv(if_t ifp, int link_state); - -struct ifmedia; -void ifmedia_init_drv(struct ifmedia *, int, int (*)(void *), - void (*)(void *, struct ifmediareq *)); - -void if_addr_rlock_drv(if_t ifp); -void if_addr_runlock_drv(if_t ifp); -void if_qflush_drv(if_t ifp); - /* Revisit the below. These are inline functions originally */ int drbr_inuse_drv(if_t ifp, struct buf_ring *br); struct mbuf* drbr_dequeue_drv(if_t ifp, struct buf_ring *br); From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 13:30:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 870872C5; Sun, 31 Aug 2014 13:30:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7270F17FE; Sun, 31 Aug 2014 13:30:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VDUtOP040606; Sun, 31 Aug 2014 13:30:55 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VDUtLH040605; Sun, 31 Aug 2014 13:30:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201408311330.s7VDUtLH040605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 31 Aug 2014 13:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270877 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 13:30:55 -0000 Author: glebius Date: Sun Aug 31 13:30:54 2014 New Revision: 270877 URL: http://svnweb.freebsd.org/changeset/base/270877 Log: Toss fields so that no padding field is required to achieve alignment. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Aug 31 12:48:13 2014 (r270876) +++ head/sys/net/if_var.h Sun Aug 31 13:30:54 2014 (r270877) @@ -146,11 +146,11 @@ struct ifnet { /* Variable fields that are touched by the stack and drivers. */ int if_flags; /* up/down, broadcast, etc. */ + int if_drv_flags; /* driver-managed status flags */ int if_capabilities; /* interface features & capabilities */ int if_capenable; /* enabled features & capabilities */ void *if_linkmib; /* link-type-specific MIB data */ size_t if_linkmiblen; /* length of above data */ - int if_drv_flags; /* driver-managed status flags */ u_int if_refcount; /* reference count */ /* These fields are shared with struct if_data. */ @@ -158,7 +158,6 @@ struct ifnet { uint8_t if_addrlen; /* media address length */ uint8_t if_hdrlen; /* media header length */ uint8_t if_link_state; /* current link state */ - uint32_t if_spare32; uint32_t if_mtu; /* maximum transmission unit */ uint32_t if_metric; /* routing metric (external only) */ uint64_t if_baudrate; /* linespeed */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 13:59:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38BA3E25; Sun, 31 Aug 2014 13:59:19 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DF8CF1A36; Sun, 31 Aug 2014 13:59:18 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C3D7D25D37C3; Sun, 31 Aug 2014 13:59:15 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 88032C770B1; Sun, 31 Aug 2014 13:59:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id yB2HQoJly743; Sun, 31 Aug 2014 13:59:12 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f] (unknown [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1843BC770B0; Sun, 31 Aug 2014 13:59:10 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270877 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201408311330.s7VDUtLH040605@svn.freebsd.org> Date: Sun, 31 Aug 2014 13:58:39 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <1EC00F70-7E6E-448F-AE85-BE87A3C753A1@FreeBSD.org> References: <201408311330.s7VDUtLH040605@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 13:59:19 -0000 On 31 Aug 2014, at 13:30 , Gleb Smirnoff wrote: > Author: glebius > Date: Sun Aug 31 13:30:54 2014 > New Revision: 270877 > URL: http://svnweb.freebsd.org/changeset/base/270877 >=20 > Log: > Toss fields so that no padding field is required to achieve = alignment. >=20 > Modified: > head/sys/net/if_var.h >=20 > Modified: head/sys/net/if_var.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/if_var.h Sun Aug 31 12:48:13 2014 = (r270876) > +++ head/sys/net/if_var.h Sun Aug 31 13:30:54 2014 = (r270877) > @@ -146,11 +146,11 @@ struct ifnet { >=20 > /* Variable fields that are touched by the stack and drivers. */ > int if_flags; /* up/down, broadcast, etc. */ > + int if_drv_flags; /* driver-managed status flags = */ > int if_capabilities; /* interface features & = capabilities */ > int if_capenable; /* enabled features & = capabilities */ > void *if_linkmib; /* link-type-specific MIB data = */ > size_t if_linkmiblen; /* length of above data */ > - int if_drv_flags; /* driver-managed status flags = */ > u_int if_refcount; /* reference count */ >=20 > /* These fields are shared with struct if_data. */ > @@ -158,7 +158,6 @@ struct ifnet { > uint8_t if_addrlen; /* media address length */ > uint8_t if_hdrlen; /* media header length */ > uint8_t if_link_state; /* current link state */ > - uint32_t if_spare32; Doesn=92t this leave a gap on 64bit alignment now again? > uint32_t if_mtu; /* maximum transmission unit */ > uint32_t if_metric; /* routing metric (external = only) */ > uint64_t if_baudrate; /* linespeed */ >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 14:04:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E880DFED; Sun, 31 Aug 2014 14:04:30 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4DB1AEC; Sun, 31 Aug 2014 14:04:30 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 138A325D388C; Sun, 31 Aug 2014 14:04:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 2871BC770B1; Sun, 31 Aug 2014 14:04:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vQ6LRbUSBBIO; Sun, 31 Aug 2014 14:04:25 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f] (unknown [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C1068C770B0; Sun, 31 Aug 2014 14:04:23 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270877 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <1EC00F70-7E6E-448F-AE85-BE87A3C753A1@FreeBSD.org> Date: Sun, 31 Aug 2014 14:03:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408311330.s7VDUtLH040605@svn.freebsd.org> <1EC00F70-7E6E-448F-AE85-BE87A3C753A1@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 14:04:31 -0000 On 31 Aug 2014, at 13:58 , Bjoern A. Zeeb wrote: >=20 > On 31 Aug 2014, at 13:30 , Gleb Smirnoff wrote: >=20 >> Author: glebius >> Date: Sun Aug 31 13:30:54 2014 >> New Revision: 270877 >> URL: http://svnweb.freebsd.org/changeset/base/270877 >>=20 >> Log: >> Toss fields so that no padding field is required to achieve = alignment. >>=20 >> Modified: >> head/sys/net/if_var.h >>=20 >> Modified: head/sys/net/if_var.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/net/if_var.h Sun Aug 31 12:48:13 2014 = (r270876) >> +++ head/sys/net/if_var.h Sun Aug 31 13:30:54 2014 = (r270877) >> @@ -146,11 +146,11 @@ struct ifnet { >>=20 >> /* Variable fields that are touched by the stack and drivers. */ >> int if_flags; /* up/down, broadcast, etc. */ >> + int if_drv_flags; /* driver-managed status flags = */ >> int if_capabilities; /* interface features & = capabilities */ >> int if_capenable; /* enabled features & = capabilities */ >> void *if_linkmib; /* link-type-specific MIB data = */ >> size_t if_linkmiblen; /* length of above data */ >> - int if_drv_flags; /* driver-managed status flags = */ >> u_int if_refcount; /* reference count */ >>=20 >> /* These fields are shared with struct if_data. */ >> @@ -158,7 +158,6 @@ struct ifnet { >> uint8_t if_addrlen; /* media address length */ >> uint8_t if_hdrlen; /* media header length */ >> uint8_t if_link_state; /* current link state */ >> - uint32_t if_spare32; >=20 > Doesn=92t this leave a gap on 64bit alignment now again? Disregard. It=92s fine. >=20 >> uint32_t if_mtu; /* maximum transmission unit */ >> uint32_t if_metric; /* routing metric (external = only) */ >> uint64_t if_baudrate; /* linespeed */ >>=20 >=20 > =97=20 > Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, = 1983 >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 15:23:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 454F38F7; Sun, 31 Aug 2014 15:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3108D12BC; Sun, 31 Aug 2014 15:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VFNo7B098149; Sun, 31 Aug 2014 15:23:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VFNoto098148; Sun, 31 Aug 2014 15:23:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201408311523.s7VFNoto098148@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 31 Aug 2014 15:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270878 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 15:23:50 -0000 Author: ian Date: Sun Aug 31 15:23:49 2014 New Revision: 270878 URL: http://svnweb.freebsd.org/changeset/base/270878 Log: The Marvell PJ4B cpu family is armv7, not armv6. Modified: head/sys/arm/include/cpuconf.h Modified: head/sys/arm/include/cpuconf.h ============================================================================== --- head/sys/arm/include/cpuconf.h Sun Aug 31 13:30:54 2014 (r270877) +++ head/sys/arm/include/cpuconf.h Sun Aug 31 15:23:49 2014 (r270878) @@ -135,13 +135,13 @@ #define ARM_MMU_GENERIC 0 #endif -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) #define ARM_MMU_V6 1 #else #define ARM_MMU_V6 0 #endif -#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B) #define ARM_MMU_V7 1 #else #define ARM_MMU_V7 0 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 15:24:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF03FA38; Sun, 31 Aug 2014 15:24:38 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF65E12C5; Sun, 31 Aug 2014 15:24:38 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XO6zc-000Mlj-I1; Sun, 31 Aug 2014 15:24:36 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s7VFOZ45001199; Sun, 31 Aug 2014 09:24:35 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18fxq4b5wUTHL28QmdioKwk X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r270862 - head/sys/arm/arm From: Ian Lepore To: "Bjoern A. Zeeb" In-Reply-To: References: <201408302221.s7UMLvMS003791@svn.freebsd.org> Content-Type: text/plain; charset="windows-1251" Date: Sun, 31 Aug 2014 09:24:35 -0600 Message-ID: <1409498675.1150.198.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id s7VFOZ45001199 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 15:24:39 -0000 On Sun, 2014-08-31 at 08:58 +0000, Bjoern A. Zeeb wrote: > On 30 Aug 2014, at 22:21 , Ian Lepore wrote: >=20 > > Author: ian > > Date: Sat Aug 30 22:21:57 2014 > > New Revision: 270862 > > URL: http://svnweb.freebsd.org/changeset/base/270862 > >=20 > > Log: > > Fix the handling of MMU type in the AP entry code. The ARM_MMU_V6/V= 7 > > symbols are always #defined to 0 or 1, so use #if SYM not #if define= d(SYM). > > Also, it helps if you include the header file that defines the symbo= ls. >=20 >=20 > I can only assume it=92s been due to this commit: >=20 > 22 warnings generated. > linking kernel.debug > locore.o: In function `mpentry': > (.text+0x1ec): undefined reference to `armv6_idcache_inv_all' > --- kernel.debug --- > *** [kernel.debug] Error code 1 >=20 > bmake: stopped in /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/s= ys/ARMADAXP >=20 >=20 Yes, apparently this change exposed a long-standing bug in another header file. Fixed in r270878. -- Ian >=20 > >=20 > > Modified: > > head/sys/arm/arm/locore.S > >=20 > > Modified: head/sys/arm/arm/locore.S > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/arm/arm/locore.S Sat Aug 30 21:44:32 2014 (r270861) > > +++ head/sys/arm/arm/locore.S Sat Aug 30 22:21:57 2014 (r270862) > > @@ -37,6 +37,7 @@ > > #include > > #include > > #include > > +#include > > #include > >=20 > > __FBSDID("$FreeBSD$"); > > @@ -389,9 +390,9 @@ ASENTRY_NP(mpentry) > > nop > > CPWAIT(r0) > >=20 > > -#if defined(ARM_MMU_V6) > > +#if ARM_MMU_V6 > > bl armv6_idcache_inv_all /* Modifies r0 only */ > > -#elif defined(ARM_MMU_V7) > > +#elif ARM_MMU_V7 > > bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ > > #endif > >=20 > >=20 >=20 > =97=20 > Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 198= 3 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 15:25:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C6D0C60; Sun, 31 Aug 2014 15:25:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E48712D3; Sun, 31 Aug 2014 15:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VFPfMS098566; Sun, 31 Aug 2014 15:25:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VFPeut098561; Sun, 31 Aug 2014 15:25:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201408311525.s7VFPeut098561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 31 Aug 2014 15:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270879 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 15:25:41 -0000 Author: ian Date: Sun Aug 31 15:25:40 2014 New Revision: 270879 URL: http://svnweb.freebsd.org/changeset/base/270879 Log: Put option FDT into the base IMX6 config and remove it from the config of boards based on IMX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/IMX6 Sun Aug 31 15:25:40 2014 (r270879) @@ -147,6 +147,7 @@ device u3g # USB modems options ROOTDEVNAME=\"ufs:mmcsd0s2a\" # ARM and SoC-specific options +options FDT # Configure using FDT/DTB data. options SMP # Enable multiple cores options VFP # Enable floating point hardware support options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) Modified: head/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- head/sys/arm/conf/WANDBOARD-DUAL Sun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-DUAL Sun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include "IMX6" ident WANDBOARD-DUAL # Flattened Device Tree -options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=wandboard-dual.dts Modified: head/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- head/sys/arm/conf/WANDBOARD-QUAD Sun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-QUAD Sun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include "IMX6" ident WANDBOARD-QUAD # Flattened Device Tree -options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=wandboard-quad.dts Modified: head/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- head/sys/arm/conf/WANDBOARD-SOLO Sun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-SOLO Sun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include "IMX6" ident WANDBOARD-SOLO # Flattened Device Tree -options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=wandboard-solo.dts From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 15:26:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63518DA4; Sun, 31 Aug 2014 15:26:34 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3583212E1; Sun, 31 Aug 2014 15:26:33 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XO71P-000N7r-1F; Sun, 31 Aug 2014 15:26:27 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s7VFQOcD001210; Sun, 31 Aug 2014 09:26:24 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX197uowft74HNv7QPOpXqVvV X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r270858 - head/sys/arm/conf From: Ian Lepore To: Andrew Turner In-Reply-To: <20140831120707.0b049e07@bender.lan> References: <201408302000.s7UK0IhC024462@svn.freebsd.org> <20140831120707.0b049e07@bender.lan> Content-Type: text/plain; charset="us-ascii" Date: Sun, 31 Aug 2014 09:26:24 -0600 Message-ID: <1409498784.1150.200.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 15:26:34 -0000 On Sun, 2014-08-31 at 12:07 +0100, Andrew Turner wrote: > On Sat, 30 Aug 2014 20:00:18 +0000 (UTC) > Michael Tuexen wrote: > > > Author: tuexen > > Date: Sat Aug 30 20:00:18 2014 > > New Revision: 270858 > > URL: http://svnweb.freebsd.org/changeset/base/270858 > > > > Log: > > Remove FDT option, since it is in every file, which includes this > > one. > > > It should be the other way around, i.e. in this file and removed from > all that include it. FDT is required for armv6 and this is still a > valid kernel config. > > Andrew > I agree, we're going to have more configs soon I think based on IMX6. I changed it in r270879. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 16:08:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 969B7AE7; Sun, 31 Aug 2014 16:08:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 199511823; Sun, 31 Aug 2014 16:08:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s7VG80ix087180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 31 Aug 2014 20:08:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s7VG80ww087179; Sun, 31 Aug 2014 20:08:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 31 Aug 2014 20:08:00 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r270870 - head/sys/net Message-ID: <20140831160800.GC7693@FreeBSD.org> References: <201408310646.s7V6kM1X050678@svn.freebsd.org> <5402DAB7.2040806@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5402DAB7.2040806@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 16:08:03 -0000 On Sun, Aug 31, 2014 at 12:20:07PM +0400, Alexander V. Chernikov wrote: A> On 31.08.2014 10:46, Gleb Smirnoff wrote: A> > Author: glebius A> > Date: Sun Aug 31 06:46:21 2014 A> > New Revision: 270870 A> > URL: http://svnweb.freebsd.org/changeset/base/270870 A> > A> > Log: A> > o Remove struct if_data from struct ifnet. Now it is merely API structure A> > for route(4) socket and ifmib(4) sysctl. A> > o Move fields from if_data to ifnet, but keep all statistic counters A> > separate, since they should disappear later. A> > o Provide function if_data_copy() to fill if_data, utilize it in routing A> > socket and ifmib handler. A> > o Provide overridable ifnet(9) method to fetch counters. If no provided, A> > if_get_counters_compat() would be used, that returns old counters. A> Thanks! This isn't yet finished, but you see the direction. :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 17:21:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E2F869B; Sun, 31 Aug 2014 17:21:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8B71F60; Sun, 31 Aug 2014 17:21:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VHLuFB058896; Sun, 31 Aug 2014 17:21:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VHLpTu058657; Sun, 31 Aug 2014 17:21:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201408311721.s7VHLpTu058657@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 31 Aug 2014 17:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270882 - in head/lib/libc/arm: gen string sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 17:21:56 -0000 Author: ian Date: Sun Aug 31 17:21:51 2014 New Revision: 270882 URL: http://svnweb.freebsd.org/changeset/base/270882 Log: In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo). The EABI unwind info requires a .fnend for every .fnstart, and newer binutils will complain about seeing two .fnstart in a row. This change allows newer tools to compile our code. Reported by: bapt Reviewed by: imp Modified: head/lib/libc/arm/gen/__aeabi_read_tp.S head/lib/libc/arm/gen/_ctx_start.S head/lib/libc/arm/gen/_setjmp.S head/lib/libc/arm/gen/alloca.S head/lib/libc/arm/gen/divsi3.S head/lib/libc/arm/gen/setjmp.S head/lib/libc/arm/gen/sigsetjmp.S head/lib/libc/arm/string/ffs.S head/lib/libc/arm/string/memcmp.S head/lib/libc/arm/string/memcpy_arm.S head/lib/libc/arm/string/memcpy_xscale.S head/lib/libc/arm/string/memmove.S head/lib/libc/arm/string/memset.S head/lib/libc/arm/string/strcmp.S head/lib/libc/arm/string/strlen.S head/lib/libc/arm/string/strncmp.S head/lib/libc/arm/sys/Ovfork.S head/lib/libc/arm/sys/brk.S head/lib/libc/arm/sys/cerror.S head/lib/libc/arm/sys/pipe.S head/lib/libc/arm/sys/ptrace.S head/lib/libc/arm/sys/sbrk.S Modified: head/lib/libc/arm/gen/__aeabi_read_tp.S ============================================================================== --- head/lib/libc/arm/gen/__aeabi_read_tp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/__aeabi_read_tp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -38,6 +38,7 @@ ENTRY(__aeabi_read_tp) mrc p15, 0, r0, c13, c0, 3 #endif RET +END(__aeabi_read_tp) #ifdef ARM_TP_ADDRESS .Larm_tp_address: Modified: head/lib/libc/arm/gen/_ctx_start.S ============================================================================== --- head/lib/libc/arm/gen/_ctx_start.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/_ctx_start.S Sun Aug 31 17:21:51 2014 (r270882) @@ -7,3 +7,4 @@ ENTRY(_ctx_start) mov r0, r5 bl _C_LABEL(ctx_done) bl _C_LABEL(abort) +END(_ctx_start) Modified: head/lib/libc/arm/gen/_setjmp.S ============================================================================== --- head/lib/libc/arm/gen/_setjmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/_setjmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -89,6 +89,7 @@ ENTRY(_setjmp) mov r0, #0x00000000 RET +END(_setjmp) .L_setjmp_magic: .word _JB_MAGIC__SETJMP @@ -140,3 +141,4 @@ botch: #else b . #endif +END(_longjmp) Modified: head/lib/libc/arm/gen/alloca.S ============================================================================== --- head/lib/libc/arm/gen/alloca.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/alloca.S Sun Aug 31 17:21:51 2014 (r270882) @@ -43,3 +43,4 @@ ENTRY(alloca) sub sp, sp, r0 /* Adjust the stack pointer */ mov r0, sp /* r0 = base of new space */ RET +END(alloca) Modified: head/lib/libc/arm/gen/divsi3.S ============================================================================== --- head/lib/libc/arm/gen/divsi3.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/divsi3.S Sun Aug 31 17:21:51 2014 (r270882) @@ -29,6 +29,7 @@ ENTRY(__umodsi3) add sp, sp, #4 /* unalign stack */ mov r0, r1 ldmfd sp!, {pc} +END(__umodsi3) ENTRY(__modsi3) stmfd sp!, {lr} @@ -48,6 +49,7 @@ ENTRY(__modsi3) mvn r0, #0 #endif RET +END(__modsi3) ENTRY(__udivsi3) .L_udivide: /* r0 = r0 / r1; r1 = r0 % r1 */ @@ -70,6 +72,7 @@ ENTRY(__udivsi3) mov r0, r1 mov r1, #0 RET +END(__udivsi3) ENTRY(__divsi3) .L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */ @@ -385,3 +388,4 @@ ENTRY(__divsi3) addhs r3, r3, r2 mov r0, r3 RET +END(__divsi3) Modified: head/lib/libc/arm/gen/setjmp.S ============================================================================== --- head/lib/libc/arm/gen/setjmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/setjmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -101,7 +101,7 @@ ENTRY(setjmp) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) #endif /* __ARM_EABI__ */ - +END(setjmp) .weak _C_LABEL(longjmp) .set _C_LABEL(longjmp), _C_LABEL(__longjmp) @@ -150,3 +150,4 @@ ENTRY(__longjmp) bl PIC_SYM(_C_LABEL(longjmperror), PLT) bl PIC_SYM(_C_LABEL(abort), PLT) b . - 8 /* Cannot get here */ +END(__longjmp) Modified: head/lib/libc/arm/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/arm/gen/sigsetjmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/sigsetjmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -51,6 +51,7 @@ ENTRY(sigsetjmp) teq r1, #0 beq PIC_SYM(_C_LABEL(_setjmp), PLT) b PIC_SYM(_C_LABEL(setjmp), PLT) +END(sigsetjmp) .L_setjmp_magic: .word _JB_MAGIC__SETJMP @@ -64,3 +65,4 @@ ENTRY(siglongjmp) teq r2, r3 /* magic correct? */ beq PIC_SYM(_C_LABEL(_longjmp), PLT) b PIC_SYM(_C_LABEL(longjmp), PLT) +END(siglongjmp) Modified: head/lib/libc/arm/string/ffs.S ============================================================================== --- head/lib/libc/arm/string/ffs.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/ffs.S Sun Aug 31 17:21:51 2014 (r270882) @@ -80,3 +80,4 @@ ENTRY(ffs) rsbne r0, r0, #32 RET #endif +END(ffs) Modified: head/lib/libc/arm/string/memcmp.S ============================================================================== --- head/lib/libc/arm/string/memcmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/memcmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -178,3 +178,4 @@ ENTRY(memcmp) sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ RET #endif +END(memcmp) Modified: head/lib/libc/arm/string/memcpy_arm.S ============================================================================== --- head/lib/libc/arm/string/memcpy_arm.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/memcpy_arm.S Sun Aug 31 17:21:51 2014 (r270882) @@ -330,3 +330,4 @@ ENTRY(memcpy) .Lmemcpy_srcul3l4: sub r1, r1, #1 b .Lmemcpy_l4 +END(memcpy) Modified: head/lib/libc/arm/string/memcpy_xscale.S ============================================================================== --- head/lib/libc/arm/string/memcpy_xscale.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/memcpy_xscale.S Sun Aug 31 17:21:51 2014 (r270882) @@ -1781,3 +1781,4 @@ ENTRY(memcpy) strb r1, [r0, #0x0b] bx lr #endif /* !_STANDALONE */ +END(memcpy) Modified: head/lib/libc/arm/string/memmove.S ============================================================================== --- head/lib/libc/arm/string/memmove.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/memmove.S Sun Aug 31 17:21:51 2014 (r270882) @@ -580,3 +580,8 @@ ENTRY(bcopy) .Lmemmove_bsrcul1l4: add r1, r1, #1 b .Lmemmove_bl4 +#ifndef _BCOPY +END(memmove) +#else +END(bcopy) +#endif Modified: head/lib/libc/arm/string/memset.S ============================================================================== --- head/lib/libc/arm/string/memset.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/memset.S Sun Aug 31 17:21:51 2014 (r270882) @@ -234,3 +234,8 @@ ENTRY(memset) strgeb r3, [ip], #0x01 /* Set another byte */ strgtb r3, [ip] /* and a third */ RET /* Exit */ +#ifdef _BZERO +END(bzero) +#else +END(memset) +#endif Modified: head/lib/libc/arm/string/strcmp.S ============================================================================== --- head/lib/libc/arm/string/strcmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/strcmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -41,3 +41,4 @@ ENTRY(strcmp) beq 1b sub r0, r2, r3 RET +END(strcmp) Modified: head/lib/libc/arm/string/strlen.S ============================================================================== --- head/lib/libc/arm/string/strlen.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/strlen.S Sun Aug 31 17:21:51 2014 (r270882) @@ -76,3 +76,4 @@ ENTRY(strlen) .Lexit: mov r0, r1 RET +END(strlen) Modified: head/lib/libc/arm/string/strncmp.S ============================================================================== --- head/lib/libc/arm/string/strncmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/string/strncmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -52,3 +52,4 @@ ENTRY(strncmp) beq 1b sub r0, r2, r3 RET +END(strncmp) Modified: head/lib/libc/arm/sys/Ovfork.S ============================================================================== --- head/lib/libc/arm/sys/Ovfork.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/Ovfork.S Sun Aug 31 17:21:51 2014 (r270882) @@ -52,3 +52,4 @@ ENTRY(vfork) sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */ and r0, r0, r1 /* r0 == 0 if child, else unchanged */ mov r15, r2 +END(vfork) Modified: head/lib/libc/arm/sys/brk.S ============================================================================== --- head/lib/libc/arm/sys/brk.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/brk.S Sun Aug 31 17:21:51 2014 (r270882) @@ -98,3 +98,4 @@ ENTRY(_brk) .word PIC_SYM(_C_LABEL(minbrk), GOT) .Lcurbrk: .word PIC_SYM(CURBRK, GOT) +END(_brk) Modified: head/lib/libc/arm/sys/cerror.S ============================================================================== --- head/lib/libc/arm/sys/cerror.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/cerror.S Sun Aug 31 17:21:51 2014 (r270882) @@ -46,3 +46,4 @@ ASENTRY(CERROR) mvn r0, #0x00000000 mvn r1, #0x00000000 ldmfd sp!, {r4, pc} +END(CERROR) Modified: head/lib/libc/arm/sys/pipe.S ============================================================================== --- head/lib/libc/arm/sys/pipe.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/pipe.S Sun Aug 31 17:21:51 2014 (r270882) @@ -48,3 +48,4 @@ ENTRY(_pipe) str r1, [r2, #0x0004] mov r0, #0x00000000 RET +END(_pipe) Modified: head/lib/libc/arm/sys/ptrace.S ============================================================================== --- head/lib/libc/arm/sys/ptrace.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/ptrace.S Sun Aug 31 17:21:51 2014 (r270882) @@ -46,3 +46,4 @@ ENTRY(ptrace) SYSTRAP(ptrace) bcs PIC_SYM(CERROR, PLT) RET +END(ptrace) Modified: head/lib/libc/arm/sys/sbrk.S ============================================================================== --- head/lib/libc/arm/sys/sbrk.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/sys/sbrk.S Sun Aug 31 17:21:51 2014 (r270882) @@ -86,3 +86,4 @@ ENTRY(_sbrk) #endif .Lcurbrk: .word PIC_SYM(CURBRK, GOT) +END(_sbrk) From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 17:38:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11F4233F; Sun, 31 Aug 2014 17:38:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1EDE120B; Sun, 31 Aug 2014 17:38:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VHcfII065611; Sun, 31 Aug 2014 17:38:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VHcfvn065610; Sun, 31 Aug 2014 17:38:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201408311738.s7VHcfvn065610@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 31 Aug 2014 17:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270883 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 17:38:42 -0000 Author: alc Date: Sun Aug 31 17:38:41 2014 New Revision: 270883 URL: http://svnweb.freebsd.org/changeset/base/270883 Log: Automatically prefault a limited number of mappings to resident pages in shmat(2), just like mmap(2). MFC after: 5 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Sun Aug 31 17:21:51 2014 (r270882) +++ head/sys/kern/sysv_shm.c Sun Aug 31 17:38:41 2014 (r270883) @@ -410,9 +410,9 @@ kern_shmat(td, shmid, shmaddr, shmflg) } vm_object_reference(shmseg->object); - rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, - 0, &attach_va, size, 0, shmaddr != NULL ? VMFS_NO_SPACE : - VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE); + rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object, 0, &attach_va, + size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE, + prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg->object); error = ENOMEM; From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 17:40:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 921C6490; Sun, 31 Aug 2014 17:40:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2331226; Sun, 31 Aug 2014 17:40:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VHeJEN065941; Sun, 31 Aug 2014 17:40:19 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VHeJBL065940; Sun, 31 Aug 2014 17:40:19 GMT (envelope-from br@FreeBSD.org) Message-Id: <201408311740.s7VHeJBL065940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 31 Aug 2014 17:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270884 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 17:40:19 -0000 Author: br Date: Sun Aug 31 17:40:19 2014 New Revision: 270884 URL: http://svnweb.freebsd.org/changeset/base/270884 Log: GIC (Cortex A's interrupt controller) supports up to 1020 IRQs. Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sun Aug 31 17:38:41 2014 (r270883) +++ head/sys/arm/include/intr.h Sun Aug 31 17:40:19 2014 (r270884) @@ -51,7 +51,7 @@ defined(CPU_XSCALE_IXP435) #define NIRQ 64 #elif defined(CPU_CORTEXA) -#define NIRQ 160 +#define NIRQ 1020 #elif defined(CPU_KRAIT) #define NIRQ 288 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 17:56:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B059DC; Sun, 31 Aug 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026C91447; Sun, 31 Aug 2014 17:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VHutab075171; Sun, 31 Aug 2014 17:56:55 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VHutRE075166; Sun, 31 Aug 2014 17:56:55 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201408311756.s7VHutRE075166@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 31 Aug 2014 17:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270885 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 17:56:56 -0000 Author: marius Date: Sun Aug 31 17:56:54 2014 New Revision: 270885 URL: http://svnweb.freebsd.org/changeset/base/270885 Log: - Nuke unused sdhci_softc. - Static'ize sdhci_debug local to sdhci.c. - Const'ify PCI device description strings. - Nuke redundant resource ID members from sdhci_pci_softc. - Nuke unused hw.sdhci_pci.debug tunable. - Add support for using MSI instead of INTx, controllable via the tunable hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD controller. - Use NULL instead of 0 for pointers. MFC after: 3 days Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_if.m head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci.c Sun Aug 31 17:56:54 2014 (r270885) @@ -52,21 +52,9 @@ __FBSDID("$FreeBSD$"); #include "sdhci.h" #include "sdhci_if.h" -struct sdhci_softc; +SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); -struct sdhci_softc { - device_t dev; /* Controller device */ - struct resource *irq_res; /* IRQ resource */ - int irq_rid; - void *intrhand; /* Interrupt handle */ - - int num_slots; /* Number of slots on this controller */ - struct sdhci_slot slots[6]; -}; - -static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); - -int sdhci_debug = 0; +static int sdhci_debug; SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, "Debug level"); #define RD1(slot, off) SDHCI_READ_1((slot)->bus, (slot), (off)) Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci.h Sun Aug 31 17:56:54 2014 (r270885) @@ -223,6 +223,8 @@ #define SDHCI_SPEC_200 1 #define SDHCI_SPEC_300 2 +SYSCTL_DECL(_hw_sdhci); + struct sdhci_slot { u_int quirks; /* Chip specific quirks */ u_int caps; /* Override SDHCI_CAPABILITIES */ Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_fdt.c Sun Aug 31 17:56:54 2014 (r270885) @@ -180,7 +180,6 @@ sdhci_fdt_probe(device_t dev) if ((OF_getencprop(node, "max-frequency", &cid, sizeof(cid))) > 0) sc->max_clk = cid; - return (0); } @@ -189,7 +188,7 @@ sdhci_fdt_attach(device_t dev) { struct sdhci_fdt_softc *sc = device_get_softc(dev); int err, slots, rid, i; - + sc->dev = dev; /* Allocate IRQ. */ @@ -241,7 +240,7 @@ sdhci_fdt_attach(device_t dev) struct sdhci_slot *slot = &sc->slots[i]; sdhci_start_slot(slot); } - + return (0); } @@ -305,5 +304,6 @@ static driver_t sdhci_fdt_driver = { }; static devclass_t sdhci_fdt_devclass; -DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, 0,0); +DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, + NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); Modified: head/sys/dev/sdhci/sdhci_if.m ============================================================================== --- head/sys/dev/sdhci/sdhci_if.m Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_if.m Sun Aug 31 17:56:54 2014 (r270885) @@ -62,6 +62,7 @@ #include #include #include +#include #include #include Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_pci.c Sun Aug 31 17:56:54 2014 (r270885) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); static const struct sdhci_device { uint32_t model; uint16_t subvendor; - char *desc; + const char *desc; u_int quirks; } sdhci_devices[] = { { 0x08221180, 0xffff, "RICOH R5C822 SD", @@ -112,19 +112,16 @@ struct sdhci_pci_softc { device_t dev; /* Controller device */ u_int quirks; /* Chip specific quirks */ struct resource *irq_res; /* IRQ resource */ - int irq_rid; void *intrhand; /* Interrupt handle */ int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; struct resource *mem_res[6]; /* Memory resource */ - int mem_rid[6]; }; -static SYSCTL_NODE(_hw, OID_AUTO, sdhci_pci, CTLFLAG_RD, 0, "sdhci PCI driver"); - -int sdhci_pci_debug; -SYSCTL_INT(_hw_sdhci_pci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_pci_debug, 0, "Debug level"); +static int sdhci_enable_msi = 1; +SYSCTL_INT(_hw_sdhci, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &sdhci_enable_msi, + 0, "Enable MSI interrupts"); static uint8_t sdhci_pci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) @@ -231,13 +228,13 @@ sdhci_pci_probe(device_t dev) uint16_t subvendor; uint8_t class, subclass; int i, result; - + model = (uint32_t)pci_get_device(dev) << 16; model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; subvendor = pci_get_subvendor(dev); class = pci_get_class(dev); subclass = pci_get_subclass(dev); - + result = ENXIO; for (i = 0; sdhci_devices[i].model != 0; i++) { if (sdhci_devices[i].model == model && @@ -253,7 +250,7 @@ sdhci_pci_probe(device_t dev) device_set_desc(dev, "Generic SD HCI"); result = BUS_PROBE_GENERIC; } - + return (result); } @@ -264,7 +261,7 @@ sdhci_pci_attach(device_t dev) uint32_t model; uint16_t subvendor; uint8_t class, subclass, progif; - int err, slots, bar, i; + int bar, err, rid, slots, i; sc->dev = dev; model = (uint32_t)pci_get_device(dev) << 16; @@ -295,11 +292,15 @@ sdhci_pci_attach(device_t dev) return (EINVAL); } /* Allocate IRQ. */ - sc->irq_rid = 0; - sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, - RF_SHAREABLE | RF_ACTIVE); + i = 1; + rid = 0; + if (sdhci_enable_msi != 0 && pci_alloc_msi(dev, &i) == 0) + rid = 1; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | (rid != 0 ? 0 : RF_SHAREABLE)); if (sc->irq_res == NULL) { device_printf(dev, "Can't allocate IRQ\n"); + pci_release_msi(dev); return (ENOMEM); } /* Scan all slots. */ @@ -307,9 +308,9 @@ sdhci_pci_attach(device_t dev) struct sdhci_slot *slot = &sc->slots[sc->num_slots]; /* Allocate memory. */ - sc->mem_rid[i] = PCIR_BAR(bar + i); - sc->mem_res[i] = bus_alloc_resource(dev, - SYS_RES_MEMORY, &(sc->mem_rid[i]), 0ul, ~0ul, 0x100, RF_ACTIVE); + rid = PCIR_BAR(bar + i); + sc->mem_res[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, + &rid, 0ul, ~0ul, 0x100, RF_ACTIVE); if (sc->mem_res[i] == NULL) { device_printf(dev, "Can't allocate memory for slot %d\n", i); continue; @@ -318,7 +319,6 @@ sdhci_pci_attach(device_t dev) if (sdhci_init_slot(dev, slot, i) != 0) continue; - sc->num_slots++; } device_printf(dev, "%d slot(s) allocated\n", sc->num_slots); @@ -334,7 +334,7 @@ sdhci_pci_attach(device_t dev) sdhci_start_slot(slot); } - + return (0); } @@ -346,14 +346,15 @@ sdhci_pci_detach(device_t dev) bus_teardown_intr(dev, sc->irq_res, sc->intrhand); bus_release_resource(dev, SYS_RES_IRQ, - sc->irq_rid, sc->irq_res); + rman_get_rid(sc->irq_res), sc->irq_res); + pci_release_msi(dev); for (i = 0; i < sc->num_slots; i++) { struct sdhci_slot *slot = &sc->slots[i]; sdhci_cleanup_slot(slot); bus_release_resource(dev, SYS_RES_MEMORY, - sc->mem_rid[i], sc->mem_res[i]); + rman_get_rid(sc->mem_res[i]), sc->mem_res[i]); } return (0); } @@ -368,7 +369,7 @@ sdhci_pci_suspend(device_t dev) if (err) return (err); for (i = 0; i < sc->num_slots; i++) - sdhci_generic_suspend(&sc->slots[i]); + sdhci_generic_suspend(&sc->slots[i]); return (0); } @@ -383,7 +384,6 @@ sdhci_pci_resume(device_t dev) return (bus_generic_resume(dev)); } - static void sdhci_pci_intr(void *arg) { @@ -435,5 +435,6 @@ static driver_t sdhci_pci_driver = { }; static devclass_t sdhci_pci_devclass; -DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, 0, 0); +DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, NULL, + NULL); MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 21:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9821322; Sun, 31 Aug 2014 21:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88EDA1CCE; Sun, 31 Aug 2014 21:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7VLc4GB082704; Sun, 31 Aug 2014 21:38:04 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7VLc4MA082700; Sun, 31 Aug 2014 21:38:04 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201408312138.s7VLc4MA082700@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Sun, 31 Aug 2014 21:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270893 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 21:38:04 -0000 Author: kargl Date: Sun Aug 31 21:38:03 2014 New Revision: 270893 URL: http://svnweb.freebsd.org/changeset/base/270893 Log: Compute sin(pi*x) without actually doing the pi*x multiplication. sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is the precision of x. The new argument reduction is an optimization compared to the old code, and it removes a chunk of dead code. Accuracy tests in the intervals (-21,-20), (-20,-19), ... (-1,0) show no differences between the old and new code. Obtained from: bde Modified: head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Sun Aug 31 21:18:23 2014 (r270892) +++ head/lib/msun/src/e_lgamma_r.c Sun Aug 31 21:38:03 2014 (r270893) @@ -156,37 +156,35 @@ w6 = -1.63092934096575273989e-03; /* 0x static const double zero= 0.00000000000000000000e+00; - static double sin_pi(double x) +/* + * Compute sin(pi*x) without actually doing the pi*x multiplication. + * sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is + * the precision of x. + */ +static double +sin_pi(double x) { + volatile double vz; double y,z; - int n,ix; + int n; - GET_HIGH_WORD(ix,x); - ix &= 0x7fffffff; + y = -x; - if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0); - y = -x; /* x is assume negative */ + vz = y+0x1p52; /* depend on 0 <= y < 0x1p52 */ + z = vz-0x1p52; /* rint(y) for the above range */ + if (z == y) + return (zero); + + vz = y+0x1p50; + GET_LOW_WORD(n,vz); /* bits for rounded y (units 0.25) */ + z = vz-0x1p50; /* y rounded to a multiple of 0.25 */ + if (z > y) { + z -= 0.25; /* adjust to round down */ + n--; + } + n &= 7; /* octant of y mod 2 */ + y = y - z + n * 0.25; /* y mod 2 */ - /* - * argument reduction, make sure inexact flag not raised if input - * is an integer - */ - z = floor(y); - if(z!=y) { /* inexact anyway */ - y *= 0.5; - y = 2.0*(y - floor(y)); /* y = |x| mod 2.0 */ - n = (int) (y*4.0); - } else { - if(ix>=0x43400000) { - y = zero; n = 0; /* y must be even */ - } else { - if(ix<0x43300000) z = y+two52; /* exact */ - GET_LOW_WORD(n,z); - n &= 1; - y = n; - n<<= 2; - } - } switch (n) { case 0: y = __kernel_sin(pi*y,zero,0); break; case 1: Modified: head/lib/msun/src/e_lgammaf_r.c ============================================================================== --- head/lib/msun/src/e_lgammaf_r.c Sun Aug 31 21:18:23 2014 (r270892) +++ head/lib/msun/src/e_lgammaf_r.c Sun Aug 31 21:38:03 2014 (r270893) @@ -89,37 +89,35 @@ w6 = -1.6309292987e-03; /* 0xbad5c4e8 * static const float zero= 0.0000000000e+00; - static float sin_pif(float x) +/* + * Compute sin(pi*x) without actually doing the pi*x multiplication. + * sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is + * the precision of x. + */ +static float +sin_pi(float x) { + volatile float vz; float y,z; - int n,ix; + int n; - GET_FLOAT_WORD(ix,x); - ix &= 0x7fffffff; + y = -x; - if(ix<0x3e800000) return __kernel_sindf(pi*x); - y = -x; /* x is assume negative */ + vz = y+0x1p23F; /* depend on 0 <= y < 0x1p23 */ + z = vz-0x1p23F; /* rintf(y) for the above range */ + if (z == y) + return (zero); + + vz = y+0x1p21F; + GET_FLOAT_WORD(n,vz); /* bits for rounded y (units 0.25) */ + z = vz-0x1p21F; /* y rounded to a multiple of 0.25 */ + if (z > y) { + z -= 0.25F; /* adjust to round down */ + n--; + } + n &= 7; /* octant of y mod 2 */ + y = y - z + n * 0.25F; /* y mod 2 */ - /* - * argument reduction, make sure inexact flag not raised if input - * is an integer - */ - z = floorf(y); - if(z!=y) { /* inexact anyway */ - y *= (float)0.5; - y = (float)2.0*(y - floorf(y)); /* y = |x| mod 2.0 */ - n = (int) (y*(float)4.0); - } else { - if(ix>=0x4b800000) { - y = zero; n = 0; /* y must be even */ - } else { - if(ix<0x4b000000) z = y+two23; /* exact */ - GET_FLOAT_WORD(n,z); - n &= 1; - y = n; - n<<= 2; - } - } switch (n) { case 0: y = __kernel_sindf(pi*y); break; case 1: @@ -157,7 +155,7 @@ __ieee754_lgammaf_r(float x, int *signga if(hx<0) { if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */ return one/zero; - t = sin_pif(x); + t = sin_pi(x); if(t==zero) return one/zero; /* -integer */ nadj = __ieee754_logf(pi/fabsf(t*x)); if(t Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFEFD22F; Mon, 1 Sep 2014 03:49:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81C5A12A1; Mon, 1 Sep 2014 03:49:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s813nQgh057273; Mon, 1 Sep 2014 03:49:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s813nLpM057241; Mon, 1 Sep 2014 03:49:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409010349.s813nLpM057241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 1 Sep 2014 03:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270912 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 03:49:26 -0000 Author: imp Date: Mon Sep 1 03:49:21 2014 New Revision: 270912 URL: http://svnweb.freebsd.org/changeset/base/270912 Log: Resync comments about scbus and pass for life after AHCI joined CAM. Sponsored by: Netflix Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RK3188 head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SN9G45 head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/BEAGLEBONE Mon Sep 1 03:49:21 2014 (r270912) @@ -116,7 +116,7 @@ options USB_DEBUG #options USB_VERBOSE device musb device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) # Ethernet Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/CNS11XXNAS Mon Sep 1 03:49:21 2014 (r270912) @@ -111,7 +111,7 @@ device usb device ohci device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass device cfi Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/CUBIEBOARD Mon Sep 1 03:49:21 2014 (r270912) @@ -104,7 +104,7 @@ device random # Entropy device # GPIO device gpio -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/CUBIEBOARD2 Mon Sep 1 03:49:21 2014 (r270912) @@ -104,7 +104,7 @@ device random # Entropy device # GPIO device gpio -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/DIGI-CCWMX53 Mon Sep 1 03:49:21 2014 (r270912) @@ -130,10 +130,10 @@ device iic device iicbus # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/EB9200 Mon Sep 1 03:49:21 2014 (r270912) @@ -102,10 +102,10 @@ device ohci # OHCI localbus->USB inte device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB device (gadget) support #device at91_dci # Atmel's usb device Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/EFIKA_MX Mon Sep 1 03:49:21 2014 (r270912) @@ -126,10 +126,10 @@ device iic device iicbus # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/EXYNOS5.common Mon Sep 1 03:49:21 2014 (r270912) @@ -104,7 +104,7 @@ device ehci device xhci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/HL200 Mon Sep 1 03:49:21 2014 (r270912) @@ -132,10 +132,10 @@ device uath # Atheros AR5523 wireless device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # Wireless NIC cards device wlan # 802.11 support device wlan_wep # 802.11 WEP support Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/HL201 Mon Sep 1 03:49:21 2014 (r270912) @@ -116,10 +116,10 @@ device miibus #device ural # Ralink Technology RT2500USB wireless NICs #device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # Wireless NIC cards #device wlan # 802.11 support #device wlan_wep # 802.11 WEP support Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/IMX53-QSB Mon Sep 1 03:49:21 2014 (r270912) @@ -129,10 +129,10 @@ device iic device iicbus # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/IMX6 Mon Sep 1 03:49:21 2014 (r270912) @@ -94,10 +94,10 @@ device mmc # SD/MMC protocol device mmcsd # SDCard disk device # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support #options USB_DEBUG # enable debug msgs Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/KB920X Mon Sep 1 03:49:21 2014 (r270912) @@ -132,10 +132,10 @@ device uath # Atheros AR5523 wireless device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # Wireless NIC cards device wlan # 802.11 support device wlan_wep # 802.11 WEP support Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/NSLU Mon Sep 1 03:49:21 2014 (r270912) @@ -115,5 +115,5 @@ options USB_DEBUG device ohci device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/PANDABOARD Mon Sep 1 03:49:21 2014 (r270912) @@ -122,7 +122,7 @@ options USB_DEBUG device ohci device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) # Ethernet Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/QILA9G20 Mon Sep 1 03:49:21 2014 (r270912) @@ -117,10 +117,10 @@ device iicbus device icee # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support device ohci # OHCI localbus->USB interface Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/RK3188 Mon Sep 1 03:49:21 2014 (r270912) @@ -88,7 +88,7 @@ device random # Entropy device # GPIO device gpio -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/SAM9G20EK Mon Sep 1 03:49:21 2014 (r270912) @@ -119,10 +119,10 @@ device iicbus device icee # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support device ohci # OHCI localbus->USB interface Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/SAM9X25EK Mon Sep 1 03:49:21 2014 (r270912) @@ -118,10 +118,10 @@ device iicbus device icee # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support #device ohci # OHCI localbus->USB interface Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/SN9G45 Mon Sep 1 03:49:21 2014 (r270912) @@ -95,10 +95,10 @@ option AT91_ATE_USE_RMII device at91_wdt # WDT: Watchdog timer # SCSI peripherals -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # USB support device ohci # OHCI localbus->USB interface Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/VYBRID Mon Sep 1 03:49:21 2014 (r270912) @@ -112,7 +112,7 @@ device ehci #device ohci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device pass Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Mon Sep 1 03:22:47 2014 (r270911) +++ head/sys/arm/conf/ZEDBOARD Mon Sep 1 03:49:21 2014 (r270912) @@ -91,7 +91,7 @@ options USB_DEBUG #options USB_VERBOSE device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device axe # USB-Ethernet From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 09:30:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3BE6A48; Mon, 1 Sep 2014 09:30:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72DFF1FE0; Mon, 1 Sep 2014 09:30:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s819UZ10017837; Mon, 1 Sep 2014 09:30:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s819UZ9d017831; Mon, 1 Sep 2014 09:30:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201409010930.s819UZ9d017831@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 1 Sep 2014 09:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270927 - in head: sys/netinet6 usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 09:30:35 -0000 Author: ae Date: Mon Sep 1 09:30:34 2014 New Revision: 270927 URL: http://svnweb.freebsd.org/changeset/base/270927 Log: Add the reverse part to rule #9. Also change its description in the netstat(8) output. MFC after: 1 week Modified: head/sys/netinet6/in6_src.c head/usr.bin/netstat/inet6.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Mon Sep 1 09:00:00 2014 (r270926) +++ head/sys/netinet6/in6_src.c Mon Sep 1 09:30:34 2014 (r270927) @@ -448,6 +448,8 @@ in6_selectsrc(struct sockaddr_in6 *dstso */ if (ifa_preferred(&ia_best->ia_ifa, &ia->ia_ifa)) REPLACE(9); + if (ifa_preferred(&ia->ia_ifa, &ia_best->ia_ifa)) + NEXT(9); /* * Rule 14: Use longest matching prefix. Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Mon Sep 1 09:00:00 2014 (r270926) +++ head/usr.bin/netstat/inet6.c Mon Sep 1 09:30:34 2014 (r270927) @@ -345,7 +345,7 @@ static const char *srcrule_str[] = { "matching label", "public/temporary address", "alive interface", - "preferred interface", + "better virtual status", "rule #10", "rule #11", "rule #12", From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 13:00:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 144F27B3; Mon, 1 Sep 2014 13:00:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 004DC18A9; Mon, 1 Sep 2014 13:00:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81D0jmK019059; Mon, 1 Sep 2014 13:00:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81D0jnF019058; Mon, 1 Sep 2014 13:00:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409011300.s81D0jnF019058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 1 Sep 2014 13:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270928 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 13:00:46 -0000 Author: glebius Date: Mon Sep 1 13:00:45 2014 New Revision: 270928 URL: http://svnweb.freebsd.org/changeset/base/270928 Log: Explicitly free packet on PF_DROP, otherwise a "quick" rule with "route-to" may still forward it. PR: 177808 Submitted by: Kajetan Staszkiewicz Sponsored by: InnoGames GmbH Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Sep 1 09:30:34 2014 (r270927) +++ head/sys/netpfil/pf/pf.c Mon Sep 1 13:00:45 2014 (r270928) @@ -6000,6 +6000,10 @@ done: *m0 = NULL; action = PF_PASS; break; + case PF_DROP: + m_freem(*m0); + *m0 = NULL; + break; default: /* pf_route() returns unlocked. */ if (r->rt) { @@ -6376,6 +6380,10 @@ done: *m0 = NULL; action = PF_PASS; break; + case PF_DROP: + m_freem(*m0); + *m0 = NULL; + break; default: /* pf_route6() returns unlocked. */ if (r->rt) { From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 14:04:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70F9F9AC; Mon, 1 Sep 2014 14:04:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E46C1F5C; Mon, 1 Sep 2014 14:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81E4qDQ051142; Mon, 1 Sep 2014 14:04:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81E4pJg051138; Mon, 1 Sep 2014 14:04:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409011404.s81E4pJg051138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 1 Sep 2014 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270929 - in head: share/man/man4 sys/netinet sys/sys usr.sbin/traceroute X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 14:04:52 -0000 Author: glebius Date: Mon Sep 1 14:04:51 2014 New Revision: 270929 URL: http://svnweb.freebsd.org/changeset/base/270929 Log: Make SOCK_RAW sockets to be truly raw, not modifying received and sent packets at all. Swapping byte order on SOCK_RAW was actually a bug, an artifact from the BSD network stack, that used to convert a packet to native byte order once it is received by kernel. Other operating systems didn't follow this, and later other BSD descendants fixed this, leaving us alone with the bug. Now it is clear that we should fix the bug. In collaboration with: Olivier Cochard-Labbé See also: https://wiki.freebsd.org/SOCK_RAW Sponsored by: Nginx, Inc. Modified: head/share/man/man4/ip.4 head/sys/netinet/raw_ip.c head/sys/sys/param.h head/usr.sbin/traceroute/Makefile Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Sep 1 13:00:45 2014 (r270928) +++ head/share/man/man4/ip.4 Mon Sep 1 14:04:51 2014 (r270929) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd October 12, 2012 +.Dd September 1, 2014 .Dt IP 4 .Os .Sh NAME @@ -755,13 +755,11 @@ number the socket is created with), unless the .Dv IP_HDRINCL option has been set. -Incoming packets are received with +Unlike in previous +.Bx +releases, incoming packets are received with .Tn IP -header and options intact, except for -.Va ip_len -and -.Va ip_off -fields converted to host byte order. +header and options intact, leaving all fields in network byte order. .Pp .Dv IP_HDRINCL indicates the complete IP header is included with the data @@ -784,17 +782,16 @@ the fields of the IP header, including t ip->ip_v = IPVERSION; ip->ip_hl = hlen >> 2; ip->ip_id = 0; /* 0 means kernel set appropriate value */ -ip->ip_off = offset; +ip->ip_off = htons(offset); +ip->ip_len = htons(len); .Ed .Pp -The +The packet should be provided as is to be sent over wire. +This implies all fields, including .Va ip_len and .Va ip_off -fields -.Em must -be provided in host byte order. -All other fields must be provided in network byte order. +to be in network byte order. See .Xr byteorder 3 for more information on network byte order. @@ -891,3 +888,16 @@ packets received on raw IP sockets had t subtracted from the .Va ip_len field. +.Pp +Before +.Fx 11.0 +packets received on raw IP sockets had the +.Va ip_len +and +.Va ip_off +fields converted to host byte order. +Packets written to raw IP sockets were expected to have +.Va ip_len +and +.Va ip_off +in host byte order. Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Mon Sep 1 13:00:45 2014 (r270928) +++ head/sys/netinet/raw_ip.c Mon Sep 1 14:04:51 2014 (r270929) @@ -290,11 +290,6 @@ rip_input(struct mbuf **mp, int *offp, i last = NULL; ifp = m->m_pkthdr.rcvif; - /* - * Applications on raw sockets expect host byte order. - */ - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr, ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask); @@ -504,8 +499,8 @@ rip_output(struct mbuf *m, struct socket * and don't allow packet length sizes that will crash. */ if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) - || (ip->ip_len > m->m_pkthdr.len) - || (ip->ip_len < (ip->ip_hl << 2))) { + || (ntohs(ip->ip_len) > m->m_pkthdr.len) + || (ntohs(ip->ip_len) < (ip->ip_hl << 2))) { INP_RUNLOCK(inp); m_freem(m); return (EINVAL); @@ -514,13 +509,6 @@ rip_output(struct mbuf *m, struct socket ip->ip_id = ip_newid(); /* - * Applications on raw sockets pass us packets - * in host byte order. - */ - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); - - /* * XXX prevent ip_output from overwriting header fields. */ flags |= IP_RAWOUTPUT; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 1 13:00:45 2014 (r270928) +++ head/sys/sys/param.h Mon Sep 1 14:04:51 2014 (r270929) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100029 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100030 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/traceroute/Makefile ============================================================================== --- head/usr.sbin/traceroute/Makefile Mon Sep 1 13:00:45 2014 (r270928) +++ head/usr.sbin/traceroute/Makefile Mon Sep 1 14:04:51 2014 (r270929) @@ -13,7 +13,7 @@ CLEANFILES= version.c CFLAGS+= -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKIO_H=1 \ -DHAVE_NET_ROUTE_H=1 -DHAVE_NET_IF_DL_H=1 \ -DHAVE_STRERROR=1 -DHAVE_USLEEP=1 \ - -DHAVE_SYS_SYSCTL_H=1 \ + -DHAVE_SYS_SYSCTL_H=1 -DBYTESWAP_IP_HDR=1 \ -DHAVE_SETLINEBUF=1 -DHAVE_RAW_OPTIONS=1 \ -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_ICMP_NEXTMTU=1 .if !defined(TRACEROUTE_NO_IPSEC) From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 14:57:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0E5D575; Mon, 1 Sep 2014 14:57:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CDD01584; Mon, 1 Sep 2014 14:57:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81Ev4rB075487; Mon, 1 Sep 2014 14:57:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81Ev483075486; Mon, 1 Sep 2014 14:57:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409011457.s81Ev483075486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 1 Sep 2014 14:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270930 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 14:57:04 -0000 Author: ian Date: Mon Sep 1 14:57:04 2014 New Revision: 270930 URL: http://svnweb.freebsd.org/changeset/base/270930 Log: Do not generate unwind info in asm functions if _STANDALONE is defined. The .fnend op causes the assembler to emit RELOC references to unwind support functions that don't exist in libstand. Modified: head/sys/arm/include/asm.h Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Mon Sep 1 14:04:51 2014 (r270929) +++ head/sys/arm/include/asm.h Mon Sep 1 14:57:04 2014 (r270930) @@ -53,7 +53,7 @@ # define _ALIGN_TEXT .align 0 #endif -#ifdef __ARM_EABI__ +#if defined(__ARM_EABI__) && !defined(_STANDALONE) #define STOP_UNWINDING .cantunwind #define _FNSTART .fnstart #define _FNEND .fnend From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 16:12:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A70E64E1; Mon, 1 Sep 2014 16:12:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92DC21EDA; Mon, 1 Sep 2014 16:12:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81GCTdZ014500; Mon, 1 Sep 2014 16:12:29 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81GCTll014499; Mon, 1 Sep 2014 16:12:29 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409011612.s81GCTll014499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 1 Sep 2014 16:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270931 - head/usr.sbin/smbmsg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 16:12:29 -0000 Author: se Date: Mon Sep 1 16:12:29 2014 New Revision: 270931 URL: http://svnweb.freebsd.org/changeset/base/270931 Log: Fix typo (by -> be). MFC after: 3 days Modified: head/usr.sbin/smbmsg/smbmsg.8 Modified: head/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.8 Mon Sep 1 14:57:04 2014 (r270930) +++ head/usr.sbin/smbmsg/smbmsg.8 Mon Sep 1 16:12:29 2014 (r270931) @@ -59,7 +59,7 @@ The first form shown in the synopsis can the devices on the SMBus. This is done by sending each valid device address one receive byte, and one quick read message, respectively. -Devices that respond to these requests will by displayed +Devices that respond to these requests will be displayed by their device address, followed by the strings .Ql r , .Ql w , From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 16:24:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25B41947; Mon, 1 Sep 2014 16:24:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8F31FBE; Mon, 1 Sep 2014 16:24:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81GOPRt019856; Mon, 1 Sep 2014 16:24:25 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81GOPdM019854; Mon, 1 Sep 2014 16:24:25 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409011624.s81GOPdM019854@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Mon, 1 Sep 2014 16:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270932 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 16:24:26 -0000 Author: kargl Date: Mon Sep 1 16:24:25 2014 New Revision: 270932 URL: http://svnweb.freebsd.org/changeset/base/270932 Log: Fix a tab that somehow became 8 spaces. Remove parentheses in a return statement to be consistent with the rest of the file. Rename sin_pi() in the float version to sin_pif(). Remove large comment that precedes sin_pif(). The comment duplicates a comment in e_lgamma_r.c where the algorithm is documented. Requested by: bde Modified: head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Mon Sep 1 16:12:29 2014 (r270931) +++ head/lib/msun/src/e_lgamma_r.c Mon Sep 1 16:24:25 2014 (r270932) @@ -171,9 +171,9 @@ sin_pi(double x) y = -x; vz = y+0x1p52; /* depend on 0 <= y < 0x1p52 */ - z = vz-0x1p52; /* rint(y) for the above range */ + z = vz-0x1p52; /* rint(y) for the above range */ if (z == y) - return (zero); + return zero; vz = y+0x1p50; GET_LOW_WORD(n,vz); /* bits for rounded y (units 0.25) */ Modified: head/lib/msun/src/e_lgammaf_r.c ============================================================================== --- head/lib/msun/src/e_lgammaf_r.c Mon Sep 1 16:12:29 2014 (r270931) +++ head/lib/msun/src/e_lgammaf_r.c Mon Sep 1 16:24:25 2014 (r270932) @@ -89,13 +89,8 @@ w6 = -1.6309292987e-03; /* 0xbad5c4e8 * static const float zero= 0.0000000000e+00; -/* - * Compute sin(pi*x) without actually doing the pi*x multiplication. - * sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is - * the precision of x. - */ static float -sin_pi(float x) +sin_pif(float x) { volatile float vz; float y,z; @@ -106,7 +101,7 @@ sin_pi(float x) vz = y+0x1p23F; /* depend on 0 <= y < 0x1p23 */ z = vz-0x1p23F; /* rintf(y) for the above range */ if (z == y) - return (zero); + return zero; vz = y+0x1p21F; GET_FLOAT_WORD(n,vz); /* bits for rounded y (units 0.25) */ @@ -155,7 +150,7 @@ __ieee754_lgammaf_r(float x, int *signga if(hx<0) { if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */ return one/zero; - t = sin_pi(x); + t = sin_pif(x); if(t==zero) return one/zero; /* -integer */ nadj = __ieee754_logf(pi/fabsf(t*x)); if(t Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DDFBA86; Mon, 1 Sep 2014 16:25:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 490E91FC3; Mon, 1 Sep 2014 16:25:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81GP9BV020031; Mon, 1 Sep 2014 16:25:09 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81GP8gt020029; Mon, 1 Sep 2014 16:25:08 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409011625.s81GP8gt020029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 1 Sep 2014 16:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270933 - in head: sbin/conscontrol usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 16:25:09 -0000 Author: se Date: Mon Sep 1 16:25:08 2014 New Revision: 270933 URL: http://svnweb.freebsd.org/changeset/base/270933 Log: Add references to vt(4) to further man-pages. MFC after: 3 days Modified: head/sbin/conscontrol/conscontrol.8 head/usr.sbin/vidcontrol/vidcontrol.1 Modified: head/sbin/conscontrol/conscontrol.8 ============================================================================== --- head/sbin/conscontrol/conscontrol.8 Mon Sep 1 16:24:25 2014 (r270932) +++ head/sbin/conscontrol/conscontrol.8 Mon Sep 1 16:25:08 2014 (r270933) @@ -104,6 +104,7 @@ This is an interface to the tty ioctl .Xr sio 4 , .Xr syscons 4 , .Xr tty 4 , +.Xr vt 4 , .Xr boot 8 , .Xr loader 8 .Sh HISTORY Modified: head/usr.sbin/vidcontrol/vidcontrol.1 ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.1 Mon Sep 1 16:24:25 2014 (r270932) +++ head/usr.sbin/vidcontrol/vidcontrol.1 Mon Sep 1 16:25:08 2014 (r270933) @@ -1,5 +1,5 @@ .\" -.\" vidcontrol - a utility for manipulating the syscons video driver +.\" vidcontrol - a utility for manipulating the syscons or vt video driver .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -48,9 +48,15 @@ The .Nm utility is used to set various options for the .Xr syscons 4 +or +.Xr vt 4 console driver, such as video mode, colors, cursor shape, screen output map, font and screen saver timeout. +Only a small subset of options is supported by +.Xr vt 4 . +Unsupported options lead to error messages, typically including +the text "Inappropriate ioctl for device". .Pp The following command line options are supported: .Bl -tag -width indent @@ -158,8 +164,11 @@ See also .Sx Video Mode Support and .Sx EXAMPLES -below and the man page for -.Xr syscons 4 . +below and the man page for either +.Xr syscons 4 +or +.Xr vt 4 +(depending on which driver you use). .It Fl g Ar geometry Set the .Ar geometry @@ -185,7 +194,10 @@ Shows the possible video modes with the Install screen output map file from .Ar screen_map . See also -.Xr syscons 4 . +.Xr syscons 4 +or +.Xr vt 4 +(depending on which driver you use). .It Fl L Install default screen output map. .It Fl M Ar char @@ -307,12 +319,18 @@ kernel with the option. See .Xr syscons 4 +or +.Xr vt 4 +(depending on which driver you use) for more details on this kernel option. .Ss Format of Video Buffer Dump The .Nm utility uses the .Xr syscons 4 +.\" is it supported on vt(4)??? +or +.Xr vt 4 .Dv CONS_SCRSHOT .Xr ioctl 2 to capture the current contents of the video buffer. @@ -453,9 +471,12 @@ for details. .Sh FILES .Bl -tag -width /usr/share/syscons/scrnmaps/foo-bar -compact .It Pa /usr/share/syscons/fonts/* +.It Pa /usr/share/vt/fonts/* font files. .It Pa /usr/share/syscons/scrnmaps/* -screen output map files. +screen output map files (relevant for +.Xr syscons 4 +only). .El .Sh EXAMPLES If you want to load @@ -467,7 +488,10 @@ as: .Dl vidcontrol -f 8x16 /usr/share/syscons/fonts/iso-8x16.fnt .Pp So long as the font file is in -.Pa /usr/share/syscons/fonts , +.Pa /usr/share/syscons/fonts +(if using syscons) or +.Pa /usr/share/vt/fonts +(if using vt), you may abbreviate the file name as .Pa iso-8x16 : .Pp @@ -521,6 +545,7 @@ to the standard output in the human read .Xr screen 4 , .Xr syscons 4 , .Xr vga 4 , +.Xr vt 4 , .Xr rc.conf 5 , .Xr kldload 8 , .Xr moused 8 , From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 16:26:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60144CBF; Mon, 1 Sep 2014 16:26:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 320E81FDF; Mon, 1 Sep 2014 16:26:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81GQwuJ020310; Mon, 1 Sep 2014 16:26:58 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81GQvmP020308; Mon, 1 Sep 2014 16:26:57 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409011626.s81GQvmP020308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 1 Sep 2014 16:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270934 - head/tools/tools/vt/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 16:26:58 -0000 Author: se Date: Mon Sep 1 16:26:57 2014 New Revision: 270934 URL: http://svnweb.freebsd.org/changeset/base/270934 Log: Final patches to the tools used to convert syscons keymaps for use with vt. MFC after: 3 days Modified: head/tools/tools/vt/keymaps/KBDFILES.map head/tools/tools/vt/keymaps/convert-keymap.pl Modified: head/tools/tools/vt/keymaps/KBDFILES.map ============================================================================== --- head/tools/tools/vt/keymaps/KBDFILES.map Mon Sep 1 16:25:08 2014 (r270933) +++ head/tools/tools/vt/keymaps/KBDFILES.map Mon Sep 1 16:26:57 2014 (r270934) @@ -144,6 +144,6 @@ ISO8859-1 us.emacs.kbd us.emacs.kbd ISO8859-1 us.pc-ctrl.kbd us.ctrl.kbd ISO8859-1 us.unix.kbd us.unix.kbd -ISO8859-5 ua.iso5.kbd ua.kbd.from-iso5 +#ISO8859-5 ua.iso5.kbd ua.kbd.from-iso5 KOI8-U ua.koi8-u.kbd ua.kbd KOI8-U ua.koi8-u.shift.alt.kbd ua.shift.alt.kbd Modified: head/tools/tools/vt/keymaps/convert-keymap.pl ============================================================================== --- head/tools/tools/vt/keymaps/convert-keymap.pl Mon Sep 1 16:25:08 2014 (r270933) +++ head/tools/tools/vt/keymaps/convert-keymap.pl Mon Sep 1 16:26:57 2014 (r270934) @@ -7,7 +7,7 @@ use strict; use utf8; # command line parsing -die "Usage: $0 filename.kbd CHARSET [EURO]" +die "Usage: $0 filename.kbd charset [EURO|YEN]\n" unless ($ARGV[1]); my $inputfile = shift; # first command argument @@ -60,8 +60,8 @@ sub local_to_UCS_code $ucs_char = 0xa5 # replace with Jap. Yen character on PC kbd if $ucs_char == ord('\\') and $use_yen and $current_scancode == 125; - $ucs_char = 0xa5 # replace with Jap. Yen character on PC98x1 kbd - if $ucs_char == ord('\\') and $use_yen and $current_scancode == 13; +# $ucs_char = 0xa5 # replace with Jap. Yen character on PC98x1 kbd +# if $ucs_char == ord('\\') and $use_yen and $current_scancode == 13; return prettyprint_token($ucs_char); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 16:51:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A10F2BF; Mon, 1 Sep 2014 16:51:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE1461311; Mon, 1 Sep 2014 16:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81GpvRJ034721; Mon, 1 Sep 2014 16:51:57 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81GpvcB034720; Mon, 1 Sep 2014 16:51:57 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409011651.s81GpvcB034720@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 1 Sep 2014 16:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270935 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 16:51:58 -0000 Author: se Date: Mon Sep 1 16:51:57 2014 New Revision: 270935 URL: http://svnweb.freebsd.org/changeset/base/270935 Log: Add vt(4) support to the console initialisation script, specifically: - Identify the console driver used and print syscons or vt as appropriate. - If vt is used and a keymap could not be loaded, then try to replace the keymap name configured in rc.conf based on a replacement list in this script. Warn about the fact, that a syscons keyname is configured and report the replacement used under vt. - If no replacement keymap is found, no keymap is loaded and a warning is displayed, which points at the conversion script and allows the conversion of keymaps not part of the official distribution. This patch has been sent to the -hackers list for review, but no comment has been received, yet. It is tested to work under syscons and vt on my system (on vt with either the syscons or vt keymap file name in rc.conf). MFC after: 3 days Modified: head/etc/rc.d/syscons Modified: head/etc/rc.d/syscons ============================================================================== --- head/etc/rc.d/syscons Mon Sep 1 16:26:57 2014 (r270934) +++ head/etc/rc.d/syscons Mon Sep 1 16:51:57 2014 (r270935) @@ -45,16 +45,122 @@ stop_cmd=":" kbddev=/dev/ttyv0 viddev=/dev/ttyv0 -_sc_config="syscons" +_sc_config= +_sc_console= _sc_initdone= +_sc_keymap_msg= sc_init() { if [ -z "${_sc_initdone}" ]; then + if [ -z "${_sc_console}" ]; then + if [ x`sysctl -n kern.vty` = x"vt" ]; then + _sc_console="vt" + else + _sc_console="syscons" + fi + _sc_config="${_sc_console}" + fi echo -n "Configuring ${_sc_config}:" _sc_initdone=yes fi } +# syscons to vt migration helper +lookup_keymap_for_vt() +{ + keymap=`basename $1 .kbd` + case $keymap in +hy.armscii-8) echo am;; +be.iso.acc) echo be.acc;; +be.iso) echo be;; +bg.bds.ctrlcaps) echo bg.bds;; +bg.phonetic.ctrlcaps) echo bg.phonetic;; +br275.iso.acc) echo br;; +br275.*) echo br.noacc;; +by.*) echo by;; +fr_CA.iso.acc) echo ca-fr;; +swissgerman.macbook.acc) echo ch.macbook.acc;; +swissgerman.iso.acc) echo ch.acc;; +swissgerman.*) echo ch;; +swissfrench.iso.acc) echo ch-fr.acc;; +swissfrench.*) echo ch-fr;; +ce.iso2) echo centraleuropean.qwerty;; +colemak.iso15.acc) echo colemak.acc;; +cs.*|cz.*) echo cz;; +german.iso.acc) echo de.acc;; +german.*) echo de;; +danish.iso.acc) echo dk.acc;; +danish.iso.macbook) echo dk.macbook;; +danish.*) echo dk;; +estonian.*) echo ee;; +spanish.dvorak) echo es.dvorak;; +spanish.iso*.acc) echo es.acc;; +spanish.iso) echo es;; +finnish.*) echo fi;; +fr.macbook.acc) echo fr.macbook;; +fr.iso.acc) echo fr.acc;; +fr.iso) echo fr;; +el.iso07) echo gr;; +gr.us101.acc) echo gr.101.acc;; +hr.iso) echo hr;; +hu.iso2.101keys) echo hu.101;; +hu.iso2.102keys) echo hu.102;; +iw.iso8) echo il;; +icelandic.iso.acc) echo is.acc;; +icelandic.iso) echo is;; +it.iso) echo it;; +jp.106x) echo jp.capsctrl;; +jp.106) echo jp;; +#?? jp.pc98.iso) echo jp.pc98;; +kk.pt154.io) echo kz.io;; +kk.pt154.kst) echo kz.kst;; +latinamerican.iso.acc) echo latinamerican.acc;; +lt.iso4) echo lt;; +norwegian.iso) echo no;; +norwegian.dvorak) echo no.dvorak;; +dutch.iso.acc) echo nl;; +eee_nordic) echo nordic.asus-eee;; +pl_PL.dvorak) echo pl.dvorak;; +pl_PL.ISO8859-2) echo pl;; +pt.iso.acc) echo pt.acc;; +pt.iso) echo pt;; +ru.koi8-r.shift) echo ru.shift;; +ru.koi8-r.win) echo ru.win;; +ru.*) echo ru;; +swedish.*) echo se;; +si.iso) echo si;; +sk.iso2) echo sk;; +tr.iso9.q) echo tr;; +ua.koi8-u.shift.alt) echo ua.shift.alt;; +ua.*) echo ua;; +uk.*-ctrl) echo uk.capsctrl;; +uk.dvorak) echo uk.dvorak;; +uk.*) echo uk;; +us.iso.acc) echo us.acc;; +us.pc-ctrl) echo us.ctrl;; +us.iso) echo us;; + esac +} + +kbdcontrol_load_keymap() +{ + errmsg=`kbdcontrol < ${kbddev} -l ${keymap} 2>&1` + if [ -n "${errmsg}" -a "${_sc_console}" = "vt" ]; then + _sc_keymap_msg="${errmsg}" + keymap_vt=`lookup_keymap_for_vt ${keymap}` + if [ -n "${keymap_vt}" ]; then + errmsg=`kbdcontrol < ${kbddev} -l ${keymap_vt} 2>&1` + if [ -z "${errmsg}" ]; then + _sc_keymap_msg="New keymap: In /etc/rc.conf replace 'keymap=${keymap}' by 'keymap=${keymap_vt}'" + fi + else + _sc_keymap_msg="No replacement found for keymap '${keymap}'. +You may try to convert your keymap file using 'convert-keymap.pl', which is +part of the system sources and located in /usr/src/tools/tools/vt/keymaps/" + fi + fi +} + # helper syscons_configure_keyboard() { @@ -65,7 +171,7 @@ syscons_configure_keyboard() ;; *) sc_init - echo -n ' keymap'; kbdcontrol < ${kbddev} -l ${keymap} + echo -n ' keymap'; kbdcontrol_load_keymap ;; esac @@ -139,10 +245,9 @@ syscons_setkeyboard() # if [ -n "${_sc_initdone}" ]; then echo '.' - _sc_config="syscons" + _sc_config="${_sc_console}" _sc_initdone= fi - } syscons_precmd() @@ -256,6 +361,12 @@ syscons_start() fi [ -n "${_sc_initdone}" ] && echo '.' + if [ -n "${_sc_keymap_msg}" ]; then + echo + echo "WARNING:" + echo "${_sc_keymap_msg}." + echo + fi } load_rc_config $name From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:27:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D196B28B; Mon, 1 Sep 2014 18:27:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB31B1EF1; Mon, 1 Sep 2014 18:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81IR4a8081938; Mon, 1 Sep 2014 18:27:04 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81IR4iD081937; Mon, 1 Sep 2014 18:27:04 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409011827.s81IR4iD081937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 18:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270941 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:27:05 -0000 Author: ed Date: Mon Sep 1 18:27:04 2014 New Revision: 270941 URL: http://svnweb.freebsd.org/changeset/base/270941 Log: Add lock annotations to . Clang has support for annotating mutexes and code that uses mutexes to validate certain aspects of thread safety: - Whether acquiring/releasing locks is done properly (e.g., whether you unlock a mutex before leaving a function). - Whether a lock is held while reading/writing data from/to memory. Analysis is performed at the function level. Functions can be annotated to indicate they: - (try to) pick up a lock, - release a lock, - can only be called when (not) holding a lock, - assert that a lock is held. Variables and structure members can be annotated to indicate that they are guarded by a certain lock. In C++, these annotations can refer to both global variables, but also other class/structure members. In C, it is only possible to refer to global variables. This change adds wrappers for the annotations used by Clang to . They currently have no effect, but this is on purpose. This change will be merged back to FreeBSD 9 and 10, which means we can safely experiment with these annotations on HEAD without making it harder to port changes back. Reviewed by: announced on arch@ and toolchain@ MFC after: 3 weeks Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Sep 1 18:25:49 2014 (r270940) +++ head/sys/sys/cdefs.h Mon Sep 1 18:27:04 2014 (r270941) @@ -739,4 +739,60 @@ #define __NO_TLS 1 #endif +/* + * Lock annotations. + * + * Clang provides support for doing basic thread-safety tests at + * compile-time, by marking which locks will/should be held when + * entering/leaving a functions. + * + * Furthermore, it is also possible to annotate variables and structure + * members to enforce that they are only accessed when certain locks are + * held. + * + * Note: These annotations have no effect on this version of FreeBSD. + * They are merely provided for forward compatibilty. + */ + +#define __lock_annotate(x) + +/* Structure implements a lock. */ +#define __lockable __lock_annotate(lockable) + +/* Function acquires an exclusive or shared lock. */ +#define __locks_exclusive(...) \ + __lock_annotate(exclusive_lock_function(__VA_ARGS__)) +#define __locks_shared(...) \ + __lock_annotate(shared_lock_function(__VA_ARGS__)) + +/* Function attempts to acquire an exclusive or shared lock. */ +#define __trylocks_exclusive(...) \ + __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) +#define __trylocks_shared(...) \ + __lock_annotate(shared_trylock_function(__VA_ARGS__)) + +/* Function releases a lock. */ +#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) + +/* Function asserts that an exclusive or shared lock is held. */ +#define __asserts_exclusive(...) \ + __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) +#define __asserts_shared(...) \ + __lock_annotate(assert_shared_lock(__VA_ARGS__)) + +/* Function requires that an exclusive or shared lock is or is not held. */ +#define __requires_exclusive(...) \ + __lock_annotate(exclusive_locks_required(__VA_ARGS__)) +#define __requires_shared(...) \ + __lock_annotate(shared_locks_required(__VA_ARGS__)) +#define __requires_unlocked(...) \ + __lock_annotate(locks_excluded(__VA_ARGS__)) + +/* Function should not be analyzed. */ +#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) + +/* Guard variables and structure members by lock. */ +#define __guarded_by(x) __lock_annotate(guarded_by(x)) +#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) + #endif /* !_SYS_CDEFS_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:28:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5976C45B; Mon, 1 Sep 2014 18:28:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 455201F0C; Mon, 1 Sep 2014 18:28:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81ISCLS082143; Mon, 1 Sep 2014 18:28:12 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81ISCF6082142; Mon, 1 Sep 2014 18:28:12 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409011828.s81ISCF6082142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 18:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270942 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:28:12 -0000 Author: ed Date: Mon Sep 1 18:28:11 2014 New Revision: 270942 URL: http://svnweb.freebsd.org/changeset/base/270942 Log: Enable lock annotations on HEAD when using Clang. MFC after: never Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Sep 1 18:27:04 2014 (r270941) +++ head/sys/sys/cdefs.h Mon Sep 1 18:28:11 2014 (r270942) @@ -749,12 +749,13 @@ * Furthermore, it is also possible to annotate variables and structure * members to enforce that they are only accessed when certain locks are * held. - * - * Note: These annotations have no effect on this version of FreeBSD. - * They are merely provided for forward compatibilty. */ +#ifdef __clang__ +#define __lock_annotate(x) __attribute__((x)) +#else #define __lock_annotate(x) +#endif /* Structure implements a lock. */ #define __lockable __lock_annotate(lockable) From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:34:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B68666A0; Mon, 1 Sep 2014 18:34:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A150B1FCE; Mon, 1 Sep 2014 18:34:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81IYVp0086398; Mon, 1 Sep 2014 18:34:31 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81IYVUO086394; Mon, 1 Sep 2014 18:34:31 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409011834.s81IYVUO086394@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270943 - in head: include lib/libstdthreads X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:34:31 -0000 Author: ed Date: Mon Sep 1 18:34:30 2014 New Revision: 270943 URL: http://svnweb.freebsd.org/changeset/base/270943 Log: Add lock annotations to the header files of our threading libraries. This change extends all of the functions present in the and headers to have lock annotations. This will allow Clang to warn about the following: - Locking a function twice, - Unlocking a function without a mutex being locked, - Forgetting to unlock a mutex before returning, - Destroying or reinitializing a mutex that is currenty locked, - Using an unlocked mutex in combination with a condition variable. Enabling these annotations already allowed me to catch a bug in one of our userspace tools (r270749). Modified: head/include/pthread.h head/lib/libstdthreads/threads.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Mon Sep 1 18:28:11 2014 (r270942) +++ head/include/pthread.h Mon Sep 1 18:34:30 2014 (r270943) @@ -193,8 +193,10 @@ int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, - pthread_mutex_t *, const struct timespec *); -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); + pthread_mutex_t *__mutex, const struct timespec *) + __requires_exclusive(*__mutex); +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex) + __requires_exclusive(*__mutex); int pthread_create(pthread_t *, const pthread_attr_t *, void *(*) (void *), void *); int pthread_detach(pthread_t); @@ -213,27 +215,42 @@ int pthread_mutexattr_getpshared(const int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); int pthread_mutexattr_settype(pthread_mutexattr_t *, int); int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); -int pthread_mutex_destroy(pthread_mutex_t *); -int pthread_mutex_init(pthread_mutex_t *, - const pthread_mutexattr_t *); -int pthread_mutex_lock(pthread_mutex_t *); -int pthread_mutex_trylock(pthread_mutex_t *); -int pthread_mutex_timedlock(pthread_mutex_t *, - const struct timespec *); -int pthread_mutex_unlock(pthread_mutex_t *); +int pthread_mutex_destroy(pthread_mutex_t *__mutex) + __requires_unlocked(*__mutex); +int pthread_mutex_init(pthread_mutex_t *__mutex, + const pthread_mutexattr_t *) + __requires_unlocked(*__mutex); +int pthread_mutex_lock(pthread_mutex_t *__mutex) + __locks_exclusive(*__mutex); +int pthread_mutex_trylock(pthread_mutex_t *__mutex) + __trylocks_exclusive(0, *__mutex); +int pthread_mutex_timedlock(pthread_mutex_t *__mutex, + const struct timespec *) + __trylocks_exclusive(0, *__mutex); +int pthread_mutex_unlock(pthread_mutex_t *__mutex) + __unlocks(*__mutex); int pthread_once(pthread_once_t *, void (*) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t *); -int pthread_rwlock_init(pthread_rwlock_t *, - const pthread_rwlockattr_t *); -int pthread_rwlock_rdlock(pthread_rwlock_t *); -int pthread_rwlock_timedrdlock(pthread_rwlock_t *, - const struct timespec *); -int pthread_rwlock_timedwrlock(pthread_rwlock_t *, - const struct timespec *); -int pthread_rwlock_tryrdlock(pthread_rwlock_t *); -int pthread_rwlock_trywrlock(pthread_rwlock_t *); -int pthread_rwlock_unlock(pthread_rwlock_t *); -int pthread_rwlock_wrlock(pthread_rwlock_t *); +int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) + __requires_unlocked(*__rwlock); +int pthread_rwlock_init(pthread_rwlock_t *__rwlock, + const pthread_rwlockattr_t *) + __requires_unlocked(*__rwlock); +int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) + __locks_shared(*__rwlock); +int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock, + const struct timespec *) + __trylocks_shared(0, *__rwlock); +int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock, + const struct timespec *) + __trylocks_exclusive(0, *__rwlock); +int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) + __trylocks_shared(0, *__rwlock); +int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) + __trylocks_exclusive(0, *__rwlock); +int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) + __unlocks(*__rwlock); +int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) + __locks_exclusive(*__rwlock); int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, int *); @@ -245,11 +262,16 @@ int pthread_rwlockattr_setpshared(pthre pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t *, int); -int pthread_spin_destroy(pthread_spinlock_t *); -int pthread_spin_lock(pthread_spinlock_t *); -int pthread_spin_trylock(pthread_spinlock_t *); -int pthread_spin_unlock(pthread_spinlock_t *); +int pthread_spin_init(pthread_spinlock_t *__spin, int) + __requires_unlocked(*__spin); +int pthread_spin_destroy(pthread_spinlock_t *__spin) + __requires_unlocked(*__spin); +int pthread_spin_lock(pthread_spinlock_t *__spin) + __locks_exclusive(*__spin); +int pthread_spin_trylock(pthread_spinlock_t *__spin) + __trylocks_exclusive(0, *__spin); +int pthread_spin_unlock(pthread_spinlock_t *__spin) + __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); int pthread_setcanceltype(int, int *); Modified: head/lib/libstdthreads/threads.h ============================================================================== --- head/lib/libstdthreads/threads.h Mon Sep 1 18:28:11 2014 (r270942) +++ head/lib/libstdthreads/threads.h Mon Sep 1 18:34:30 2014 (r270943) @@ -79,15 +79,24 @@ int cnd_broadcast(cnd_t *); void cnd_destroy(cnd_t *); int cnd_init(cnd_t *); int cnd_signal(cnd_t *); -int cnd_timedwait(cnd_t *__restrict, mtx_t *__restrict, - const struct timespec *__restrict); -int cnd_wait(cnd_t *, mtx_t *); -void mtx_destroy(mtx_t *); -int mtx_init(mtx_t *, int); -int mtx_lock(mtx_t *); -int mtx_timedlock(mtx_t *__restrict, const struct timespec *__restrict); -int mtx_trylock(mtx_t *); -int mtx_unlock(mtx_t *); +int cnd_timedwait(cnd_t *__restrict, mtx_t *__restrict __mtx, + const struct timespec *__restrict) + __requires_exclusive(*__mtx); +int cnd_wait(cnd_t *, mtx_t *__mtx) + __requires_exclusive(*__mtx); +void mtx_destroy(mtx_t *__mtx) + __requires_unlocked(*__mtx); +int mtx_init(mtx_t *__mtx, int) + __requires_unlocked(*__mtx); +int mtx_lock(mtx_t *__mtx) + __locks_exclusive(*__mtx); +int mtx_timedlock(mtx_t *__restrict __mtx, + const struct timespec *__restrict) + __trylocks_exclusive(thrd_success, *__mtx); +int mtx_trylock(mtx_t *__mtx) + __trylocks_exclusive(thrd_success, *__mtx); +int mtx_unlock(mtx_t *__mtx) + __unlocks(*__mtx); int thrd_create(thrd_t *, thrd_start_t, void *); thrd_t thrd_current(void); int thrd_detach(thrd_t); From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:35:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC400996; Mon, 1 Sep 2014 18:35:44 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F42F1FDC; Mon, 1 Sep 2014 18:35:43 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id gi9so6586632lab.0 for ; Mon, 01 Sep 2014 11:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=1KoxknqTFB6BYh6PXANirlnsRPCFfehg1YSeRV/IxHk=; b=N5qnOB+HsOSR39AYaAZy+kBqv24WgHJ6X5NcLsw+t3ybKOPkhV+Sg9tgNqZ7UKbRIs cbTZbrCC27a7hYP/gut2meAzP8wD5CqUdp/HCHaOumBQrYTv46ZF5sqOLyMjAM/Hj7GF nMHbbS4f+m2Z3lDvlczMNNAs9d8OvczYaHGOG+cefLnOWIT+zaVYr3MEh1kE1UGO4HuY 9NFFhV1ZWoNHQekhlxNGhwlptZ/xKObFN2GURgiCEJmxhK/3V20OrnYXTt5TOKJpag5D aaoulnPPDYH87Df0b5dPdw9speCtGWKcsrLu9u7e5ml4F/CJaxoWoD51m0S4q/CYRtW5 doTQ== MIME-Version: 1.0 X-Received: by 10.112.202.69 with SMTP id kg5mr29003872lbc.33.1409596541666; Mon, 01 Sep 2014 11:35:41 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.152.144.2 with HTTP; Mon, 1 Sep 2014 11:35:41 -0700 (PDT) In-Reply-To: <201409011834.s81IYVUO086394@svn.freebsd.org> References: <201409011834.s81IYVUO086394@svn.freebsd.org> Date: Mon, 1 Sep 2014 20:35:41 +0200 X-Google-Sender-Auth: STzDBKdyQP_hW-QULPIJoqtv6k0 Message-ID: Subject: Re: svn commit: r270943 - in head: include lib/libstdthreads From: Ed Schouten To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:35:45 -0000 On 1 September 2014 20:34, Ed Schouten wrote: > - Locking a function twice, > - Unlocking a function without a mutex being locked, Errr... - Locking a mutex twice, - Unlocking a mutex without it being locked -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:37:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 416B7AE8; Mon, 1 Sep 2014 18:37:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE971FEE; Mon, 1 Sep 2014 18:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81IbIWT086836; Mon, 1 Sep 2014 18:37:18 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81IbHSc086834; Mon, 1 Sep 2014 18:37:17 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409011837.s81IbHSc086834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 18:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270944 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:37:18 -0000 Author: ed Date: Mon Sep 1 18:37:17 2014 New Revision: 270944 URL: http://svnweb.freebsd.org/changeset/base/270944 Log: Add lock annotations to the threading API used by hastd. Approved by: pjd@ Modified: head/sbin/hastd/primary.c head/sbin/hastd/synch.h Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Sep 1 18:34:30 2014 (r270943) +++ head/sbin/hastd/primary.c Mon Sep 1 18:37:17 2014 (r270944) @@ -330,9 +330,8 @@ primary_exitx(int exitcode, const char * exit(exitcode); } -/* Expects res->hr_amp locked, returns unlocked. */ static int -hast_activemap_flush(struct hast_resource *res) +hast_activemap_flush(struct hast_resource *res) __unlocks(res->hr_amp_lock) { const unsigned char *buf; size_t size; Modified: head/sbin/hastd/synch.h ============================================================================== --- head/sbin/hastd/synch.h Mon Sep 1 18:34:30 2014 (r270943) +++ head/sbin/hastd/synch.h Mon Sep 1 18:37:17 2014 (r270944) @@ -46,7 +46,7 @@ #endif static __inline void -mtx_init(pthread_mutex_t *lock) +mtx_init(pthread_mutex_t *lock) __requires_unlocked(*lock) { int error; @@ -54,7 +54,7 @@ mtx_init(pthread_mutex_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -mtx_destroy(pthread_mutex_t *lock) +mtx_destroy(pthread_mutex_t *lock) __requires_unlocked(*lock) { int error; @@ -62,7 +62,7 @@ mtx_destroy(pthread_mutex_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -mtx_lock(pthread_mutex_t *lock) +mtx_lock(pthread_mutex_t *lock) __locks_exclusive(*lock) { int error; @@ -70,7 +70,7 @@ mtx_lock(pthread_mutex_t *lock) PJDLOG_ASSERT(error == 0); } static __inline bool -mtx_trylock(pthread_mutex_t *lock) +mtx_trylock(pthread_mutex_t *lock) __trylocks_exclusive(true, *lock) { int error; @@ -79,7 +79,7 @@ mtx_trylock(pthread_mutex_t *lock) return (error == 0); } static __inline void -mtx_unlock(pthread_mutex_t *lock) +mtx_unlock(pthread_mutex_t *lock) __unlocks(*lock) { int error; @@ -94,7 +94,7 @@ mtx_owned(pthread_mutex_t *lock) } static __inline void -rw_init(pthread_rwlock_t *lock) +rw_init(pthread_rwlock_t *lock) __requires_unlocked(*lock) { int error; @@ -102,7 +102,7 @@ rw_init(pthread_rwlock_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -rw_destroy(pthread_rwlock_t *lock) +rw_destroy(pthread_rwlock_t *lock) __requires_unlocked(*lock) { int error; @@ -110,7 +110,7 @@ rw_destroy(pthread_rwlock_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -rw_rlock(pthread_rwlock_t *lock) +rw_rlock(pthread_rwlock_t *lock) __locks_shared(*lock) { int error; @@ -118,7 +118,7 @@ rw_rlock(pthread_rwlock_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -rw_wlock(pthread_rwlock_t *lock) +rw_wlock(pthread_rwlock_t *lock) __locks_exclusive(*lock) { int error; @@ -126,7 +126,7 @@ rw_wlock(pthread_rwlock_t *lock) PJDLOG_ASSERT(error == 0); } static __inline void -rw_unlock(pthread_rwlock_t *lock) +rw_unlock(pthread_rwlock_t *lock) __unlocks(*lock) { int error; @@ -150,7 +150,7 @@ cv_init(pthread_cond_t *cv) PJDLOG_ASSERT(error == 0); } static __inline void -cv_wait(pthread_cond_t *cv, pthread_mutex_t *lock) +cv_wait(pthread_cond_t *cv, pthread_mutex_t *lock) __requires_exclusive(*lock) { int error; @@ -159,6 +159,7 @@ cv_wait(pthread_cond_t *cv, pthread_mute } static __inline bool cv_timedwait(pthread_cond_t *cv, pthread_mutex_t *lock, int timeout) + __requires_exclusive(*lock) { struct timespec ts; int error; From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:51:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0CF4DE4; Mon, 1 Sep 2014 18:51:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 996B51213; Mon, 1 Sep 2014 18:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81Ip5kY093048; Mon, 1 Sep 2014 18:51:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81Ip1oL093023; Mon, 1 Sep 2014 18:51:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409011851.s81Ip1oL093023@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 1 Sep 2014 18:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270945 - in head/sys: arm/arm arm/at91 arm/freescale/vybrid arm/mv arm/rockchip dev/fdt dev/gpio dev/ofw dev/tsec mips/beri powerpc/ofw powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:51:05 -0000 Author: ian Date: Mon Sep 1 18:51:01 2014 New Revision: 270945 URL: http://svnweb.freebsd.org/changeset/base/270945 Log: Rename OF_xref_phandle() to OF_node_from_xref() and add a new function that provides the inverse translation, OF_xref_from_node(). Discussed with: nwhitehorn Modified: head/sys/arm/arm/nexus.c head/sys/arm/at91/at91_pinctrl.c head/sys/arm/freescale/vybrid/vf_sai.c head/sys/arm/mv/gpio.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/simplebus.c head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_fdt.c head/sys/dev/ofw/ofwbus.c head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/dev/tsec/if_tsec_fdt.c head/sys/mips/beri/beri_simplebus.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/powermac/macio.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/arm/arm/nexus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -341,7 +341,7 @@ nexus_ofw_map_intr(device_t dev, device_ phandle_t intr_offset; int i, rv, interrupt, trig, pol; - intr_offset = OF_xref_phandle(iparent); + intr_offset = OF_node_from_xref(iparent); for (i = 0; i < icells; i++) intr[i] = cpu_to_fdt32(intr[i]); Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/arm/at91/at91_pinctrl.c Mon Sep 1 18:51:01 2014 (r270945) @@ -136,7 +136,7 @@ at91_pinctrl_setup_dinfo(device_t dev, p "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); @@ -399,7 +399,7 @@ pinctrl_walk_tree(device_t bus, phandle_ len /= sizeof(phandle_t); printf("pinctrl: Found active node %s\n", name); for (i = 0; i < len; i++) { - scratch = OF_xref_phandle(pinctrl[i]); + scratch = OF_node_from_xref(pinctrl[i]); npins = OF_getencprop(scratch, "atmel,pins", pins, sizeof(pins)); if (npins <= 0) { printf("We're doing it wrong %s\n", name); Modified: head/sys/arm/freescale/vybrid/vf_sai.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_sai.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/arm/freescale/vybrid/vf_sai.c Mon Sep 1 18:51:01 2014 (r270945) @@ -430,7 +430,7 @@ find_edma_controller(struct sc_info *sc) OF_getprop(node, "edma-mux-group", &dts_value, len); edma_mux_group = fdt32_to_cpu(dts_value); OF_getprop(node, "edma-controller", &dts_value, len); - edma_node = OF_xref_phandle(fdt32_to_cpu(dts_value)); + edma_node = OF_node_from_xref(fdt32_to_cpu(dts_value)); if ((len = OF_getproplen(edma_node, "device-id")) <= 0) { return (ENXIO); Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/arm/mv/gpio.c Mon Sep 1 18:51:01 2014 (r270945) @@ -642,7 +642,7 @@ mv_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/arm/rockchip/rk30xx_gpio.c Mon Sep 1 18:51:01 2014 (r270945) @@ -656,7 +656,7 @@ rk30_gpio_init(void) * contain a ref. to a node defining GPIO * controller. */ - ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + ctrl = OF_node_from_xref(fdt32_to_cpu(gpios[0])); if (fdt_is_compatible(ctrl, e->compat)) /* Call a handler. */ Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/fdt/fdt_common.c Mon Sep 1 18:51:01 2014 (r270945) @@ -510,7 +510,7 @@ fdt_intr_to_rl(device_t dev, phandle_t n "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); @@ -545,7 +545,7 @@ fdt_get_phyaddr(phandle_t node, device_t sizeof(phy_handle)) <= 0) return (ENXIO); - phy_node = OF_xref_phandle(phy_handle); + phy_node = OF_node_from_xref(phy_handle); if (OF_getprop(phy_node, "reg", (void *)&phy_reg, sizeof(phy_reg)) <= 0) Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/fdt/simplebus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -298,7 +298,7 @@ simplebus_setup_dinfo(device_t dev, phan "assuming direct parent\n"); iparent = OF_parent(node); } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1>\n"); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/gpio/ofw_gpiobus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -129,7 +129,7 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s i++; continue; } - gpio = OF_xref_phandle(gpios[i]); + gpio = OF_node_from_xref(gpios[i]); /* Verify if we're attaching to the correct GPIO controller. */ if (!OF_hasprop(gpio, "gpio-controller") || gpio != ofw_bus_get_node(sc->sc_dev)) { @@ -168,7 +168,7 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s continue; } - gpio = OF_xref_phandle(gpios[i]); + gpio = OF_node_from_xref(gpios[i]); /* Read gpio-cells property for this GPIO controller. */ if (OF_getencprop(gpio, "#gpio-cells", &cells, sizeof(cells)) < 0) { Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Sep 1 18:51:01 2014 (r270945) @@ -344,7 +344,7 @@ ofw_bus_search_intrmap(void *intr, int i i = imapsz; while (i > 0) { bcopy(mptr + physsz + intrsz, &parent, sizeof(parent)); - if (OF_searchencprop(OF_xref_phandle(parent), + if (OF_searchencprop(OF_node_from_xref(parent), "#interrupt-cells", &pintrsz, sizeof(pintrsz)) == -1) pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/ofw/ofw_fdt.c Mon Sep 1 18:51:01 2014 (r270945) @@ -208,7 +208,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, i { /* Where real OF uses ihandles in the tree, FDT uses xref phandles */ - return (OF_xref_phandle(instance)); + return (OF_node_from_xref(instance)); } /* Get the length of a property of a package. */ Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/ofw/ofwbus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -494,7 +494,7 @@ ofwbus_setup_dinfo(device_t dev, phandle "assuming nexus on <%s>\n", nodename); iparent = 0xffffffff; } - if (OF_searchencprop(OF_xref_phandle(iparent), + if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells property, " "assuming <1> on <%s>\n", nodename); Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/ofw/openfirm.c Mon Sep 1 18:51:01 2014 (r270945) @@ -463,7 +463,7 @@ OF_child_xref_phandle(phandle_t parent, } phandle_t -OF_xref_phandle(phandle_t xref) +OF_node_from_xref(phandle_t xref) { phandle_t node; @@ -474,6 +474,20 @@ OF_xref_phandle(phandle_t xref) return (node); } +phandle_t +OF_xref_from_node(phandle_t node) +{ + phandle_t xref; + + if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == + -1 && OF_getencprop(node, "ibm,phandle", &xref, + sizeof(xref)) == -1 && OF_getencprop(node, + "linux,phandle", &xref, sizeof(xref)) == -1) + return (node); + + return (xref); +} + /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/ofw/openfirm.h Mon Sep 1 18:51:01 2014 (r270945) @@ -130,7 +130,8 @@ ssize_t OF_package_to_path(phandle_t no * real phandle. If one can't be found (or running on OF implementations * without this property), returns its input. */ -phandle_t OF_xref_phandle(phandle_t xref); +phandle_t OF_node_from_xref(phandle_t xref); +phandle_t OF_xref_from_node(phandle_t node); /* Device I/O functions */ ihandle_t OF_open(const char *path); Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/dev/tsec/if_tsec_fdt.c Mon Sep 1 18:51:01 2014 (r270945) @@ -166,7 +166,7 @@ tsec_fdt_attach(device_t dev) return (ENXIO); } - phy = OF_xref_phandle(phy); + phy = OF_node_from_xref(phy); OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh); OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr)); Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/mips/beri/beri_simplebus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -351,7 +351,7 @@ simplebus_get_interrupt_parent(device_t if (OF_getencprop(di->di_ofw.obd_node, "interrupt-parent", &iph, sizeof(iph)) > 0) { - ph = OF_xref_phandle(iph); + ph = OF_node_from_xref(iph); SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { if (ic->iph == ph) { ip = ic->dev; Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/powerpc/ofw/ofw_pcibus.c Mon Sep 1 18:51:01 2014 (r270945) @@ -212,7 +212,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_ OF_getprop(child, "interrupt-parent", &iparent, sizeof(iparent)); if (iparent != 0) { - OF_getprop(OF_xref_phandle(iparent), + OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)); intr[0] = ofw_bus_map_intr(dev, iparent, @@ -329,7 +329,7 @@ ofw_pcibus_assign_interrupt(device_t dev iparent = -1; icells = 1; if (iparent != -1) - OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", + OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)); /* Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Mon Sep 1 18:37:17 2014 (r270944) +++ head/sys/powerpc/powermac/macio.c Mon Sep 1 18:51:01 2014 (r270945) @@ -217,7 +217,7 @@ macio_add_intr(phandle_t devnode, struct <= 0) panic("Interrupt but no interrupt parent!\n"); - if (OF_getprop(OF_xref_phandle(iparent), "#interrupt-cells", &icells, + if (OF_getprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) <= 0) icells = 1; From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 18:57:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 776641FD; Mon, 1 Sep 2014 18:57:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F62212FB; Mon, 1 Sep 2014 18:57:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81IvEjN096376; Mon, 1 Sep 2014 18:57:14 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81IvEmc096373; Mon, 1 Sep 2014 18:57:14 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409011857.s81IvEmc096373@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Mon, 1 Sep 2014 18:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270947 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 18:57:14 -0000 Author: kargl Date: Mon Sep 1 18:57:13 2014 New Revision: 270947 URL: http://svnweb.freebsd.org/changeset/base/270947 Log: According to the ISO C standard, lgamma(-integer) returns inf and raises the divided-by-zero exception. Compilers constant fold one/zero to inf but do not raise the exception. Introduce a volatile vzero to prevent the constant folding. Move the declaration of zero into the main declaration block. While here, fix a nearby disordering of 'lx,ix' Discussed with: bde Modified: head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Mon Sep 1 18:56:22 2014 (r270946) +++ head/lib/msun/src/e_lgamma_r.c Mon Sep 1 18:57:13 2014 (r270947) @@ -86,7 +86,10 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +static const volatile double vzero = 0; + static const double +zero= 0.00000000000000000000e+00, two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ @@ -154,8 +157,6 @@ w4 = -5.95187557450339963135e-04, /* 0x w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */ w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */ -static const double zero= 0.00000000000000000000e+00; - /* * Compute sin(pi*x) without actually doing the pi*x multiplication. * sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is @@ -204,7 +205,7 @@ __ieee754_lgamma_r(double x, int *signga { double t,y,z,nadj,p,p1,p2,p3,q,r,w; int32_t hx; - int i,lx,ix; + int i,ix,lx; EXTRACT_WORDS(hx,lx,x); @@ -212,7 +213,7 @@ __ieee754_lgamma_r(double x, int *signga *signgamp = 1; ix = hx&0x7fffffff; if(ix>=0x7ff00000) return x*x; - if((ix|lx)==0) return one/zero; + if((ix|lx)==0) return one/vzero; if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */ if(hx<0) { *signgamp = -1; @@ -221,9 +222,9 @@ __ieee754_lgamma_r(double x, int *signga } if(hx<0) { if(ix>=0x43300000) /* |x|>=2**52, must be -integer */ - return one/zero; + return one/vzero; t = sin_pi(x); - if(t==zero) return one/zero; /* -integer */ + if(t==zero) return one/vzero; /* -integer */ nadj = __ieee754_log(pi/fabs(t*x)); if(t=0x7f800000) return x*x; - if(ix==0) return one/zero; + if(ix==0) return one/vzero; if(ix<0x35000000) { /* |x|<2**-21, return -log(|x|) */ if(hx<0) { *signgamp = -1; @@ -149,9 +150,9 @@ __ieee754_lgammaf_r(float x, int *signga } if(hx<0) { if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */ - return one/zero; + return one/vzero; t = sin_pif(x); - if(t==zero) return one/zero; /* -integer */ + if(t==zero) return one/vzero; /* -integer */ nadj = __ieee754_logf(pi/fabsf(t*x)); if(t Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5762BF3B; Mon, 1 Sep 2014 19:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41EA815AC; Mon, 1 Sep 2014 19:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81JKZO6007759; Mon, 1 Sep 2014 19:20:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81JKYrk007754; Mon, 1 Sep 2014 19:20:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409011920.s81JKYrk007754@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 1 Sep 2014 19:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270948 - in head/sys/arm: broadcom/bcm2835 freescale/imx ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 19:20:35 -0000 Author: ian Date: Mon Sep 1 19:20:34 2014 New Revision: 270948 URL: http://svnweb.freebsd.org/changeset/base/270948 Log: sdhci.h has grown a dependency on sysctl.h, include the latter where needed. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Sep 1 18:57:13 2014 (r270947) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Sep 1 19:20:34 2014 (r270948) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Mon Sep 1 18:57:13 2014 (r270947) +++ head/sys/arm/freescale/imx/imx_sdhci.c Mon Sep 1 19:20:34 2014 (r270948) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Mon Sep 1 18:57:13 2014 (r270947) +++ head/sys/arm/ti/ti_sdhci.c Mon Sep 1 19:20:34 2014 (r270948) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 19:56:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34598604; Mon, 1 Sep 2014 19:56:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB081A9E; Mon, 1 Sep 2014 19:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81JuTWh028691; Mon, 1 Sep 2014 19:56:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81JuS6a028690; Mon, 1 Sep 2014 19:56:28 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409011956.s81JuS6a028690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 19:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270950 - head/lib/libcuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 19:56:29 -0000 Author: ed Date: Mon Sep 1 19:56:28 2014 New Revision: 270950 URL: http://svnweb.freebsd.org/changeset/base/270950 Log: Add lock annotations to libcuse. - Add annotations to the lock/unlock function to indicate that the function is allowed to lock and unlock the underlying pthread mutex. - Add __guarded_by() annotations to the global variables. Approved by: hselasky@ Modified: head/lib/libcuse/cuse_lib.c Modified: head/lib/libcuse/cuse_lib.c ============================================================================== --- head/lib/libcuse/cuse_lib.c Mon Sep 1 19:20:42 2014 (r270949) +++ head/lib/libcuse/cuse_lib.c Mon Sep 1 19:56:28 2014 (r270950) @@ -79,20 +79,22 @@ struct cuse_dev { void *priv1; }; -static TAILQ_HEAD(, cuse_dev) h_cuse; -static TAILQ_HEAD(, cuse_dev_entered) h_cuse_entered; static int f_cuse = -1; + static pthread_mutex_t m_cuse; -static struct cuse_vm_allocation a_cuse[CUSE_ALLOC_UNIT_MAX]; +static TAILQ_HEAD(, cuse_dev) h_cuse __guarded_by(m_cuse); +static TAILQ_HEAD(, cuse_dev_entered) h_cuse_entered __guarded_by(m_cuse); +static struct cuse_vm_allocation a_cuse[CUSE_ALLOC_UNIT_MAX] + __guarded_by(m_cuse); static void -cuse_lock(void) +cuse_lock(void) __locks_exclusive(m_cuse) { pthread_mutex_lock(&m_cuse); } static void -cuse_unlock(void) +cuse_unlock(void) __unlocks(m_cuse) { pthread_mutex_unlock(&m_cuse); } From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 20:18:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5362A1B4; Mon, 1 Sep 2014 20:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB121CB5; Mon, 1 Sep 2014 20:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81KIAY3039512; Mon, 1 Sep 2014 20:18:10 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81KI9lc039510; Mon, 1 Sep 2014 20:18:09 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409012018.s81KI9lc039510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 1 Sep 2014 20:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270951 - in head: share/mk usr.sbin/auditdistd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 20:18:10 -0000 Author: ed Date: Mon Sep 1 20:18:09 2014 New Revision: 270951 URL: http://svnweb.freebsd.org/changeset/base/270951 Log: Add -Wthread-safety to WARNS=6. While there, add a NO_WTHREAD_SAFETY flag that can be used to disable this specific warning flag. Disable it for auditdistd. We can easily patch up auditdistd to have the right annotations to build, but as auditdistd is intended to be portable across other operating systems, it's not worth the effort. Approved by: brueffer@ Modified: head/share/mk/bsd.sys.mk head/usr.sbin/auditdistd/Makefile Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Sep 1 19:56:28 2014 (r270950) +++ head/share/mk/bsd.sys.mk Mon Sep 1 20:18:09 2014 (r270951) @@ -54,6 +54,9 @@ CWARNFLAGS+= -Wchar-subscripts -Winline .if !defined(NO_WMISSING_VARIABLE_DECLARATIONS) CWARNFLAGS.clang+= -Wmissing-variable-declarations .endif +.if !defined(NO_WTHREAD_SAFETY) +CWARNFLAGS.clang+= -Wthread-safety +.endif .endif # WARNS >= 6 .if ${WARNS} >= 2 && ${WARNS} <= 4 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't Modified: head/usr.sbin/auditdistd/Makefile ============================================================================== --- head/usr.sbin/auditdistd/Makefile Mon Sep 1 19:56:28 2014 (r270950) +++ head/usr.sbin/auditdistd/Makefile Mon Sep 1 20:18:09 2014 (r270951) @@ -30,4 +30,8 @@ YFLAGS+=-v CLEANFILES=parse.c parse.h parse.output +# auditdistd cannot use FreeBSD specific lock annotation macros. Disable +# thread safety analysis completely. +NO_WTHREAD_SAFETY= + .include From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 22:25:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F464869; Mon, 1 Sep 2014 22:25:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212F61AE2; Mon, 1 Sep 2014 22:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81MPg4X004845; Mon, 1 Sep 2014 22:25:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81MPg8l004843; Mon, 1 Sep 2014 22:25:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409012225.s81MPg8l004843@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 1 Sep 2014 22:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270952 - in head: include lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 22:25:43 -0000 Author: pfg Date: Mon Sep 1 22:25:42 2014 New Revision: 270952 URL: http://svnweb.freebsd.org/changeset/base/270952 Log: Add bsearch_b to the libc map and the stdlib header. bsearch_b is the Apple blocks enabled version of bsearch(3). This was added to libc in Revision 264042 but the commit missed the declaration required to make use of it. While here move some other block-related functions to the BSD_VISIBLE block as these are non-standard. Phabric: D638 Reviewed by: theraven, wollman Modified: head/include/stdlib.h head/lib/libc/stdlib/Symbol.map Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Sep 1 20:18:09 2014 (r270951) +++ head/include/stdlib.h Mon Sep 1 22:25:42 2014 (r270952) @@ -82,9 +82,6 @@ extern int ___mb_cur_max(void); _Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); -#ifdef __BLOCKS__ -int atexit_b(void (^)(void)); -#endif double atof(const char *); int atoi(const char *); long atol(const char *); @@ -103,10 +100,6 @@ size_t mbstowcs(wchar_t * __restrict , int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); -#ifdef __BLOCKS__ -void qsort_b(void *, size_t, size_t, - int (^)(const void *, const void *)); -#endif int rand(void); void *realloc(void *, size_t); void srand(unsigned); @@ -264,6 +257,11 @@ void arc4random_buf(void *, size_t); void arc4random_stir(void); __uint32_t arc4random_uniform(__uint32_t); +#ifdef __BLOCKS__ +int atexit_b(void (^)(void)); +void *bsearch_b(const void *, const void *, size_t, + size_t, int (^)(const void *, const void *)); +#endif char *getbsize(int *, long *); /* getcap(3) functions */ char *cgetcap(char *, const char *, int); @@ -289,6 +287,8 @@ const char * int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); #ifdef __BLOCKS__ int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +void qsort_b(void *, size_t, size_t, + int (^)(const void *, const void *)); #endif int l64a_r(long, char *, int); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Sep 1 20:18:09 2014 (r270951) +++ head/lib/libc/stdlib/Symbol.map Mon Sep 1 22:25:42 2014 (r270952) @@ -106,6 +106,7 @@ FBSD_1.3 { FBSD_1.4 { atexit_b; + bsearch_b; heapsort_b; mergesort_b; qsort_b; From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 22:40:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FC7BB0D; Mon, 1 Sep 2014 22:40:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 217331C89; Mon, 1 Sep 2014 22:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81MeWAK010271; Mon, 1 Sep 2014 22:40:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81MeVrB010269; Mon, 1 Sep 2014 22:40:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409012240.s81MeVrB010269@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 1 Sep 2014 22:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270953 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 22:40:32 -0000 Author: ian Date: Mon Sep 1 22:40:31 2014 New Revision: 270953 URL: http://svnweb.freebsd.org/changeset/base/270953 Log: Create a mechanism for looking up a device_t associated with an ofw/fdt xref handle, and for registering that association. Also use the same data for faster translations between node and xref handles. Now when fdt properties contain &othernode references, a driver can find the device instance that corresponds to &othernode, and thus can use interfaces provided by that instance. Reviewed by: nwhitehorn Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Mon Sep 1 22:25:42 2014 (r270952) +++ head/sys/dev/ofw/openfirm.c Mon Sep 1 22:40:31 2014 (r270953) @@ -84,6 +84,78 @@ static ofw_t ofw_obj; static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; +struct xrefinfo { + phandle_t xref; + phandle_t node; + device_t dev; + SLIST_ENTRY(xrefinfo) next_entry; +}; + +static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); +static boolean_t xref_init_done; + +#define FIND_BY_XREF 0 +#define FIND_BY_NODE 1 + +/* + * xref-phandle-device lookup helper routines. + * + * As soon as we are able to use malloc(), walk the node tree and build a list + * of info that cross-references node handles, xref handles, and device_t + * instances. This list exists primarily to allow association of a device_t + * with an xref handle, but it is also used to speed up translation between xref + * and node handles. Before malloc() is available we have to recursively search + * the node tree each time we want to translate between a node and xref handle. + * Afterwards we can do the translations by searching this much shorter list. + */ +static void +xrefinfo_create(phandle_t node) +{ + struct xrefinfo * xi; + phandle_t child, xref; + + /* + * Recursively descend from parent, looking for nodes with a property + * named either "phandle", "ibm,phandle", or "linux,phandle". For each + * such node found create an entry in the xreflist. + */ + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + xrefinfo_create(child); + if (OF_getencprop(child, "phandle", &xref, sizeof(xref)) == + -1 && OF_getencprop(child, "ibm,phandle", &xref, + sizeof(xref)) == -1 && OF_getencprop(child, + "linux,phandle", &xref, sizeof(xref)) == -1) + continue; + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK | M_ZERO); + xi->node = child; + xi->xref = xref; + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); + } +} + +static void +xrefinfo_init(void *unsed) +{ + + xrefinfo_create(OF_peer(0)); + xref_init_done = true; +} +SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ANY, xrefinfo_init, NULL); + +static struct xrefinfo * +xrefinfo_find(phandle_t phandle, int find_by) +{ + struct xrefinfo * xi; + + SLIST_FOREACH(xi, &xreflist, next_entry) { + if (find_by == FIND_BY_XREF && phandle == xi->xref) + return (xi); + else if (find_by == FIND_BY_NODE && phandle == xi->node) + return (xi); + } + return (NULL); +} + /* * OFW install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. @@ -465,29 +537,67 @@ OF_child_xref_phandle(phandle_t parent, phandle_t OF_node_from_xref(phandle_t xref) { + struct xrefinfo *xi; phandle_t node; - node = OF_child_xref_phandle(OF_peer(0), xref); - if (node == -1) - return (xref); + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + return (xref); + return (xi->node); + } + if ((node = OF_child_xref_phandle(OF_peer(0), xref)) == -1) + return (xref); return (node); } phandle_t OF_xref_from_node(phandle_t node) { + struct xrefinfo *xi; phandle_t xref; + if (xref_init_done) { + if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) + return (node); + return (xi->xref); + } + if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) return (node); - return (xref); } +device_t +OF_device_from_xref(phandle_t xref) +{ + struct xrefinfo *xi; + + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + return (NULL); + return (xi->dev); + } + panic("Attempt to find device before xreflist_init"); +} + +int +OF_device_register_xref(phandle_t xref, device_t dev) +{ + struct xrefinfo *xi; + + if (xref_init_done) { + if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) + return (ENXIO); + xi->dev = dev; + return (0); + } + panic("Attempt to register device before xreflist_init"); +} + /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Sep 1 22:25:42 2014 (r270952) +++ head/sys/dev/ofw/openfirm.h Mon Sep 1 22:40:31 2014 (r270953) @@ -133,6 +133,16 @@ ssize_t OF_package_to_path(phandle_t no phandle_t OF_node_from_xref(phandle_t xref); phandle_t OF_xref_from_node(phandle_t node); +/* + * When properties contain references to other nodes using xref handles it is + * often necessary to use interfaces provided by the driver for the referenced + * instance. These routines allow a driver that provides such an interface to + * register its association with an xref handle, and for other drivers to obtain + * the device_t associated with an xref handle. + */ +device_t OF_device_from_xref(phandle_t xref); +int OF_device_register_xref(phandle_t xref, device_t dev); + /* Device I/O functions */ ihandle_t OF_open(const char *path); void OF_close(ihandle_t instance); From owner-svn-src-head@FreeBSD.ORG Mon Sep 1 22:53:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D97D4D2A; Mon, 1 Sep 2014 22:53:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C56581D66; Mon, 1 Sep 2014 22:53:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s81MrlOu018628; Mon, 1 Sep 2014 22:53:47 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s81MrlHL018627; Mon, 1 Sep 2014 22:53:47 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409012253.s81MrlHL018627@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 1 Sep 2014 22:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270954 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2014 22:53:48 -0000 Author: dteske Date: Mon Sep 1 22:53:47 2014 New Revision: 270954 URL: http://svnweb.freebsd.org/changeset/base/270954 Log: Fix a bug where command line arguments could be misprocessed if getopts is used prior to f_dialog_init() -- e.g., in a script that sets DIALOG_SELF_INITIALIZE to NULL, preventing f_dialog_init() from being run automaticaly when `dialog.subr' is included. Caused by sub-shell processing of arguments inheriting prior value of $OPTIND, used by getopts. Solved by unsetting OPTIND prior to [re-]processing of positional arguments. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Mon Sep 1 22:40:31 2014 (r270953) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Sep 1 22:53:47 2014 (r270954) @@ -2116,6 +2116,7 @@ f_dialog_init() f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" SECURE=`set -- $ARGV + unset OPTIND while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do @@ -2125,6 +2126,7 @@ f_dialog_init() done ` # END-BACKTICK USE_XDIALOG=`set -- $ARGV + unset OPTIND while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 02:54:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDF9A611; Tue, 2 Sep 2014 02:54:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA66F1553; Tue, 2 Sep 2014 02:54:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s822stLP034900; Tue, 2 Sep 2014 02:54:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s822stcS034899; Tue, 2 Sep 2014 02:54:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020254.s822stcS034899@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 02:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270955 - head/sys/arm/freescale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 02:54:55 -0000 Author: ian Date: Tue Sep 2 02:54:55 2014 New Revision: 270955 URL: http://svnweb.freebsd.org/changeset/base/270955 Log: The ocotp driver provides access to registers containing chip configuration data that is needed by other drivers, so make it an EARLY_DRIVER_MODULE() that loads before just about anything else. Modified: head/sys/arm/freescale/fsl_ocotp.c Modified: head/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- head/sys/arm/freescale/fsl_ocotp.c Mon Sep 1 22:53:47 2014 (r270954) +++ head/sys/arm/freescale/fsl_ocotp.c Tue Sep 2 02:54:55 2014 (r270955) @@ -200,5 +200,6 @@ static driver_t ocotp_driver = { static devclass_t ocotp_devclass; -DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0); +EARLY_DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 02:56:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39669774; Tue, 2 Sep 2014 02:56:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C446157C; Tue, 2 Sep 2014 02:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s822uhjT035200; Tue, 2 Sep 2014 02:56:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s822uh4g035199; Tue, 2 Sep 2014 02:56:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020256.s822uh4g035199@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 02:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270956 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 02:56:44 -0000 Author: ian Date: Tue Sep 2 02:56:43 2014 New Revision: 270956 URL: http://svnweb.freebsd.org/changeset/base/270956 Log: The anatop driver controls power and PLLs and needs to be available before just about anything else (other than octop which provides it config info), so make it an EARLY_DRIVER_MODULE(). Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Tue Sep 2 02:54:55 2014 (r270955) +++ head/sys/arm/freescale/imx/imx6_anatop.c Tue Sep 2 02:56:43 2014 (r270956) @@ -88,6 +88,8 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_t dev; struct resource *res[2]; + struct intr_config_hook + intr_setup_hook; uint32_t cpu_curmhz; uint32_t cpu_curmv; uint32_t cpu_minmhz; @@ -610,10 +612,22 @@ initialize_tempmon(struct imx6_anatop_so "Throttle CPU when exceeding this temperature"); } +static void +intr_setup(void *arg) +{ + struct imx6_anatop_softc *sc; + + sc = arg; + bus_setup_intr(sc->dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, + tempmon_intr, NULL, sc, &sc->temp_intrhand); + config_intrhook_disestablish(&sc->intr_setup_hook); +} + static int imx6_anatop_detach(device_t dev) { + /* This device can never detach. */ return (EBUSY); } @@ -633,10 +647,9 @@ imx6_anatop_attach(device_t dev) goto out; } - err = bus_setup_intr(dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, - tempmon_intr, NULL, sc, &sc->temp_intrhand); - if (err != 0) - goto out; + sc->intr_setup_hook.ich_func = intr_setup; + sc->intr_setup_hook.ich_arg = sc; + config_intrhook_establish(&sc->intr_setup_hook); SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), @@ -713,5 +726,6 @@ static driver_t imx6_anatop_driver = { static devclass_t imx6_anatop_devclass; -DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, imx6_anatop_devclass, 0, 0); +EARLY_DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, + imx6_anatop_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST + 1); From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 03:23:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 333B9A03; Tue, 2 Sep 2014 03:23:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D00C1A86; Tue, 2 Sep 2014 03:23:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s823N6bq049580; Tue, 2 Sep 2014 03:23:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s823N6X2049576; Tue, 2 Sep 2014 03:23:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020323.s823N6X2049576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 03:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270957 - in head/sys: conf dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 03:23:07 -0000 Author: ian Date: Tue Sep 2 03:23:05 2014 New Revision: 270957 URL: http://svnweb.freebsd.org/changeset/base/270957 Log: Create an interface for drivers to enable or disable their clocks as listed in the clocks=<...> properties of their FDT data. The clock properties consist of 2-cell tuples, each containing a clock device node reference and a clock number. A clock device driver can register itself as providing this interface, then other drivers can turn the FDT clock node reference into the corresponding device_t so that they can use the interface to query and manipulate their clocks. This provides convenience functions to enable or disable all the clocks listed in the properties for a device, so most drivers will be able to manage their clocks with a single call to fdt_clock_enable_all(dev). Added: head/sys/dev/fdt/fdt_clock.c (contents, props changed) head/sys/dev/fdt/fdt_clock.h (contents, props changed) head/sys/dev/fdt/fdt_clock_if.m (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 2 02:56:43 2014 (r270956) +++ head/sys/conf/files Tue Sep 2 03:23:05 2014 (r270957) @@ -1376,6 +1376,8 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash +dev/fdt/fdt_clock.c optional fdt +dev/fdt/fdt_clock_if.m optional fdt dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ Added: head/sys/dev/fdt/fdt_clock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_clock.c Tue Sep 2 03:23:05 2014 (r270957) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "fdt_clock_if.h" +#include + +/* + * Loop through all the tuples in the clocks= property for a device, enabling or + * disabling each clock. + * + * Be liberal about errors for now: warn about a failure to enable but keep + * trying with any other clocks in the list. Return ENXIO if any errors were + * found, and let the caller decide whether the problem is fatal. + */ +static int +enable_disable_all(device_t consumer, boolean_t enable) +{ + phandle_t cnode; + device_t clockdev; + int clocknum, err, i, ncells; + uint32_t *clks; + boolean_t anyerrors; + + cnode = ofw_bus_get_node(consumer); + ncells = OF_getencprop_alloc(cnode, "clocks", sizeof(*clks), + (void **)&clks); + if (enable && ncells < 2) { + device_printf(consumer, "Warning: No clocks specified in fdt " + "data; device may not function."); + return (ENXIO); + } + anyerrors = false; + for (i = 0; i < ncells; i += 2) { + clockdev = OF_device_from_xref(clks[i]); + clocknum = clks[i + 1]; + if (clockdev == NULL) { + if (enable) + device_printf(consumer, "Warning: can not find " + "driver for clock number %u; device may not " + "function\n", clocknum); + anyerrors = true; + continue; + } + if (enable) + err = FDT_CLOCK_ENABLE(clockdev, clocknum); + else + err = FDT_CLOCK_DISABLE(clockdev, clocknum); + if (err != 0) { + if (enable) + device_printf(consumer, "Warning: failed to " + "enable clock number %u; device may not " + "function\n", clocknum); + anyerrors = true; + } + } + free(clks, M_OFWPROP); + return (anyerrors ? ENXIO : 0); +} + +int +fdt_clock_get_info(device_t consumer, int n, struct fdt_clock_info *info) +{ + phandle_t cnode; + device_t clockdev; + int clocknum, err, ncells; + uint32_t *clks; + + cnode = ofw_bus_get_node(consumer); + ncells = OF_getencprop_alloc(cnode, "clocks", sizeof(*clks), + (void **)&clks); + if (ncells <= 0) + return (ENXIO); + n *= 2; + if (ncells <= n) + err = ENXIO; + else { + clockdev = OF_device_from_xref(clks[n]); + if (clockdev == NULL) + err = ENXIO; + else { + /* + * Make struct contents minimally valid, then call + * provider to fill in what it knows (provider can + * override anything it wants to). + */ + clocknum = clks[n + 1]; + memset(info, 0, sizeof(*info)); + info->provider = clockdev; + info->index = clocknum; + info->name = ""; + err = FDT_CLOCK_GET_INFO(clockdev, clocknum, info); + } + } + free(clks, M_OFWPROP); + return (err); +} + +int +fdt_clock_enable_all(device_t consumer) +{ + + return (enable_disable_all(consumer, true)); +} + +int +fdt_clock_disable_all(device_t consumer) +{ + + return (enable_disable_all(consumer, false)); +} + +void +fdt_clock_register_provider(device_t provider) +{ + + OF_device_register_xref(OF_xref_from_node(provider), provider); +} + +void +fdt_clock_unregister_provider(device_t provider) +{ + + OF_device_register_xref(OF_xref_from_node(provider), NULL); +} + Added: head/sys/dev/fdt/fdt_clock.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_clock.h Tue Sep 2 03:23:05 2014 (r270957) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_FDT_CLOCK_H +#define DEV_FDT_CLOCK_H + +#include "fdt_clock_if.h" + +/* + * Get info about the Nth clock listed in consumer's "clocks" property. + * + * Returns 0 on success, ENXIO if clock #n not found. + */ +int fdt_clock_get_info(device_t consumer, int n, struct fdt_clock_info *info); + +/* + * Look up "clocks" property in consumer's fdt data and enable or disable all + * configured clocks. + */ +int fdt_clock_enable_all(device_t consumer); +int fdt_clock_disable_all(device_t consumer); + +/* + * [Un]register the given device instance as a driver that implements the + * fdt_clock interface. + */ +void fdt_clock_register_provider(device_t provider); +void fdt_clock_unregister_provider(device_t provider); + +#endif /* DEV_FDT_CLOCK_H */ + Added: head/sys/dev/fdt/fdt_clock_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_clock_if.m Tue Sep 2 03:23:05 2014 (r270957) @@ -0,0 +1,81 @@ +#- +# Copyright (c) 2014 Ian Lepore +# 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$ +# + +#include + +# +# This is the interface that fdt_clock drivers provide to other drivers. +# In this context, clock refers to a clock signal provided to some other +# hardware component within the system. They are most often found within +# embedded processors that have on-chip IO controllers. +# + +INTERFACE fdt_clock; + +HEADER { + + enum { + FDT_CIFLAG_RUNNING = 0x01, + }; + + struct fdt_clock_info { + device_t provider; + uint32_t index; + const char * name; /* May be "", will not be NULL. */ + uint32_t flags; + uint64_t frequency; /* In Hz. */ + }; +} + +# +# Enable the specified clock. +# Returns 0 on success or a standard errno value. +# +METHOD int enable { + device_t provider; + int index; +}; + +# +# Disable the specified clock. +# Returns 0 on success or a standard errno value. +# +METHOD int disable { + device_t provider; + int index; +}; + +# +# Returns information about the current operational state of specified clock. +# +METHOD int get_info { + device_t provider; + int index; + struct fdt_clock_info *info; +}; + From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 03:45:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7435E796; Tue, 2 Sep 2014 03:45:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4717E1CB5; Tue, 2 Sep 2014 03:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s823j2sS059015; Tue, 2 Sep 2014 03:45:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s823j1HW059013; Tue, 2 Sep 2014 03:45:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020345.s823j1HW059013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 03:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270958 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 03:45:02 -0000 Author: ian Date: Tue Sep 2 03:45:01 2014 New Revision: 270958 URL: http://svnweb.freebsd.org/changeset/base/270958 Log: Add OF_xref_from_device() so that there's no need to have an intermediate call to ofw_bus_get_node() to lookup info that's already in the xreflist. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Sep 2 03:23:05 2014 (r270957) +++ head/sys/dev/ofw/openfirm.c Tue Sep 2 03:45:01 2014 (r270958) @@ -96,6 +96,7 @@ static boolean_t xref_init_done; #define FIND_BY_XREF 0 #define FIND_BY_NODE 1 +#define FIND_BY_DEV 1 /* * xref-phandle-device lookup helper routines. @@ -152,6 +153,8 @@ xrefinfo_find(phandle_t phandle, int fin return (xi); else if (find_by == FIND_BY_NODE && phandle == xi->node) return (xi); + else if (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev) + return (xi); } return (NULL); } @@ -584,6 +587,19 @@ OF_device_from_xref(phandle_t xref) panic("Attempt to find device before xreflist_init"); } +phandle_t +OF_xref_from_device(device_t dev) +{ + struct xrefinfo *xi; + + if (xref_init_done) { + if ((xi = xrefinfo_find((uintptr_t)dev, FIND_BY_DEV)) == NULL) + return (0); + return (xi->xref); + } + panic("Attempt to find xref before xreflist_init"); +} + int OF_device_register_xref(phandle_t xref, device_t dev) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Tue Sep 2 03:23:05 2014 (r270957) +++ head/sys/dev/ofw/openfirm.h Tue Sep 2 03:45:01 2014 (r270958) @@ -141,6 +141,7 @@ phandle_t OF_xref_from_node(phandle_t no * the device_t associated with an xref handle. */ device_t OF_device_from_xref(phandle_t xref); +phandle_t OF_xref_from_device(device_t dev); int OF_device_register_xref(phandle_t xref, device_t dev); /* Device I/O functions */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 03:46:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 320E68FF; Tue, 2 Sep 2014 03:46:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBC61CD0; Tue, 2 Sep 2014 03:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s823kOvl059230; Tue, 2 Sep 2014 03:46:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s823kOEO059229; Tue, 2 Sep 2014 03:46:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020346.s823kOEO059229@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 03:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270959 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 03:46:25 -0000 Author: ian Date: Tue Sep 2 03:46:24 2014 New Revision: 270959 URL: http://svnweb.freebsd.org/changeset/base/270959 Log: Use OF_xref_from_device(), not OF_xref_from_node(). Also, use bzero() rather than memset(). Modified: head/sys/dev/fdt/fdt_clock.c Modified: head/sys/dev/fdt/fdt_clock.c ============================================================================== --- head/sys/dev/fdt/fdt_clock.c Tue Sep 2 03:45:01 2014 (r270958) +++ head/sys/dev/fdt/fdt_clock.c Tue Sep 2 03:46:24 2014 (r270959) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -119,7 +120,7 @@ fdt_clock_get_info(device_t consumer, in * override anything it wants to). */ clocknum = clks[n + 1]; - memset(info, 0, sizeof(*info)); + bzero(info, sizeof(*info)); info->provider = clockdev; info->index = clocknum; info->name = ""; @@ -148,13 +149,13 @@ void fdt_clock_register_provider(device_t provider) { - OF_device_register_xref(OF_xref_from_node(provider), provider); + OF_device_register_xref(OF_xref_from_device(provider), provider); } void fdt_clock_unregister_provider(device_t provider) { - OF_device_register_xref(OF_xref_from_node(provider), NULL); + OF_device_register_xref(OF_xref_from_device(provider), NULL); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 03:51:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CB8BB91; Tue, 2 Sep 2014 03:51:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7980E1D28; Tue, 2 Sep 2014 03:51:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s823pD61062984; Tue, 2 Sep 2014 03:51:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s823pDPu062983; Tue, 2 Sep 2014 03:51:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409020351.s823pDPu062983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 2 Sep 2014 03:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270960 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 03:51:13 -0000 Author: ian Date: Tue Sep 2 03:51:12 2014 New Revision: 270960 URL: http://svnweb.freebsd.org/changeset/base/270960 Log: Fix typo. Pointy hat: ian Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Sep 2 03:46:24 2014 (r270959) +++ head/sys/dev/ofw/openfirm.c Tue Sep 2 03:51:12 2014 (r270960) @@ -96,7 +96,7 @@ static boolean_t xref_init_done; #define FIND_BY_XREF 0 #define FIND_BY_NODE 1 -#define FIND_BY_DEV 1 +#define FIND_BY_DEV 2 /* * xref-phandle-device lookup helper routines. From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 04:11:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A55C2B6; Tue, 2 Sep 2014 04:11:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66E391F14; Tue, 2 Sep 2014 04:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s824BL3R071933; Tue, 2 Sep 2014 04:11:21 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s824BLsl071932; Tue, 2 Sep 2014 04:11:21 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201409020411.s824BLsl071932@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 2 Sep 2014 04:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270961 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 04:11:21 -0000 Author: alc Date: Tue Sep 2 04:11:20 2014 New Revision: 270961 URL: http://svnweb.freebsd.org/changeset/base/270961 Log: Update a comment to reflect the changes in r213408. MFC after: 5 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Sep 2 03:51:12 2014 (r270960) +++ head/sys/amd64/amd64/pmap.c Tue Sep 2 04:11:20 2014 (r270961) @@ -2571,7 +2571,7 @@ pmap_growkernel(vm_offset_t addr) * "kernel_vm_end" and the kernel page table as they were. * * The correctness of this action is based on the following - * argument: vm_map_findspace() allocates contiguous ranges of the + * argument: vm_map_insert() allocates contiguous ranges of the * kernel virtual address space. It calls this function if a range * ends after "kernel_vm_end". If the kernel is mapped between * "kernel_vm_end" and "addr", then the range cannot begin at From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 09:30:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6605D264; Tue, 2 Sep 2014 09:30:16 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E1751300; Tue, 2 Sep 2014 09:30:15 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id b13so6463015wgh.13 for ; Tue, 02 Sep 2014 02:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Gfqz1ep3pKJyc2dPyZnIAyN9Cexd4LPyiPF25D1XurQ=; b=EQeewgfng8BHJetZqcnvXZ8vyGwjRTE5BohY7SkbCtq5/gHTMUFa2Y9v43ekWNtbVN dANL6L/y8pVx2rMQvcmnAPB8Wl4BTFp/zh7kP2QRCvhh3uTcH/fsunDxb3P6ha2wZagq wMT3Y+oeCWf2lx+tPdcYzos5Zs/m9RmssVCsXKhq62noM/AOhYdeNHnOlwyWVCo2DpbO 6x3kC10I3tVb3h+diD1VWz0Q83Tx9IaTl4AJ3Q7N+n+TbWOHKe5rXEs7Wl2VFsW8E7pY 4UuEO7ohnXms+CI1D9Z94j59jnT76eFRjL/6uXpbXcc82js9Gcmwy6xzZCffHLwZuRIy NGQA== X-Received: by 10.180.12.173 with SMTP id z13mr3739489wib.53.1409650213344; Tue, 02 Sep 2014 02:30:13 -0700 (PDT) Received: from [172.16.1.30] (124.Red-83-33-238.dynamicIP.rima-tde.net. [83.33.238.124]) by mx.google.com with ESMTPSA id kw2sm8193706wjb.30.2014.09.02.02.30.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 02:30:12 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <54058E1E.4050907@FreeBSD.org> Date: Tue, 02 Sep 2014 11:30:06 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Alexander Motin , John-Mark Gurney Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> In-Reply-To: <5400BDC7.7020902@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 09:30:16 -0000 El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: > El 28/08/14 a les 20.58, Alexander Motin ha escrit: >> On 28.08.2014 21:45, John-Mark Gurney wrote: >>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: >>>> Hi, Roger. >>>> >>>> It looks to me like this commit does not work as it should. I got >>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. >>>> Somehow newfs does not produce valid filesystem. Problem is reliably >>>> repeatable and reverting this commit fixes it. >>>> >>>> I found at least one possible cause there: If original data buffer is >>>> unmapped, misaligned and not physically contiguous, then present x86 >>>> bus_dmamap_load_bio() implementation will process each physically >>>> contiguous segment separately. Due to the misalignment first and last >>>> physical segments may have size not multiple to 512 bytes. Since each >>>> segment processed separately, they are not joined together, and >>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to >>>> convert them to exact number of sectors in the driver cause data corruption. >>> >>> Are you sure this isn't a problem w/ the tag not properly specifying >>> the correct alignement? >> >> I don't know how to specify it stronger then this: >> error = bus_dma_tag_create( >> bus_get_dma_tag(sc->xbd_dev), /* parent */ >> 512, PAGE_SIZE, /* algnmnt, boundary */ >> BUS_SPACE_MAXADDR, /* lowaddr */ >> BUS_SPACE_MAXADDR, /* highaddr */ >> NULL, NULL, /* filter, filterarg */ >> sc->xbd_max_request_size, >> sc->xbd_max_request_segments, >> PAGE_SIZE, /* maxsegsize */ >> BUS_DMA_ALLOCNOW, /* flags */ >> busdma_lock_mutex, /* lockfunc */ >> &sc->xbd_io_lock, /* lockarg */ >> &sc->xbd_io_dmat); >> >>> Also, I don't think there is a way for busdma >>> to say that you MUST have a segment be a multiple of 512, though you >>> could use a 512 boundary, but that would force all segments to only be >>> 512 bytes... >> >> As I understand, that is mandatory requirement for this "hardware". >> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC >> UHCI/OHCI hardware. Even AHCI requires both segment addresses and >> lengths to be even. >> >> I may be wrong, but I think it is quite likely that hardware that >> requires segment address alignment quite likely will have the same >> requirements for segments length. Hello, I have the following fix, which makes sure the total length and the size of each segment is aligned. I'm not very knowledgeable of the busdma code, so someone has to review it. Roger. --- diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index d1c75f8..688f559 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -620,6 +620,8 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, segs = dmat->segments; if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + /* Make sure buflen is aligned */ + buflen = roundup2(buflen, dmat->common.alignment); _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -634,6 +636,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = roundup2(sgsize, dmat->common.alignment); sgsize = MIN(sgsize, PAGE_SIZE); curaddr = add_bounce_page(dmat, map, 0, curaddr, sgsize); From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 11:16:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1511359D; Tue, 2 Sep 2014 11:16:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00E711111; Tue, 2 Sep 2014 11:16:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82BGiqF071066; Tue, 2 Sep 2014 11:16:44 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82BGiXI071065; Tue, 2 Sep 2014 11:16:44 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409021116.s82BGiXI071065@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 2 Sep 2014 11:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270964 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 11:16:45 -0000 Author: ed Date: Tue Sep 2 11:16:44 2014 New Revision: 270964 URL: http://svnweb.freebsd.org/changeset/base/270964 Log: Clean up slightly. - Remove c++0x hack from that was needed when Clang did not fully implement C++11. We can now safely test against C++11 to check whether thread_local is available, like we do for all other C++11 keywords. - Don't use __clang__ to test for thread safety annotation presence. It turns out we have a proper attribute for this. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Sep 2 10:35:04 2014 (r270963) +++ head/sys/sys/cdefs.h Tue Sep 2 11:16:44 2014 (r270964) @@ -298,8 +298,7 @@ #endif #if !__has_extension(c_thread_local) -/* XXX: Change this to test against C++11 when clang in base supports it. */ -#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ +#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_thread_local) #define _Thread_local thread_local #else @@ -751,7 +750,7 @@ * held. */ -#ifdef __clang__ +#if __has_extension(c_thread_safety_attributes) #define __lock_annotate(x) __attribute__((x)) #else #define __lock_annotate(x) From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 15:21:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C011DA89; Tue, 2 Sep 2014 15:21:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62A6115C3; Tue, 2 Sep 2014 15:21:09 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1E105B941; Tue, 2 Sep 2014 11:21:08 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Tue, 2 Sep 2014 11:00:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <20140830195809.GS2737@kib.kiev.ua> In-Reply-To: <20140830195809.GS2737@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201409021100.57493.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 02 Sep 2014 11:21:08 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 15:21:09 -0000 On Saturday, August 30, 2014 3:58:09 pm Konstantin Belousov wrote: > On Sat, Aug 30, 2014 at 05:48:38PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Sat Aug 30 17:48:38 2014 > > New Revision: 270850 > > URL: http://svnweb.freebsd.org/changeset/base/270850 > > > > Log: > > Save and restore FPU state across suspend and resume. In earlier revisions > > of this patch, resumectx() called npxresume() directly, but that doesn't > > work because resumectx() runs with a non-standard %cs selector. Instead, > > all of the FPU suspend/resume handling is done in C. > > > > MFC after: 1 week > > > > Modified: > > head/sys/i386/i386/mp_machdep.c > > head/sys/i386/i386/swtch.s > > head/sys/i386/include/npx.h > > head/sys/i386/include/pcb.h > > head/sys/i386/isa/npx.c > > head/sys/x86/acpica/acpi_wakeup.c > > > > Modified: head/sys/i386/i386/mp_machdep.c > > ============================================================================== > > --- head/sys/i386/i386/mp_machdep.c Sat Aug 30 17:39:28 2014 (r270849) > > +++ head/sys/i386/i386/mp_machdep.c Sat Aug 30 17:48:38 2014 (r270850) > > @@ -1522,9 +1522,15 @@ cpususpend_handler(void) > > > > cpu = PCPU_GET(cpuid); > > if (savectx(susppcbs[cpu])) { > > +#ifdef DEV_NPX > > + npxsuspend(&suspcbs[cpu]->pcb_fpususpend); > > +#endif > > wbinvd(); > > CPU_SET_ATOMIC(cpu, &suspended_cpus); > > } else { > > +#ifdef DEV_NPX > > + npxresume(&suspcbs[cpu]->pcb_fpususpend); > > +#endif > > pmap_init_pat(); > > PCPU_SET(switchtime, 0); > > PCPU_SET(switchticks, ticks); > > > > Modified: head/sys/i386/i386/swtch.s > > ============================================================================== > > --- head/sys/i386/i386/swtch.s Sat Aug 30 17:39:28 2014 (r270849) > > +++ head/sys/i386/i386/swtch.s Sat Aug 30 17:48:38 2014 (r270850) > > @@ -416,45 +416,6 @@ ENTRY(savectx) > > sldt PCB_LDT(%ecx) > > str PCB_TR(%ecx) > > > > -#ifdef DEV_NPX > > - /* > > - * If fpcurthread == NULL, then the npx h/w state is irrelevant and the > > - * state had better already be in the pcb. This is true for forks > > - * but not for dumps (the old book-keeping with FP flags in the pcb > > - * always lost for dumps because the dump pcb has 0 flags). > > - * > > - * If fpcurthread != NULL, then we have to save the npx h/w state to > > - * fpcurthread's pcb and copy it to the requested pcb, or save to the > > - * requested pcb and reload. Copying is easier because we would > > - * have to handle h/w bugs for reloading. We used to lose the > > - * parent's npx state for forks by forgetting to reload. > > - */ > > - pushfl > > - CLI > > - movl PCPU(FPCURTHREAD),%eax > > - testl %eax,%eax > > - je 1f > > - > > - pushl %ecx > > - movl TD_PCB(%eax),%eax > > - movl PCB_SAVEFPU(%eax),%eax > > - pushl %eax > > - pushl %eax > > - call npxsave > > - addl $4,%esp > > - popl %eax > > - popl %ecx > > - > > - pushl $PCB_SAVEFPU_SIZE > > - leal PCB_USERFPU(%ecx),%ecx > > - pushl %ecx > > - pushl %eax > > - call bcopy > > - addl $12,%esp > > -1: > > - popfl > > -#endif /* DEV_NPX */ > > - > > movl $1,%eax > > ret > > END(savectx) > > @@ -519,10 +480,6 @@ ENTRY(resumectx) > > movl PCB_DR7(%ecx),%eax > > movl %eax,%dr7 > > > > -#ifdef DEV_NPX > > - /* XXX FIX ME */ > > -#endif > > - > > /* Restore other registers */ > > movl PCB_EDI(%ecx),%edi > > movl PCB_ESI(%ecx),%esi > > > > Modified: head/sys/i386/include/npx.h > > ============================================================================== > > --- head/sys/i386/include/npx.h Sat Aug 30 17:39:28 2014 (r270849) > > +++ head/sys/i386/include/npx.h Sat Aug 30 17:48:38 2014 (r270850) > > @@ -53,8 +53,10 @@ void npxexit(struct thread *td); > > int npxformat(void); > > int npxgetregs(struct thread *td); > > void npxinit(void); > > +void npxresume(union savefpu *addr); > > void npxsave(union savefpu *addr); > > void npxsetregs(struct thread *td, union savefpu *addr); > > +void npxsuspend(union savefpu *addr); > > int npxtrap_x87(void); > > int npxtrap_sse(void); > > void npxuserinited(struct thread *); > > > > Modified: head/sys/i386/include/pcb.h > > ============================================================================== > > --- head/sys/i386/include/pcb.h Sat Aug 30 17:39:28 2014 (r270849) > > +++ head/sys/i386/include/pcb.h Sat Aug 30 17:48:38 2014 (r270850) > > @@ -90,6 +90,8 @@ struct pcb { > > struct region_descriptor pcb_idt; > > uint16_t pcb_ldt; > > uint16_t pcb_tr; > > + > > + union savefpu pcb_fpususpend; > > }; > Now pcb consumes 512 bytes from each thread' kernel stack, which mostly > stay unused. > > Amd64 only stores the pointer to the fpususpend context in pcb, and > acpu_wakeup() allocates the memory as needed. Even this is a waste of 8 > bytes which are not needed for normal kernel operations. > > Suspend FPU context, as well as amd64 MSRs should go out of pcb into > some per-cpu suspend data block. I thought about that. I could easily make a parallel array, or perhaps use a separate 'susppcb' structure that includes a pcb and the savefpu union and change susppcbs to be an array of those. Which do you prefer? If we want to move some state out of the PCB on amd64 into this, then a separate struct for susppcbs might be the sanest. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 15:41:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E6E72FD; Tue, 2 Sep 2014 15:41:35 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02FF61A15; Tue, 2 Sep 2014 15:41:34 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s82FfRJx003268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Sep 2014 18:41:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s82FfRJx003268 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s82FfRJI003267; Tue, 2 Sep 2014 18:41:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 Sep 2014 18:41:27 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Message-ID: <20140902154127.GD2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <20140830195809.GS2737@kib.kiev.ua> <201409021100.57493.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="I2bJ1vO3Y/RENlXz" Content-Disposition: inline In-Reply-To: <201409021100.57493.jhb@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 15:41:35 -0000 --I2bJ1vO3Y/RENlXz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > On Saturday, August 30, 2014 3:58:09 pm Konstantin Belousov wrote: > > On Sat, Aug 30, 2014 at 05:48:38PM +0000, John Baldwin wrote: > > > Author: jhb > > > Date: Sat Aug 30 17:48:38 2014 > > > New Revision: 270850 > > > URL: http://svnweb.freebsd.org/changeset/base/270850 > > >=20 > > > Log: > > > Save and restore FPU state across suspend and resume. In earlier= =20 > revisions > > > of this patch, resumectx() called npxresume() directly, but that do= esn't > > > work because resumectx() runs with a non-standard %cs selector. =20 > Instead, > > > all of the FPU suspend/resume handling is done in C. > > > =20 > > > MFC after: 1 week > > >=20 > > > Modified: > > > head/sys/i386/i386/mp_machdep.c > > > head/sys/i386/i386/swtch.s > > > head/sys/i386/include/npx.h > > > head/sys/i386/include/pcb.h > > > head/sys/i386/isa/npx.c > > > head/sys/x86/acpica/acpi_wakeup.c > > >=20 > > > Modified: head/sys/i386/i386/mp_machdep.c > > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > --- head/sys/i386/i386/mp_machdep.c Sat Aug 30 17:39:28 2014 (r270849) > > > +++ head/sys/i386/i386/mp_machdep.c Sat Aug 30 17:48:38 2014 (r270850) > > > @@ -1522,9 +1522,15 @@ cpususpend_handler(void) > > > =20 > > > cpu =3D PCPU_GET(cpuid); > > > if (savectx(susppcbs[cpu])) { > > > +#ifdef DEV_NPX > > > + npxsuspend(&suspcbs[cpu]->pcb_fpususpend); > > > +#endif > > > wbinvd(); > > > CPU_SET_ATOMIC(cpu, &suspended_cpus); > > > } else { > > > +#ifdef DEV_NPX > > > + npxresume(&suspcbs[cpu]->pcb_fpususpend); > > > +#endif > > > pmap_init_pat(); > > > PCPU_SET(switchtime, 0); > > > PCPU_SET(switchticks, ticks); > > >=20 > > > Modified: head/sys/i386/i386/swtch.s > > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > --- head/sys/i386/i386/swtch.s Sat Aug 30 17:39:28 2014 (r270849) > > > +++ head/sys/i386/i386/swtch.s Sat Aug 30 17:48:38 2014 (r270850) > > > @@ -416,45 +416,6 @@ ENTRY(savectx) > > > sldt PCB_LDT(%ecx) > > > str PCB_TR(%ecx) > > > =20 > > > -#ifdef DEV_NPX > > > - /* > > > - * If fpcurthread =3D=3D NULL, then the npx h/w state is irrelevant= and=20 > the > > > - * state had better already be in the pcb. This is true for forks > > > - * but not for dumps (the old book-keeping with FP flags in the pcb > > > - * always lost for dumps because the dump pcb has 0 flags). > > > - * > > > - * If fpcurthread !=3D NULL, then we have to save the npx h/w state= to > > > - * fpcurthread's pcb and copy it to the requested pcb, or save to t= he > > > - * requested pcb and reload. Copying is easier because we would > > > - * have to handle h/w bugs for reloading. We used to lose the > > > - * parent's npx state for forks by forgetting to reload. > > > - */ > > > - pushfl > > > - CLI > > > - movl PCPU(FPCURTHREAD),%eax > > > - testl %eax,%eax > > > - je 1f > > > - > > > - pushl %ecx > > > - movl TD_PCB(%eax),%eax > > > - movl PCB_SAVEFPU(%eax),%eax > > > - pushl %eax > > > - pushl %eax > > > - call npxsave > > > - addl $4,%esp > > > - popl %eax > > > - popl %ecx > > > - > > > - pushl $PCB_SAVEFPU_SIZE > > > - leal PCB_USERFPU(%ecx),%ecx > > > - pushl %ecx > > > - pushl %eax > > > - call bcopy > > > - addl $12,%esp > > > -1: > > > - popfl > > > -#endif /* DEV_NPX */ > > > - > > > movl $1,%eax > > > ret > > > END(savectx) > > > @@ -519,10 +480,6 @@ ENTRY(resumectx) > > > movl PCB_DR7(%ecx),%eax > > > movl %eax,%dr7 > > > =20 > > > -#ifdef DEV_NPX > > > - /* XXX FIX ME */ > > > -#endif > > > - > > > /* Restore other registers */ > > > movl PCB_EDI(%ecx),%edi > > > movl PCB_ESI(%ecx),%esi > > >=20 > > > Modified: head/sys/i386/include/npx.h > > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > --- head/sys/i386/include/npx.h Sat Aug 30 17:39:28 2014 (r270849) > > > +++ head/sys/i386/include/npx.h Sat Aug 30 17:48:38 2014 (r270850) > > > @@ -53,8 +53,10 @@ void npxexit(struct thread *td); > > > int npxformat(void); > > > int npxgetregs(struct thread *td); > > > void npxinit(void); > > > +void npxresume(union savefpu *addr); > > > void npxsave(union savefpu *addr); > > > void npxsetregs(struct thread *td, union savefpu *addr); > > > +void npxsuspend(union savefpu *addr); > > > int npxtrap_x87(void); > > > int npxtrap_sse(void); > > > void npxuserinited(struct thread *); > > >=20 > > > Modified: head/sys/i386/include/pcb.h > > >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > --- head/sys/i386/include/pcb.h Sat Aug 30 17:39:28 2014 (r270849) > > > +++ head/sys/i386/include/pcb.h Sat Aug 30 17:48:38 2014 (r270850) > > > @@ -90,6 +90,8 @@ struct pcb { > > > struct region_descriptor pcb_idt; > > > uint16_t pcb_ldt; > > > uint16_t pcb_tr; > > > + > > > + union savefpu pcb_fpususpend; > > > }; > > Now pcb consumes 512 bytes from each thread' kernel stack, which mostly > > stay unused. > >=20 > > Amd64 only stores the pointer to the fpususpend context in pcb, and > > acpu_wakeup() allocates the memory as needed. Even this is a waste of 8 > > bytes which are not needed for normal kernel operations. > >=20 > > Suspend FPU context, as well as amd64 MSRs should go out of pcb into > > some per-cpu suspend data block. >=20 > I thought about that. I could easily make a parallel array, or perhaps u= se a=20 > separate 'susppcb' structure that includes a pcb and the savefpu union and > change susppcbs to be an array of those. Which do you prefer? If we want > to move some state out of the PCB on amd64 into this, then a separate str= uct > for susppcbs might be the sanest. Yes, separate structure seems to be a way forward. FWIW, I do not understand the need for pcb in its current form, allocated on the thread kernel stack, at all. It looks like a vestige of the u-area, but serves no real purpose except to consume now precious stack space. The idea of the part of the thread state that can be swapped out, together with the stack, seems to become alien. Most of the thread state which is not needed when the thread is not runnable, now goes to struct thread anyway. Might be, we should move the pcb into td_md. People actively object to the idea of the swappable kernel stack when they learn hard that local vars cannot participate in the global lists. The only thing which is currently allocated below the pcb and which seems to be reasonable to swap out, is the FPU context on amd64. --I2bJ1vO3Y/RENlXz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUBeUmAAoJEJDCuSvBvK1BRY8P/jJrYZlapubg7Gq/IcOlHD30 j8wk2GUR09kK+97FlpZ84SFcuQTNjguI9ygaDXbjYxmEcEGcV2WJFFIBA5MPpi2R D4MCYtHwdYHAdQ3umKBRWi/Jnx1Ctpq69pDYlzbMd39EnBfNR9MJbN5AHJ95Z7Kq Hm9TWYVIXIvi6eTcwz4q9agbbcn6S3UqUGQYbOQ5u8fUcbuzxhmxx8j/d9F8xg1H 3myJ1N8A2gf5b5Ux2+bLlE8+V5SsHutNj/2fcIVEppSAVBNxlhYBkZKcuZw9TgQL y4F73p3y53ppfaK+cyClwbnV35qH5MxOgWqAEusVr2DvLMNfQbWOnkUkXTG4pKIL BPPaaJAOUqEbdU+fE5EbKSoHKPY5fD+gYD70Eyml5G6H72HzJYvzLgpfIj4M2s0X v9MWAJvdo1aHRuu2D54A00fsmBUp9CVKp2cyfOZChJTJhnlTTcP7PgFCoDNG6MKt Q7ukiXjzl+B+c0aeqxkn4vy7RTR5K4drkbyqlExg7lrYjhryrt+k/LWJALIMVQnX qMjylHOvtQ0vxroZb0Goh8Mreovr7fKtxJfQsyaAiBTU8H3pKsQNm7F70Eq6LYBR wncIIpiHdM+xLNpo+bPA2SYpsxNOAGkqJ4s1+H0kpxf4bFQc8bm8dmofsVwoJQeg EhOErA1bkAZE7SZbfvM3 =fmsT -----END PGP SIGNATURE----- --I2bJ1vO3Y/RENlXz-- From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 16:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 519053BF; Tue, 2 Sep 2014 16:06:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F6F1CE1; Tue, 2 Sep 2014 16:06:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A77D7B924; Tue, 2 Sep 2014 12:06:09 -0400 (EDT) From: John Baldwin To: Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Tue, 2 Sep 2014 12:01:15 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> In-Reply-To: <39211177.i8nn9sHiCx@overcee.wemm.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201409021201.15967.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 02 Sep 2014 12:06:09 -0400 (EDT) Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@freebsd.org, Steven Hartland X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 16:06:11 -0000 On Saturday, August 30, 2014 1:37:43 pm Peter Wemm wrote: > On Saturday 30 August 2014 02:03:42 Steven Hartland wrote: > I'm very disappointed in the attention to detail and errors in the commit. > I'm almost at the point where I want to ask for the whole thing to be backed > out. I would not be too supportive of that. This PR has been open for a long, long time with many users using patches from it in production loads that were greatly improved by the changes and clamoring on the lists multiple times to get someone to look at it. avg@ contributed quite a bit of time to diagnose this with Karl early on, but other developers aside from Steven did not. It also was not hard to explain to Karl the meaning of 'cache + free' in the bug follow-ups itself (though I believe avg@ had tried this before and it didn't sink in that time for some reason). I know Steven has since committed a fix, but if there are still concerns, I think it would be best to not just revert this entirely but to spend some time fixing the remaining issues. Clearly this issue affects a lot of users and the earlier fixes to pagedaemon were not sufficient to fix their issues alone. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 16:36:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 110B9340; Tue, 2 Sep 2014 16:36:50 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC531195; Tue, 2 Sep 2014 16:36:48 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA29497; Tue, 02 Sep 2014 19:36:40 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XOr4S-000CKM-J1; Tue, 02 Sep 2014 19:36:40 +0300 Message-ID: <5405F1F3.1@FreeBSD.org> Date: Tue, 02 Sep 2014 19:36:03 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John Baldwin , Peter Wemm , Steven Hartland Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> In-Reply-To: <201409021201.15967.jhb@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 16:36:50 -0000 on 02/09/2014 19:01 John Baldwin said the following: > I know Steven has since committed a fix, but if there are still concerns, I > think it would be best to not just revert this entirely but to spend some time > fixing the remaining issues. Clearly this issue affects a lot of users and > the earlier fixes to pagedaemon were not sufficient to fix their issues alone. I am not sure that that is the case. I could have very well missed an evidence of that, but then I'd appreciate a pointer or two to such reports. I am certainly sure that a large number of reports about "ZFS vs swapping" issue appeared after the pagedaemon problem was introduced. I have also missed any "theoretical" justification for the patch. That is, an explanation of how the patch interacts with the pagedaemon and improves things. The empirical evidence could be insufficient, because it's easy to tilt the balance such that the ARC gives in too easily. But people who were affected by the opposite problem could be different from people who would be affected by the new problem, because of differences in system characteristics such as amount of RAM, workload patterns, working set sizes, etc. Having said that, I do not ask for the changes to be reverted, but I'll probably get back after I have sufficient time to look at the patch and also to test its effect on my systems. This might not be very soon though. P.S. I think that there was no technical reason to initialize the newly introduced parameters via SYSINIT mechanism. I think that the initialization could be just done in arc_init. And the newly added kmem_foo() functions probably do not belong in cddl/compat/opensolaris as Solaris / illumos does not have those functions. I think that in this case e.g. vm_cnt.v_free_target can just be used directly by the FreeBSD-specific ARC code. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 16:38:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3165549A; Tue, 2 Sep 2014 16:38:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D64611C2; Tue, 2 Sep 2014 16:38:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82Gc0eS030197; Tue, 2 Sep 2014 16:38:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82Gc0oC030191; Tue, 2 Sep 2014 16:38:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409021638.s82Gc0oC030191@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 2 Sep 2014 16:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270971 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 16:38:01 -0000 Author: imp Date: Tue Sep 2 16:38:00 2014 New Revision: 270971 URL: http://svnweb.freebsd.org/changeset/base/270971 Log: The proper compatibility string for the AHCI device is allwinner,sun4i-ahci, so use that instead of the older string which had become FreeBSD specific. Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Tue Sep 2 16:14:16 2014 (r270970) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Tue Sep 2 16:38:00 2014 (r270971) @@ -60,6 +60,10 @@ emac@01c0b000 { status = "okay"; }; + + ahci: sata@01c18000 { + status = "okay"; + }; }; chosen { Modified: head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Tue Sep 2 16:14:16 2014 (r270970) +++ head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Tue Sep 2 16:38:00 2014 (r270971) @@ -104,7 +104,7 @@ }; sata@01c18000 { - compatible = "allwinner,ahci"; + compatible = "allwinner,sun4i-ahci"; reg = <0x01c18000 0x1000>; interrupts = <56>; interrupt-parent = <&AINTC>; Modified: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Tue Sep 2 16:14:16 2014 (r270970) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Tue Sep 2 16:38:00 2014 (r270971) @@ -110,7 +110,7 @@ }; sata@01c18000 { - compatible = "allwinner,ahci"; + compatible = "allwinner,sun4i-a10-ahci"; reg = <0x01c18000 0x1000>; interrupts = <56>; interrupt-parent = <&GIC>; From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:18:44 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1876A6E6; Tue, 2 Sep 2014 17:18:44 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E04C118B9; Tue, 2 Sep 2014 17:18:43 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s82HIfee057115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Sep 2014 10:18:42 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s82HIf6D057114; Tue, 2 Sep 2014 10:18:41 -0700 (PDT) (envelope-from jmg) Date: Tue, 2 Sep 2014 10:18:41 -0700 From: John-Mark Gurney To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront Message-ID: <20140902171841.GX71691@funkthat.com> References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54058E1E.4050907@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 02 Sep 2014 10:18:42 -0700 (PDT) Cc: src-committers@FreeBSD.org, Alexander Motin , scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:18:44 -0000 Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: > El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: > > El 28/08/14 a les 20.58, Alexander Motin ha escrit: > >> On 28.08.2014 21:45, John-Mark Gurney wrote: > >>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: > >>>> Hi, Roger. > >>>> > >>>> It looks to me like this commit does not work as it should. I got > >>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. > >>>> Somehow newfs does not produce valid filesystem. Problem is reliably > >>>> repeatable and reverting this commit fixes it. > >>>> > >>>> I found at least one possible cause there: If original data buffer is > >>>> unmapped, misaligned and not physically contiguous, then present x86 > >>>> bus_dmamap_load_bio() implementation will process each physically > >>>> contiguous segment separately. Due to the misalignment first and last > >>>> physical segments may have size not multiple to 512 bytes. Since each > >>>> segment processed separately, they are not joined together, and > >>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to > >>>> convert them to exact number of sectors in the driver cause data corruption. > >>> > >>> Are you sure this isn't a problem w/ the tag not properly specifying > >>> the correct alignement? > >> > >> I don't know how to specify it stronger then this: > >> error = bus_dma_tag_create( > >> bus_get_dma_tag(sc->xbd_dev), /* parent */ > >> 512, PAGE_SIZE, /* algnmnt, boundary */ > >> BUS_SPACE_MAXADDR, /* lowaddr */ > >> BUS_SPACE_MAXADDR, /* highaddr */ > >> NULL, NULL, /* filter, filterarg */ > >> sc->xbd_max_request_size, > >> sc->xbd_max_request_segments, > >> PAGE_SIZE, /* maxsegsize */ > >> BUS_DMA_ALLOCNOW, /* flags */ > >> busdma_lock_mutex, /* lockfunc */ > >> &sc->xbd_io_lock, /* lockarg */ > >> &sc->xbd_io_dmat); > >> > >>> Also, I don't think there is a way for busdma > >>> to say that you MUST have a segment be a multiple of 512, though you > >>> could use a 512 boundary, but that would force all segments to only be > >>> 512 bytes... > >> > >> As I understand, that is mandatory requirement for this "hardware". > >> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC > >> UHCI/OHCI hardware. Even AHCI requires both segment addresses and > >> lengths to be even. > >> > >> I may be wrong, but I think it is quite likely that hardware that > >> requires segment address alignment quite likely will have the same > >> requirements for segments length. > > Hello, > > I have the following fix, which makes sure the total length and the > size of each segment is aligned. I'm not very knowledgeable of the > busdma code, so someone has to review it. I feel that this alignment should only be enforced via a new option on the tag... I don't see how alignment and segment size should be conflated... I could totally see a device that requires an alignement of 8 bytes, but has a segment size of 16, or vice versa, and requiring them to be the same means we will bounce unnecesarily... cc'd scottl since he knows this code better than I... and cperciva as he touched it for similar reasons.. Oh, I just found PR 152818, where cperciva did a similar fix to bounce_bus_dmamap_load_buffer for the exact same reason... It was committed in r216194... > --- > diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c > index d1c75f8..688f559 100644 > --- a/sys/x86/x86/busdma_bounce.c > +++ b/sys/x86/x86/busdma_bounce.c > @@ -620,6 +620,8 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, > segs = dmat->segments; > > if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { > + /* Make sure buflen is aligned */ > + buflen = roundup2(buflen, dmat->common.alignment); > _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); > if (map->pagesneeded != 0) { > error = _bus_dmamap_reserve_pages(dmat, map, flags); > @@ -634,6 +636,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, > if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && > map->pagesneeded != 0 && > bus_dma_run_filter(&dmat->common, curaddr)) { > + sgsize = roundup2(sgsize, dmat->common.alignment); > sgsize = MIN(sgsize, PAGE_SIZE); > curaddr = add_bounce_page(dmat, map, 0, curaddr, > sgsize); > Doesn't this same change need to be made to _bus_dmamap_count_phys so that the cound will be correct? Also, make sure you review the other arch's bounce implementations, as they were often copied from the x86 one... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:24:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A87CA76; Tue, 2 Sep 2014 17:24:00 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEB21985; Tue, 2 Sep 2014 17:23:59 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s82HCKU4008536; Tue, 2 Sep 2014 12:23:57 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 1p574dgbh8-1; Tue, 02 Sep 2014 12:23:57 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 15013403F0; Tue, 2 Sep 2014 12:23:57 -0500 (CDT) Message-ID: <5405FD2C.8000901@rice.edu> Date: Tue, 02 Sep 2014 12:23:56 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John Baldwin , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> In-Reply-To: <201409021201.15967.jhb@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.248919945447816 urlsuspect_oldscore=0.248919945447816 suspectscore=11 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.248919945447816 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409020196 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@freebsd.org, Steven Hartland X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:24:00 -0000 On 09/02/2014 11:01, John Baldwin wrote: > On Saturday, August 30, 2014 1:37:43 pm Peter Wemm wrote: >> On Saturday 30 August 2014 02:03:42 Steven Hartland wrote: >> I'm very disappointed in the attention to detail and errors in the commit. >> I'm almost at the point where I want to ask for the whole thing to be backed >> out. > I would not be too supportive of that. This PR has been open for a long, long > time with many users using patches from it in production loads that were > greatly improved by the changes and clamoring on the lists multiple times to > get someone to look at it. avg@ contributed quite a bit of time to diagnose > this with Karl early on, but other developers aside from Steven did not. It > also was not hard to explain to Karl the meaning of 'cache + free' in the bug > follow-ups itself (though I believe avg@ had tried this before and it didn't > sink in that time for some reason). > > I know Steven has since committed a fix, but if there are still concerns, I > think it would be best to not just revert this entirely but to spend some time > fixing the remaining issues. Clearly this issue affects a lot of users and > the earlier fixes to pagedaemon were not sufficient to fix their issues alone. > The patch actually makes two completely orthogonal changes at once, and one of those changes has no connection to the page daemon. I suspect that is why some people have said that their issues were not addressed by the page daemon fix. Prior to this patch, we were limiting the ARC size to 3/4 the kmem map/arena/object size on all architectures, including 64-bit, uma_small_alloc-enabled architectures where such a limit makes no sense. Consequently, some people were complaining, "Why is 1/4 of my memory going unused?" From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:27:48 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BBE1E8B; Tue, 2 Sep 2014 17:27:48 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E397819DC; Tue, 2 Sep 2014 17:27:47 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s82HRkVN057293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Sep 2014 10:27:47 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s82HRkkk057292; Tue, 2 Sep 2014 10:27:46 -0700 (PDT) (envelope-from jmg) Date: Tue, 2 Sep 2014 10:27:46 -0700 From: John-Mark Gurney To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront Message-ID: <20140902172746.GY71691@funkthat.com> References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140902171841.GX71691@funkthat.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 02 Sep 2014 10:27:47 -0700 (PDT) Cc: src-committers@FreeBSD.org, Alexander Motin , scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:27:48 -0000 John-Mark Gurney wrote this message on Tue, Sep 02, 2014 at 10:18 -0700: > Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: > > El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: > > > El 28/08/14 a les 20.58, Alexander Motin ha escrit: > > >> On 28.08.2014 21:45, John-Mark Gurney wrote: > > >>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: > > >>>> Hi, Roger. > > >>>> > > >>>> It looks to me like this commit does not work as it should. I got > > >>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. > > >>>> Somehow newfs does not produce valid filesystem. Problem is reliably > > >>>> repeatable and reverting this commit fixes it. > > >>>> > > >>>> I found at least one possible cause there: If original data buffer is > > >>>> unmapped, misaligned and not physically contiguous, then present x86 > > >>>> bus_dmamap_load_bio() implementation will process each physically > > >>>> contiguous segment separately. Due to the misalignment first and last > > >>>> physical segments may have size not multiple to 512 bytes. Since each > > >>>> segment processed separately, they are not joined together, and > > >>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to > > >>>> convert them to exact number of sectors in the driver cause data corruption. > > >>> > > >>> Are you sure this isn't a problem w/ the tag not properly specifying > > >>> the correct alignement? > > >> > > >> I don't know how to specify it stronger then this: > > >> error = bus_dma_tag_create( > > >> bus_get_dma_tag(sc->xbd_dev), /* parent */ > > >> 512, PAGE_SIZE, /* algnmnt, boundary */ > > >> BUS_SPACE_MAXADDR, /* lowaddr */ > > >> BUS_SPACE_MAXADDR, /* highaddr */ > > >> NULL, NULL, /* filter, filterarg */ > > >> sc->xbd_max_request_size, > > >> sc->xbd_max_request_segments, > > >> PAGE_SIZE, /* maxsegsize */ > > >> BUS_DMA_ALLOCNOW, /* flags */ > > >> busdma_lock_mutex, /* lockfunc */ > > >> &sc->xbd_io_lock, /* lockarg */ > > >> &sc->xbd_io_dmat); > > >> > > >>> Also, I don't think there is a way for busdma > > >>> to say that you MUST have a segment be a multiple of 512, though you > > >>> could use a 512 boundary, but that would force all segments to only be > > >>> 512 bytes... > > >> > > >> As I understand, that is mandatory requirement for this "hardware". > > >> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC > > >> UHCI/OHCI hardware. Even AHCI requires both segment addresses and > > >> lengths to be even. > > >> > > >> I may be wrong, but I think it is quite likely that hardware that > > >> requires segment address alignment quite likely will have the same > > >> requirements for segments length. > > > > Hello, > > > > I have the following fix, which makes sure the total length and the > > size of each segment is aligned. I'm not very knowledgeable of the > > busdma code, so someone has to review it. > > I feel that this alignment should only be enforced via a new option on > the tag... I don't see how alignment and segment size should be > conflated... I could totally see a device that requires an alignement > of 8 bytes, but has a segment size of 16, or vice versa, and requiring > them to be the same means we will bounce unnecesarily... > > cc'd scottl since he knows this code better than I... and cperciva as > he touched it for similar reasons.. > > Oh, I just found PR 152818, where cperciva did a similar fix to > bounce_bus_dmamap_load_buffer for the exact same reason... It was > committed in r216194... Also, if this change is made w/o adding a field to the tag, the busdma man page needs to be updated w/ the fact that alignment also forces segment sizes to be alignment sized... cperciva forgot this when he did his commit... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:34:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 636D248E; Tue, 2 Sep 2014 17:34:59 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 225CA1AC4; Tue, 2 Sep 2014 17:34:58 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 6D0E520E7088F; Tue, 2 Sep 2014 17:34:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id F11B520E7088C; Tue, 2 Sep 2014 17:34:53 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Alan Cox" , "John Baldwin" , "Peter Wemm" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Tue, 2 Sep 2014 18:34:55 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:34:59 -0000 ----- Original Message ----- From: "Alan Cox" > On 09/02/2014 11:01, John Baldwin wrote: >> On Saturday, August 30, 2014 1:37:43 pm Peter Wemm wrote: >>> On Saturday 30 August 2014 02:03:42 Steven Hartland wrote: >>> I'm very disappointed in the attention to detail and errors in the commit. >>> I'm almost at the point where I want to ask for the whole thing to be backed >>> out. >> I would not be too supportive of that. This PR has been open for a long, long >> time with many users using patches from it in production loads that were >> greatly improved by the changes and clamoring on the lists multiple times to >> get someone to look at it. avg@ contributed quite a bit of time to diagnose >> this with Karl early on, but other developers aside from Steven did not. It >> also was not hard to explain to Karl the meaning of 'cache + free' in the bug >> follow-ups itself (though I believe avg@ had tried this before and it didn't >> sink in that time for some reason). >> >> I know Steven has since committed a fix, but if there are still concerns, I >> think it would be best to not just revert this entirely but to spend some time >> fixing the remaining issues. Clearly this issue affects a lot of users and >> the earlier fixes to pagedaemon were not sufficient to fix their issues alone. >> > > The patch actually makes two completely orthogonal changes at once, and > one of those changes has no connection to the page daemon. I suspect > that is why some people have said that their issues were not addressed > by the page daemon fix. > > Prior to this patch, we were limiting the ARC size to 3/4 the kmem > map/arena/object size on all architectures, including 64-bit, > uma_small_alloc-enabled architectures where such a limit makes no > sense. Consequently, some people were complaining, "Why is 1/4 of my > memory going unused?" This is exactly the problem which lead me into investigating the issue. It should be noted that for i386, as requested by Peter, this limitation has been re-applied. Regards Steve From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:43:20 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78712809; Tue, 2 Sep 2014 17:43:20 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0541BB8; Tue, 2 Sep 2014 17:43:19 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id D18B220E70890; Tue, 2 Sep 2014 17:43:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 1117320E7088C; Tue, 2 Sep 2014 17:43:17 +0000 (UTC) Message-ID: <8AA1D02BB967468DA07731149E95390D@multiplay.co.uk> From: "Steven Hartland" To: "Andriy Gapon" , "John Baldwin" , "Peter Wemm" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405F1F3.1@FreeBSD.org> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Tue, 2 Sep 2014 18:43:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:43:20 -0000 ----- Original Message ----- From: "Andriy Gapon" > on 02/09/2014 19:01 John Baldwin said the following: >> I know Steven has since committed a fix, but if there are still >> concerns, I >> think it would be best to not just revert this entirely but to spend >> some time >> fixing the remaining issues. Clearly this issue affects a lot of >> users and >> the earlier fixes to pagedaemon were not sufficient to fix their >> issues alone. > > I am not sure that that is the case. I could have very well missed an > evidence > of that, but then I'd appreciate a pointer or two to such reports. > I am certainly sure that a large number of reports about "ZFS vs > swapping" issue > appeared after the pagedaemon problem was introduced. > > I have also missed any "theoretical" justification for the patch. > That is, an > explanation of how the patch interacts with the pagedaemon and > improves things. > The empirical evidence could be insufficient, because it's easy to > tilt the > balance such that the ARC gives in too easily. But people who were > affected by > the opposite problem could be different from people who would be > affected by the > new problem, because of differences in system characteristics such as > amount of > RAM, workload patterns, working set sizes, etc. > > Having said that, I do not ask for the changes to be reverted, but > I'll probably > get back after I have sufficient time to look at the patch and also to > test its > effect on my systems. This might not be very soon though. > > P.S. I think that there was no technical reason to initialize the > newly > introduced parameters via SYSINIT mechanism. I created the SYSINT as the values are not available early enough for the sysctl. > I think that the initialization could be just done in arc_init. I thought I'd tested this when doing the initial implementation but it was a long week so I just did a quick re-test and confirmed arc_init is called before the pagedaemon is initialised so it can't be used in this case. On a side note it would be nice if ARC sysctls, which are currently done via arc_init, where cleaned up as currently the limits aren't enforced correctly when manually changed, as well as being split up into two locations making them hard to follow. Something I intend to look at when I get some free time. > And the newly added kmem_foo() functions probably do not belong in > cddl/compat/opensolaris as Solaris / illumos does not have those > functions. They could be moved but their current location keeps all the kmem related functions neatly in one place. Spreading them around IMO would just make things hard to find. > I think that in this case e.g. vm_cnt.v_free_target can just be > used directly by the FreeBSD-specific ARC code. It could but as above keeping everything in one place makes it to find and hence MFC as this area has seen changes which will require all those fields renamed. It also means if the logic for free pages changes in the future there's only one place it needs to be changed. For those interested there's also an open review on additional changes in this area: https://reviews.freebsd.org/D702 Regards Steve From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 17:45:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39C9D98A for ; Tue, 2 Sep 2014 17:45:27 +0000 (UTC) Received: from o3.shared.sendgrid.net (o3.shared.sendgrid.net [208.117.48.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E271BCC for ; Tue, 2 Sep 2014 17:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=JPD5EVRwPoW01MikeRDo033mK7Y=; b=p7ThUPK5kv4yXMPrMi m9UXZ8h/mZfM4ykX4sxpibhVI3zJE0ow/itt97o8STw+d+UKL+e30c88ndMoTWs5 JfFQ5cK+UcIg7F8OFwdpMxJ+sABXjUPfMkJZB3S2+KH58k9DI5s1bcx1kxxdbVXw MFTguZrwiOivPhBl4Pq9pxy4Y= Received: by mf190.sendgrid.net with SMTP id mf190.32254.5406003D46 2014-09-02 17:37:07.047415887 +0000 UTC Received: from mail.tarsnap.com (unknown [10.100.60.108]) by ismtpd-029.iad1.sendgrid.net (SG) with ESMTP id 14837710584.65c5.1df85a for ; Tue, 02 Sep 2014 17:37:06 +0000 (GMT) Received: (qmail 83357 invoked from network); 2 Sep 2014 17:37:06 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 2 Sep 2014 17:37:06 -0000 Received: (qmail 10160 invoked from network); 2 Sep 2014 17:36:07 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 2 Sep 2014 17:36:07 -0000 Message-ID: <54060007.1090500@freebsd.org> Date: Tue, 02 Sep 2014 10:36:07 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: John-Mark Gurney , =?ISO-8859-1?Q?Roger_Pau_Mon?= =?ISO-8859-1?Q?n=E9?= Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> In-Reply-To: <20140902171841.GX71691@funkthat.com> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SG-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNFRVmY8so1ArPPs6G+R2wS8plAk7Cmj+do+icDuLxxNmKuoCvj1nCdfyjcMHM40oKJdlOa5KixlyjNlVv7VVs5r3GKcoKEWqayukqYSCU3KMNljJYMz0jn0kspfMm+ISVQ= Cc: src-committers@FreeBSD.org, Alexander Motin , scottl@FreeBSD.org, svn-src-head@FreeBSD.org, "Justin T. Gibbs" , svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:45:27 -0000 On 09/02/14 10:18, John-Mark Gurney wrote: > cc'd scottl since he knows this code better than I... and cperciva as > he touched it for similar reasons.. > > Oh, I just found PR 152818, where cperciva did a similar fix to > bounce_bus_dmamap_load_buffer for the exact same reason... It was > committed in r216194... This was just a MFamd64 of r204214 -- at that point i386 and amd64 had separate busdma_bounce.c files with different sets of bug fixes. I don't think I ever fixed any new bugs; I just merged fixes between the two architectures and then (once they were identical) replaced them by a single x86 file (in r216316). This particular bug fix came from gibbs. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 18:21:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 971E780E; Tue, 2 Sep 2014 18:21:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 816931FA5; Tue, 2 Sep 2014 18:21:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82ILK4F081190; Tue, 2 Sep 2014 18:21:20 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82ILKmr081189; Tue, 2 Sep 2014 18:21:20 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409021821.s82ILKmr081189@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 2 Sep 2014 18:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270972 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 18:21:20 -0000 Author: rpaulo Date: Tue Sep 2 18:21:19 2014 New Revision: 270972 URL: http://svnweb.freebsd.org/changeset/base/270972 Log: Fix typo in a comment. Modified: head/lib/libthr/thread/thr_cond.c Modified: head/lib/libthr/thread/thr_cond.c ============================================================================== --- head/lib/libthr/thread/thr_cond.c Tue Sep 2 16:38:00 2014 (r270971) +++ head/lib/libthr/thread/thr_cond.c Tue Sep 2 18:21:19 2014 (r270972) @@ -150,7 +150,7 @@ _pthread_cond_destroy(pthread_cond_t *co } /* - * Cancellation behaivor: + * Cancellation behavior: * Thread may be canceled at start, if thread is canceled, it means it * did not get a wakeup from pthread_cond_signal(), otherwise, it is * not canceled. From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 18:32:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AFD2C18; Tue, 2 Sep 2014 18:32:00 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFE01114F; Tue, 2 Sep 2014 18:31:59 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s82IRN9x009021; Tue, 2 Sep 2014 13:31:57 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp1.rice.edu with ESMTP id 1p2u5b9n6h-1; Tue, 02 Sep 2014 13:31:56 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id C14E04C01BC; Tue, 2 Sep 2014 13:31:55 -0500 (CDT) Message-ID: <54060D1B.6020700@rice.edu> Date: Tue, 02 Sep 2014 13:31:55 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland , John Baldwin , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.601496849000349 urlsuspect_oldscore=0.00149684900034924 suspectscore=11 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.601496849000349 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409020199 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 18:32:00 -0000 On 09/02/2014 12:34, Steven Hartland wrote: > ----- Original Message ----- From: "Alan Cox" > >> On 09/02/2014 11:01, John Baldwin wrote: >>> On Saturday, August 30, 2014 1:37:43 pm Peter Wemm wrote: >>>> On Saturday 30 August 2014 02:03:42 Steven Hartland wrote: >>>> I'm very disappointed in the attention to detail and errors in the >>>> commit. I'm almost at the point where I want to ask for the whole >>>> thing to be backed out. >>> I would not be too supportive of that. This PR has been open for a >>> long, long time with many users using patches from it in production >>> loads that were greatly improved by the changes and clamoring on the >>> lists multiple times to get someone to look at it. avg@ contributed >>> quite a bit of time to diagnose this with Karl early on, but other >>> developers aside from Steven did not. It also was not hard to >>> explain to Karl the meaning of 'cache + free' in the bug follow-ups >>> itself (though I believe avg@ had tried this before and it didn't >>> sink in that time for some reason). >>> >>> I know Steven has since committed a fix, but if there are still >>> concerns, I think it would be best to not just revert this entirely >>> but to spend some time fixing the remaining issues. Clearly this >>> issue affects a lot of users and the earlier fixes to pagedaemon >>> were not sufficient to fix their issues alone. >>> >> >> The patch actually makes two completely orthogonal changes at once, and >> one of those changes has no connection to the page daemon. I suspect >> that is why some people have said that their issues were not addressed >> by the page daemon fix. >> >> Prior to this patch, we were limiting the ARC size to 3/4 the kmem >> map/arena/object size on all architectures, including 64-bit, >> uma_small_alloc-enabled architectures where such a limit makes no >> sense. Consequently, some people were complaining, "Why is 1/4 of my >> memory going unused?" > > This is exactly the problem which lead me into investigating the issue. > Is there any evidence that anything other than eliminating the KVA limit is needed on machines where the page daemon isn't broken? > It should be noted that for i386, as requested by Peter, this limitation > has been re-applied. > Unlike Solaris, we run on a few 32-bit architectures, besides i386, that don't have a direct map or a full 4GB address space for the kernel. So, for FreeBSD, this needs to be more general than just i386. I would suggest using '#ifndef UMA_MD_SMALL_ALLOC' as being the closest thing that we have to what you want here. This check will allow any machine, including 32-bit machines that allocate some kernel memory through a direct map, to opt out of the kmem map/arena/object limit. Finally, the Solaris KVA check is written to avoid the possibility of integer overflow. However, the FreeBSD version is not. For example, suppose that I setup an i386 machine with something approaching a 2GB/2GB user/kernel split, 3 * kmem_size() could overflow. From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 18:32:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 245B6D59; Tue, 2 Sep 2014 18:32:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FDB9115B; Tue, 2 Sep 2014 18:32:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82IWfpb088448; Tue, 2 Sep 2014 18:32:41 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82IWfWj088446; Tue, 2 Sep 2014 18:32:41 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201409021832.s82IWfWj088446@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 2 Sep 2014 18:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270973 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 18:32:42 -0000 Author: kadesai Date: Tue Sep 2 18:32:41 2014 New Revision: 270973 URL: http://svnweb.freebsd.org/changeset/base/270973 Log: Fix for WITNESS warning while doing xpt_rescan. This happen when converting any JBOD to RAID or creating any new RAID from Unconfigured Drives. Without this fix, user may see below call trace if WITNESS is enabled. witness_warn() at witness_warn+0x4b5/frame 0xfffffe011f929a00 uma_zalloc_arg() at uma_zalloc_arg+0x3b/frame 0xfffffe011f929a70 malloc() at malloc+0x192/frame 0xfffffe011f929ac0 mrsas_bus_scan_sim() at mrsas_bus_scan_sim+0x32/frame 0xfffffe011f929af0 mrsas_aen_handler() at mrsas_aen_handler+0x11c/frame 0xfffffe011f929b20 taskqueue_run_locked() at taskqueue_run_locked+0xf0/frame 0xfffffe011f929b80 taskqueue_thread_loop() at taskqueue_thread_loop+0x9b/frame 0xfffffe011f929bb0 fork_exit() at fork_exit+0x84/frame 0xfffffe011f929bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe011f929bf0 Submitted by: kadesai Reviewed by: ambrisko MFC after: 3 days Modified: head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Sep 2 18:21:19 2014 (r270972) +++ head/sys/dev/mrsas/mrsas.h Tue Sep 2 18:32:41 2014 (r270973) @@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.704.01.00-fbsd" +#define MRSAS_VERSION "06.704.01.01-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 //temp #define DONE 0 Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Sep 2 18:21:19 2014 (r270972) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Sep 2 18:32:41 2014 (r270973) @@ -1116,18 +1116,16 @@ int mrsas_bus_scan(struct mrsas_softc *s union ccb *ccb_0; union ccb *ccb_1; - mtx_lock(&sc->sim_lock); if ((ccb_0 = xpt_alloc_ccb()) == NULL) { - mtx_unlock(&sc->sim_lock); return(ENOMEM); } if ((ccb_1 = xpt_alloc_ccb()) == NULL) { xpt_free_ccb(ccb_0); - mtx_unlock(&sc->sim_lock); return(ENOMEM); } + mtx_lock(&sc->sim_lock); if (xpt_create_path(&ccb_0->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_0), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){ xpt_free_ccb(ccb_0); @@ -1144,9 +1142,9 @@ int mrsas_bus_scan(struct mrsas_softc *s return(EIO); } + mtx_unlock(&sc->sim_lock); xpt_rescan(ccb_0); xpt_rescan(ccb_1); - mtx_unlock(&sc->sim_lock); return(0); } @@ -1161,19 +1159,18 @@ int mrsas_bus_scan_sim(struct mrsas_soft { union ccb *ccb; - mtx_lock(&sc->sim_lock); if ((ccb = xpt_alloc_ccb()) == NULL) { - mtx_unlock(&sc->sim_lock); return(ENOMEM); } + mtx_lock(&sc->sim_lock); if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){ xpt_free_ccb(ccb); mtx_unlock(&sc->sim_lock); return(EIO); } - xpt_rescan(ccb); mtx_unlock(&sc->sim_lock); + xpt_rescan(ccb); return(0); } From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 18:57:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFAE950B; Tue, 2 Sep 2014 18:57:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B9C41399; Tue, 2 Sep 2014 18:57:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82IvJtN098662; Tue, 2 Sep 2014 18:57:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82IvJl1098661; Tue, 2 Sep 2014 18:57:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409021857.s82IvJl1098661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 2 Sep 2014 18:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270975 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 18:57:19 -0000 Author: jhb Date: Tue Sep 2 18:57:19 2014 New Revision: 270975 URL: http://svnweb.freebsd.org/changeset/base/270975 Log: Use callout(9) instead of timeout(9). Tested by: danfe Modified: head/sys/dev/ofw/ofw_console.c Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Tue Sep 2 18:54:40 2014 (r270974) +++ head/sys/dev/ofw/ofw_console.c Tue Sep 2 18:57:19 2014 (r270975) @@ -60,8 +60,7 @@ static struct ttydevsw ofw_ttydevsw = { }; static int polltime; -static struct callout_handle ofw_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); +static struct callout ofw_timer; #if defined(KDB) static int alt_break_state; @@ -101,6 +100,7 @@ cn_drvinit(void *unused) return; if (strlen(output) > 0) tty_makealias(tp, "%s", output); + callout_init_mtx(&ofw_timer, tty_getlock(tp), 0); } } @@ -116,7 +116,7 @@ ofwtty_open(struct tty *tp) if (polltime < 1) polltime = 1; - ofw_timeouthandle = timeout(ofw_timeout, tp, polltime); + callout_reset(&ofw_timer, polltime, ofw_timeout, tp); return (0); } @@ -125,8 +125,7 @@ static void ofwtty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(ofw_timeout, tp, ofw_timeouthandle); + callout_stop(&ofw_timer); } static void @@ -151,13 +150,12 @@ ofw_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = ofw_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - ofw_timeouthandle = timeout(ofw_timeout, tp, polltime); + callout_schedule(&ofw_timer, polltime); } static void From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 19:05:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B24F391A; Tue, 2 Sep 2014 19:05:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E63114F9; Tue, 2 Sep 2014 19:05:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82J5YdJ003528; Tue, 2 Sep 2014 19:05:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82J5YHf003527; Tue, 2 Sep 2014 19:05:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409021905.s82J5YHf003527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Sep 2014 19:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270976 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 19:05:34 -0000 Author: emaste Date: Tue Sep 2 19:05:34 2014 New Revision: 270976 URL: http://svnweb.freebsd.org/changeset/base/270976 Log: Allow standalone debug for non-default ${PROG} targets This allows WITH_DEBUG_FILES to produce standalone debug for the ELF runtime linker. We previously disabled standalone debug files for bsd.prog.mk consumers that included a non-default ${PROG} target, but this is not required. Consumers that do not support standalone debug are still handled by disabling it for statically linked binaries, and for those that specify a non-default binary format. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Tue Sep 2 18:57:19 2014 (r270975) +++ head/share/mk/bsd.prog.mk Tue Sep 2 19:05:34 2014 (r270976) @@ -29,9 +29,7 @@ CTFFLAGS+= -g PROG= ${PROG_CXX} .endif -.if defined(PROG) && target(${PROG}) -MK_DEBUG_FILES= no -.elif !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static) +.if !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static) MK_DEBUG_FILES= no .endif From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 19:09:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5D69B8B; Tue, 2 Sep 2014 19:09:13 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 5EA69154D; Tue, 2 Sep 2014 19:09:13 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id E1EFA20E7088E; Tue, 2 Sep 2014 19:09:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=1.0 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id 0C2CC20E7088C; Tue, 2 Sep 2014 19:09:09 +0000 (UTC) Message-ID: <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> From: "Steven Hartland" To: "Alan Cox" , "John Baldwin" , "Peter Wemm" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Tue, 2 Sep 2014 20:09:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 19:09:14 -0000 ----- Original Message ----- From: "Alan Cox" > On 09/02/2014 12:34, Steven Hartland wrote: >> ----- Original Message ----- From: "Alan Cox" >>> The patch actually makes two completely orthogonal changes at once, and >>> one of those changes has no connection to the page daemon. I suspect >>> that is why some people have said that their issues were not addressed >>> by the page daemon fix. >>> >>> Prior to this patch, we were limiting the ARC size to 3/4 the kmem >>> map/arena/object size on all architectures, including 64-bit, >>> uma_small_alloc-enabled architectures where such a limit makes no >>> sense. Consequently, some people were complaining, "Why is 1/4 of my >>> memory going unused?" >> >> This is exactly the problem which lead me into investigating the issue. >> > > Is there any evidence that anything other than eliminating the KVA limit > is needed on machines where the page daemon isn't broken? In "my" direct experience, I would have to say no, I can't speak for others. >> It should be noted that for i386, as requested by Peter, this limitation >> has been re-applied. >> > > Unlike Solaris, we run on a few 32-bit architectures, besides i386, that > don't have a direct map or a full 4GB address space for the kernel. So, > for FreeBSD, this needs to be more general than just i386. I would > suggest using '#ifndef UMA_MD_SMALL_ALLOC' as being the closest thing > that we have to what you want here. This check will allow any machine, > including 32-bit machines that allocate some kernel memory through a > direct map, to opt out of the kmem map/arena/object limit. I'm not and don't profess to be an expert in this domain as you know ;-) So I'm to defer to you guys, Peter would you agree with this? > Finally, the Solaris KVA check is written to avoid the possibility of > integer overflow. However, the FreeBSD version is not. For example, > suppose that I setup an i386 machine with something approaching a > 2GB/2GB user/kernel split, 3 * kmem_size() could overflow. The returns of said functions are uint64_t so I'm not sure where the overflow would be when working with 2GB values? We seem to be missing some of the following, which doesn't impact us directly but may affect understanding of the "current" illumos code as its not in the tree: https://github.com/illumos/illumos-gate/commit/94dd93aee32d1616436eb51fb7b58094b9a8d3e8 Regards Steve From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 20:02:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 409192AB; Tue, 2 Sep 2014 20:02:54 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0005B1CAF; Tue, 2 Sep 2014 20:02:53 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s82K2NK1009245; Tue, 2 Sep 2014 15:02:50 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp1.rice.edu with ESMTP id 1p2u5b9r1g-1; Tue, 02 Sep 2014 15:02:50 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 7D0354C01D0; Tue, 2 Sep 2014 15:02:49 -0500 (CDT) Message-ID: <54062268.9060603@rice.edu> Date: Tue, 02 Sep 2014 15:02:48 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland , John Baldwin , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> In-Reply-To: <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.601496849000349 urlsuspect_oldscore=0.00149684900034924 suspectscore=3 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.601496849000349 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409020210 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 20:02:54 -0000 On 09/02/2014 14:09, Steven Hartland wrote: > ----- Original Message ----- From: "Alan Cox" >> On 09/02/2014 12:34, Steven Hartland wrote: >>> ----- Original Message ----- From: "Alan Cox" >>>> The patch actually makes two completely orthogonal changes at once, >>>> and >>>> one of those changes has no connection to the page daemon. I suspect >>>> that is why some people have said that their issues were not addressed >>>> by the page daemon fix. >>>> >>>> Prior to this patch, we were limiting the ARC size to 3/4 the kmem >>>> map/arena/object size on all architectures, including 64-bit, >>>> uma_small_alloc-enabled architectures where such a limit makes no >>>> sense. Consequently, some people were complaining, "Why is 1/4 of my >>>> memory going unused?" >>> >>> This is exactly the problem which lead me into investigating the issue. >>> >> >> Is there any evidence that anything other than eliminating the KVA limit >> is needed on machines where the page daemon isn't broken? > > In "my" direct experience, I would have to say no, I can't speak for > others. > >>> It should be noted that for i386, as requested by Peter, this >>> limitation >>> has been re-applied. >>> >> >> Unlike Solaris, we run on a few 32-bit architectures, besides i386, that >> don't have a direct map or a full 4GB address space for the kernel. So, >> for FreeBSD, this needs to be more general than just i386. I would >> suggest using '#ifndef UMA_MD_SMALL_ALLOC' as being the closest thing >> that we have to what you want here. This check will allow any machine, >> including 32-bit machines that allocate some kernel memory through a >> direct map, to opt out of the kmem map/arena/object limit. > > I'm not and don't profess to be an expert in this domain as you > know ;-) So I'm to defer to you guys, Peter would you agree with > this? > >> Finally, the Solaris KVA check is written to avoid the possibility of >> integer overflow. However, the FreeBSD version is not. For example, >> suppose that I setup an i386 machine with something approaching a >> 2GB/2GB user/kernel split, 3 * kmem_size() could overflow. > > The returns of said functions are uint64_t so I'm not sure where > the overflow would be when working with 2GB values? > Ah, I didn't see the uint64_t. I only looked at the calculation and assumed vm_offset_t was being used. So, yes, you are safe from overflow. > We seem to be missing some of the following, which doesn't impact > us directly but may affect understanding of the "current" illumos > code as its not in the tree: > https://github.com/illumos/illumos-gate/commit/94dd93aee32d1616436eb51fb7b58094b9a8d3e8 > > > Regards > Steve > > From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 22:59:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1AE92B4; Tue, 2 Sep 2014 22:59:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD5CB10BF; Tue, 2 Sep 2014 22:59:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82MxeRT017935; Tue, 2 Sep 2014 22:59:40 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82MxeVN017934; Tue, 2 Sep 2014 22:59:40 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409022259.s82MxeVN017934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 2 Sep 2014 22:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270989 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 22:59:41 -0000 Author: dteske Date: Tue Sep 2 22:59:40 2014 New Revision: 270989 URL: http://svnweb.freebsd.org/changeset/base/270989 Log: Fix regression introduced by SVN r270954. Correct way to reset getopts is to set OPTIND to 1, not unset it (which causes an error). Thanks to: jilles Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Tue Sep 2 22:01:14 2014 (r270988) +++ head/usr.sbin/bsdconfig/share/dialog.subr Tue Sep 2 22:59:40 2014 (r270989) @@ -2116,7 +2116,7 @@ f_dialog_init() f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" SECURE=`set -- $ARGV - unset OPTIND + OPTIND=1 while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do @@ -2126,7 +2126,7 @@ f_dialog_init() done ` # END-BACKTICK USE_XDIALOG=`set -- $ARGV - unset OPTIND + OPTIND=1 while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do From owner-svn-src-head@FreeBSD.ORG Tue Sep 2 23:43:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6027F685; Tue, 2 Sep 2014 23:43:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7A41789; Tue, 2 Sep 2014 23:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82Nh7G0042044; Tue, 2 Sep 2014 23:43:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82Nh6FH042040; Tue, 2 Sep 2014 23:43:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409022343.s82Nh6FH042040@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 2 Sep 2014 23:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270990 - in head: share/mk sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 23:43:07 -0000 Author: markj Date: Tue Sep 2 23:43:06 2014 New Revision: 270990 URL: http://svnweb.freebsd.org/changeset/base/270990 Log: Define _DTRACE_VERSION in sdt.h rather than setting it manually. This is similar to what illumos does, and makes it easier to enable USDT probes in third-party software that doesn't make use of the system makefiles. Modified: head/share/mk/bsd.dep.mk head/sys/sys/sdt.h Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Sep 2 22:59:40 2014 (r270989) +++ head/share/mk/bsd.dep.mk Tue Sep 2 23:43:06 2014 (r270990) @@ -125,7 +125,7 @@ ${_YC:R}.o: ${_YC} .if ${SRCS:M*.d} LDFLAGS+= -lelf LDADD+= ${LIBELF} -CFLAGS+= -D_DTRACE_VERSION=1 -I${.OBJDIR} +CFLAGS+= -I${.OBJDIR} .endif .for _DSRC in ${SRCS:M*.d:N*/*} .for _D in ${_DSRC:R} Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Tue Sep 2 22:59:40 2014 (r270989) +++ head/sys/sys/sdt.h Tue Sep 2 23:43:06 2014 (r270990) @@ -33,6 +33,8 @@ #ifndef _KERNEL +#define _DTRACE_VERSION 1 + #define DTRACE_PROBE(prov, name) { \ extern void __dtrace_##prov##___##name(void); \ __dtrace_##prov##___##name(); \ From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 00:32:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAC0DAFE; Wed, 3 Sep 2014 00:32:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B76CA1BC2; Wed, 3 Sep 2014 00:32:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s830WJhX066536; Wed, 3 Sep 2014 00:32:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s830WJCI066535; Wed, 3 Sep 2014 00:32:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409030032.s830WJCI066535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 3 Sep 2014 00:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270991 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 00:32:19 -0000 Author: imp Date: Wed Sep 3 00:32:19 2014 New Revision: 270991 URL: http://svnweb.freebsd.org/changeset/base/270991 Log: Invoke make_dtb with MACHINE defined for enhanced cross building friendliness. This should restore old-fashioned kernel building in a cross environment, though this has only had limited testing. Sponsored by: Netflix Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 2 23:43:06 2014 (r270990) +++ head/sys/conf/files Wed Sep 3 00:32:19 2014 (r270991) @@ -14,11 +14,11 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 05:14:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A5257C4; Wed, 3 Sep 2014 05:14:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3601E1C2D; Wed, 3 Sep 2014 05:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s835Ep56098397; Wed, 3 Sep 2014 05:14:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s835EpmF098396; Wed, 3 Sep 2014 05:14:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409030514.s835EpmF098396@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Sep 2014 05:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270992 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 05:14:51 -0000 Author: hselasky Date: Wed Sep 3 05:14:50 2014 New Revision: 270992 URL: http://svnweb.freebsd.org/changeset/base/270992 Log: Fix logical error. MFC after: 3 days Modified: head/sys/dev/usb/net/if_aue.c Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Wed Sep 3 00:32:19 2014 (r270991) +++ head/sys/dev/usb/net/if_aue.c Wed Sep 3 05:14:50 2014 (r270992) @@ -749,7 +749,7 @@ aue_intr_callback(struct usb_xfer *xfer, if (pkt.aue_txstat0) ifp->if_oerrors++; - if (pkt.aue_txstat0 & (AUE_TXSTAT0_LATECOLL & + if (pkt.aue_txstat0 & (AUE_TXSTAT0_LATECOLL | AUE_TXSTAT0_EXCESSCOLL)) ifp->if_collisions++; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 05:44:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23025F57; Wed, 3 Sep 2014 05:44:18 +0000 (UTC) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B01491EC0; Wed, 3 Sep 2014 05:44:17 +0000 (UTC) Received: by mail-yk0-f176.google.com with SMTP id 19so4724509ykq.21 for ; Tue, 02 Sep 2014 22:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=zoSoomAmAxKHQxJp4LZ51syZ/IoKhf4b3AkK+5qY7iE=; b=D3c+pMvfZbfKZTioUTyZ2fGYdKGRFHrvB258xkvKyFVU+gpbAqGAkMMsoIonYocxAB mAd5X96Lxf7MWpfxvKqfrTazTyqoHA4ooNFPCxYiZQMkB2TMWD3ChKEQ57kTk9+/xtPE kTQkPiEevPXKEbANLl2IGl2CZx6x0jrTw1LJzl5dASRjy1JwN+VbvdVkcqSFep/5Vv/D wQN+SqFIvUtc1IJbOHGPYRZbftc2rD+EXTFi+0WM2zGsQMIrySwiPU6rqfBIuRD+r2nB LdBLvRVmLCMY+nIupuOp03cJiIibPcMgva3/brqCTacX/MT5oThczoSsZa+JlOB/OvB3 Z3CQ== MIME-Version: 1.0 X-Received: by 10.236.121.44 with SMTP id q32mr58901462yhh.55.1409723056870; Tue, 02 Sep 2014 22:44:16 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.170.164.197 with HTTP; Tue, 2 Sep 2014 22:44:16 -0700 (PDT) In-Reply-To: <201409021116.s82BGiXI071065@svn.freebsd.org> References: <201409021116.s82BGiXI071065@svn.freebsd.org> Date: Wed, 3 Sep 2014 07:44:16 +0200 X-Google-Sender-Auth: oNzTjlPMM7c6ACePfweYJOlLjlo Message-ID: Subject: Re: svn commit: r270964 - head/sys/sys From: Antoine Brodin To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 05:44:18 -0000 On Tue, Sep 2, 2014 at 1:16 PM, Ed Schouten wrote: > Author: ed > Date: Tue Sep 2 11:16:44 2014 > New Revision: 270964 > URL: http://svnweb.freebsd.org/changeset/base/270964 > > Log: > Clean up slightly. > > - Remove c++0x hack from that was needed when Clang did > not fully implement C++11. We can now safely test against C++11 to > check whether thread_local is available, like we do for all other > C++11 keywords. > > - Don't use __clang__ to test for thread safety annotation presence. It > turns out we have a proper attribute for this. > > Modified: > head/sys/sys/cdefs.h > > Modified: head/sys/sys/cdefs.h > ============================================================================== > --- head/sys/sys/cdefs.h Tue Sep 2 10:35:04 2014 (r270963) > +++ head/sys/sys/cdefs.h Tue Sep 2 11:16:44 2014 (r270964) > @@ -298,8 +298,7 @@ > #endif > > #if !__has_extension(c_thread_local) > -/* XXX: Change this to test against C++11 when clang in base supports it. */ > -#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ > +#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ > __has_extension(cxx_thread_local) > #define _Thread_local thread_local > #else Hi, This change may break the lang/gcc port on head: http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p367138_s270990/logs/errors/gcc-4.7.4.log Cheers, Antoine From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 06:25:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C10DCC9; Wed, 3 Sep 2014 06:25:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 581881311; Wed, 3 Sep 2014 06:25:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s836PZ3Q032160; Wed, 3 Sep 2014 06:25:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s836PZHY032159; Wed, 3 Sep 2014 06:25:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409030625.s836PZHY032159@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 3 Sep 2014 06:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270993 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 06:25:35 -0000 Author: mjg Date: Wed Sep 3 06:25:34 2014 New Revision: 270993 URL: http://svnweb.freebsd.org/changeset/base/270993 Log: Fix up proc_realparent to always return correct process. Prior to the change it would always return initproc for non-traced processes. This fixes ps apparently always returning 1 as ppid. Pointy hat: mjg Reported by: many MFC after: 1 week Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014 (r270992) +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014 (r270993) @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) sx_assert(&proctree_lock, SX_LOCKED); if ((child->p_treeflag & P_TREE_ORPHANED) == 0) { - return (child->p_pptr->p_pid == child->p_oppid ? - child->p_pptr : initproc); + if (child->p_oppid == 0 || + child->p_pptr->p_pid == child->p_oppid) + parent = child->p_pptr; + else + parent = initproc; + return (parent); } for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 06:34:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 511B7D0; Wed, 3 Sep 2014 06:34:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3F213DC; Wed, 3 Sep 2014 06:34:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s836YHIP036748; Wed, 3 Sep 2014 06:34:17 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s836YHEG036747; Wed, 3 Sep 2014 06:34:17 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409030634.s836YHEG036747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 3 Sep 2014 06:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270994 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 06:34:17 -0000 Author: ed Date: Wed Sep 3 06:34:16 2014 New Revision: 270994 URL: http://svnweb.freebsd.org/changeset/base/270994 Log: Partially revert r270964. Don't test for C++11 to define _Thread_local. In addition to Clang 3.3, it turns out that GCC 4.7 in Ports also does not support the _Thread_local keyword. Let's document this in a bit more detail. Reported by: antoine@ Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Wed Sep 3 06:25:34 2014 (r270993) +++ head/sys/sys/cdefs.h Wed Sep 3 06:34:16 2014 (r270994) @@ -298,7 +298,12 @@ #endif #if !__has_extension(c_thread_local) -#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ +/* + * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode + * without actually supporting the thread_local keyword. Don't check for + * the presence of C++11 when defining _Thread_local. + */ +#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ __has_extension(cxx_thread_local) #define _Thread_local thread_local #else From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 06:34:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7190B2F3; Wed, 3 Sep 2014 06:34:44 +0000 (UTC) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68C5C13E6; Wed, 3 Sep 2014 06:34:43 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id ty20so9110621lab.2 for ; Tue, 02 Sep 2014 23:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0XAPpeV7ZDuyHQ4OhWzw21FCrFI14hnBBJLIhfDmMro=; b=ULC87RPScA/5GtnRmzFFUCdywUBIiDgr48HnbqK9m3QSNj+/fJS1iP5ssoQUJcjTZj 05geunnfywGFUa+SmJoNEm967YFtBIcH6lFrL4JlxgLoUsFacQW6ISnfV70vBfjDnubW zpApU7FW9jQlIXryuhvZMDMmQgi4en5r84CV4bBHXP4lc3DXQtsdTkwepYkY5WtvUawj NAw2PuK6UZtZcvgnCDRHVd8zm8mJtMu1glKpUv3LYra512vzN3KIMX/NhI78tVle+thW ouEv2YMZ8k0MVJW+vn2P9kXxr2/TuKGHra73DbrDSOapTZAHfz4c317VLc56SLcEzwI0 BTAA== MIME-Version: 1.0 X-Received: by 10.112.198.233 with SMTP id jf9mr15593674lbc.43.1409726081290; Tue, 02 Sep 2014 23:34:41 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.152.144.2 with HTTP; Tue, 2 Sep 2014 23:34:41 -0700 (PDT) In-Reply-To: References: <201409021116.s82BGiXI071065@svn.freebsd.org> Date: Wed, 3 Sep 2014 08:34:41 +0200 X-Google-Sender-Auth: qGopY8j7JOg1ve0rxcwEHtDBLKs Message-ID: Subject: Re: svn commit: r270964 - head/sys/sys From: Ed Schouten To: Antoine Brodin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 06:34:44 -0000 On 3 September 2014 07:44, Antoine Brodin wrote: > This change may break the lang/gcc port on head: > http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p367138_s270990/logs/errors/gcc-4.7.4.log Good catch! Fixed in r270994. -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 07:16:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24D96EFB; Wed, 3 Sep 2014 07:16:37 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7037199E; Wed, 3 Sep 2014 07:16:36 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s837GUeS014627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Sep 2014 10:16:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s837GUeS014627 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s837GTnE014626; Wed, 3 Sep 2014 10:16:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 3 Sep 2014 10:16:29 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r270993 - head/sys/kern Message-ID: <20140903071629.GG2737@kib.kiev.ua> References: <201409030625.s836PZHY032159@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ycwUkriSLVNn2GEA" Content-Disposition: inline In-Reply-To: <201409030625.s836PZHY032159@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 07:16:37 -0000 --ycwUkriSLVNn2GEA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 03, 2014 at 06:25:35AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Sep 3 06:25:34 2014 > New Revision: 270993 > URL: http://svnweb.freebsd.org/changeset/base/270993 >=20 > Log: > Fix up proc_realparent to always return correct process. > =20 > Prior to the change it would always return initproc for non-traced proc= esses. > =20 > This fixes ps apparently always returning 1 as ppid. > =20 > Pointy hat: mjg No, this is my bug. Thank you for fixing it. It is a consequence of the last minute 'safety' change I did. > Reported by: many > MFC after: 1 week I suggest to merge in 3 days. >=20 > Modified: > head/sys/kern/kern_exit.c >=20 > Modified: head/sys/kern/kern_exit.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014 (r270992) > +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014 (r270993) > @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) > =20 > sx_assert(&proctree_lock, SX_LOCKED); > if ((child->p_treeflag & P_TREE_ORPHANED) =3D=3D 0) { > - return (child->p_pptr->p_pid =3D=3D child->p_oppid ? > - child->p_pptr : initproc); > + if (child->p_oppid =3D=3D 0 || > + child->p_pptr->p_pid =3D=3D child->p_oppid) > + parent =3D child->p_pptr; > + else > + parent =3D initproc; > + return (parent); > } > for (p =3D child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) =3D=3D 0;) { > /* Cannot use LIST_PREV(), since the list head is not known. */ --ycwUkriSLVNn2GEA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUBsBNAAoJEJDCuSvBvK1BZsYQAKMG6eByajEpv3jfq4zesfOR n6IrBo6JWXfIGKgyh/Jfz83beKwWwGWj3QW767zCZeTGtUW/zSsgZD2ntTMchPVg phYuOmeKSFYg0qLwauISHuCloWDCDLXSQ3Ytlq5UQ93nHvsuBSrI1Y91Gl/ZiEAt Tz6e4Uz9Hs4aS0TffGMLSKDmDk2vIEPRCxIpVy9TxBHdZMyPxEt8txPzXp8pgOlR X0N9cHCESjYIcTeDJ/0ZOW2dH5NAFLtW4ppAEQll9+ptdcbwHExRh/KOTtkesqf7 1LM2EEYOVC48xDD5QP3omZ6IiMTUzX/wFBU8Ce7ju62R+XTIqqxLskRtIZxRA9hc JAFL/eRjJ3Rn/Dm01u7pmKCF8g+ajCe7jR/wdHm3LAFfcjWDAmrjuNiJWQI75HcX Ky0JLo/paw+9NgDOrNmpo5ZpS77VoS7ZKkPAro9zQSPE6HCzcNdduKiqI9r6NmjJ VTRvHUlMcUK9X7gcKQp+rmZAP+xb7OZep0AdIwERUNmzk5Om9vbu8AjLtfkpMGO4 X2VyGgpDLraVHghtLZ4Vj0c5c/wr159cVLB/sPn2fQUX0skAwP15pdyQx3lmmoX/ /oWQhmc4DWMaEEYvtEYxCty7oAkUNPP42RDgaOpNIVwA5XGI2b+Vv95M1ySvznLd lE/ZCMRbYQQl6FQeeGpO =aWPA -----END PGP SIGNATURE----- --ycwUkriSLVNn2GEA-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:09:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A0BEC25; Wed, 3 Sep 2014 08:09:25 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 37ADE1E70; Wed, 3 Sep 2014 08:09:24 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 0B42220E7088C; Wed, 3 Sep 2014 08:09:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id B043C20E7088A; Wed, 3 Sep 2014 08:09:21 +0000 (UTC) Message-ID: <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> From: "Steven Hartland" To: "Alan Cox" , "John Baldwin" , "Peter Wemm" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Wed, 3 Sep 2014 09:09:23 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:09:25 -0000 I'm looking to MFC this change so wanted to check if anyone had an final feedback / objections? I know we currently have Alan's feedback on changing the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC which sounds sensible but waiting Peter to comment on. Regards Steve From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:14:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C0BE100; Wed, 3 Sep 2014 08:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF5D1F26; Wed, 3 Sep 2014 08:14:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838E7C0084258; Wed, 3 Sep 2014 08:14:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838E7A2084257; Wed, 3 Sep 2014 08:14:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409030814.s838E7A2084257@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 3 Sep 2014 08:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270999 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:14:08 -0000 Author: glebius Date: Wed Sep 3 08:14:07 2014 New Revision: 270999 URL: http://svnweb.freebsd.org/changeset/base/270999 Log: Fix dereference after NULL check. CID: 1234607 Sponsored by: Nginx, Inc. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_xstat = p->p_xstat; kp->ki_acflag = p->p_acflag; kp->ki_lock = p->p_lock; - if (p->p_pptr) + if (p->p_pptr) { kp->ki_ppid = proc_realparent(p)->p_pid; - if (p->p_flag & P_TRACED) - kp->ki_tracer = p->p_pptr->p_pid; + if (p->p_flag & P_TRACED) + kp->ki_tracer = p->p_pptr->p_pid; + } } /* From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:18:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D702272; Wed, 3 Sep 2014 08:18:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F42F1F48; Wed, 3 Sep 2014 08:18:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838I8q5084844; Wed, 3 Sep 2014 08:18:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838I8uY084843; Wed, 3 Sep 2014 08:18:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409030818.s838I8uY084843@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Sep 2014 08:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271000 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:18:08 -0000 Author: kib Date: Wed Sep 3 08:18:07 2014 New Revision: 271000 URL: http://svnweb.freebsd.org/changeset/base/271000 Log: Right now, thread_single(SINGLE_EXIT) returns after the p_numthreads reaches 1. The p_numthreads counter is decremented in thread_exit() by a call to thread_unlink(). This means that the exiting threads may still execute on other CPUs when thread_single(SINGLE_EXIT) returns. As result, vmspace could be destroyed while paging structures are still used on other CPUs by exiting threads. Delay the return from thread_single(SINGLE_EXIT) until all threads are really destroyed by thread_stash() after the last switch out. The p_exitthreads counter already provides the required mechanism, move the wait from the thread_wait() (which is called from wait(2) code) into thread_single(). Reported by: many (as "panic: pmap active ") Reviewed by: alc, jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Sep 3 08:14:07 2014 (r270999) +++ head/sys/kern/kern_thread.c Wed Sep 3 08:18:07 2014 (r271000) @@ -432,6 +432,7 @@ thread_exit(void) */ if (p->p_flag & P_HADTHREADS) { if (p->p_numthreads > 1) { + atomic_add_int(&td->td_proc->p_exitthreads, 1); thread_unlink(td); td2 = FIRST_THREAD_IN_PROC(p); sched_exit_thread(td2, td); @@ -452,7 +453,6 @@ thread_exit(void) } } - atomic_add_int(&td->td_proc->p_exitthreads, 1); PCPU_SET(deadthread, td); } else { /* @@ -507,14 +507,12 @@ thread_wait(struct proc *p) struct thread *td; mtx_assert(&Giant, MA_NOTOWNED); - KASSERT((p->p_numthreads == 1), ("Multiple threads in wait1()")); + KASSERT((p->p_numthreads == 1), ("multiple threads in thread_wait()")); + KASSERT((p->p_exitthreads == 0), ("p_exitthreads leaking")); td = FIRST_THREAD_IN_PROC(p); /* Lock the last thread so we spin until it exits cpu_throw(). */ thread_lock(td); thread_unlock(td); - /* Wait for any remaining threads to exit cpu_throw(). */ - while (p->p_exitthreads) - sched_relinquish(curthread); lock_profile_thread_exit(td); cpuset_rel(td->td_cpuset); td->td_cpuset = NULL; @@ -722,6 +720,17 @@ stopme: p->p_singlethread = NULL; p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); thread_unthread(td); + + /* + * Wait for any remaining threads to exit cpu_throw(). + */ + while (p->p_exitthreads != 0) { + PROC_SUNLOCK(p); + PROC_UNLOCK(p); + sched_relinquish(td); + PROC_LOCK(p); + PROC_SLOCK(p); + } } PROC_SUNLOCK(p); return (0); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:28:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 740F4BEA; Wed, 3 Sep 2014 08:28:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F95F10C2; Wed, 3 Sep 2014 08:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838SHJj089840; Wed, 3 Sep 2014 08:28:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838SHnb089839; Wed, 3 Sep 2014 08:28:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409030828.s838SHnb089839@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 3 Sep 2014 08:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271005 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:28:17 -0000 Author: glebius Date: Wed Sep 3 08:28:16 2014 New Revision: 271005 URL: http://svnweb.freebsd.org/changeset/base/271005 Log: Use CSUM_BITS instead of incorrect copy. Sponsored by: Nginx, Inc. Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed Sep 3 08:27:05 2014 (r271004) +++ head/sys/dev/bce/if_bce.c Wed Sep 3 08:28:16 2014 (r271005) @@ -9837,11 +9837,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru BCE_PRINTF("- m_pkthdr: len = %d, flags = 0x%b, " "csum_flags = %b\n", mp->m_pkthdr.len, mp->m_flags, M_FLAG_PRINTF, - mp->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" - "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" - "\12CSUM_IP_VALID\13CSUM_DATA_VALID" - "\14CSUM_PSEUDO_HDR"); + mp->m_pkthdr.csum_flags, CSUM_BITS); } if (mp->m_flags & M_EXT) { From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:30:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84BA9D58; Wed, 3 Sep 2014 08:30:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7701106; Wed, 3 Sep 2014 08:30:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838UJcJ090248; Wed, 3 Sep 2014 08:30:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838UIxI090242; Wed, 3 Sep 2014 08:30:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409030830.s838UIxI090242@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 3 Sep 2014 08:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271006 - in head/sys: net netinet netpfil/pf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:30:19 -0000 Author: glebius Date: Wed Sep 3 08:30:18 2014 New Revision: 271006 URL: http://svnweb.freebsd.org/changeset/base/271006 Log: Clean up unused CSUM_FRAGMENT. Sponsored by: Nginx, Inc. Modified: head/sys/net/if_vlan.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_output.c head/sys/netpfil/pf/pf.c head/sys/sys/mbuf.h Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Sep 3 08:28:16 2014 (r271005) +++ head/sys/net/if_vlan.c Wed Sep 3 08:30:18 2014 (r271006) @@ -1501,7 +1501,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Wed Sep 3 08:28:16 2014 (r271005) +++ head/sys/netinet/ip_fastfwd.c Wed Sep 3 08:30:18 2014 (r271006) @@ -523,8 +523,7 @@ passout: else mtu = ifp->if_mtu; - if (ip_len <= mtu || - (ifp->if_hwassist & CSUM_FRAGMENT && (ip_off & IP_DF) == 0)) { + if (ip_len <= mtu) { /* * Avoid confusing lower layers. */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Sep 3 08:28:16 2014 (r271005) +++ head/sys/netinet/ip_output.c Wed Sep 3 08:30:18 2014 (r271006) @@ -624,8 +624,7 @@ passout: * care of the fragmentation for us, we can just send directly. */ if (ip_len <= mtu || - (m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 || - ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) { + (m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0) { ip->ip_sum = 0; if (m->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) { ip->ip_sum = in_cksum(m, hlen); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Sep 3 08:28:16 2014 (r271005) +++ head/sys/netpfil/pf/pf.c Wed Sep 3 08:30:18 2014 (r271006) @@ -5332,8 +5332,7 @@ pf_route(struct mbuf **m, struct pf_rule * care of the fragmentation for us, we can just send directly. */ if (ip_len <= ifp->if_mtu || - (m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 || - ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) { + (m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0) { ip->ip_sum = 0; if (m0->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) { ip->ip_sum = in_cksum(m0, ip->ip_hl << 2); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Sep 3 08:28:16 2014 (r271005) +++ head/sys/sys/mbuf.h Wed Sep 3 08:30:18 2014 (r271006) @@ -445,7 +445,6 @@ void sf_ext_free(void *, void *); #define CSUM_UDP_IPV6 CSUM_IP6_UDP #define CSUM_TCP_IPV6 CSUM_IP6_TCP #define CSUM_SCTP_IPV6 CSUM_IP6_SCTP -#define CSUM_FRAGMENT 0x0 /* Unused */ /* * mbuf types describing the content of the mbuf (including external storage). From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:35:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 094FFFC6; Wed, 3 Sep 2014 08:35:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF30E1218; Wed, 3 Sep 2014 08:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838Zg6i094415; Wed, 3 Sep 2014 08:35:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838ZgcH094413; Wed, 3 Sep 2014 08:35:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409030835.s838ZgcH094413@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Sep 2014 08:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271007 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:35:43 -0000 Author: kib Date: Wed Sep 3 08:35:42 2014 New Revision: 271007 URL: http://svnweb.freebsd.org/changeset/base/271007 Log: Retire thread_unthread(), it has only one caller. Update comment in the block of code before the previous call to thread_unthread(). Discussed with: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Sep 3 08:30:18 2014 (r271006) +++ head/sys/kern/kern_thread.c Wed Sep 3 08:35:42 2014 (r271007) @@ -549,18 +549,6 @@ thread_link(struct thread *td, struct pr } /* - * Convert a process with one thread to an unthreaded process. - */ -void -thread_unthread(struct thread *td) -{ - struct proc *p = td->td_proc; - - KASSERT((p->p_numthreads == 1), ("Unthreading with >1 threads")); - p->p_flag &= ~P_HADTHREADS; -} - -/* * Called from: * thread_exit() */ @@ -712,14 +700,13 @@ stopme: } if (mode == SINGLE_EXIT) { /* - * We have gotten rid of all the other threads and we - * are about to either exit or exec. In either case, - * we try our utmost to revert to being a non-threaded - * process. + * Convert the process to an unthreaded process. The + * SINGLE_EXIT is called by exit1() or execve(), in + * both cases other threads must be retired. */ + KASSERT(p->p_numthreads == 1, ("Unthreading with >1 threads")); p->p_singlethread = NULL; - p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); - thread_unthread(td); + p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_HADTHREADS); /* * Wait for any remaining threads to exit cpu_throw(). Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Sep 3 08:30:18 2014 (r271006) +++ head/sys/sys/proc.h Wed Sep 3 08:35:42 2014 (r271007) @@ -956,7 +956,6 @@ void thread_suspend_one(struct thread *t void thread_unlink(struct thread *td); void thread_unsuspend(struct proc *p); int thread_unsuspend_one(struct thread *td); -void thread_unthread(struct thread *td); void thread_wait(struct proc *p); struct thread *thread_find(struct proc *p, lwpid_t tid); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:40:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB4351E5; Wed, 3 Sep 2014 08:40:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96F021251; Wed, 3 Sep 2014 08:40:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s838eGmR095079; Wed, 3 Sep 2014 08:40:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s838eGgD095078; Wed, 3 Sep 2014 08:40:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409030840.s838eGgD095078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Sep 2014 08:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271008 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:40:16 -0000 Author: kib Date: Wed Sep 3 08:40:16 2014 New Revision: 271008 URL: http://svnweb.freebsd.org/changeset/base/271008 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Sep 3 08:35:42 2014 (r271007) +++ head/sys/kern/kern_thread.c Wed Sep 3 08:40:16 2014 (r271008) @@ -507,8 +507,8 @@ thread_wait(struct proc *p) struct thread *td; mtx_assert(&Giant, MA_NOTOWNED); - KASSERT((p->p_numthreads == 1), ("multiple threads in thread_wait()")); - KASSERT((p->p_exitthreads == 0), ("p_exitthreads leaking")); + KASSERT(p->p_numthreads == 1, ("multiple threads in thread_wait()")); + KASSERT(p->p_exitthreads == 0, ("p_exitthreads leaking")); td = FIRST_THREAD_IN_PROC(p); /* Lock the last thread so we spin until it exits cpu_throw(). */ thread_lock(td); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:47:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6E3C6F6; Wed, 3 Sep 2014 08:47:13 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 866DE13D4; Wed, 3 Sep 2014 08:47:13 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s838l7UN035262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Sep 2014 11:47:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s838l7UN035262 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s838l7sT035261; Wed, 3 Sep 2014 11:47:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 3 Sep 2014 11:47:07 +0300 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140903084707.GH2737@kib.kiev.ua> References: <201409030814.s838E7A2084257@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wfk8K8yAAOQoLncY" Content-Disposition: inline In-Reply-To: <201409030814.s838E7A2084257@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:47:14 -0000 --wfk8K8yAAOQoLncY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 03, 2014 at 08:14:07AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Sep 3 08:14:07 2014 > New Revision: 270999 > URL: http://svnweb.freebsd.org/changeset/base/270999 >=20 > Log: > Fix dereference after NULL check. > =20 > CID: 1234607 > Sponsored by: Nginx, Inc. >=20 > Modified: > head/sys/kern/kern_proc.c >=20 > Modified: head/sys/kern/kern_proc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) > +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) > @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str > kp->ki_xstat =3D p->p_xstat; > kp->ki_acflag =3D p->p_acflag; > kp->ki_lock =3D p->p_lock; > - if (p->p_pptr) > + if (p->p_pptr) { > kp->ki_ppid =3D proc_realparent(p)->p_pid; > - if (p->p_flag & P_TRACED) > - kp->ki_tracer =3D p->p_pptr->p_pid; > + if (p->p_flag & P_TRACED) > + kp->ki_tracer =3D p->p_pptr->p_pid; > + } > } If P_TRACED is set, p_pptr must be non-NULL. Or in reverse, only kernel process (pid 0) may have p_pptr as NULL, and it cannot be traced. Previous code contained assertion (triggered by paging hardware) that p_pptr is not NULL if P_TRACED is set. It is Coverity which cannot deduce the invariant. I do not expect any analyzer to be able to make the implication, though. --wfk8K8yAAOQoLncY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUBtWLAAoJEJDCuSvBvK1BEpQP/RYW3XUszfAXBpDM7cojLBUR EAqN90D5uDWvBmDzjqQof804RfgV9hCNshBol9mzIlUQxxRvQo+006LTQ73Mc0aK XTOeALw49fh4AV3BdG54cnUeVpDgpzz2iojU5C+bPf2kzYDaLJDgNd10FyIsyRGR 5d2soMOA+rAW5m9SVPNnwVsZdRX8/dXsX9gESIqF2bT71Kfl7aURxFdE6qDCYtr8 oHaT4Qf3HlzzIj+eaSPRgqs6Te11NsD8h3VluSQyX3SDcRGPfIc3oYJg+MDsfTZq pRxDAqym1n0aD5UUu32sk93XUEt9hl1BVa4YstcCq5+8PBuCmd3Pker5sSiEOQwd 4s6knIjCM8QOukXUX00sn+iCIFYlFSFTOlbXhXc112gYbDO1nLOBPoI3Y4US4yuC UJlSOd9eQvPYvZtzx6/NIXNnWUUFc9qeU2TLXkjmSerd5lNTWt57Ix56EcZH8kPW j/1avXWU+vIaysxKnhZRwWpztJ6g1k25qQufBJmQHmqF0CR84YsUQ7Piz3ImP5j6 9wkXX0PY89bohmVsqzNftOBF4HpxZrKpQVK5gd/l7ujZ2bhTWLzEqOo+vwLgmM7H wQwaR0A8NE3Je528Mmme1TpzN6ZPgQ1d9Ge0K7MW8q8rj5BOvmvEDMCv5caI4yKn aV5rPuq4zKLVDbSlhmwG =HzmX -----END PGP SIGNATURE----- --wfk8K8yAAOQoLncY-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 08:55:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EACCB8E2; Wed, 3 Sep 2014 08:55:34 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12094150D; Wed, 3 Sep 2014 08:55:33 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id z2so9333386wiv.15 for ; Wed, 03 Sep 2014 01:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=bsv/k5TUKUCqGAc5QdjUbDjEYPL2gVZUwiMZ2QFqHUk=; b=0eeLzetZguaiVyyyAFzBrpfxw/ilCLXfTPK5m+Sb6vbnFMVYIQcXNqgKJwPKoMKPwg 9W8mKqJd7+z2CFTg/uPPniRErVl4Alqh7e2nI9tVhZ4KszTEE/A+WNQ2NucRiO3ohuYc o3vDfsBqL6x8XqSjsvS/FoD10+HsvSCT6SUy9uIK0LmM0SnRFggApTTgoxaBQFsWtvuv Q0nTxSiUKtrW+0GeafPELDItojK4MSa9nIj7hanVE8+SfC+AgAFxQcpKbzmseCICLbaj oqsazc5wjFeo3Gp75O156zwwatcgBEY2B13QiUHrHfWqyCpyrQiPyoEH9y9ZHw5mRzYj LdQw== X-Received: by 10.194.81.37 with SMTP id w5mr46169485wjx.12.1409734532323; Wed, 03 Sep 2014 01:55:32 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id xm4sm3323353wib.9.2014.09.03.01.55.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Sep 2014 01:55:31 -0700 (PDT) Date: Wed, 3 Sep 2014 10:55:23 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140903085523.GB13871@dft-labs.eu> References: <201409030814.s838E7A2084257@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409030814.s838E7A2084257@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 08:55:35 -0000 On Wed, Sep 03, 2014 at 08:14:07AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Sep 3 08:14:07 2014 > New Revision: 270999 > URL: http://svnweb.freebsd.org/changeset/base/270999 > > Log: > Fix dereference after NULL check. > > CID: 1234607 > Sponsored by: Nginx, Inc. > > Modified: > head/sys/kern/kern_proc.c > > Modified: head/sys/kern/kern_proc.c > ============================================================================== > --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) > +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) > @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str > kp->ki_xstat = p->p_xstat; > kp->ki_acflag = p->p_acflag; > kp->ki_lock = p->p_lock; > - if (p->p_pptr) > + if (p->p_pptr) { > kp->ki_ppid = proc_realparent(p)->p_pid; > - if (p->p_flag & P_TRACED) > - kp->ki_tracer = p->p_pptr->p_pid; > + if (p->p_flag & P_TRACED) > + kp->ki_tracer = p->p_pptr->p_pid; > + } > } > > /* > p_pptr must be non-NULL if P_TRACED is set. If there is no way to annotate it for coverity, this change deserves a comment in the code (and in retrospect previous code should have had appropriate comment as well). -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 09:04:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F331D54; Wed, 3 Sep 2014 09:04:50 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5299E175F; Wed, 3 Sep 2014 09:04:48 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA10288; Wed, 03 Sep 2014 12:04:44 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XP6Ue-000GLY-Ae; Wed, 03 Sep 2014 12:04:44 +0300 Message-ID: <5406D972.8010305@FreeBSD.org> Date: Wed, 03 Sep 2014 12:03:46 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405F1F3.1@FreeBSD.org> <8AA1D02BB967468DA07731149E95390D@multiplay.co.uk> In-Reply-To: <8AA1D02BB967468DA07731149E95390D@multiplay.co.uk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, John Baldwin , Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:04:50 -0000 on 02/09/2014 20:43 Steven Hartland said the following: > ----- Original Message ----- From: "Andriy Gapon" >> And the newly added kmem_foo() functions probably do not belong in >> cddl/compat/opensolaris as Solaris / illumos does not have those functions. > > They could be moved but their current location keeps all the kmem > related functions neatly in one place. Spreading them around IMO > would just make things hard to find. BTW, here is some of my old WIP that completely removed the pre-existing kmem_* functions and made the related code much closer to that in illumos. Unfortunately, I will now have hard time merging my changes with your change. https://github.com/avg-I/freebsd/compare/wip/hc/kmem_size-memguard-fix (esp.commits e0cf2f7 and becf087) >> I think that in this case e.g. vm_cnt.v_free_target can just be >> used directly by the FreeBSD-specific ARC code. > > It could but as above keeping everything in one place makes it to > find and hence MFC as this area has seen changes which will require > all those fields renamed. It also means if the logic for free pages > changes in the future there's only one place it needs to be changed. > > For those interested there's also an open review on additional > changes in this area: https://reviews.freebsd.org/D702 -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 09:12:43 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B10F2A1; Wed, 3 Sep 2014 09:12:43 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id B1DE71861; Wed, 3 Sep 2014 09:12:42 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 6B51C20E7088D; Wed, 3 Sep 2014 09:12:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: * X-Spam-Status: No, score=1.0 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id C504F20E70886; Wed, 3 Sep 2014 09:12:37 +0000 (UTC) Message-ID: <7DF8E1BCE4E648888B9AA8BABB1A5991@multiplay.co.uk> From: "Steven Hartland" To: "Andriy Gapon" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405F1F3.1@FreeBSD.org> <8AA1D02BB967468DA07731149E95390D@multiplay.co.uk> <5406D972.8010305@FreeBSD.org> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Wed, 3 Sep 2014 10:12:39 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: src-committers@FreeBSD.org, John Baldwin , Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:12:43 -0000 ----- Original Message ----- From: "Andriy Gapon" > on 02/09/2014 20:43 Steven Hartland said the following: >> ----- Original Message ----- From: "Andriy Gapon" >>> And the newly added kmem_foo() functions probably do not belong in >>> cddl/compat/opensolaris as Solaris / illumos does not have those functions. >> >> They could be moved but their current location keeps all the kmem >> related functions neatly in one place. Spreading them around IMO >> would just make things hard to find. > > BTW, here is some of my old WIP that completely removed the pre-existing kmem_* > functions and made the related code much closer to that in illumos. > Unfortunately, I will now have hard time merging my changes with your change. > > https://github.com/avg-I/freebsd/compare/wip/hc/kmem_size-memguard-fix > (esp.commits e0cf2f7 and becf087) Looking good, I'm all for eliminating the differences between the two code bases as that will make things easier to maintain in the future, so something we should definitely try to get in for 11. Regards Steve From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 09:35:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC18A884; Wed, 3 Sep 2014 09:35:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBF6D1A88; Wed, 3 Sep 2014 09:35:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s839ZcNV023060; Wed, 3 Sep 2014 09:35:38 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s839Zccf023058; Wed, 3 Sep 2014 09:35:38 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409030935.s839Zccf023058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 3 Sep 2014 09:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271012 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:35:39 -0000 Author: ed Date: Wed Sep 3 09:35:38 2014 New Revision: 271012 URL: http://svnweb.freebsd.org/changeset/base/271012 Log: Leave the C11 keywords alone when we have a recent version of GCC. As GCC also gained support for the C11 keywords over time, we can patch up to not define these anymore. This has the advantage that error messages for static assertions are printed natively and that _Alignas() will work with even a type outside of C11 mode. All C11 keywords are supported with GCC 4.7 and higher, with the exception of _Thread_local and _Generic. These are only supported as of GCC 4.9. Modified: head/include/tgmath.h head/sys/sys/cdefs.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Wed Sep 3 09:05:37 2014 (r271011) +++ head/include/tgmath.h Wed Sep 3 09:35:38 2014 (r271012) @@ -61,7 +61,7 @@ */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ - __has_extension(c_generic_selections) + __has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) #define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ _Generic(x, \ long double _Complex: cfnl, \ Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Wed Sep 3 09:05:37 2014 (r271011) +++ head/sys/sys/cdefs.h Wed Sep 3 09:35:38 2014 (r271012) @@ -254,7 +254,7 @@ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L -#if !__has_extension(c_alignas) +#if !__has_extension(c_alignas) && !__GNUC_PREREQ__(4, 7) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_alignas) #define _Alignas(x) alignas(x) @@ -264,11 +264,13 @@ #endif #endif +#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) && __cplusplus >= 201103L #define _Alignof(x) alignof(x) #else #define _Alignof(x) __alignof(x) #endif +#endif #if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) /* @@ -278,13 +280,15 @@ #define _Atomic(T) struct { T volatile __val; } #endif +#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) && __cplusplus >= 201103L #define _Noreturn [[noreturn]] #else #define _Noreturn __dead2 #endif +#endif -#if !__has_extension(c_static_assert) +#if !__has_extension(c_static_assert) && !__GNUC_PREREQ__(4, 7) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) @@ -297,7 +301,7 @@ #endif #endif -#if !__has_extension(c_thread_local) +#if !__has_extension(c_thread_local) && !__GNUC_PREREQ__(4, 9) /* * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode * without actually supporting the thread_local keyword. Don't check for @@ -322,7 +326,8 @@ * distinguish multiple cases. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + __has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) #define __generic(expr, t, yes, no) \ _Generic(expr, t: yes, default: no) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 09:49:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EF06F23; Wed, 3 Sep 2014 09:49:27 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2E61BC5; Wed, 3 Sep 2014 09:49:25 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s839nHxU003325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Sep 2014 13:49:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s839nGkV003324; Wed, 3 Sep 2014 13:49:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 3 Sep 2014 13:49:16 +0400 From: Gleb Smirnoff To: Mateusz Guzik , kib@FreeBSD.org Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140903094916.GO7693@FreeBSD.org> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140903085523.GB13871@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:49:27 -0000 Mateusz, Kostik, On Wed, Sep 03, 2014 at 10:55:23AM +0200, Mateusz Guzik wrote: M> > Modified: head/sys/kern/kern_proc.c M> > ============================================================================== M> > --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) M> > +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) M> > @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str M> > kp->ki_xstat = p->p_xstat; M> > kp->ki_acflag = p->p_acflag; M> > kp->ki_lock = p->p_lock; M> > - if (p->p_pptr) M> > + if (p->p_pptr) { M> > kp->ki_ppid = proc_realparent(p)->p_pid; M> > - if (p->p_flag & P_TRACED) M> > - kp->ki_tracer = p->p_pptr->p_pid; M> > + if (p->p_flag & P_TRACED) M> > + kp->ki_tracer = p->p_pptr->p_pid; M> > + } M> > } M> > M> > /* M> > M> M> p_pptr must be non-NULL if P_TRACED is set. If there is no way to M> annotate it for coverity, this change deserves a comment in the code M> (and in retrospect previous code should have had appropriate comment as M> well). Thanks for explanation. I'd suggest to leave the change in, since now it is a micro-micro-optimization :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 09:58:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE4D52E9; Wed, 3 Sep 2014 09:58:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9EB31CD3; Wed, 3 Sep 2014 09:58:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s839wxpU032980; Wed, 3 Sep 2014 09:58:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s839wxNG032979; Wed, 3 Sep 2014 09:58:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409030958.s839wxNG032979@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 3 Sep 2014 09:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271013 - head/sys/dev/drm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 09:58:59 -0000 Author: glebius Date: Wed Sep 3 09:58:59 2014 New Revision: 271013 URL: http://svnweb.freebsd.org/changeset/base/271013 Log: Remove always false comparison. Sponsored by: Nginx, Inc. Modified: head/sys/dev/drm/drm_sysctl.c Modified: head/sys/dev/drm/drm_sysctl.c ============================================================================== --- head/sys/dev/drm/drm_sysctl.c Wed Sep 3 09:35:38 2014 (r271012) +++ head/sys/dev/drm/drm_sysctl.c Wed Sep 3 09:58:59 2014 (r271013) @@ -193,7 +193,7 @@ static int drm_vm_info DRM_SYSCTL_HANDLE for (i = 0; i < mapcount; i++) { map = &tempmaps[i]; - if (map->type < 0 || map->type > 4) + if (map->type > 4) type = "??"; else type = types[map->type]; From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 11:07:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5847045B; Wed, 3 Sep 2014 11:07:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433CB153E; Wed, 3 Sep 2014 11:07:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83B7oow065406; Wed, 3 Sep 2014 11:07:50 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83B7of1065405; Wed, 3 Sep 2014 11:07:50 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409031107.s83B7of1065405@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 3 Sep 2014 11:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271014 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 11:07:50 -0000 Author: melifaro Date: Wed Sep 3 11:07:49 2014 New Revision: 271014 URL: http://svnweb.freebsd.org/changeset/base/271014 Log: * Unconditionally turn on SIOCGI2C probing for all interfaces on "ifconfig -v". I've seen no measurable timing difference for doing additional SIOCGI2C call for system with 4k vlans. * Determine appropriate handler (SFP/QSFP) by reading identification byte (which is the same for both SFF-8472 and SFF-8436) instead of checking driver name. MFC with: r270064 Sponsored by: Yandex LLC Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Wed Sep 3 09:58:59 2014 (r271013) +++ head/sbin/ifconfig/sfp.c Wed Sep 3 11:07:49 2014 (r271014) @@ -753,25 +753,31 @@ void sfp_status(int s, struct ifreq *ifr, int verbose) { struct i2c_info ii; + uint8_t id_byte; memset(&ii, 0, sizeof(ii)); /* Prepare necessary into to pass to NIC handler */ ii.s = s; ii.ifr = ifr; + ii.f = read_i2c_generic; /* - * Check if we have i2c support for particular driver. - * TODO: Determine driver by original name. + * Try to read byte 0 from i2c: + * Both SFF-8472 and SFF-8436 use it as + * 'identification byte' */ - if (strncmp(ifr->ifr_name, "ix", 2) == 0) { - ii.f = read_i2c_generic; - print_sfp_status(&ii, verbose); - } else if (strncmp(ifr->ifr_name, "cxl", 3) == 0) { - ii.port_id = atoi(&ifr->ifr_name[3]); - ii.f = read_i2c_generic; - ii.cfd = -1; - print_qsfp_status(&ii, verbose); - } else + id_byte = 0; + ii.f(&ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&id_byte); + if (ii.error != 0) return; + + switch (id_byte) { + case SFF_8024_ID_QSFP: + case SFF_8024_ID_QSFPPLUS: + print_qsfp_status(&ii, verbose); + break; + default: + print_sfp_status(&ii, verbose); + }; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 11:46:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B49F8F82; Wed, 3 Sep 2014 11:46:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBD61AFB; Wed, 3 Sep 2014 11:46:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83Bkim6084091; Wed, 3 Sep 2014 11:46:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83BkiYn084089; Wed, 3 Sep 2014 11:46:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409031146.s83BkiYn084089@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Sep 2014 11:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271017 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 11:46:44 -0000 Author: hselasky Date: Wed Sep 3 11:46:43 2014 New Revision: 271017 URL: http://svnweb.freebsd.org/changeset/base/271017 Log: Add new quirk. PR: 193279 MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:17:27 2014 (r271016) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:46:43 2014 (r271017) @@ -130,6 +130,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* Quirk for Corsair Vengeance K60 keyboard */ USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair Vengeance K60 keyboard */ + USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Sep 3 11:17:27 2014 (r271016) +++ head/sys/dev/usb/usbdevs Wed Sep 3 11:46:43 2014 (r271017) @@ -1486,6 +1486,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEt /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard +product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 12:07:01 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AB77771; Wed, 3 Sep 2014 12:07:01 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 297951D32; Wed, 3 Sep 2014 12:06:59 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA12757; Wed, 03 Sep 2014 15:06:50 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XP9Ks-000GW7-AO; Wed, 03 Sep 2014 15:06:50 +0300 Message-ID: <54070421.9030200@FreeBSD.org> Date: Wed, 03 Sep 2014 15:05:53 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland , Alan Cox , John Baldwin , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> In-Reply-To: <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 12:07:01 -0000 on 03/09/2014 11:09 Steven Hartland said the following: > I'm looking to MFC this change so wanted to check if > anyone had an final feedback / objections? I think that your changes went in a bit prematurely (little review), so perhaps MFC would be premature as well. > I know we currently have Alan's feedback on changing > the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC > which sounds sensible but waiting Peter to comment on. > > Regards > Steve > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 12:17:44 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A2ACB32; Wed, 3 Sep 2014 12:17:44 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 363281E2D; Wed, 3 Sep 2014 12:17:44 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 1D26220E7088F; Wed, 3 Sep 2014 12:17:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: * X-Spam-Status: No, score=1.0 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id BB3DD20E70886; Wed, 3 Sep 2014 12:17:40 +0000 (UTC) Message-ID: <7FA917F9BB6F45FA84D8408C13359748@multiplay.co.uk> From: "Steven Hartland" To: "Andriy Gapon" , "Alan Cox" , "John Baldwin" , "Peter Wemm" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54070421.9030200@FreeBSD.org> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Wed, 3 Sep 2014 13:17:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 12:17:44 -0000 ----- Original Message ----- From: "Andriy Gapon" > on 03/09/2014 11:09 Steven Hartland said the following: >> I'm looking to MFC this change so wanted to check if >> anyone had an final feedback / objections? > > I think that your changes went in a bit prematurely (little review), so perhaps > MFC would be premature as well. Its a change which really needs to make it into 10.1 IMO due to its impact on users so I don't really want to hold off too long. If anyone has any substantiated reason to then off course I'll hold off. Regards Steve From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 12:20:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1A4CCC6; Wed, 3 Sep 2014 12:20:28 +0000 (UTC) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEB4B1E62; Wed, 3 Sep 2014 12:20:27 +0000 (UTC) Received: by mail-we0-f179.google.com with SMTP id t60so8426730wes.38 for ; Wed, 03 Sep 2014 05:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wpe7n3WYQFet+yr8O8wfVEuIUHJQBo8aLkDVZWZBwoE=; b=ID9NZNm5ok0sGiHT+qNHaXNzYj5+gSEyK/0ixARYy9z1v73QP6B5xE7hrdoiojcrEm AOT7NP99YJGbUj+VPxxoPQUlO58tUE+PY2dWKWKgSUYBC1hHDsdSC8UqQKbbNo3VR/Wn L/cVdB/E1w4kcGGcAKIT8L90pdWJuZfmwUm+OxsN0NsWNtxPYbfllkvFywIJy1xfTzo3 Q8vx0lnQGkQr0IbdyvLjBNJzh2q0xkrKq4AMkKobEI7FXCpDdAzLpBG95uXeOegKt0tO jQZ7Mq8dYCbtjImBopwaWRwJknaDpODD4+miQ8B1ojXPm4Hh7/2+hiGTQGE/3sF5d5C5 GBLw== X-Received: by 10.180.207.6 with SMTP id ls6mr25009371wic.48.1409746824637; Wed, 03 Sep 2014 05:20:24 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id mx19sm4480878wic.3.2014.09.03.05.20.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Sep 2014 05:20:23 -0700 (PDT) Date: Wed, 3 Sep 2014 14:20:18 +0200 From: Mateusz Guzik To: Konstantin Belousov Subject: Re: svn commit: r270993 - head/sys/kern Message-ID: <20140903122018.GC13871@dft-labs.eu> References: <201409030625.s836PZHY032159@svn.freebsd.org> <20140903071629.GG2737@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140903071629.GG2737@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 12:20:28 -0000 On Wed, Sep 03, 2014 at 10:16:29AM +0300, Konstantin Belousov wrote: > On Wed, Sep 03, 2014 at 06:25:35AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Wed Sep 3 06:25:34 2014 > > New Revision: 270993 > > URL: http://svnweb.freebsd.org/changeset/base/270993 > > > > Log: > > Fix up proc_realparent to always return correct process. > > > > Prior to the change it would always return initproc for non-traced processes. > > > > This fixes ps apparently always returning 1 as ppid. > > > > Pointy hat: mjg > No, this is my bug. Thank you for fixing it. It is a consequence of > the last minute 'safety' change I did. > I used it without veryfing it returns correct results. I'm happy to share the blame. :> > > Reported by: many > > MFC after: 1 week > I suggest to merge in 3 days. > Ok. > > > > Modified: > > head/sys/kern/kern_exit.c > > > > Modified: head/sys/kern/kern_exit.c > > ============================================================================== > > --- head/sys/kern/kern_exit.c Wed Sep 3 05:14:50 2014 (r270992) > > +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014 (r270993) > > @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) > > > > sx_assert(&proctree_lock, SX_LOCKED); > > if ((child->p_treeflag & P_TREE_ORPHANED) == 0) { > > - return (child->p_pptr->p_pid == child->p_oppid ? > > - child->p_pptr : initproc); > > + if (child->p_oppid == 0 || > > + child->p_pptr->p_pid == child->p_oppid) > > + parent = child->p_pptr; > > + else > > + parent = initproc; > > + return (parent); > > } > > for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { > > /* Cannot use LIST_PREV(), since the list head is not known. */ -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 13:15:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFCC5CD4; Wed, 3 Sep 2014 13:15:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB29F15CD; Wed, 3 Sep 2014 13:15:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83DFG9i026268; Wed, 3 Sep 2014 13:15:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83DFG02026267; Wed, 3 Sep 2014 13:15:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409031315.s83DFG02026267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Sep 2014 13:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271018 - head/sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 13:15:16 -0000 Author: hselasky Date: Wed Sep 3 13:15:16 2014 New Revision: 271018 URL: http://svnweb.freebsd.org/changeset/base/271018 Log: Fix spelling. PR: 193279 MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 11:46:43 2014 (r271017) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Sep 3 13:15:16 2014 (r271018) @@ -130,7 +130,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* Quirk for Corsair Vengeance K60 keyboard */ USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), - /* Quirk for Corsair Vengeance K60 keyboard */ + /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 14:16:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E035AD4; Wed, 3 Sep 2014 14:16:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396AF1EE4; Wed, 3 Sep 2014 14:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83EGpd9057176; Wed, 3 Sep 2014 14:16:51 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83EGp1h057175; Wed, 3 Sep 2014 14:16:51 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409031416.s83EGp1h057175@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Sep 2014 14:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271025 - head/contrib/llvm/lib/Target/ARM X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 14:16:51 -0000 Author: sbruno Date: Wed Sep 3 14:16:50 2014 New Revision: 271025 URL: http://svnweb.freebsd.org/changeset/base/271025 Log: MFV: Only emit movw on ARMv6T2 Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS in base doesn't understand this instruction for this target. One would need to use --integrated-as to get this to build if desired. http://llvm.org/viewvc/llvm-project?view=revision&revision=216989 Submitted by: ian Reviewed by: dim Obtained from: llvm.org MFC after: 2 days Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 14:06:12 2014 (r271024) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 14:16:50 2014 (r271025) @@ -3248,7 +3248,8 @@ def : ARMPat<(ARMaddc GPR:$src, imm0_655 def : ARMPat<(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm)>; def : ARMPat<(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>; + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>, + Requires<[IsARM, HasV6T2]>; // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 14:44:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61DB6C11; Wed, 3 Sep 2014 14:44:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDCB1332; Wed, 3 Sep 2014 14:44:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83EiODc070848; Wed, 3 Sep 2014 14:44:24 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83EiOvS070847; Wed, 3 Sep 2014 14:44:24 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409031444.s83EiOvS070847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 3 Sep 2014 14:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271026 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 14:44:24 -0000 Author: pjd Date: Wed Sep 3 14:44:23 2014 New Revision: 271026 URL: http://svnweb.freebsd.org/changeset/base/271026 Log: Fix descriptors leak in case of nvlist_xunpack() failure. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Wed Sep 3 14:16:50 2014 (r271025) +++ head/lib/libnv/nvlist.c Wed Sep 3 14:44:23 2014 (r271026) @@ -760,8 +760,11 @@ nvlist_recv(int sock) } nvl = nvlist_xunpack(buf, size, fds, nfds); - if (nvl == NULL) + if (nvl == NULL) { + for (i = 0; i < nfds; i++) + close(fds[i]); goto out; + } ret = nvl; out: From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 14:59:27 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6C119E2; Wed, 3 Sep 2014 14:59:27 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 244201515; Wed, 3 Sep 2014 14:59:25 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA14644; Wed, 03 Sep 2014 17:59:22 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XPC1p-000GqR-QP; Wed, 03 Sep 2014 17:59:22 +0300 Message-ID: <54072C8E.7030501@FreeBSD.org> Date: Wed, 03 Sep 2014 17:58:22 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54070421.9030200@FreeBSD.org> <7FA917F9BB6F45FA84D8408C13359748@multiplay.co.uk> In-Reply-To: <7FA917F9BB6F45FA84D8408C13359748@multiplay.co.uk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, John Baldwin , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 14:59:27 -0000 on 03/09/2014 15:17 Steven Hartland said the following: > ----- Original Message ----- From: "Andriy Gapon" > >> on 03/09/2014 11:09 Steven Hartland said the following: >>> I'm looking to MFC this change so wanted to check if >>> anyone had an final feedback / objections? >> >> I think that your changes went in a bit prematurely (little review), so perhaps >> MFC would be premature as well. > > Its a change which really needs to make it into 10.1 IMO I think that this is the arguable point. As I've mentioned before I have not noticed, perhaps through the fault of my own, any reports that users need this change after Alan's pagedaemon fix(es). Also, there is no confirmation yet that after this change ARC does not give up its buffers too easily. > due to its impact on users so I don't really want to hold > off too long. > > If anyone has any substantiated reason to then off course > I'll hold off. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EF76E37 for ; Wed, 3 Sep 2014 15:06:11 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60919176B for ; Wed, 3 Sep 2014 15:06:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s83F6BZe062790 for ; Wed, 3 Sep 2014 15:06:11 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s83F6BcS062783 for svn-src-head@freebsd.org; Wed, 3 Sep 2014 15:06:11 GMT (envelope-from bdrewery) Received: (qmail 36553 invoked from network); 3 Sep 2014 10:06:09 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 3 Sep 2014 10:06:09 -0500 Message-ID: <54072E34.3080403@FreeBSD.org> Date: Wed, 03 Sep 2014 10:05:24 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271000 - head/sys/kern References: <201409030818.s838I8uY084843@svn.freebsd.org> In-Reply-To: <201409030818.s838I8uY084843@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mv7p62cdxbHga8v6jLn38kEFvItCLoG9o" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:06:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mv7p62cdxbHga8v6jLn38kEFvItCLoG9o Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9/3/2014 3:18 AM, Konstantin Belousov wrote: > Author: kib > Date: Wed Sep 3 08:18:07 2014 > New Revision: 271000 > URL: http://svnweb.freebsd.org/changeset/base/271000 >=20 > Log: > Right now, thread_single(SINGLE_EXIT) returns after the p_numthreads > reaches 1. The p_numthreads counter is decremented in thread_exit() b= y > a call to thread_unlink(). This means that the exiting threads may > still execute on other CPUs when thread_single(SINGLE_EXIT) returns. > As result, vmspace could be destroyed while paging structures are > still used on other CPUs by exiting threads. > =20 > Delay the return from thread_single(SINGLE_EXIT) until all threads ar= e > really destroyed by thread_stash() after the last switch out. The > p_exitthreads counter already provides the required mechanism, move > the wait from the thread_wait() (which is called from wait(2) code) > into thread_single(). > =20 > Reported by: many (as "panic: pmap active ") > Reviewed by: alc, jhb > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week >=20 > Modified: > head/sys/kern/kern_thread.c >=20 > Modified: head/sys/kern/kern_thread.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_thread.c Wed Sep 3 08:14:07 2014 (r270999) > +++ head/sys/kern/kern_thread.c Wed Sep 3 08:18:07 2014 (r271000) > @@ -432,6 +432,7 @@ thread_exit(void) > */ > if (p->p_flag & P_HADTHREADS) { > if (p->p_numthreads > 1) { > + atomic_add_int(&td->td_proc->p_exitthreads, 1); > thread_unlink(td); > td2 =3D FIRST_THREAD_IN_PROC(p); > sched_exit_thread(td2, td); > @@ -452,7 +453,6 @@ thread_exit(void) > } > } > =20 > - atomic_add_int(&td->td_proc->p_exitthreads, 1); > PCPU_SET(deadthread, td); > } else { > /* > @@ -507,14 +507,12 @@ thread_wait(struct proc *p) > struct thread *td; > =20 > mtx_assert(&Giant, MA_NOTOWNED); > - KASSERT((p->p_numthreads =3D=3D 1), ("Multiple threads in wait1()"));= > + KASSERT((p->p_numthreads =3D=3D 1), ("multiple threads in thread_wait= ()")); > + KASSERT((p->p_exitthreads =3D=3D 0), ("p_exitthreads leaking")); > td =3D FIRST_THREAD_IN_PROC(p); > /* Lock the last thread so we spin until it exits cpu_throw(). */ > thread_lock(td); > thread_unlock(td); > - /* Wait for any remaining threads to exit cpu_throw(). */ > - while (p->p_exitthreads) > - sched_relinquish(curthread); > lock_profile_thread_exit(td); > cpuset_rel(td->td_cpuset); > td->td_cpuset =3D NULL; > @@ -722,6 +720,17 @@ stopme: > p->p_singlethread =3D NULL; > p->p_flag &=3D ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); > thread_unthread(td); > + > + /* > + * Wait for any remaining threads to exit cpu_throw(). > + */ > + while (p->p_exitthreads !=3D 0) { > + PROC_SUNLOCK(p); > + PROC_UNLOCK(p); > + sched_relinquish(td); > + PROC_LOCK(p); > + PROC_SLOCK(p); > + } > } > PROC_SUNLOCK(p); > return (0); >=20 Thanks! --=20 Regards, Bryan Drewery --mv7p62cdxbHga8v6jLn38kEFvItCLoG9o Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUBy40AAoJEDXXcbtuRpfPgNIIAMcrjKmUsAr+qHsxaYGODJT+ wKHwdGwcNM3XuVXe8g8zG3/gyzYIvrWNuQyUKc0ZOewIhEgxUvHJz3WPB/IMV7zH cxH7R+W2sM/L+QUIbSEcpqe6YdogX8mzgzzmOxwKmN22HkE4RcaG5Dc7V3xmXs6v fnw1Ilbez0YCDXL1CpLSyc06cu11zTW5F/Fce798HdCyI0YQn1rxFbamfR5wdLLD gOeHFUgltZ7eMb6t7HEI101jrsh1qrsYpokPStA5pIdKhYK/rXKT+5LfTdrFl+Fz Ao5TX8NcmvgPwqrwBsLvV5ZMRPNOcgwkC3WurfhG3/uzm8F1Q655liXlU/Y6js0= =Eg8Q -----END PGP SIGNATURE----- --mv7p62cdxbHga8v6jLn38kEFvItCLoG9o-- From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:06:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C681AF7E; Wed, 3 Sep 2014 15:06:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2B13177A; Wed, 3 Sep 2014 15:06:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83F6lWZ081009; Wed, 3 Sep 2014 15:06:47 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83F6l8B081008; Wed, 3 Sep 2014 15:06:47 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409031506.s83F6l8B081008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 3 Sep 2014 15:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271027 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:06:47 -0000 Author: pjd Date: Wed Sep 3 15:06:47 2014 New Revision: 271027 URL: http://svnweb.freebsd.org/changeset/base/271027 Log: Declare i. Reported by: sbruno Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Wed Sep 3 14:44:23 2014 (r271026) +++ head/lib/libnv/nvlist.c Wed Sep 3 15:06:47 2014 (r271027) @@ -728,7 +728,7 @@ nvlist_recv(int sock) nvlist_t *nvl, *ret; unsigned char *buf; size_t nfds, size; - int serrno, *fds; + int serrno, i, *fds; if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:08:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E91BE290; Wed, 3 Sep 2014 15:08:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5200179A; Wed, 3 Sep 2014 15:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83F8X8i081283; Wed, 3 Sep 2014 15:08:33 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83F8Xhg081282; Wed, 3 Sep 2014 15:08:33 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409031508.s83F8Xhg081282@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 3 Sep 2014 15:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271028 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:08:34 -0000 Author: pjd Date: Wed Sep 3 15:08:33 2014 New Revision: 271028 URL: http://svnweb.freebsd.org/changeset/base/271028 Log: Use better type for i. Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Wed Sep 3 15:06:47 2014 (r271027) +++ head/lib/libnv/nvlist.c Wed Sep 3 15:08:33 2014 (r271028) @@ -727,8 +727,8 @@ nvlist_recv(int sock) struct nvlist_header nvlhdr; nvlist_t *nvl, *ret; unsigned char *buf; - size_t nfds, size; - int serrno, i, *fds; + size_t nfds, size, i; + int serrno, *fds; if (buf_recv(sock, &nvlhdr, sizeof(nvlhdr)) == -1) return (NULL); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:14:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52CBC616; Wed, 3 Sep 2014 15:14:30 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32057189A; Wed, 3 Sep 2014 15:14:30 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 568131B3061; Wed, 3 Sep 2014 11:05:07 -0400 (EDT) Received: from [127.0.0.1] (vnat004.nandomedia.com [166.108.31.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 9E1061B2E63; Wed, 3 Sep 2014 11:05:05 -0400 (EDT) Message-ID: <54072E20.10802@mail.lifanov.com> Date: Wed, 03 Sep 2014 11:05:04 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Steven Hartland , Alan Cox , John Baldwin , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> In-Reply-To: <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:14:30 -0000 On 09/03/14 04:09, Steven Hartland wrote: > I'm looking to MFC this change so wanted to check if > anyone had an final feedback / objections? > > I know we currently have Alan's feedback on changing > the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC > which sounds sensible but waiting Peter to comment on. > > Regards > Steve I have no technical input, but this change improves ARC usefulness for me quite a bit. I would like to see the improvement in 10-STABLE. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:17:32 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F4694F; Wed, 3 Sep 2014 15:17:32 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 347B618DE; Wed, 3 Sep 2014 15:17:30 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA14867; Wed, 03 Sep 2014 18:17:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XPCJM-000GtV-IX; Wed, 03 Sep 2014 18:17:28 +0300 Message-ID: <540730E5.1080206@FreeBSD.org> Date: Wed, 03 Sep 2014 18:16:53 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland , Peter Wemm Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <39211177.i8nn9sHiCx@overcee.wemm.org> <201409021201.15967.jhb@freebsd.org> <5405FD2C.8000901@rice.edu> <54060D1B.6020700@rice.edu> <774F8EEE96EB483DA8ACF533CF7C23F3@multiplay.co.uk> <54062268.9060603@rice.edu> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54070421.9030200@FreeBSD.org> <7FA917F9BB6F45FA84D8408C13359748@multiplay.co.uk> <54072C8E.7030501@FreeBSD.org> In-Reply-To: <54072C8E.7030501@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, John Baldwin , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:17:32 -0000 on 03/09/2014 17:58 Andriy Gapon said the following: > on 03/09/2014 15:17 Steven Hartland said the following: >> ----- Original Message ----- From: "Andriy Gapon" >> >>> on 03/09/2014 11:09 Steven Hartland said the following: >>>> I'm looking to MFC this change so wanted to check if >>>> anyone had an final feedback / objections? >>> >>> I think that your changes went in a bit prematurely (little review), so perhaps >>> MFC would be premature as well. >> >> Its a change which really needs to make it into 10.1 IMO > > I think that this is the arguable point. > As I've mentioned before I have not noticed, perhaps through the fault of my > own, any reports that users need this change after Alan's pagedaemon fix(es). > Also, there is no confirmation yet that after this change ARC does not give up > its buffers too easily. > >> due to its impact on users so I don't really want to hold >> off too long. >> >> If anyone has any substantiated reason to then off course >> I'll hold off. Based on our parallel conversation I feel a need to clarify my position. The commit in question has multiple changes in it: 1. removal of KVA check, which was later correctly restored for i386 2. addition of DTrace probes 3. zfs_arc_free_target check and all the support code for it So, #1 plus later fixes is obviously correct. #2 is useful and I like it. #3 is what I have great doubts about. All of what I said in the previous emails applies to #3 exclusively. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:32:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAA8C4ED; Wed, 3 Sep 2014 15:32:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAF991AB5; Wed, 3 Sep 2014 15:32:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83FWcSA094858; Wed, 3 Sep 2014 15:32:38 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83FWcRg094856; Wed, 3 Sep 2014 15:32:38 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409031532.s83FWcRg094856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Sep 2014 15:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271029 - in head/contrib/llvm: lib/Target/ARM patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:32:39 -0000 Author: sbruno Date: Wed Sep 3 15:32:38 2014 New Revision: 271029 URL: http://svnweb.freebsd.org/changeset/base/271029 Log: Do not direct commit to contrib/llvm. Make the change a patch file instead. Reverts 271025 but still functionally patches it. Original intent is still the same. Pointed out by rdivacky. MFV: Only emit movw on ARMv6T2 Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS in base doesn't understand this instruction for this target. One would need to use --integrated-as to get this to build if desired. http://llvm.org/viewvc/llvm-project?view=revision&revision=216989 Submitted by: ian Reviewed by: dim Obtained from: llvm.org MFC after: 2 days Relnotes: yes Added: head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 15:08:33 2014 (r271028) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 15:32:38 2014 (r271029) @@ -3248,8 +3248,7 @@ def : ARMPat<(ARMaddc GPR:$src, imm0_655 def : ARMPat<(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm)>; def : ARMPat<(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>, - Requires<[IsARM, HasV6T2]>; + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>; // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function Added: head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Wed Sep 3 15:32:38 2014 (r271029) @@ -0,0 +1,14 @@ +Index: lib/Target/ARM/ARMInstrInfo.td +=================================================================== +--- lib/Target/ARM/ARMInstrInfo.td (revision 271024) ++++ lib/Target/ARM/ARMInstrInfo.td (revision 271026) +@@ -3248,7 +3248,8 @@ + def : ARMPat<(ARMadde GPR:$src, so_imm_not:$imm, CPSR), + (SBCri GPR:$src, so_imm_not:$imm)>; + def : ARMPat<(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), +- (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>; ++ (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>, ++ Requires<[IsARM, HasV6T2]>; + + // Note: These are implemented in C++ code, because they have to generate + // ADD/SUBrs instructions, which use a complex pattern that a xform function From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:48:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A486C8C; Wed, 3 Sep 2014 15:48:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75E0E1C69; Wed, 3 Sep 2014 15:48:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83Fm8jb000429; Wed, 3 Sep 2014 15:48:08 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83Fm8k0000428; Wed, 3 Sep 2014 15:48:08 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409031548.s83Fm8k0000428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Sep 2014 15:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271030 - head/contrib/llvm/lib/Target/ARM X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:48:08 -0000 Author: sbruno Date: Wed Sep 3 15:48:07 2014 New Revision: 271030 URL: http://svnweb.freebsd.org/changeset/base/271030 Log: Apparently, the patch commited in svn r271029 doesn't actually do anyting, so we still need to modify the code in place. Pointed out by emaste. MFC after: 2 days Relnotes: yes Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 15:32:38 2014 (r271029) +++ head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td Wed Sep 3 15:48:07 2014 (r271030) @@ -3248,7 +3248,8 @@ def : ARMPat<(ARMaddc GPR:$src, imm0_655 def : ARMPat<(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm)>; def : ARMPat<(ARMadde GPR:$src, imm0_65535_neg:$imm, CPSR), - (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>; + (SBCrr GPR:$src, (MOVi16 (imm_not_XFORM imm:$imm)))>, + Requires<[IsARM, HasV6T2]>; // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 15:48:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B00F0EBE; Wed, 3 Sep 2014 15:48:58 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 558351C86; Wed, 3 Sep 2014 15:48:57 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id r20so10047422wiv.11 for ; Wed, 03 Sep 2014 08:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=XSA/dVEeGGg1FOnnS/kc4TprmChoekUeqRZnW7a9ybI=; b=t4kq5RxubVbsKMD1nakwnvIVFBKBdI1mD8NRR5eMfFZ+3AzSf6OTr1PZwzlhhb3Rfo Q7zelEbkFPvFM2cXXK7O4aB9bVrhTbtYq/5UYnSHbG7cdEzZyMhl4BSycBpvwkK6WKhc IGdgZOKFYrZ+/T6QX/5cLpTymxPlho1f6cx6lZoHqYPWg1984jKTj7Uj8sWXSvOt5A5p j9+2CTKoNGI0fB+PNeW8i4SxFPg1HhC5EkQsJgrKsVtaWy5P8BE3Y5CA+Xqnkyh6YeUJ HQyRigYLwkx4fzsEIs8BbGII1Fq6MNWQqq9Yk6xJMR13RgQGyY2pzVne0VhM/M1gazOL x5BA== X-Received: by 10.194.58.83 with SMTP id o19mr49103998wjq.20.1409759332963; Wed, 03 Sep 2014 08:48:52 -0700 (PDT) Received: from [172.16.1.30] (124.Red-83-33-238.dynamicIP.rima-tde.net. [83.33.238.124]) by mx.google.com with ESMTPSA id w10sm5403760wif.15.2014.09.03.08.48.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Sep 2014 08:48:52 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <5407385B.1000005@FreeBSD.org> Date: Wed, 03 Sep 2014 17:48:43 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> In-Reply-To: <20140902171841.GX71691@funkthat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: src-committers@FreeBSD.org, Alexander Motin , scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, gibbs@freebsd.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 15:48:58 -0000 El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: > Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: >> El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: >>> El 28/08/14 a les 20.58, Alexander Motin ha escrit: >>>> On 28.08.2014 21:45, John-Mark Gurney wrote: >>>>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: >>>>>> Hi, Roger. >>>>>> >>>>>> It looks to me like this commit does not work as it should. I got >>>>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. >>>>>> Somehow newfs does not produce valid filesystem. Problem is reliably >>>>>> repeatable and reverting this commit fixes it. >>>>>> >>>>>> I found at least one possible cause there: If original data buffer is >>>>>> unmapped, misaligned and not physically contiguous, then present x86 >>>>>> bus_dmamap_load_bio() implementation will process each physically >>>>>> contiguous segment separately. Due to the misalignment first and last >>>>>> physical segments may have size not multiple to 512 bytes. Since each >>>>>> segment processed separately, they are not joined together, and >>>>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to >>>>>> convert them to exact number of sectors in the driver cause data corruption. >>>>> >>>>> Are you sure this isn't a problem w/ the tag not properly specifying >>>>> the correct alignement? >>>> >>>> I don't know how to specify it stronger then this: >>>> error = bus_dma_tag_create( >>>> bus_get_dma_tag(sc->xbd_dev), /* parent */ >>>> 512, PAGE_SIZE, /* algnmnt, boundary */ >>>> BUS_SPACE_MAXADDR, /* lowaddr */ >>>> BUS_SPACE_MAXADDR, /* highaddr */ >>>> NULL, NULL, /* filter, filterarg */ >>>> sc->xbd_max_request_size, >>>> sc->xbd_max_request_segments, >>>> PAGE_SIZE, /* maxsegsize */ >>>> BUS_DMA_ALLOCNOW, /* flags */ >>>> busdma_lock_mutex, /* lockfunc */ >>>> &sc->xbd_io_lock, /* lockarg */ >>>> &sc->xbd_io_dmat); >>>> >>>>> Also, I don't think there is a way for busdma >>>>> to say that you MUST have a segment be a multiple of 512, though you >>>>> could use a 512 boundary, but that would force all segments to only be >>>>> 512 bytes... >>>> >>>> As I understand, that is mandatory requirement for this "hardware". >>>> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC >>>> UHCI/OHCI hardware. Even AHCI requires both segment addresses and >>>> lengths to be even. >>>> >>>> I may be wrong, but I think it is quite likely that hardware that >>>> requires segment address alignment quite likely will have the same >>>> requirements for segments length. >> >> Hello, >> >> I have the following fix, which makes sure the total length and the >> size of each segment is aligned. I'm not very knowledgeable of the >> busdma code, so someone has to review it. > > I feel that this alignment should only be enforced via a new option on > the tag... I don't see how alignment and segment size should be > conflated... I could totally see a device that requires an alignement > of 8 bytes, but has a segment size of 16, or vice versa, and requiring > them to be the same means we will bounce unnecesarily... > > cc'd scottl since he knows this code better than I... and cperciva as > he touched it for similar reasons.. > > Oh, I just found PR 152818, where cperciva did a similar fix to > bounce_bus_dmamap_load_buffer for the exact same reason... It was > committed in r216194... Since Xen blkfront seems to be the only driver to have such segment size requirements, it might be best to just fix blkfront to always roundup segment size to 512, like the following: diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 26b8f09..2d284d9 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -209,7 +209,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) buffer_ma = segs->ds_addr; fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; - lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; + lsect = fsect + (roundup2(segs->ds_len, 512) + >> XBD_SECTOR_SHFT) - 1; KASSERT(lsect <= 7, ("XEN disk driver data cannot " "cross a page boundary")); >> --- >> diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c >> index d1c75f8..688f559 100644 >> --- a/sys/x86/x86/busdma_bounce.c >> +++ b/sys/x86/x86/busdma_bounce.c >> @@ -620,6 +620,8 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, >> segs = dmat->segments; >> >> if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { >> + /* Make sure buflen is aligned */ >> + buflen = roundup2(buflen, dmat->common.alignment); >> _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); >> if (map->pagesneeded != 0) { >> error = _bus_dmamap_reserve_pages(dmat, map, flags); >> @@ -634,6 +636,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, >> if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && >> map->pagesneeded != 0 && >> bus_dma_run_filter(&dmat->common, curaddr)) { >> + sgsize = roundup2(sgsize, dmat->common.alignment); >> sgsize = MIN(sgsize, PAGE_SIZE); >> curaddr = add_bounce_page(dmat, map, 0, curaddr, >> sgsize); >> > > Doesn't this same change need to be made to _bus_dmamap_count_phys so that > the cound will be correct? We already roundup the buflen to the alignement value before calling _bus_dmamap_count_phys, so every segment should have a size that's a multiple of alignement. > Also, make sure you review the other arch's bounce implementations, as > they were often copied from the x86 one... > From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 16:03:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC5C2640; Wed, 3 Sep 2014 16:03:21 +0000 (UTC) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA2E1E71; Wed, 3 Sep 2014 16:03:19 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id mc6so10143727lab.1 for ; Wed, 03 Sep 2014 09:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/4P1Fuosth6xxyAGnExTlaVK46ATL8oTYWyyhzOfwwA=; b=JZg0WMQOTRjSFksX6nXkJM713ztT/brfF+MSX5wPxdSUgJ8hH7Ft6HBsbTPWK1QvTI yfMAI7PLffCIgcNH83Cw0Hx2/FWm1BT2ACvS1XaaYTBNzD8WTh0ueykwaOhR6UhCZKEB xmgqHtwV8WV7HOZV0bkvzR6CDC/ZjG9yKqyK85Fq0SaIbxjBCL0/z0IjGxtQ2uEX745a oEIGVL5V04jne+rOfl20HAIWn6Wl+zBBjL6yKUsxD0NP4W+7uLKQKl6JcWwXjEEci6/E DsDS1x0uAZfFC2Y0UzXjsOjUIfgZTf6Ra621oScb1+nAHfHmRX92al2HwsQtznfopyWt Xeqw== X-Received: by 10.152.4.9 with SMTP id g9mr43019213lag.14.1409760198036; Wed, 03 Sep 2014 09:03:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id sr4sm1300574lac.39.2014.09.03.09.03.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 09:03:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <54073BC2.1000703@FreeBSD.org> Date: Wed, 03 Sep 2014 19:03:14 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Roger_Pau_Monn=E9?= , John-Mark Gurney Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> <5407385B.1000005@FreeBSD.org> In-Reply-To: <5407385B.1000005@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, gibbs@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 16:03:21 -0000 On 03.09.2014 18:48, Roger Pau Monné wrote: > El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: >> Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: >>> El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: >>>> El 28/08/14 a les 20.58, Alexander Motin ha escrit: >>>>> On 28.08.2014 21:45, John-Mark Gurney wrote: >>>>>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: >>>>>>> Hi, Roger. >>>>>>> >>>>>>> It looks to me like this commit does not work as it should. I got >>>>>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. >>>>>>> Somehow newfs does not produce valid filesystem. Problem is reliably >>>>>>> repeatable and reverting this commit fixes it. >>>>>>> >>>>>>> I found at least one possible cause there: If original data buffer is >>>>>>> unmapped, misaligned and not physically contiguous, then present x86 >>>>>>> bus_dmamap_load_bio() implementation will process each physically >>>>>>> contiguous segment separately. Due to the misalignment first and last >>>>>>> physical segments may have size not multiple to 512 bytes. Since each >>>>>>> segment processed separately, they are not joined together, and >>>>>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to >>>>>>> convert them to exact number of sectors in the driver cause data corruption. >>>>>> >>>>>> Are you sure this isn't a problem w/ the tag not properly specifying >>>>>> the correct alignement? >>>>> >>>>> I don't know how to specify it stronger then this: >>>>> error = bus_dma_tag_create( >>>>> bus_get_dma_tag(sc->xbd_dev), /* parent */ >>>>> 512, PAGE_SIZE, /* algnmnt, boundary */ >>>>> BUS_SPACE_MAXADDR, /* lowaddr */ >>>>> BUS_SPACE_MAXADDR, /* highaddr */ >>>>> NULL, NULL, /* filter, filterarg */ >>>>> sc->xbd_max_request_size, >>>>> sc->xbd_max_request_segments, >>>>> PAGE_SIZE, /* maxsegsize */ >>>>> BUS_DMA_ALLOCNOW, /* flags */ >>>>> busdma_lock_mutex, /* lockfunc */ >>>>> &sc->xbd_io_lock, /* lockarg */ >>>>> &sc->xbd_io_dmat); >>>>> >>>>>> Also, I don't think there is a way for busdma >>>>>> to say that you MUST have a segment be a multiple of 512, though you >>>>>> could use a 512 boundary, but that would force all segments to only be >>>>>> 512 bytes... >>>>> >>>>> As I understand, that is mandatory requirement for this "hardware". >>>>> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC >>>>> UHCI/OHCI hardware. Even AHCI requires both segment addresses and >>>>> lengths to be even. >>>>> >>>>> I may be wrong, but I think it is quite likely that hardware that >>>>> requires segment address alignment quite likely will have the same >>>>> requirements for segments length. >>> >>> Hello, >>> >>> I have the following fix, which makes sure the total length and the >>> size of each segment is aligned. I'm not very knowledgeable of the >>> busdma code, so someone has to review it. >> >> I feel that this alignment should only be enforced via a new option on >> the tag... I don't see how alignment and segment size should be >> conflated... I could totally see a device that requires an alignement >> of 8 bytes, but has a segment size of 16, or vice versa, and requiring >> them to be the same means we will bounce unnecesarily... >> >> cc'd scottl since he knows this code better than I... and cperciva as >> he touched it for similar reasons.. >> >> Oh, I just found PR 152818, where cperciva did a similar fix to >> bounce_bus_dmamap_load_buffer for the exact same reason... It was >> committed in r216194... > > Since Xen blkfront seems to be the only driver to have such segment > size requirements, No, it is not. I've already posted other examples I can recall: SDHCI, UHCI/OHCI and AHCI. Their limitations are different and less strict, but still may need handling. For SDHCI, since it is quite slow and has many other bugs, I practically implemented custom buffer bouncing. AHCI I suppose works only because limitation is only for even addresses, and odd ones happen extremely rarely (does not happen). For USB I am not sure, but at least umass driver does not support unmapped I/O. > it might be best to just fix blkfront to always > roundup segment size to 512, like the following: I think some coffee is needed here. ;) Rounding addresses won't make data properly aligned. Some copy is unavoidable in such cases. It would be good if it was done properly by default buffer bouncer. > diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c > index 26b8f09..2d284d9 100644 > --- a/sys/dev/xen/blkfront/blkfront.c > +++ b/sys/dev/xen/blkfront/blkfront.c > @@ -209,7 +209,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) > > buffer_ma = segs->ds_addr; > fsect = (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; > - lsect = fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; > + lsect = fsect + (roundup2(segs->ds_len, 512) > + >> XBD_SECTOR_SHFT) - 1; > > KASSERT(lsect <= 7, ("XEN disk driver data cannot " > "cross a page boundary")); -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 16:16:30 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F3ABBA2; Wed, 3 Sep 2014 16:16:30 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6661FC4; Wed, 3 Sep 2014 16:16:29 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XPDEN-00028F-51; Wed, 03 Sep 2014 16:16:23 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s83GGLrB008496; Wed, 3 Sep 2014 10:16:21 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18JnAYrtXkqqIeDf/I6/jOg X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront From: Ian Lepore To: Alexander Motin In-Reply-To: <54073BC2.1000703@FreeBSD.org> References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> <5407385B.1000005@FreeBSD.org> <54073BC2.1000703@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 03 Sep 2014 10:16:21 -0600 Message-ID: <1409760981.1150.284.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id s83GGLrB008496 Cc: src-committers@FreeBSD.org, John-Mark Gurney , Roger Pau =?ISO-8859-1?Q?Monn=E9?= , scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, gibbs@freebsd.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 16:16:30 -0000 On Wed, 2014-09-03 at 19:03 +0300, Alexander Motin wrote: > On 03.09.2014 18:48, Roger Pau Monn=E9 wrote: > > El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: > >> Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +020= 0: > >>> El 29/08/14 a les 19.52, Roger Pau Monn=E9 ha escrit: > >>>> El 28/08/14 a les 20.58, Alexander Motin ha escrit: > >>>>> On 28.08.2014 21:45, John-Mark Gurney wrote: > >>>>>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23= +0300: > >>>>>>> Hi, Roger. > >>>>>>> > >>>>>>> It looks to me like this commit does not work as it should. I g= ot > >>>>>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /m= nt`. > >>>>>>> Somehow newfs does not produce valid filesystem. Problem is rel= iably > >>>>>>> repeatable and reverting this commit fixes it. > >>>>>>> > >>>>>>> I found at least one possible cause there: If original data buf= fer is > >>>>>>> unmapped, misaligned and not physically contiguous, then presen= t x86 > >>>>>>> bus_dmamap_load_bio() implementation will process each physical= ly > >>>>>>> contiguous segment separately. Due to the misalignment first an= d last > >>>>>>> physical segments may have size not multiple to 512 bytes. Sinc= e each > >>>>>>> segment processed separately, they are not joined together, and > >>>>>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. A= ttempt to > >>>>>>> convert them to exact number of sectors in the driver cause dat= a corruption. > >>>>>> > >>>>>> Are you sure this isn't a problem w/ the tag not properly specif= ying > >>>>>> the correct alignement?=20 > >>>>> > >>>>> I don't know how to specify it stronger then this: > >>>>> error =3D bus_dma_tag_create( > >>>>> bus_get_dma_tag(sc->xbd_dev), /* parent */ > >>>>> 512, PAGE_SIZE, /* algnmnt, bound= ary */ > >>>>> BUS_SPACE_MAXADDR, /* lowaddr */ > >>>>> BUS_SPACE_MAXADDR, /* highaddr */ > >>>>> NULL, NULL, /* filter, filter= arg */ > >>>>> sc->xbd_max_request_size, > >>>>> sc->xbd_max_request_segments, > >>>>> PAGE_SIZE, /* maxsegsize */ > >>>>> BUS_DMA_ALLOCNOW, /* flags */ > >>>>> busdma_lock_mutex, /* lockfunc */ > >>>>> &sc->xbd_io_lock, /* lockarg */ > >>>>> &sc->xbd_io_dmat); > >>>>> > >>>>>> Also, I don't think there is a way for busdma > >>>>>> to say that you MUST have a segment be a multiple of 512, though= you > >>>>>> could use a 512 boundary, but that would force all segments to o= nly be > >>>>>> 512 bytes... > >>>>> > >>>>> As I understand, that is mandatory requirement for this "hardware= ". > >>>>> Alike 4K alignment requirement also exist at least for SDHCI, and= IIRC > >>>>> UHCI/OHCI hardware. Even AHCI requires both segment addresses and > >>>>> lengths to be even. > >>>>> > >>>>> I may be wrong, but I think it is quite likely that hardware that > >>>>> requires segment address alignment quite likely will have the sam= e > >>>>> requirements for segments length. > >>> > >>> Hello, > >>> > >>> I have the following fix, which makes sure the total length and the= =20 > >>> size of each segment is aligned. I'm not very knowledgeable of the=20 > >>> busdma code, so someone has to review it. > >> > >> I feel that this alignment should only be enforced via a new option = on > >> the tag... I don't see how alignment and segment size should be > >> conflated... I could totally see a device that requires an aligneme= nt > >> of 8 bytes, but has a segment size of 16, or vice versa, and requiri= ng > >> them to be the same means we will bounce unnecesarily... > >> > >> cc'd scottl since he knows this code better than I... and cperciva a= s > >> he touched it for similar reasons.. > >> > >> Oh, I just found PR 152818, where cperciva did a similar fix to > >> bounce_bus_dmamap_load_buffer for the exact same reason... It was > >> committed in r216194... > >=20 > > Since Xen blkfront seems to be the only driver to have such segment=20 > > size requirements,=20 >=20 > No, it is not. I've already posted other examples I can recall: SDHCI, > UHCI/OHCI and AHCI. Their limitations are different and less strict, bu= t > still may need handling. For SDHCI, since it is quite slow and has many > other bugs, I practically implemented custom buffer bouncing. AHCI I > suppose works only because limitation is only for even addresses, and > odd ones happen extremely rarely (does not happen). For USB I am not > sure, but at least umass driver does not support unmapped I/O. >=20 > > it might be best to just fix blkfront to always=20 > > roundup segment size to 512, like the following: >=20 > I think some coffee is needed here. ;) Rounding addresses won't make > data properly aligned. Some copy is unavoidable in such cases. It would > be good if it was done properly by default buffer bouncer. >=20 And likewise I don't see how rounding up sizes can result in anything other than writing extra garbage to disk. If there is a 512 byte sector's worth of data not aligned to a 512 boundary and crossing a page boundary, the bounce code is going to have to cope with the fact that the second half of the data to be copied may not be physically contiguous, unless there's some rule in the phys bio world that g'tees it is. -- Ian > > diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/b= lkfront.c > > index 26b8f09..2d284d9 100644 > > --- a/sys/dev/xen/blkfront/blkfront.c > > +++ b/sys/dev/xen/blkfront/blkfront.c > > @@ -209,7 +209,8 @@ xbd_queue_cb(void *arg, bus_dma_segment_t *segs, = int nsegs, int error) > > =20 > > buffer_ma =3D segs->ds_addr; > > fsect =3D (buffer_ma & PAGE_MASK) >> XBD_SECTOR_SHFT; > > - lsect =3D fsect + (segs->ds_len >> XBD_SECTOR_SHFT) - 1; > > + lsect =3D fsect + (roundup2(segs->ds_len, 512) > > + >> XBD_SECTOR_SHFT) - 1; > > =20 > > KASSERT(lsect <=3D 7, ("XEN disk driver data cannot " > > "cross a page boundary")); >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 17:15:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18DC19CB; Wed, 3 Sep 2014 17:15:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 050D418DB; Wed, 3 Sep 2014 17:15:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83HFC8L044050; Wed, 3 Sep 2014 17:15:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83HFC4h044049; Wed, 3 Sep 2014 17:15:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409031715.s83HFC4h044049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 3 Sep 2014 17:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271043 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 17:15:13 -0000 Author: gjb Date: Wed Sep 3 17:15:12 2014 New Revision: 271043 URL: http://svnweb.freebsd.org/changeset/base/271043 Log: Update the autofs(5) manual to reflect it first appeared in FreeBSD 10.1-RELEASE. Submitted by: dhw MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/autofs.5 Modified: head/share/man/man5/autofs.5 ============================================================================== --- head/share/man/man5/autofs.5 Wed Sep 3 16:48:33 2014 (r271042) +++ head/share/man/man5/autofs.5 Wed Sep 3 17:15:12 2014 (r271043) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2014 +.Dd September 3, 2014 .Dt AUTOFS 5 .Os .Sh NAME @@ -90,7 +90,7 @@ filesystems specified in The .Nm driver first appeared in -.Fx 10.2 . +.Fx 10.1 . .Sh AUTHORS The .Nm From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 17:26:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A119AE54; Wed, 3 Sep 2014 17:26:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C55F19F8; Wed, 3 Sep 2014 17:26:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83HQl4S048948; Wed, 3 Sep 2014 17:26:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83HQlMM048946; Wed, 3 Sep 2014 17:26:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409031726.s83HQlMM048946@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 3 Sep 2014 17:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271044 - head/tools/tools/tscdrift X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 17:26:47 -0000 Author: jhb Date: Wed Sep 3 17:26:46 2014 New Revision: 271044 URL: http://svnweb.freebsd.org/changeset/base/271044 Log: Import a hackish tool I use to examine the skew of the TSC across CPUs in a system. The tool queries the kernel for its set of CPUs and compares TSC values on each of the additional CPUs to the first CPU in turn. It then outputs a table of simple statistics. Added: head/tools/tools/tscdrift/ head/tools/tools/tscdrift/Makefile (contents, props changed) head/tools/tools/tscdrift/tscdrift.c (contents, props changed) Added: head/tools/tools/tscdrift/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tscdrift/Makefile Wed Sep 3 17:26:46 2014 (r271044) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= tscdrift +MAN= +WARNS?= 6 + +LDADD= -lpthread -lm +DPADD= ${LIBPTHREAD} ${LIBM} + +.include Added: head/tools/tools/tscdrift/tscdrift.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tscdrift/tscdrift.c Wed Sep 3 17:26:46 2014 (r271044) @@ -0,0 +1,193 @@ +/*- + * Copyright (c) 2014 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. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define barrier() __asm __volatile("" ::: "memory") + +#define TESTS 1024 + +static volatile int gate; +static volatile uint64_t thread_tsc; + +/* Bind the current thread to the specified CPU. */ +static void +bind_cpu(int cpu) +{ + cpuset_t set; + + CPU_ZERO(&set); + CPU_SET(cpu, &set); + if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(set), + &set) < 0) + err(1, "cpuset_setaffinity(%d)", cpu); +} + +static void * +thread_main(void *arg) +{ + int cpu, i; + + cpu = (intptr_t)arg; + bind_cpu(cpu); + for (i = 0; i < TESTS; i++) { + gate = 1; + while (gate == 1) + cpu_spinwait(); + barrier(); + + __asm __volatile("lfence"); + thread_tsc = rdtsc(); + + barrier(); + gate = 3; + while (gate == 3) + cpu_spinwait(); + } + return (NULL); +} + +int +main(int ac __unused, char **av __unused) +{ + cpuset_t all_cpus; + int64_t **skew, *aveskew, *minskew, *maxskew; + float *stddev; + double sumsq; + pthread_t child; + uint64_t tsc; + int *cpus; + int error, i, j, ncpu; + + /* + * Find all the CPUs this program is eligible to run on and use + * this as our global set. This means you can use cpuset to + * restrict this program to only run on a subset of CPUs. + */ + if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(all_cpus), &all_cpus) < 0) + err(1, "cpuset_getaffinity"); + for (ncpu = 0, i = 0; i < CPU_SETSIZE; i++) { + if (CPU_ISSET(i, &all_cpus)) + ncpu++; + } + if (ncpu < 2) + errx(1, "Only one available CPU"); + cpus = calloc(ncpu, sizeof(*cpus)); + skew = calloc(ncpu, sizeof(*skew)); + for (i = 0; i < ncpu; i++) + skew[i] = calloc(TESTS, sizeof(*skew[i])); + for (i = 0, j = 0; i < CPU_SETSIZE; i++) + if (CPU_ISSET(i, &all_cpus)) { + assert(j < ncpu); + cpus[j] = i; + j++; + } + + /* + * We bind this thread to the first CPU and then bind all the + * other threads to other CPUs in turn saving TESTS counts of + * skew calculations. + */ + bind_cpu(cpus[0]); + for (i = 1; i < ncpu; i++) { + error = pthread_create(&child, NULL, thread_main, + (void *)(intptr_t)cpus[i]); + if (error) + errc(1, error, "pthread_create"); + + for (j = 0; j < TESTS; j++) { + while (gate != 1) + cpu_spinwait(); + gate = 2; + barrier(); + + tsc = rdtsc(); + + barrier(); + while (gate != 3) + cpu_spinwait(); + gate = 4; + + skew[i][j] = thread_tsc - tsc; + } + + error = pthread_join(child, NULL); + if (error) + errc(1, error, "pthread_join"); + } + + /* + * Compute average skew for each CPU and output a summary of + * the results. + */ + aveskew = calloc(ncpu, sizeof(*aveskew)); + minskew = calloc(ncpu, sizeof(*minskew)); + maxskew = calloc(ncpu, sizeof(*maxskew)); + stddev = calloc(ncpu, sizeof(*stddev)); + stddev[0] = 0.0; + for (i = 1; i < ncpu; i++) { + sumsq = 0; + minskew[i] = maxskew[i] = skew[i][0]; + for (j = 0; j < TESTS; j++) { + aveskew[i] += skew[i][j]; + if (skew[i][j] < minskew[i]) + minskew[i] = skew[i][j]; + if (skew[i][j] > maxskew[i]) + maxskew[i] = skew[i][j]; + sumsq += (skew[i][j] * skew[i][j]); + } + aveskew[i] /= TESTS; + sumsq /= TESTS; + sumsq -= aveskew[i] * aveskew[i]; + stddev[i] = sqrt(sumsq); + } + + printf("CPU | TSC skew (min/avg/max/stddev)\n"); + printf("----+------------------------------\n"); + for (i = 0; i < ncpu; i++) + printf("%3d | %5jd %5jd %5jd %6.3f\n", cpus[i], + (intmax_t)minskew[i], (intmax_t)aveskew[i], + (intmax_t)maxskew[i], stddev[i]); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 17:32:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FE25101; Wed, 3 Sep 2014 17:32:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BA7E1ABA; Wed, 3 Sep 2014 17:32:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83HWIjr053049; Wed, 3 Sep 2014 17:32:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83HWIER053048; Wed, 3 Sep 2014 17:32:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409031732.s83HWIER053048@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Sep 2014 17:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271045 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 17:32:18 -0000 Author: ian Date: Wed Sep 3 17:32:17 2014 New Revision: 271045 URL: http://svnweb.freebsd.org/changeset/base/271045 Log: Use sh -c '...' to launch the dtb build scripts with env stuff prepended, otherwise it tries to treat the env var stuff as a script file name. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Sep 3 17:26:46 2014 (r271044) +++ head/sys/conf/files Wed Sep 3 17:32:17 2014 (r271045) @@ -14,11 +14,11 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}'" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with "sh MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + compile-with "sh -c 'MACHINE=${MACHINE} $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}'" \ dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 17:51:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C278499; Wed, 3 Sep 2014 17:51:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D851CB4; Wed, 3 Sep 2014 17:51:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83Hp4tw061743; Wed, 3 Sep 2014 17:51:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83Hp3dw061738; Wed, 3 Sep 2014 17:51:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409031751.s83Hp3dw061738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Sep 2014 17:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271046 - in head/sys: arm/conf arm/xilinx dev/cadence X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 17:51:04 -0000 Author: ian Date: Wed Sep 3 17:51:03 2014 New Revision: 271046 URL: http://svnweb.freebsd.org/changeset/base/271046 Log: Fixes and enhancements for the if_cgem driver... - miibus fixes as suggested by Yonghyeon Pyun. - enable VLAN MTU support. - fix a few WITNESS complaints in cgem_attach(). - have cgem_attach() properly init the ifnet struct before calling mii_attach() to fix panic when using e1000phy. - fix ethernet address changing. - fix transmit queue overflow handling. - tweak receive queue handling to reduce receive overflows. - bring out MAC statistic counters to sysctls. - add e1000phy to config file. - implement receive hang work-around described in reference guide. - change device name from if_cgem to cgem to be consistent with other interfaces. Submitted by: Thomas Skibo Reviewed by: wkoszek, Yonghyeon PYUN Modified: head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/files.zynq7 head/sys/dev/cadence/if_cgem.c head/sys/dev/cadence/if_cgem_hw.h Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/arm/conf/ZEDBOARD Wed Sep 3 17:51:03 2014 (r271046) @@ -72,8 +72,9 @@ options KDB device loop device random device ether -device if_cgem # Zynq-7000 gig ethernet device +device cgem # Zynq-7000 gig ethernet device device mii +device e1000phy device pty device uart device gpio Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/arm/xilinx/files.zynq7 Wed Sep 3 17:51:03 2014 (r271046) @@ -23,7 +23,7 @@ arm/xilinx/zy7_slcr.c standard arm/xilinx/zy7_devcfg.c standard arm/xilinx/zy7_mp.c optional smp -dev/cadence/if_cgem.c optional if_cgem +dev/cadence/if_cgem.c optional cgem dev/sdhci/sdhci_fdt.c optional sdhci arm/xilinx/zy7_ehci.c optional ehci arm/xilinx/uart_dev_cdnc.c optional uart Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/dev/cadence/if_cgem.c Wed Sep 3 17:51:03 2014 (r271046) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2014 Thomas Skibo + * Copyright (c) 2012-2014 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,17 +82,17 @@ __FBSDID("$FreeBSD$"); #define IF_CGEM_NAME "cgem" -#define CGEM_NUM_RX_DESCS 256 /* size of receive descriptor ring */ -#define CGEM_NUM_TX_DESCS 256 /* size of transmit descriptor ring */ +#define CGEM_NUM_RX_DESCS 512 /* size of receive descriptor ring */ +#define CGEM_NUM_TX_DESCS 512 /* size of transmit descriptor ring */ #define MAX_DESC_RING_SIZE (MAX(CGEM_NUM_RX_DESCS*sizeof(struct cgem_rx_desc),\ CGEM_NUM_TX_DESCS*sizeof(struct cgem_tx_desc))) /* Default for sysctl rxbufs. Must be < CGEM_NUM_RX_DESCS of course. */ -#define DEFAULT_NUM_RX_BUFS 64 /* number of receive bufs to queue. */ +#define DEFAULT_NUM_RX_BUFS 256 /* number of receive bufs to queue. */ -#define TX_MAX_DMA_SEGS 4 /* maximum segs in a tx mbuf dma */ +#define TX_MAX_DMA_SEGS 8 /* maximum segs in a tx mbuf dma */ #define CGEM_CKSUM_ASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP | \ CSUM_TCP_IPV6 | CSUM_UDP_IPV6) @@ -102,6 +102,7 @@ struct cgem_softc { struct mtx sc_mtx; device_t dev; device_t miibus; + u_int mii_media_active; /* last active media */ int if_old_flags; struct resource *mem_res; struct resource *irq_res; @@ -124,7 +125,11 @@ struct cgem_softc { int rxring_queued; /* how many rcv bufs queued */ bus_dmamap_t rxring_dma_map; int rxbufs; /* tunable number rcv bufs */ - int rxoverruns; /* rx ring overruns */ + int rxhangwar; /* rx hang work-around */ + u_int rxoverruns; /* rx overruns */ + u_int rxnobufs; /* rx buf ring empty events */ + u_int rxdmamapfails; /* rx dmamap failures */ + uint32_t rx_frames_prev; /* transmit descriptor ring */ struct cgem_tx_desc *txring; @@ -135,6 +140,56 @@ struct cgem_softc { int txring_tl_ptr; /* next xmit mbuf to free */ int txring_queued; /* num xmits segs queued */ bus_dmamap_t txring_dma_map; + u_int txfull; /* tx ring full events */ + u_int txdefrags; /* tx calls to m_defrag() */ + u_int txdefragfails; /* tx m_defrag() failures */ + u_int txdmamapfails; /* tx dmamap failures */ + + /* hardware provided statistics */ + struct cgem_hw_stats { + uint64_t tx_bytes; + uint32_t tx_frames; + uint32_t tx_frames_bcast; + uint32_t tx_frames_multi; + uint32_t tx_frames_pause; + uint32_t tx_frames_64b; + uint32_t tx_frames_65to127b; + uint32_t tx_frames_128to255b; + uint32_t tx_frames_256to511b; + uint32_t tx_frames_512to1023b; + uint32_t tx_frames_1024to1536b; + uint32_t tx_under_runs; + uint32_t tx_single_collisn; + uint32_t tx_multi_collisn; + uint32_t tx_excsv_collisn; + uint32_t tx_late_collisn; + uint32_t tx_deferred_frames; + uint32_t tx_carrier_sense_errs; + + uint64_t rx_bytes; + uint32_t rx_frames; + uint32_t rx_frames_bcast; + uint32_t rx_frames_multi; + uint32_t rx_frames_pause; + uint32_t rx_frames_64b; + uint32_t rx_frames_65to127b; + uint32_t rx_frames_128to255b; + uint32_t rx_frames_256to511b; + uint32_t rx_frames_512to1023b; + uint32_t rx_frames_1024to1536b; + uint32_t rx_frames_undersize; + uint32_t rx_frames_oversize; + uint32_t rx_frames_jabber; + uint32_t rx_frames_fcs_errs; + uint32_t rx_frames_length_errs; + uint32_t rx_symbol_errs; + uint32_t rx_align_errs; + uint32_t rx_resource_errs; + uint32_t rx_overrun_errs; + uint32_t rx_ip_hdr_csum_errs; + uint32_t rx_tcp_csum_errs; + uint32_t rx_udp_csum_errs; + } stats; }; #define RD4(sc, off) (bus_read_4((sc)->mem_res, (off))) @@ -161,6 +216,8 @@ static int cgem_detach(device_t dev); static void cgem_tick(void *); static void cgem_intr(void *); +static void cgem_mediachange(struct cgem_softc *, struct mii_data *); + static void cgem_get_mac(struct cgem_softc *sc, u_char eaddr[]) { @@ -197,10 +254,16 @@ cgem_get_mac(struct cgem_softc *sc, u_ch "random: %02x:%02x:%02x:%02x:%02x:%02x\n", eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]); + } - WR4(sc, CGEM_SPEC_ADDR_LOW(0), (eaddr[3] << 24) | - (eaddr[2] << 16) | (eaddr[1] << 8) | eaddr[0]); - WR4(sc, CGEM_SPEC_ADDR_HI(0), (eaddr[5] << 8) | eaddr[4]); + /* Move address to first slot and zero out the rest. */ + WR4(sc, CGEM_SPEC_ADDR_LOW(0), (eaddr[3] << 24) | + (eaddr[2] << 16) | (eaddr[1] << 8) | eaddr[0]); + WR4(sc, CGEM_SPEC_ADDR_HI(0), (eaddr[5] << 8) | eaddr[4]); + + for (i = 1; i < 4; i++) { + WR4(sc, CGEM_SPEC_ADDR_LOW(i), 0); + WR4(sc, CGEM_SPEC_ADDR_HI(i), 0); } } @@ -426,7 +489,7 @@ cgem_fill_rqueue(struct cgem_softc *sc) if (bus_dmamap_load_mbuf_sg(sc->mbuf_dma_tag, sc->rxring_m_dmamap[sc->rxring_hd_ptr], m, segs, &nsegs, BUS_DMA_NOWAIT)) { - /* XXX: warn? */ + sc->rxdmamapfails++; m_free(m); break; } @@ -455,12 +518,14 @@ static void cgem_recv(struct cgem_softc *sc) { struct ifnet *ifp = sc->ifp; - struct mbuf *m; + struct mbuf *m, *m_hd, **m_tl; uint32_t ctl; CGEM_ASSERT_LOCKED(sc); /* Pick up all packets in which the OWN bit is set. */ + m_hd = NULL; + m_tl = &m_hd; while (sc->rxring_queued > 0 && (sc->rxring[sc->rxring_tl_ptr].addr & CGEM_RXDESC_OWN) != 0) { @@ -497,7 +562,7 @@ cgem_recv(struct cgem_softc *sc) continue; } - /* Hand it off to upper layers. */ + /* Ready it to hand off to upper layers. */ m->m_data += ETHER_ALIGN; m->m_len = (ctl & CGEM_RXDESC_LENGTH_MASK); m->m_pkthdr.rcvif = ifp; @@ -525,11 +590,24 @@ cgem_recv(struct cgem_softc *sc) } } + /* Queue it up for delivery below. */ + *m_tl = m; + m_tl = &m->m_next; + } + + /* Replenish receive buffers. */ + cgem_fill_rqueue(sc); + + /* Unlock and send up packets. */ + CGEM_UNLOCK(sc); + while (m_hd != NULL) { + m = m_hd; + m_hd = m_hd->m_next; + m->m_next = NULL; ifp->if_ipackets++; - CGEM_UNLOCK(sc); (*ifp->if_input)(ifp, m); - CGEM_LOCK(sc); } + CGEM_LOCK(sc); } /* Find completed transmits and free their mbufs. */ @@ -595,6 +673,8 @@ cgem_clean_tx(struct cgem_softc *sc) else sc->txring_tl_ptr++; sc->txring_queued--; + + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } } @@ -615,16 +695,17 @@ cgem_start_locked(struct ifnet *ifp) for (;;) { /* Check that there is room in the descriptor ring. */ - if (sc->txring_queued >= CGEM_NUM_TX_DESCS - - TX_MAX_DMA_SEGS - 1) { + if (sc->txring_queued >= + CGEM_NUM_TX_DESCS - TX_MAX_DMA_SEGS * 2) { /* Try to make room. */ cgem_clean_tx(sc); /* Still no room? */ - if (sc->txring_queued >= CGEM_NUM_TX_DESCS - - TX_MAX_DMA_SEGS - 1) { + if (sc->txring_queued >= + CGEM_NUM_TX_DESCS - TX_MAX_DMA_SEGS * 2) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; + sc->txfull++; break; } } @@ -643,6 +724,7 @@ cgem_start_locked(struct ifnet *ifp) struct mbuf *m2 = m_defrag(m, M_NOWAIT); if (m2 == NULL) { + sc->txdefragfails++; m_freem(m); continue; } @@ -650,10 +732,12 @@ cgem_start_locked(struct ifnet *ifp) err = bus_dmamap_load_mbuf_sg(sc->mbuf_dma_tag, sc->txring_m_dmamap[sc->txring_hd_ptr], m, segs, &nsegs, BUS_DMA_NOWAIT); + sc->txdefrags++; } if (err) { /* Give up. */ m_freem(m); + sc->txdmamapfails++; continue; } sc->txring_m[sc->txring_hd_ptr] = m; @@ -697,8 +781,10 @@ cgem_start_locked(struct ifnet *ifp) /* Kick the transmitter. */ WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow | CGEM_NET_CTRL_START_TX); - } + /* If there is a BPF listener, bounce a copy to to him. */ + ETHER_BPF_MTAP(ifp, m); + } } static void @@ -712,6 +798,71 @@ cgem_start(struct ifnet *ifp) } static void +cgem_poll_hw_stats(struct cgem_softc *sc) +{ + uint32_t n; + + CGEM_ASSERT_LOCKED(sc); + + sc->stats.tx_bytes += RD4(sc, CGEM_OCTETS_TX_BOT); + sc->stats.tx_bytes += (uint64_t)RD4(sc, CGEM_OCTETS_TX_TOP) << 32; + + sc->stats.tx_frames += RD4(sc, CGEM_FRAMES_TX); + sc->stats.tx_frames_bcast += RD4(sc, CGEM_BCAST_FRAMES_TX); + sc->stats.tx_frames_multi += RD4(sc, CGEM_MULTI_FRAMES_TX); + sc->stats.tx_frames_pause += RD4(sc, CGEM_PAUSE_FRAMES_TX); + sc->stats.tx_frames_64b += RD4(sc, CGEM_FRAMES_64B_TX); + sc->stats.tx_frames_65to127b += RD4(sc, CGEM_FRAMES_65_127B_TX); + sc->stats.tx_frames_128to255b += RD4(sc, CGEM_FRAMES_128_255B_TX); + sc->stats.tx_frames_256to511b += RD4(sc, CGEM_FRAMES_256_511B_TX); + sc->stats.tx_frames_512to1023b += RD4(sc, CGEM_FRAMES_512_1023B_TX); + sc->stats.tx_frames_1024to1536b += RD4(sc, CGEM_FRAMES_1024_1518B_TX); + sc->stats.tx_under_runs += RD4(sc, CGEM_TX_UNDERRUNS); + + n = RD4(sc, CGEM_SINGLE_COLL_FRAMES); + sc->stats.tx_single_collisn += n; + sc->ifp->if_collisions += n; + n = RD4(sc, CGEM_MULTI_COLL_FRAMES); + sc->stats.tx_multi_collisn += n; + sc->ifp->if_collisions += n; + n = RD4(sc, CGEM_EXCESSIVE_COLL_FRAMES); + sc->stats.tx_excsv_collisn += n; + sc->ifp->if_collisions += n; + n = RD4(sc, CGEM_LATE_COLL); + sc->stats.tx_late_collisn += n; + sc->ifp->if_collisions += n; + + sc->stats.tx_deferred_frames += RD4(sc, CGEM_DEFERRED_TX_FRAMES); + sc->stats.tx_carrier_sense_errs += RD4(sc, CGEM_CARRIER_SENSE_ERRS); + + sc->stats.rx_bytes += RD4(sc, CGEM_OCTETS_RX_BOT); + sc->stats.rx_bytes += (uint64_t)RD4(sc, CGEM_OCTETS_RX_TOP) << 32; + + sc->stats.rx_frames += RD4(sc, CGEM_FRAMES_RX); + sc->stats.rx_frames_bcast += RD4(sc, CGEM_BCAST_FRAMES_RX); + sc->stats.rx_frames_multi += RD4(sc, CGEM_MULTI_FRAMES_RX); + sc->stats.rx_frames_pause += RD4(sc, CGEM_PAUSE_FRAMES_RX); + sc->stats.rx_frames_64b += RD4(sc, CGEM_FRAMES_64B_RX); + sc->stats.rx_frames_65to127b += RD4(sc, CGEM_FRAMES_65_127B_RX); + sc->stats.rx_frames_128to255b += RD4(sc, CGEM_FRAMES_128_255B_RX); + sc->stats.rx_frames_256to511b += RD4(sc, CGEM_FRAMES_256_511B_RX); + sc->stats.rx_frames_512to1023b += RD4(sc, CGEM_FRAMES_512_1023B_RX); + sc->stats.rx_frames_1024to1536b += RD4(sc, CGEM_FRAMES_1024_1518B_RX); + sc->stats.rx_frames_undersize += RD4(sc, CGEM_UNDERSZ_RX); + sc->stats.rx_frames_oversize += RD4(sc, CGEM_OVERSZ_RX); + sc->stats.rx_frames_jabber += RD4(sc, CGEM_JABBERS_RX); + sc->stats.rx_frames_fcs_errs += RD4(sc, CGEM_FCS_ERRS); + sc->stats.rx_frames_length_errs += RD4(sc, CGEM_LENGTH_FIELD_ERRS); + sc->stats.rx_symbol_errs += RD4(sc, CGEM_RX_SYMBOL_ERRS); + sc->stats.rx_align_errs += RD4(sc, CGEM_ALIGN_ERRS); + sc->stats.rx_resource_errs += RD4(sc, CGEM_RX_RESOURCE_ERRS); + sc->stats.rx_overrun_errs += RD4(sc, CGEM_RX_OVERRUN_ERRS); + sc->stats.rx_ip_hdr_csum_errs += RD4(sc, CGEM_IP_HDR_CKSUM_ERRS); + sc->stats.rx_tcp_csum_errs += RD4(sc, CGEM_TCP_CKSUM_ERRS); + sc->stats.rx_udp_csum_errs += RD4(sc, CGEM_UDP_CKSUM_ERRS); +} + +static void cgem_tick(void *arg) { struct cgem_softc *sc = (struct cgem_softc *)arg; @@ -725,6 +876,23 @@ cgem_tick(void *arg) mii_tick(mii); } + /* Poll statistics registers. */ + cgem_poll_hw_stats(sc); + + /* Check for receiver hang. */ + if (sc->rxhangwar && sc->rx_frames_prev == sc->stats.rx_frames) { + /* + * Reset receiver logic by toggling RX_EN bit. 1usec + * delay is necessary especially when operating at 100mbps + * and 10mbps speeds. + */ + WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow & + ~CGEM_NET_CTRL_RX_EN); + DELAY(1); + WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow); + } + sc->rx_frames_prev = sc->stats.rx_frames; + /* Next callout in one second. */ callout_reset(&sc->tick_ch, hz, cgem_tick, sc); } @@ -743,33 +911,43 @@ cgem_intr(void *arg) return; } + /* Read interrupt status and immediately clear the bits. */ istatus = RD4(sc, CGEM_INTR_STAT); - WR4(sc, CGEM_INTR_STAT, istatus & - (CGEM_INTR_RX_COMPLETE | CGEM_INTR_TX_USED_READ | - CGEM_INTR_RX_OVERRUN | CGEM_INTR_HRESP_NOT_OK)); + WR4(sc, CGEM_INTR_STAT, istatus); + + /* Packets received. */ + if ((istatus & CGEM_INTR_RX_COMPLETE) != 0) + cgem_recv(sc); - /* Hresp not ok. Something very bad with DMA. Try to clear. */ + /* Free up any completed transmit buffers. */ + cgem_clean_tx(sc); + + /* Hresp not ok. Something is very bad with DMA. Try to clear. */ if ((istatus & CGEM_INTR_HRESP_NOT_OK) != 0) { - printf("cgem_intr: hresp not okay! rx_status=0x%x\n", - RD4(sc, CGEM_RX_STAT)); + device_printf(sc->dev, "cgem_intr: hresp not okay! " + "rx_status=0x%x\n", RD4(sc, CGEM_RX_STAT)); WR4(sc, CGEM_RX_STAT, CGEM_RX_STAT_HRESP_NOT_OK); } - /* Transmitter has idled. Free up any spent transmit buffers. */ - if ((istatus & CGEM_INTR_TX_USED_READ) != 0) - cgem_clean_tx(sc); + /* Receiver overrun. */ + if ((istatus & CGEM_INTR_RX_OVERRUN) != 0) { + /* Clear status bit. */ + WR4(sc, CGEM_RX_STAT, CGEM_RX_STAT_OVERRUN); + sc->rxoverruns++; + } - /* Packets received or overflow. */ - if ((istatus & (CGEM_INTR_RX_COMPLETE | CGEM_INTR_RX_OVERRUN)) != 0) { - cgem_recv(sc); + /* Receiver ran out of bufs. */ + if ((istatus & CGEM_INTR_RX_USED_READ) != 0) { + WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow | + CGEM_NET_CTRL_FLUSH_DPRAM_PKT); cgem_fill_rqueue(sc); - if ((istatus & CGEM_INTR_RX_OVERRUN) != 0) { - /* Clear rx status register. */ - sc->rxoverruns++; - WR4(sc, CGEM_RX_STAT, CGEM_RX_STAT_ALL); - } + sc->rxnobufs++; } + /* Restart transmitter if needed. */ + if (!IFQ_DRV_IS_EMPTY(&sc->ifp->if_snd)) + cgem_start_locked(sc->ifp); + CGEM_UNLOCK(sc); } @@ -806,6 +984,7 @@ cgem_config(struct cgem_softc *sc) { uint32_t net_cfg; uint32_t dma_cfg; + u_char *eaddr = IF_LLADDR(sc->ifp); CGEM_ASSERT_LOCKED(sc); @@ -815,6 +994,7 @@ cgem_config(struct cgem_softc *sc) CGEM_NET_CFG_FCS_REMOVE | CGEM_NET_CFG_RX_BUF_OFFSET(ETHER_ALIGN) | CGEM_NET_CFG_GIGE_EN | + CGEM_NET_CFG_1536RXEN | CGEM_NET_CFG_FULL_DUPLEX | CGEM_NET_CFG_SPEED100; @@ -828,7 +1008,8 @@ cgem_config(struct cgem_softc *sc) dma_cfg = CGEM_DMA_CFG_RX_BUF_SIZE(MCLBYTES) | CGEM_DMA_CFG_RX_PKTBUF_MEMSZ_SEL_8K | CGEM_DMA_CFG_TX_PKTBUF_MEMSZ_SEL | - CGEM_DMA_CFG_AHB_FIXED_BURST_LEN_16; + CGEM_DMA_CFG_AHB_FIXED_BURST_LEN_16 | + CGEM_DMA_CFG_DISC_WHEN_NO_AHB; /* Enable transmit checksum offloading? */ if ((sc->ifp->if_capenable & IFCAP_TXCSUM) != 0) @@ -844,10 +1025,16 @@ cgem_config(struct cgem_softc *sc) sc->net_ctl_shadow |= (CGEM_NET_CTRL_TX_EN | CGEM_NET_CTRL_RX_EN); WR4(sc, CGEM_NET_CTRL, sc->net_ctl_shadow); + /* Set receive address in case it changed. */ + WR4(sc, CGEM_SPEC_ADDR_LOW(0), (eaddr[3] << 24) | + (eaddr[2] << 16) | (eaddr[1] << 8) | eaddr[0]); + WR4(sc, CGEM_SPEC_ADDR_HI(0), (eaddr[5] << 8) | eaddr[4]); + /* Set up interrupts. */ WR4(sc, CGEM_INTR_EN, - CGEM_INTR_RX_COMPLETE | CGEM_INTR_TX_USED_READ | - CGEM_INTR_RX_OVERRUN | CGEM_INTR_HRESP_NOT_OK); + CGEM_INTR_RX_COMPLETE | CGEM_INTR_RX_OVERRUN | + CGEM_INTR_TX_USED_READ | CGEM_INTR_RX_USED_READ | + CGEM_INTR_HRESP_NOT_OK); } /* Turn on interface and load up receive ring with buffers. */ @@ -868,8 +1055,7 @@ cgem_init_locked(struct cgem_softc *sc) sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; mii = device_get_softc(sc->miibus); - mii_pollstat(mii); - cgem_start_locked(sc->ifp); + mii_mediachg(mii); callout_reset(&sc->tick_ch, hz, cgem_tick, sc); } @@ -932,6 +1118,9 @@ cgem_stop(struct cgem_softc *sc) sc->rxring_hd_ptr = 0; sc->rxring_tl_ptr = 0; sc->rxring_queued = 0; + + /* Force next statchg or linkchg to program net config register. */ + sc->mii_media_active = 0; } @@ -1021,6 +1210,11 @@ cgem_ioctl(struct ifnet *ifp, u_long cmd ~CGEM_NET_CFG_RX_CHKSUM_OFFLD_EN); } } + if ((ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_TXCSUM)) == + (IFCAP_RXCSUM | IFCAP_TXCSUM)) + ifp->if_capenable |= IFCAP_VLAN_HWCSUM; + else + ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; CGEM_UNLOCK(sc); break; @@ -1038,6 +1232,7 @@ static void cgem_child_detached(device_t dev, device_t child) { struct cgem_softc *sc = device_get_softc(dev); + if (child == sc->miibus) sc->miibus = NULL; } @@ -1047,12 +1242,18 @@ cgem_ifmedia_upd(struct ifnet *ifp) { struct cgem_softc *sc = (struct cgem_softc *) ifp->if_softc; struct mii_data *mii; - int error; + struct mii_softc *miisc; + int error = 0; mii = device_get_softc(sc->miibus); CGEM_LOCK(sc); - error = mii_mediachg(mii); + if ((ifp->if_flags & IFF_UP) != 0) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + } CGEM_UNLOCK(sc); + return (error); } @@ -1094,6 +1295,13 @@ cgem_miibus_readreg(device_t dev, int ph val = RD4(sc, CGEM_PHY_MAINT) & CGEM_PHY_MAINT_DATA_MASK; + if (reg == MII_EXTSR) + /* + * MAC does not support half-duplex at gig speeds. + * Let mii(4) exclude the capability. + */ + val &= ~(EXTSR_1000XHDX | EXTSR_1000THDX); + return (val); } @@ -1123,6 +1331,34 @@ cgem_miibus_writereg(device_t dev, int p return (0); } +static void +cgem_miibus_statchg(device_t dev) +{ + struct cgem_softc *sc = device_get_softc(dev); + struct mii_data *mii = device_get_softc(sc->miibus); + + CGEM_ASSERT_LOCKED(sc); + + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID) && + sc->mii_media_active != mii->mii_media_active) + cgem_mediachange(sc, mii); +} + +static void +cgem_miibus_linkchg(device_t dev) +{ + struct cgem_softc *sc = device_get_softc(dev); + struct mii_data *mii = device_get_softc(sc->miibus); + + CGEM_ASSERT_LOCKED(sc); + + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID) && + sc->mii_media_active != mii->mii_media_active) + cgem_mediachange(sc, mii); +} + /* * Overridable weak symbol cgem_set_ref_clk(). This allows platforms to * provide a function to set the cgem's reference clock. @@ -1135,49 +1371,226 @@ cgem_default_set_ref_clk(int unit, int f } __weak_reference(cgem_default_set_ref_clk, cgem_set_ref_clk); +/* Call to set reference clock and network config bits according to media. */ static void -cgem_miibus_statchg(device_t dev) +cgem_mediachange(struct cgem_softc *sc, struct mii_data *mii) { - struct cgem_softc *sc; - struct mii_data *mii; uint32_t net_cfg; int ref_clk_freq; - sc = device_get_softc(dev); - - mii = device_get_softc(sc->miibus); + CGEM_ASSERT_LOCKED(sc); - if ((mii->mii_media_status & IFM_AVALID) != 0) { - /* Update hardware to reflect phy status. */ - net_cfg = RD4(sc, CGEM_NET_CFG); - net_cfg &= ~(CGEM_NET_CFG_SPEED100 | CGEM_NET_CFG_GIGE_EN | - CGEM_NET_CFG_FULL_DUPLEX); - - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_1000_T: - net_cfg |= (CGEM_NET_CFG_SPEED100 | - CGEM_NET_CFG_GIGE_EN); - ref_clk_freq = 125000000; - break; - case IFM_100_TX: - net_cfg |= CGEM_NET_CFG_SPEED100; - ref_clk_freq = 25000000; - break; - default: - ref_clk_freq = 2500000; - } + /* Update hardware to reflect media. */ + net_cfg = RD4(sc, CGEM_NET_CFG); + net_cfg &= ~(CGEM_NET_CFG_SPEED100 | CGEM_NET_CFG_GIGE_EN | + CGEM_NET_CFG_FULL_DUPLEX); - if ((mii->mii_media_active & IFM_FDX) != 0) - net_cfg |= CGEM_NET_CFG_FULL_DUPLEX; - WR4(sc, CGEM_NET_CFG, net_cfg); - - /* Set the reference clock if necessary. */ - if (cgem_set_ref_clk(sc->ref_clk_num, ref_clk_freq)) - device_printf(dev, "could not set ref clk%d to %d.\n", - sc->ref_clk_num, ref_clk_freq); + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + net_cfg |= (CGEM_NET_CFG_SPEED100 | + CGEM_NET_CFG_GIGE_EN); + ref_clk_freq = 125000000; + break; + case IFM_100_TX: + net_cfg |= CGEM_NET_CFG_SPEED100; + ref_clk_freq = 25000000; + break; + default: + ref_clk_freq = 2500000; } + + if ((mii->mii_media_active & IFM_FDX) != 0) + net_cfg |= CGEM_NET_CFG_FULL_DUPLEX; + + WR4(sc, CGEM_NET_CFG, net_cfg); + + /* Set the reference clock if necessary. */ + if (cgem_set_ref_clk(sc->ref_clk_num, ref_clk_freq)) + device_printf(sc->dev, "cgem_mediachange: " + "could not set ref clk%d to %d.\n", + sc->ref_clk_num, ref_clk_freq); + + sc->mii_media_active = mii->mii_media_active; } +static void +cgem_add_sysctls(device_t dev) +{ + struct cgem_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child; + struct sysctl_oid *tree; + + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rxbufs", CTLFLAG_RW, + &sc->rxbufs, 0, + "Number receive buffers to provide"); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rxhangwar", CTLFLAG_RW, + &sc->rxhangwar, 0, + "Enable receive hang work-around"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_rxoverruns", CTLFLAG_RD, + &sc->rxoverruns, 0, + "Receive overrun events"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_rxnobufs", CTLFLAG_RD, + &sc->rxnobufs, 0, + "Receive buf queue empty events"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_rxdmamapfails", CTLFLAG_RD, + &sc->rxdmamapfails, 0, + "Receive DMA map failures"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_txfull", CTLFLAG_RD, + &sc->txfull, 0, + "Transmit ring full events"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_txdmamapfails", CTLFLAG_RD, + &sc->txdmamapfails, 0, + "Transmit DMA map failures"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_txdefrags", CTLFLAG_RD, + &sc->txdefrags, 0, + "Transmit m_defrag() calls"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "_txdefragfails", CTLFLAG_RD, + &sc->txdefragfails, 0, + "Transmit m_defrag() failures"); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "GEM statistics"); + child = SYSCTL_CHILDREN(tree); + + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_bytes", CTLFLAG_RD, + &sc->stats.tx_bytes, "Total bytes transmitted"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames", CTLFLAG_RD, + &sc->stats.tx_frames, 0, "Total frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_bcast", CTLFLAG_RD, + &sc->stats.tx_frames_bcast, 0, + "Number broadcast frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_multi", CTLFLAG_RD, + &sc->stats.tx_frames_multi, 0, + "Number multicast frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_pause", + CTLFLAG_RD, &sc->stats.tx_frames_pause, 0, + "Number pause frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_64b", CTLFLAG_RD, + &sc->stats.tx_frames_64b, 0, + "Number frames transmitted of size 64 bytes or less"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_65to127b", CTLFLAG_RD, + &sc->stats.tx_frames_65to127b, 0, + "Number frames transmitted of size 65-127 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_128to255b", + CTLFLAG_RD, &sc->stats.tx_frames_128to255b, 0, + "Number frames transmitted of size 128-255 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_256to511b", + CTLFLAG_RD, &sc->stats.tx_frames_256to511b, 0, + "Number frames transmitted of size 256-511 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_512to1023b", + CTLFLAG_RD, &sc->stats.tx_frames_512to1023b, 0, + "Number frames transmitted of size 512-1023 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_frames_1024to1536b", + CTLFLAG_RD, &sc->stats.tx_frames_1024to1536b, 0, + "Number frames transmitted of size 1024-1536 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_under_runs", + CTLFLAG_RD, &sc->stats.tx_under_runs, 0, + "Number transmit under-run events"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_single_collisn", + CTLFLAG_RD, &sc->stats.tx_single_collisn, 0, + "Number single-collision transmit frames"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_multi_collisn", + CTLFLAG_RD, &sc->stats.tx_multi_collisn, 0, + "Number multi-collision transmit frames"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_excsv_collisn", + CTLFLAG_RD, &sc->stats.tx_excsv_collisn, 0, + "Number excessive collision transmit frames"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_late_collisn", + CTLFLAG_RD, &sc->stats.tx_late_collisn, 0, + "Number late-collision transmit frames"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_deferred_frames", + CTLFLAG_RD, &sc->stats.tx_deferred_frames, 0, + "Number deferred transmit frames"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_carrier_sense_errs", + CTLFLAG_RD, &sc->stats.tx_carrier_sense_errs, 0, + "Number carrier sense errors on transmit"); + + SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "rx_bytes", CTLFLAG_RD, + &sc->stats.rx_bytes, "Total bytes received"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames", CTLFLAG_RD, + &sc->stats.rx_frames, 0, "Total frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_bcast", + CTLFLAG_RD, &sc->stats.rx_frames_bcast, 0, + "Number broadcast frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_multi", + CTLFLAG_RD, &sc->stats.rx_frames_multi, 0, + "Number multicast frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_pause", + CTLFLAG_RD, &sc->stats.rx_frames_pause, 0, + "Number pause frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_64b", + CTLFLAG_RD, &sc->stats.rx_frames_64b, 0, + "Number frames received of size 64 bytes or less"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_65to127b", + CTLFLAG_RD, &sc->stats.rx_frames_65to127b, 0, + "Number frames received of size 65-127 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_128to255b", + CTLFLAG_RD, &sc->stats.rx_frames_128to255b, 0, + "Number frames received of size 128-255 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_256to511b", + CTLFLAG_RD, &sc->stats.rx_frames_256to511b, 0, + "Number frames received of size 256-511 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_512to1023b", + CTLFLAG_RD, &sc->stats.rx_frames_512to1023b, 0, + "Number frames received of size 512-1023 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_1024to1536b", + CTLFLAG_RD, &sc->stats.rx_frames_1024to1536b, 0, + "Number frames received of size 1024-1536 bytes"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_undersize", + CTLFLAG_RD, &sc->stats.rx_frames_undersize, 0, + "Number undersize frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_oversize", + CTLFLAG_RD, &sc->stats.rx_frames_oversize, 0, + "Number oversize frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_jabber", + CTLFLAG_RD, &sc->stats.rx_frames_jabber, 0, + "Number jabber frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_fcs_errs", + CTLFLAG_RD, &sc->stats.rx_frames_fcs_errs, 0, + "Number frames received with FCS errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_length_errs", + CTLFLAG_RD, &sc->stats.rx_frames_length_errs, 0, + "Number frames received with length errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_symbol_errs", + CTLFLAG_RD, &sc->stats.rx_symbol_errs, 0, + "Number receive symbol errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_align_errs", + CTLFLAG_RD, &sc->stats.rx_align_errs, 0, + "Number receive alignment errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_resource_errs", + CTLFLAG_RD, &sc->stats.rx_resource_errs, 0, + "Number frames received when no rx buffer available"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_overrun_errs", + CTLFLAG_RD, &sc->stats.rx_overrun_errs, 0, + "Number frames received but not copied due to " + "receive overrun"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_ip_hdr_csum_errs", + CTLFLAG_RD, &sc->stats.rx_ip_hdr_csum_errs, 0, + "Number frames received with IP header checksum " + "errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_tcp_csum_errs", + CTLFLAG_RD, &sc->stats.rx_tcp_csum_errs, 0, + "Number frames received with TCP checksum errors"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_frames_udp_csum_errs", + CTLFLAG_RD, &sc->stats.rx_udp_csum_errs, 0, + "Number frames received with UDP checksum errors"); +} + + static int cgem_probe(device_t dev) { @@ -1227,24 +1640,43 @@ cgem_attach(device_t dev) return (ENOMEM); } + /* Set up ifnet structure. */ ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure\n"); cgem_detach(dev); return (ENOMEM); } + ifp->if_softc = sc; + if_initname(ifp, IF_CGEM_NAME, device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = cgem_start; + ifp->if_ioctl = cgem_ioctl; + ifp->if_init = cgem_init; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM; + /* Disable hardware checksumming by default. */ + ifp->if_hwassist = 0; + ifp->if_capenable = ifp->if_capabilities & + ~(IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_VLAN_HWCSUM); + ifp->if_snd.ifq_drv_maxlen = CGEM_NUM_TX_DESCS; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); - CGEM_LOCK(sc); + sc->if_old_flags = ifp->if_flags; + sc->rxbufs = DEFAULT_NUM_RX_BUFS; + sc->rxhangwar = 1; /* Reset hardware. */ + CGEM_LOCK(sc); cgem_reset(sc); + CGEM_UNLOCK(sc); /* Attach phy to mii bus. */ err = mii_attach(dev, &sc->miibus, ifp, cgem_ifmedia_upd, cgem_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (err) { - CGEM_UNLOCK(sc); device_printf(dev, "attaching PHYs failed\n"); cgem_detach(dev); return (err); @@ -1253,7 +1685,6 @@ cgem_attach(device_t dev) /* Set up TX and RX descriptor area. */ err = cgem_setup_descs(sc); if (err) { - CGEM_UNLOCK(sc); device_printf(dev, "could not set up dma mem for descs.\n"); cgem_detach(dev); return (ENOMEM); @@ -1265,50 +1696,18 @@ cgem_attach(device_t dev) /* Start ticks. */ callout_init_mtx(&sc->tick_ch, &sc->sc_mtx, 0); - /* Set up ifnet structure. */ - ifp->if_softc = sc; - if_initname(ifp, IF_CGEM_NAME, device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_start = cgem_start; - ifp->if_ioctl = cgem_ioctl; - ifp->if_init = cgem_init; - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; - /* XXX: disable hw checksumming for now. */ - ifp->if_hwassist = 0; - ifp->if_capenable = ifp->if_capabilities & - ~(IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6); - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; - IFQ_SET_READY(&ifp->if_snd); - - sc->if_old_flags = ifp->if_flags; - sc->rxbufs = DEFAULT_NUM_RX_BUFS; - ether_ifattach(ifp, eaddr); err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE | INTR_EXCL, NULL, cgem_intr, sc, &sc->intrhand); if (err) { - CGEM_UNLOCK(sc); device_printf(dev, "could not set interrupt handler.\n"); ether_ifdetach(ifp); cgem_detach(dev); return (err); } - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rxbufs", CTLFLAG_RW, - &sc->rxbufs, 0, - "Number receive buffers to provide"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "_rxoverruns", CTLFLAG_RD, - &sc->rxoverruns, 0, - "Receive ring overrun events"); - - CGEM_UNLOCK(sc); + cgem_add_sysctls(dev); return (0); } @@ -1336,7 +1735,7 @@ cgem_detach(device_t dev) sc->miibus = NULL; } - /* Release resrouces. */ + /* Release resources. */ if (sc->mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), sc->mem_res); @@ -1410,6 +1809,7 @@ static device_method_t cgem_methods[] = DEVMETHOD(miibus_readreg, cgem_miibus_readreg), DEVMETHOD(miibus_writereg, cgem_miibus_writereg), DEVMETHOD(miibus_statchg, cgem_miibus_statchg), + DEVMETHOD(miibus_linkchg, cgem_miibus_linkchg), DEVMETHOD_END }; Modified: head/sys/dev/cadence/if_cgem_hw.h ============================================================================== --- head/sys/dev/cadence/if_cgem_hw.h Wed Sep 3 17:32:17 2014 (r271045) +++ head/sys/dev/cadence/if_cgem_hw.h Wed Sep 3 17:51:03 2014 (r271046) @@ -90,6 +90,7 @@ #define CGEM_NET_CFG_PCS_SEL (1<<11) #define CGEM_NET_CFG_GIGE_EN (1<<10) #define CGEM_NET_CFG_EXT_ADDR_MATCH_EN (1<<9) +#define CGEM_NET_CFG_1536RXEN (1<<8) #define CGEM_NET_CFG_UNI_HASH_EN (1<<7) #define CGEM_NET_CFG_MULTI_HASH_EN (1<<6) #define CGEM_NET_CFG_NO_BCAST (1<<5) @@ -260,8 +261,8 @@ #define CGEM_FRAMES_256_511B_RX 0x174 /* 256-511 Byte Frames Rx'd */ #define CGEM_FRAMES_512_1023B_RX 0x178 /* 512-1023 Byte Frames Rx'd */ #define CGEM_FRAMES_1024_1518B_RX 0x17C /* 1024-1518 Byte Frames Rx'd*/ -#define CGEM_UNDERSZ_RX 0x180 /* Undersize Frames Rx'd */ -#define CGEM_OVERSZ_RX 0x184 /* Oversize Frames Rx'd */ +#define CGEM_UNDERSZ_RX 0x184 /* Undersize Frames Rx'd */ +#define CGEM_OVERSZ_RX 0x188 /* Oversize Frames Rx'd */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 18:51:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D86442C9; Wed, 3 Sep 2014 18:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C42D2138B; Wed, 3 Sep 2014 18:51:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83IpXMt089520; Wed, 3 Sep 2014 18:51:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83IpXDC089519; Wed, 3 Sep 2014 18:51:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409031851.s83IpXDC089519@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 3 Sep 2014 18:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271047 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 18:51:34 -0000 Author: emaste Date: Wed Sep 3 18:51:33 2014 New Revision: 271047 URL: http://svnweb.freebsd.org/changeset/base/271047 Log: Avoid ./ in zoneinfo entries in METALOG Use of "find ." resulted in METALOG entries with an extra ./ -- e.g., ./usr/share/zoneinfo/./America/Toronto. Avoid this by using globbing via "find *" instead. Reviewed by: brooks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D719 Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Wed Sep 3 17:51:03 2014 (r271046) +++ head/share/zoneinfo/Makefile Wed Sep 3 18:51:33 2014 (r271047) @@ -79,7 +79,7 @@ zoneinfo: yearistype ${TDATA} beforeinstall: cd ${TZBUILDDIR} && \ - find . -type f -print -exec ${INSTALL} \ + find * -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 19:01:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0607D57A; Wed, 3 Sep 2014 19:01:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E60BA14E8; Wed, 3 Sep 2014 19:01:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83J1Ysc093020; Wed, 3 Sep 2014 19:01:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83J1Yrw093019; Wed, 3 Sep 2014 19:01:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409031901.s83J1Yrw093019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 3 Sep 2014 19:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271048 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 19:01:35 -0000 Author: jhb Date: Wed Sep 3 19:01:34 2014 New Revision: 271048 URL: http://svnweb.freebsd.org/changeset/base/271048 Log: Always seek back to the beginning of a regular directory, even if the previous seek location was 0. Without this, readdir() would see dd_loc of zero and call getdirentries() which would start reading entries at the current seek location of the directory ignoring the first batch of entries. Also, rewinddir() should always seek so that it reads the directory from the beginning to get updated entries. PR: 192935 Reported by: iron@mail.ua MFC after: 3 days Modified: head/lib/libc/gen/rewinddir.c Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Wed Sep 3 18:51:33 2014 (r271047) +++ head/lib/libc/gen/rewinddir.c Wed Sep 3 19:01:34 2014 (r271048) @@ -53,7 +53,7 @@ rewinddir(dirp) _pthread_mutex_lock(&dirp->dd_lock); if (dirp->dd_flags & __DTF_READALL) _filldir(dirp, false); - else if (dirp->dd_seek != 0) { + else { (void) lseek(dirp->dd_fd, 0, SEEK_SET); dirp->dd_seek = 0; } From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 19:06:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ABF795C; Wed, 3 Sep 2014 19:06:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA63B1535; Wed, 3 Sep 2014 19:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83J68fU095464; Wed, 3 Sep 2014 19:06:08 GMT (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83J682P095463; Wed, 3 Sep 2014 19:06:08 GMT (envelope-from obrien@FreeBSD.org) Message-Id: <201409031906.s83J682P095463@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: obrien set sender to obrien@FreeBSD.org using -f From: "David E. O'Brien" Date: Wed, 3 Sep 2014 19:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271049 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 19:06:09 -0000 Author: obrien Date: Wed Sep 3 19:06:08 2014 New Revision: 271049 URL: http://svnweb.freebsd.org/changeset/base/271049 Log: Note that script(1) consumes filemon(4). Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Wed Sep 3 19:01:34 2014 (r271048) +++ head/share/man/man4/filemon.4 Wed Sep 3 19:06:08 2014 (r271049) @@ -165,6 +165,7 @@ buffer contents to it. .Sh SEE ALSO .Xr dtrace 1 , .Xr ktrace 1 , +.Xr script 1 , .Xr truss 1 , .Xr ioctl 2 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 19:10:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CFF3BF4; Wed, 3 Sep 2014 19:10:36 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CFCB815A9; Wed, 3 Sep 2014 19:10:35 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s83JASJb082101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Sep 2014 12:10:29 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s83JASop082100; Wed, 3 Sep 2014 12:10:28 -0700 (PDT) (envelope-from jmg) Date: Wed, 3 Sep 2014 12:10:28 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140903191028.GG71691@funkthat.com> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> <20140903094916.GO7693@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140903094916.GO7693@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 03 Sep 2014 12:10:29 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , kib@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 19:10:36 -0000 Gleb Smirnoff wrote this message on Wed, Sep 03, 2014 at 13:49 +0400: > Mateusz, Kostik, > > On Wed, Sep 03, 2014 at 10:55:23AM +0200, Mateusz Guzik wrote: > M> > Modified: head/sys/kern/kern_proc.c > M> > ============================================================================== > M> > --- head/sys/kern/kern_proc.c Wed Sep 3 08:13:46 2014 (r270998) > M> > +++ head/sys/kern/kern_proc.c Wed Sep 3 08:14:07 2014 (r270999) > M> > @@ -921,10 +921,11 @@ fill_kinfo_proc_only(struct proc *p, str > M> > kp->ki_xstat = p->p_xstat; > M> > kp->ki_acflag = p->p_acflag; > M> > kp->ki_lock = p->p_lock; > M> > - if (p->p_pptr) > M> > + if (p->p_pptr) { > M> > kp->ki_ppid = proc_realparent(p)->p_pid; > M> > - if (p->p_flag & P_TRACED) > M> > - kp->ki_tracer = p->p_pptr->p_pid; > M> > + if (p->p_flag & P_TRACED) > M> > + kp->ki_tracer = p->p_pptr->p_pid; > M> > + } > M> > } > M> > > M> > /* > M> > > M> > M> p_pptr must be non-NULL if P_TRACED is set. If there is no way to > M> annotate it for coverity, this change deserves a comment in the code > M> (and in retrospect previous code should have had appropriate comment as > M> well). > > Thanks for explanation. > > I'd suggest to leave the change in, since now it is a micro-micro-optimization :) If you must leave it in, then at least compare the pointer against NULL, and collapse two if statements into one... We should never introduce new pointer checks that aren't against NULL... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 19:37:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6F3A2A2; Wed, 3 Sep 2014 19:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D297719FA; Wed, 3 Sep 2014 19:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83JbgTB009954; Wed, 3 Sep 2014 19:37:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83JbfV5009941; Wed, 3 Sep 2014 19:37:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409031937.s83JbfV5009941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Sep 2014 19:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271050 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 19:37:43 -0000 Author: ian Date: Wed Sep 3 19:37:41 2014 New Revision: 271050 URL: http://svnweb.freebsd.org/changeset/base/271050 Log: Remove DIAGNOSTIC from the kernel config of low-end arm systems. Sanity checks such as vmem_check() can make a low-end system go completely unresponsive for as much as 3 seconds out of every 10. Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DB-78XXX Wed Sep 3 19:37:41 2014 (r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING options ALT_BREAK_TO_DEBUGGER options DDB #options DEADLKRES # Enable the deadlock resolver -options DIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DB-88F5XXX Wed Sep 3 19:37:41 2014 (r271050) @@ -43,7 +43,7 @@ options NO_SWAPPING options ALT_BREAK_TO_DEBUGGER options DDB #options DEADLKRES # Enable the deadlock resolver -options DIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DB-88F6XXX Wed Sep 3 19:37:41 2014 (r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING options ALT_BREAK_TO_DEBUGGER options DDB #options DEADLKRES # Enable the deadlock resolver -options DIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DOCKSTAR Wed Sep 3 19:37:41 2014 (r271050) @@ -145,7 +145,7 @@ options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER options DDB options KDB -options DIAGNOSTIC +#options DIAGNOSTIC options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/DREAMPLUG-1001 Wed Sep 3 19:37:41 2014 (r271050) @@ -153,7 +153,7 @@ options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER options DDB options KDB -options DIAGNOSTIC +#options DIAGNOSTIC options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Wed Sep 3 19:06:08 2014 (r271049) +++ head/sys/arm/conf/EA3250 Wed Sep 3 19:37:41 2014 (r271050) @@ -44,7 +44,7 @@ options NO_SWAPPING options ALT_BREAK_TO_DEBUGGER options DDB #options DEADLKRES # Enable the deadlock resolver -options DIAGNOSTIC +#options DIAGNOSTIC #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 20:06:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1257C63; Wed, 3 Sep 2014 20:06:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83C251D8C; Wed, 3 Sep 2014 20:06:28 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7F5B4B98D; Wed, 3 Sep 2014 16:06:27 -0400 (EDT) From: John Baldwin To: Nikolai Lifanov Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Wed, 03 Sep 2014 15:22:02 -0400 Message-ID: <2230377.GgKARkJyaG@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <54072E20.10802@mail.lifanov.com> References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 03 Sep 2014 16:06:27 -0400 (EDT) Cc: src-committers@freebsd.org, Peter Wemm , Alan Cox , svn-src-all@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" , Steven Hartland , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 20:06:28 -0000 On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: > On 09/03/14 04:09, Steven Hartland wrote: > > I'm looking to MFC this change so wanted to check if > > anyone had an final feedback / objections? > > > > I know we currently have Alan's feedback on changing > > the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC > > which sounds sensible but waiting Peter to comment on. > > > > Regards > > Steve > > I have no technical input, but this change improves ARC usefulness for > me quite a bit. I would like to see the improvement in 10-STABLE. Can you verify that the current 10-STABLE (as of today) with all the various pagedaemon fixes still has ARC issues for your workload? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 20:23:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1F626E3; Wed, 3 Sep 2014 20:23:09 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A36481F9C; Wed, 3 Sep 2014 20:23:09 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 82B091B3096; Wed, 3 Sep 2014 16:23:07 -0400 (EDT) Received: from [127.0.0.1] (vnat004.nandomedia.com [166.108.31.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id D79DA1B3095; Wed, 3 Sep 2014 16:22:59 -0400 (EDT) Message-ID: <540778A2.3080809@mail.lifanov.com> Date: Wed, 03 Sep 2014 16:22:58 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> <2230377.GgKARkJyaG@ralph.baldwin.cx> In-Reply-To: <2230377.GgKARkJyaG@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Peter Wemm , Alan Cox , svn-src-all@freebsd.org, Dmitry Morozovsky , "Matthew D. Fuller" , Steven Hartland , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 20:23:09 -0000 On 09/03/14 15:22, John Baldwin wrote: > On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: >> On 09/03/14 04:09, Steven Hartland wrote: >>> I'm looking to MFC this change so wanted to check if >>> anyone had an final feedback / objections? >>> >>> I know we currently have Alan's feedback on changing >>> the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC >>> which sounds sensible but waiting Peter to comment on. >>> >>> Regards >>> Steve >> >> I have no technical input, but this change improves ARC usefulness for >> me quite a bit. I would like to see the improvement in 10-STABLE. > > Can you verify that the current 10-STABLE (as of today) with all the various > pagedaemon fixes still has ARC issues for your workload? > It doesn't have any issues, but I noticed the improvement on CURRENT. I observed that just after this change, my package builder is much more likely to retain MFU and not evict useful things from there (the port tree) after large builds. However, I run a lot more 10.0-RELEASE than CURRENT and I would like to see this improvement release-bound. I would be happy to test this on 10-STABLE if you think that this is relevant. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 21:17:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0A8616B; Wed, 3 Sep 2014 21:17:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C63017DB; Wed, 3 Sep 2014 21:17:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83LH9k2069909; Wed, 3 Sep 2014 21:17:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83LH9na069907; Wed, 3 Sep 2014 21:17:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409032117.s83LH9na069907@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 3 Sep 2014 21:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271053 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:17:09 -0000 Author: jhb Date: Wed Sep 3 21:17:09 2014 New Revision: 271053 URL: http://svnweb.freebsd.org/changeset/base/271053 Log: Actually save and restore FPU state on APs during suspend and resume. Committed from: Atom-based HP netbook after resuming in X Modified: head/sys/i386/i386/mp_machdep.c Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Wed Sep 3 20:53:11 2014 (r271052) +++ head/sys/i386/i386/mp_machdep.c Wed Sep 3 21:17:09 2014 (r271053) @@ -1522,15 +1522,11 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { -#ifdef DEV_NPX - npxsuspend(&suspcbs[cpu]->pcb_fpususpend); -#endif + npxsuspend(&susppcbs[cpu]->pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { -#ifdef DEV_NPX - npxresume(&suspcbs[cpu]->pcb_fpususpend); -#endif + npxresume(&susppcbs[cpu]->pcb_fpususpend); pmap_init_pat(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 21:25:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D5AD485; Wed, 3 Sep 2014 21:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECFCE18EE; Wed, 3 Sep 2014 21:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83LPalk074443; Wed, 3 Sep 2014 21:25:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83LPahP074442; Wed, 3 Sep 2014 21:25:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409032125.s83LPahP074442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Sep 2014 21:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271054 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:25:37 -0000 Author: ian Date: Wed Sep 3 21:25:36 2014 New Revision: 271054 URL: http://svnweb.freebsd.org/changeset/base/271054 Log: When built with FDT support, add /boot/dtb to the list of search directories. Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Wed Sep 3 21:17:09 2014 (r271053) +++ head/sys/boot/common/module.c Wed Sep 3 21:25:36 2014 (r271054) @@ -66,7 +66,12 @@ static void moduledir_rebuild(void); /* load address should be tweaked by first module loaded (kernel) */ static vm_offset_t loadaddr = 0; +#if defined(LOADER_FDT_SUPPORT) +static const char *default_searchpath = + "/boot/kernel;/boot/modules;/boot/dtb"; +#else static const char *default_searchpath ="/boot/kernel;/boot/modules"; +#endif static STAILQ_HEAD(, moduledir) moduledir_list = STAILQ_HEAD_INITIALIZER(moduledir_list); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 21:45:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E4E6A6D; Wed, 3 Sep 2014 21:45:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3F771AD8; Wed, 3 Sep 2014 21:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83LjeeE084193; Wed, 3 Sep 2014 21:45:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83LjeCx084190; Wed, 3 Sep 2014 21:45:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409032145.s83LjeCx084190@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 3 Sep 2014 21:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271055 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:45:41 -0000 Author: ian Date: Wed Sep 3 21:45:39 2014 New Revision: 271055 URL: http://svnweb.freebsd.org/changeset/base/271055 Log: Add a function to get the frequency of the AHB bus. Another stopgap function until we have full clock support for imx6. Modified: head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx_ccmvar.h Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx51_ccm.c Wed Sep 3 21:45:39 2014 (r271055) @@ -580,3 +580,10 @@ imx_ccm_uart_hz(void) return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT)); } + +uint32_t +imx_ccm_ahb_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_AHB_CLK_ROOT)); +} Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx6_ccm.c Wed Sep 3 21:45:39 2014 (r271055) @@ -238,6 +238,12 @@ imx_ccm_uart_hz(void) return (80000000); } +uint32_t +imx_ccm_ahb_hz(void) +{ + return (132000000); +} + static device_method_t ccm_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ccm_probe), Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Wed Sep 3 21:25:36 2014 (r271054) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Wed Sep 3 21:45:39 2014 (r271055) @@ -47,6 +47,7 @@ uint32_t imx_ccm_ipg_hz(void); uint32_t imx_ccm_perclk_hz(void); uint32_t imx_ccm_sdhci_hz(void); uint32_t imx_ccm_uart_hz(void); +uint32_t imx_ccm_ahb_hz(void); void imx_ccm_usb_enable(device_t _usbdev); void imx_ccm_usbphy_enable(device_t _phydev); From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 21:01:48 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93F8591D; Wed, 3 Sep 2014 21:01:48 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8631519; Wed, 3 Sep 2014 21:01:46 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA18421; Thu, 04 Sep 2014 00:01:24 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XPHgC-000HFw-HD; Thu, 04 Sep 2014 00:01:24 +0300 Message-ID: <5407816B.9000401@FreeBSD.org> Date: Thu, 04 Sep 2014 00:00:27 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Nikolai Lifanov , John Baldwin Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> <2230377.GgKARkJyaG@ralph.baldwin.cx> <540778A2.3080809@mail.lifanov.com> In-Reply-To: <540778A2.3080809@mail.lifanov.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 03 Sep 2014 21:56:57 +0000 Cc: src-committers@FreeBSD.org, Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , Steven Hartland , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:01:48 -0000 on 03/09/2014 23:22 Nikolai Lifanov said the following: > On 09/03/14 15:22, John Baldwin wrote: >> On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: >>> On 09/03/14 04:09, Steven Hartland wrote: >>>> I'm looking to MFC this change so wanted to check if >>>> anyone had an final feedback / objections? >>>> >>>> I know we currently have Alan's feedback on changing >>>> the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC >>>> which sounds sensible but waiting Peter to comment on. >>>> >>>> Regards >>>> Steve >>> >>> I have no technical input, but this change improves ARC usefulness for >>> me quite a bit. I would like to see the improvement in 10-STABLE. >> >> Can you verify that the current 10-STABLE (as of today) with all the various >> pagedaemon fixes still has ARC issues for your workload? >> > > It doesn't have any issues, but I noticed the improvement on CURRENT. I > observed that just after this change, my package builder is much more > likely to retain MFU and not evict useful things from there (the port > tree) after large builds. > However, I run a lot more 10.0-RELEASE than CURRENT and I would like to > see this improvement release-bound. > > I would be happy to test this on 10-STABLE if you think that this is > relevant. As noted before, unfortunately, this commit (plus its fixups) contains at least two related but distinct changes. So, to separate the wheat from the chaff, could you please try to comment out the following block in sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c, function arc_reclaim_needed: if (kmem_free_count() < zfs_arc_free_target) { DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, kmem_free_count(), uint64_t, zfs_arc_free_target); return (1); } Alternatively, I think that the same effect can be achieved by setting sysctl vfs.zfs.arc_free_target to the same value as vm.stats.vm.v_free_min. It's interesting to me whether you would still see the better performance or if that improvement would be undone. Thanks! -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Sep 3 21:59:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA2C9D2; Wed, 3 Sep 2014 21:59:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB59D1C10; Wed, 3 Sep 2014 21:59:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s83Lx8ms089457; Wed, 3 Sep 2014 21:59:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s83Lx8fh089455; Wed, 3 Sep 2014 21:59:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409032159.s83Lx8fh089455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 3 Sep 2014 21:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271057 - in head: etc/mtree share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:59:09 -0000 Author: imp Date: Wed Sep 3 21:59:07 2014 New Revision: 271057 URL: http://svnweb.freebsd.org/changeset/base/271057 Log: Create a /boot/dtb directory to house DTB blobs. The flattened device tree support includes a device tree source compiler dtc(8) which converts .dts files into .dtb files. /boot/loader will load dtb files from this directory by default, allowing for fewer differences between images for different SoCs. Compiled dts files will wind up here eventually as an alternative to embedding them into the kernel. Document this in hier(7), as well as add missing entries for /boot/firmware and /boot/zfs, though the latter two should only be considered place holders if someone wants to make them better. Modified: head/etc/mtree/BSD.root.dist head/share/man/man7/hier.7 Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Wed Sep 3 21:57:06 2014 (r271056) +++ head/etc/mtree/BSD.root.dist Wed Sep 3 21:59:07 2014 (r271057) @@ -10,6 +10,8 @@ boot defaults .. + dtb + .. firmware .. kernel Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Wed Sep 3 21:57:06 2014 (r271056) +++ head/share/man/man7/hier.7 Wed Sep 3 21:59:07 2014 (r271057) @@ -48,13 +48,25 @@ programs and configuration files used du .It Pa defaults/ default bootstrapping configuration files; see .Xr loader.conf 5 +.It Pa dtb/ +Compiled flattened device tree (FDT) files; see +.Xr fdt 4 +and +.Xr dtc 1 +.It Pa firmware/ +Loadable modules containing binary firmware for hardware that needs +firmware downloaded to it to function .It Pa kernel/ pure kernel executable (the operating system loaded into memory -at boot time). +at boot time) .It Pa modules/ third-party loadable kernel modules; see .Xr kldstat 8 +.It Pa zfs/ +Contains +.Xr zfs 8 +zpool cache files. .El .It Pa /cdrom/ default mount point for CD-ROM drives From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 00:10:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C71FA344; Thu, 4 Sep 2014 00:10:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B324E1CA8; Thu, 4 Sep 2014 00:10:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s840A6Hm052682; Thu, 4 Sep 2014 00:10:06 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s840A6Jf052681; Thu, 4 Sep 2014 00:10:06 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201409040010.s840A6Jf052681@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 4 Sep 2014 00:10:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271070 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 00:10:06 -0000 Author: benno Date: Thu Sep 4 00:10:06 2014 New Revision: 271070 URL: http://svnweb.freebsd.org/changeset/base/271070 Log: Add KASSERTs to catch the case where a developer may have forgotten to set bo_bsize on a bufobj. This is a slight modification of the patch provided. PR: 193146 Submitted by: Conrad Meyer Sponsored by: EMC Isilon Storage Division Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Sep 3 23:29:06 2014 (r271069) +++ head/sys/kern/vfs_bio.c Thu Sep 4 00:10:06 2014 (r271070) @@ -2971,6 +2971,7 @@ bp_unmapped_get_kva(struct buf *bp, dadd * if the buffer was mapped. */ bsize = vn_isdisk(bp->b_vp, NULL) ? DEV_BSIZE : bp->b_bufobj->bo_bsize; + KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); offset = blkno * bsize; maxsize = size + (offset & PAGE_MASK); maxsize = imax(maxsize, bsize); @@ -3220,6 +3221,7 @@ loop: return NULL; bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; + KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); offset = blkno * bsize; vmio = vp->v_object != NULL; if (vmio) { From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 01:04:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20A20192; Thu, 4 Sep 2014 01:04:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A2E1239; Thu, 4 Sep 2014 01:04:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8414bBB079686; Thu, 4 Sep 2014 01:04:37 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8414bar079685; Thu, 4 Sep 2014 01:04:37 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201409040104.s8414bar079685@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 4 Sep 2014 01:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271073 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 01:04:38 -0000 Author: yongari Date: Thu Sep 4 01:04:37 2014 New Revision: 271073 URL: http://svnweb.freebsd.org/changeset/base/271073 Log: Do not blindly announce 1000baseT half-duplex capability in autonegotiation. Some controllers like cgem(4) do not support half-duplex at gigabit speeds. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Thu Sep 4 00:43:27 2014 (r271072) +++ head/sys/dev/mii/e1000phy.c Thu Sep 4 01:04:37 2014 (r271073) @@ -169,8 +169,12 @@ e1000phy_attach(device_t dev) PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & sc->mii_capmask; - if (sc->mii_capabilities & BMSR_EXTSTAT) + if (sc->mii_capabilities & BMSR_EXTSTAT) { sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + sc->mii_flags |= MIIF_HAVE_GTCR; + } device_printf(dev, " "); mii_phy_add_media(sc); printf("\n"); @@ -319,8 +323,7 @@ e1000phy_service(struct mii_softc *sc, s speed = 0; switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_1000_T: - if ((sc->mii_extcapabilities & - (EXTSR_1000TFDX | EXTSR_1000THDX)) == 0) + if ((sc->mii_flags & MIIF_HAVE_GTCR) == 0) return (EINVAL); speed = E1000_CR_SPEED_1000; break; @@ -357,10 +360,9 @@ e1000phy_service(struct mii_softc *sc, s if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { gig |= E1000_1GCR_MS_ENABLE; - if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) gig |= E1000_1GCR_MS_VALUE; - } else if ((sc->mii_extcapabilities & - (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + } else if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) gig = 0; PHY_WRITE(sc, E1000_1GCR, gig); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); @@ -485,9 +487,14 @@ e1000phy_mii_phy_auto(struct mii_softc * PHY_WRITE(sc, E1000_AR, reg | E1000_AR_SELECTOR_FIELD); } else PHY_WRITE(sc, E1000_AR, E1000_FA_1000X_FD | E1000_FA_1000X); - if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, - E1000_1GCR_1000T_FD | E1000_1GCR_1000T); + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { + reg = 0; + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) + reg |= E1000_1GCR_1000T_FD; + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) + reg |= E1000_1GCR_1000T; + PHY_WRITE(sc, E1000_1GCR, reg); + } PHY_WRITE(sc, E1000_CR, E1000_CR_AUTO_NEG_ENABLE | E1000_CR_RESTART_AUTO_NEG); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 01:18:42 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13B54565; Thu, 4 Sep 2014 01:18:42 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id A01011335; Thu, 4 Sep 2014 01:18:41 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 2614C20E7088A; Thu, 4 Sep 2014 01:18:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE,TVD_FINGER_02 autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 734B020E70885; Thu, 4 Sep 2014 01:18:31 +0000 (UTC) Message-ID: <86292055B4114529874B693EEB441CB6@multiplay.co.uk> From: "Steven Hartland" To: "Andriy Gapon" , "Nikolai Lifanov" , "John Baldwin" References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> <2230377.GgKARkJyaG@ralph.baldwin.cx> <540778A2.3080809@mail.lifanov.com> <5407816B.9000401@FreeBSD.org> Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm Date: Thu, 4 Sep 2014 02:18:33 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Mailman-Approved-At: Thu, 04 Sep 2014 01:19:57 +0000 Cc: src-committers@FreeBSD.org, Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 01:18:42 -0000 ----- Original Message ----- From: "Andriy Gapon" > on 03/09/2014 23:22 Nikolai Lifanov said the following: >> On 09/03/14 15:22, John Baldwin wrote: >>> On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: >>>> On 09/03/14 04:09, Steven Hartland wrote: >>>>> I'm looking to MFC this change so wanted to check if >>>>> anyone had an final feedback / objections? >>>>> >>>>> I know we currently have Alan's feedback on changing >>>>> the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC >>>>> which sounds sensible but waiting Peter to comment on. >>>>> >>>>> Regards >>>>> Steve >>>> >>>> I have no technical input, but this change improves ARC usefulness for >>>> me quite a bit. I would like to see the improvement in 10-STABLE. >>> >>> Can you verify that the current 10-STABLE (as of today) with all the various >>> pagedaemon fixes still has ARC issues for your workload? >>> >> >> It doesn't have any issues, but I noticed the improvement on CURRENT. I >> observed that just after this change, my package builder is much more >> likely to retain MFU and not evict useful things from there (the port >> tree) after large builds. >> However, I run a lot more 10.0-RELEASE than CURRENT and I would like to >> see this improvement release-bound. >> >> I would be happy to test this on 10-STABLE if you think that this is >> relevant. > > > As noted before, unfortunately, this commit (plus its fixups) contains at least > two related but distinct changes. So, to separate the wheat from the chaff, > could you please try to comment out the following block in > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c, function arc_reclaim_needed: > > if (kmem_free_count() < zfs_arc_free_target) { > DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, > kmem_free_count(), uint64_t, zfs_arc_free_target); > return (1); > } > > Alternatively, I think that the same effect can be achieved by setting sysctl > vfs.zfs.arc_free_target to the same value as vm.stats.vm.v_free_min. Thats correct that would achieve the same thing. > It's interesting to me whether you would still see the better performance or if > that improvement would be undone. Indeed that would be interesting, but we might find that its quite memory size dependent given the scaling so confirming HW details would be nice too. I'd also be interested to know who wins the free race between the VM and ARC when using that value. For those following this thread but not the review, I've added some additional information there which you might be interested in: https://reviews.freebsd.org/D702 Regards Steve From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 01:21:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFD2A6BC; Thu, 4 Sep 2014 01:21:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBD4A13CD; Thu, 4 Sep 2014 01:21:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s841LXMS088087; Thu, 4 Sep 2014 01:21:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s841LXRq088086; Thu, 4 Sep 2014 01:21:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409040121.s841LXRq088086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 4 Sep 2014 01:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271074 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 01:21:34 -0000 Author: mjg Date: Thu Sep 4 01:21:33 2014 New Revision: 271074 URL: http://svnweb.freebsd.org/changeset/base/271074 Log: Plug a hypothetical use after free in sysctl kern.proc.groups. MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Sep 4 01:04:37 2014 (r271073) +++ head/sys/kern/kern_proc.c Thu Sep 4 01:21:33 2014 (r271074) @@ -2508,6 +2508,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A return (EINVAL); if (*pidp == -1) { /* -1 means this process */ p = req->td->td_proc; + PROC_LOCK(p); } else { error = pget(*pidp, PGET_CANSEE, &p); if (error != 0) @@ -2515,8 +2516,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A } cred = crhold(p->p_ucred); - if (*pidp != -1) - PROC_UNLOCK(p); + PROC_UNLOCK(p); error = SYSCTL_OUT(req, cred->cr_groups, cred->cr_ngroups * sizeof(gid_t)); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 01:46:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49464B1D; Thu, 4 Sep 2014 01:46:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29449173B; Thu, 4 Sep 2014 01:46:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s841k9iA098250; Thu, 4 Sep 2014 01:46:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s841k7uo098240; Thu, 4 Sep 2014 01:46:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409040146.s841k7uo098240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 01:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 01:46:09 -0000 Author: jhb Date: Thu Sep 4 01:46:06 2014 New Revision: 271076 URL: http://svnweb.freebsd.org/changeset/base/271076 Log: - Move prototypes for various functions into out of C files and into . - Move some CPU-related variables out of i386/i386/identcpu.c to initcpu.c to match amd64. - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. - Remove a misleading comment from i386/i386/initcpu.c (locore zeros the BSS before it calls identify_cpu()) and remove explicit zero assignments to reduce the diff with amd64. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/include/md_var.h head/sys/i386/i386/identcpu.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/machdep.c head/sys/i386/i386/trap.c head/sys/i386/include/md_var.h head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) @@ -64,15 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* XXX - should be in header file: */ -void printcpuinfo(void); -void identify_cpu(void); -void earlysetcpuclass(void); -void panicifcpuunsupported(void); - static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); -static void print_AMD_assoc(int i); static void print_via_padlock_info(void); static void print_vmx_info(void); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/amd64/machdep.c Thu Sep 4 01:46:06 2014 (r271076) @@ -151,10 +151,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern u_int64_t hammer_time(u_int64_t, u_int64_t); -extern void printcpuinfo(void); /* XXX header file */ -extern void identify_cpu(void); -extern void panicifcpuunsupported(void); - #define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) #define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/amd64/include/md_var.h Thu Sep 4 01:46:06 2014 (r271076) @@ -105,14 +105,17 @@ void fsbase_load_fault(void) __asm(__STR void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault)); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); +void identify_cpu(void); void initializecpu(void); void initializecpucache(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); +void panicifcpuunsupported(void); void pagecopy(void *from, void *to); void pagezero(void *addr); +void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); int user_dbreg_trap(void); void minidumpsys(struct dumperinfo *); Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) @@ -64,30 +64,16 @@ __FBSDID("$FreeBSD$"); #define IDENTBLUE_IBMCPU 1 #define IDENTBLUE_CYRIXM2 2 -/* XXX - should be in header file: */ -void printcpuinfo(void); -void finishidentcpu(void); -void earlysetcpuclass(void); -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) -void enable_K5_wt_alloc(void); -void enable_K6_wt_alloc(void); -void enable_K6_2_wt_alloc(void); -#endif -void panicifcpuunsupported(void); - static void identifycyrix(void); static void init_exthigh(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); -static void print_AMD_assoc(int i); static void print_transmeta_info(void); static void print_via_padlock_info(void); int cpu_class; -u_int cpu_exthigh; /* Highest arg to extended CPUID */ -u_int cyrix_did; /* Device ID of Cyrix CPU */ char machine[] = MACHINE; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); @@ -161,10 +147,6 @@ static struct { #endif }; -#if defined(I586_CPU) && !defined(NO_F00F_HACK) -int has_f00f_bug = 0; /* Initialized so that it can be patched. */ -#endif - static void init_exthigh(void) { Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/i386/initcpu.c Thu Sep 4 01:46:06 2014 (r271076) @@ -48,12 +48,6 @@ __FBSDID("$FreeBSD$"); #define CPU_ENABLE_SSE #endif -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) -void enable_K5_wt_alloc(void); -void enable_K6_wt_alloc(void); -void enable_K6_2_wt_alloc(void); -#endif - #ifdef I486_CPU static void init_5x86(void); static void init_bluelightning(void); @@ -81,36 +75,36 @@ SYSCTL_INT(_hw, OID_AUTO, instruction_ss */ static int hw_clflush_disable = -1; -/* Must *NOT* be BSS or locore will bzero these after setting them */ -int cpu = 0; /* Are we 386, 386sx, 486, etc? */ -u_int cpu_feature = 0; /* Feature flags */ -u_int cpu_feature2 = 0; /* Feature flags */ -u_int amd_feature = 0; /* AMD feature flags */ -u_int amd_feature2 = 0; /* AMD feature flags */ -u_int amd_pminfo = 0; /* AMD advanced power management info */ -u_int via_feature_rng = 0; /* VIA RNG features */ -u_int via_feature_xcrypt = 0; /* VIA ACE features */ -u_int cpu_high = 0; /* Highest arg to CPUID */ -u_int cpu_id = 0; /* Stepping ID */ -u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ -u_int cpu_procinfo2 = 0; /* Multicore info */ -char cpu_vendor[20] = ""; /* CPU Origin code */ -u_int cpu_vendor_id = 0; /* CPU vendor ID */ +int cpu; /* Are we 386, 386sx, 486, etc? */ +u_int cpu_feature; /* Feature flags */ +u_int cpu_feature2; /* Feature flags */ +u_int amd_feature; /* AMD feature flags */ +u_int amd_feature2; /* AMD feature flags */ +u_int amd_pminfo; /* AMD advanced power management info */ +u_int via_feature_rng; /* VIA RNG features */ +u_int via_feature_xcrypt; /* VIA ACE features */ +u_int cpu_high; /* Highest arg to CPUID */ +u_int cpu_exthigh; /* Highest arg to extended CPUID */ +u_int cpu_id; /* Stepping ID */ +u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ +u_int cpu_procinfo2; /* Multicore info */ +char cpu_vendor[20]; /* CPU Origin code */ +u_int cpu_vendor_id; /* CPU vendor ID */ +#ifdef CPU_ENABLE_SSE +u_int cpu_fxsr; /* SSE enabled */ +u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +#endif u_int cpu_clflush_line_size = 32; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ +u_int cyrix_did; /* Device ID of Cyrix CPU */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, &via_feature_xcrypt, 0, "VIA xcrypt feature available in CPU"); -#ifdef CPU_ENABLE_SSE -u_int cpu_fxsr; /* SSE enabled */ -u_int cpu_mxcsr_mask; /* valid bits in mxcsr */ -#endif - #ifdef I486_CPU /* * IBM Blue Lightning Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/i386/machdep.c Thu Sep 4 01:46:06 2014 (r271076) @@ -180,10 +180,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern void init386(int first); extern void dblfault_handler(void); -extern void printcpuinfo(void); /* XXX header file */ -extern void finishidentcpu(void); -extern void panicifcpuunsupported(void); - #define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) #define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) @@ -1665,10 +1661,6 @@ struct gate_descriptor *idt = &idt0[0]; struct region_descriptor r_gdt, r_idt; /* table descriptors */ struct mtx dt_lock; /* lock for GDT and LDT */ -#if defined(I586_CPU) && !defined(NO_F00F_HACK) -extern int has_f00f_bug; -#endif - static struct i386tss dblfault_tss; static char dblfault_stack[PAGE_SIZE]; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/i386/trap.c Thu Sep 4 01:46:06 2014 (r271076) @@ -153,7 +153,7 @@ static char *trap_msg[] = { }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) -extern int has_f00f_bug; +int has_f00f_bug = 0; /* Initialized so that it can be patched. */ #endif #ifdef KDB Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/i386/include/md_var.h Thu Sep 4 01:46:06 2014 (r271076) @@ -56,10 +56,13 @@ extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; -extern u_int cyrix_did; extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; +extern u_int cyrix_did; +#if defined(I586_CPU) && !defined(NO_F00F_HACK) +extern int has_f00f_bug; +#endif extern char kstack[]; extern char sigcode[]; extern int szsigcode; @@ -94,15 +97,23 @@ void doreti_popl_fs(void) __asm(__STRING void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); -void initializecpu(void); +void finishidentcpu(void); +#if defined(I586_CPU) && defined(CPU_WT_ALLOC) +void enable_K5_wt_alloc(void); +void enable_K6_wt_alloc(void); +void enable_K6_2_wt_alloc(void); +#endif void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); +void initializecpu(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); vm_paddr_t kvtop(void *addr); +void panicifcpuunsupported(void); +void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); int user_dbreg_trap(void); void minidumpsys(struct dumperinfo *); Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Sep 4 01:38:31 2014 (r271075) +++ head/sys/pc98/pc98/machdep.c Thu Sep 4 01:46:06 2014 (r271076) @@ -149,10 +149,6 @@ CTASSERT(offsetof(struct pcpu, pc_curthr extern void init386(int first); extern void dblfault_handler(void); -extern void printcpuinfo(void); /* XXX header file */ -extern void finishidentcpu(void); -extern void panicifcpuunsupported(void); - #define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) #define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 01:56:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00F93CC1; Thu, 4 Sep 2014 01:56:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0D8D1811; Thu, 4 Sep 2014 01:56:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s841uFNS002930; Thu, 4 Sep 2014 01:56:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s841uFl5002928; Thu, 4 Sep 2014 01:56:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409040156.s841uFl5002928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 01:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271077 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 01:56:16 -0000 Author: jhb Date: Thu Sep 4 01:56:15 2014 New Revision: 271077 URL: http://svnweb.freebsd.org/changeset/base/271077 Log: Remove trailing whitespace. Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) +++ head/sys/amd64/amd64/identcpu.c Thu Sep 4 01:56:15 2014 (r271077) @@ -97,11 +97,11 @@ SYSCTL_PROC(_hw, HW_MACHINE, machine, CT NULL, 0, sysctl_hw_machine, "A", "Machine class"); static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); static int hw_clockrate; -SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, +SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); static eventhandler_tag tsc_post_tag; @@ -686,15 +686,15 @@ print_AMD_info(void) printf("L2 unified cache: %d kbytes", regs[2] >> 16); printf(", %d bytes/line", regs[2] & 0xff); printf(", %d lines/tag", (regs[2] >> 8) & 0x0f); - print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); + print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); } /* - * Opteron Rev E shows a bug as in very rare occasions a read memory - * barrier is not performed as expected if it is followed by a - * non-atomic read-modify-write instruction. + * Opteron Rev E shows a bug as in very rare occasions a read memory + * barrier is not performed as expected if it is followed by a + * non-atomic read-modify-write instruction. * As long as that bug pops up very rarely (intensive machine usage - * on other operating systems generally generates one unexplainable + * on other operating systems generally generates one unexplainable * crash any 2 months) and as long as a model specific fix would be * impratical at this stage, print out a warning string if the broken * model and family are identified. @@ -910,7 +910,7 @@ print_vmx_info(void) "\012single" /* INVVPID single-context type */ "\013all" /* INVVPID all-context type */ /* INVVPID single-context-retaining-globals type */ - "\014single-globals" + "\014single-globals" ); } } Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Thu Sep 4 01:46:06 2014 (r271076) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 01:56:15 2014 (r271077) @@ -75,15 +75,15 @@ static void print_via_padlock_info(void) int cpu_class; char machine[] = MACHINE; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); static int hw_clockrate; -SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, +SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); static eventhandler_tag tsc_post_tag; @@ -1270,7 +1270,7 @@ print_AMD_info(void) printf("L2 internal cache: %d kbytes", regs[2] >> 16); printf(", %d bytes/line", regs[2] & 0xff); printf(", %d lines/tag", (regs[2] >> 8) & 0x0f); - print_AMD_assoc((regs[2] >> 12) & 0x0f); + print_AMD_assoc((regs[2] >> 12) & 0x0f); } } if (((cpu_id & 0xf00) == 0x500) From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 02:06:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6751F91; Thu, 4 Sep 2014 02:06:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28FC18E8; Thu, 4 Sep 2014 02:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8426XIO007619; Thu, 4 Sep 2014 02:06:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8426Xp3007618; Thu, 4 Sep 2014 02:06:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409040206.s8426Xp3007618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 4 Sep 2014 02:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271078 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 02:06:34 -0000 Author: gjb Date: Thu Sep 4 02:06:33 2014 New Revision: 271078 URL: http://svnweb.freebsd.org/changeset/base/271078 Log: Fix typo: s/_maske/_mask/ MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Thu Sep 4 01:56:15 2014 (r271077) +++ head/etc/rc.d/jail Thu Sep 4 02:06:33 2014 (r271078) @@ -319,7 +319,7 @@ jail_extract_address() _mask=${_mask:-/32} elif [ "${_type}" = "inet6" ]; then - # In case _maske is not set for IPv6, use /128. + # In case _mask is not set for IPv6, use /128. _mask=${_mask:-/128} warn "$_type $_addr: an IPv6 address should always be " \ "specified with a prefix length. /128 is used." From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 02:26:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C22CA6A5; Thu, 4 Sep 2014 02:26:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADCE51ACC; Thu, 4 Sep 2014 02:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s842Q0rv016946; Thu, 4 Sep 2014 02:26:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s842Q0VE016942; Thu, 4 Sep 2014 02:26:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409040226.s842Q0VE016942@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 02:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271082 - in head/sys: i386/i386 x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 02:26:00 -0000 Author: jhb Date: Thu Sep 4 02:25:59 2014 New Revision: 271082 URL: http://svnweb.freebsd.org/changeset/base/271082 Log: - Move blacklists of broken TSCs out of the printcpuinfo() function and into the TSC probe routine. - Initialize cpu_exthigh once in finishidentcpu() which is called before printcpuinfo() (and matches the behavior on amd64). Modified: head/sys/i386/i386/identcpu.c head/sys/x86/x86/tsc.c Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Thu Sep 4 02:14:57 2014 (r271081) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 02:25:59 2014 (r271082) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #define IDENTBLUE_CYRIXM2 2 static void identifycyrix(void); -static void init_exthigh(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); @@ -147,28 +146,6 @@ static struct { #endif }; -static void -init_exthigh(void) -{ - static int done = 0; - u_int regs[4]; - - if (done == 0) { - if (cpu_high > 0 && - (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD || - cpu_vendor_id == CPU_VENDOR_TRANSMETA || - cpu_vendor_id == CPU_VENDOR_CENTAUR || - cpu_vendor_id == CPU_VENDOR_NSC)) { - do_cpuid(0x80000000, regs); - if (regs[0] >= 0x80000000) - cpu_exthigh = regs[0]; - } - - done = 1; - } -} - void printcpuinfo(void) { @@ -180,7 +157,6 @@ printcpuinfo(void) strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof (cpu_model)); /* Check for extended CPUID information and a processor name. */ - init_exthigh(); if (cpu_exthigh >= 0x80000004) { brand = cpu_brand; for (i = 0x80000002; i < 0x80000005; i++) { @@ -354,7 +330,6 @@ printcpuinfo(void) break; case 0x500: strcat(cpu_model, "K5 model 0"); - tsc_freq = 0; break; case 0x510: strcat(cpu_model, "K5 model 1"); @@ -553,13 +528,6 @@ printcpuinfo(void) switch (cpu_id & 0xff0) { case 0x540: strcpy(cpu_model, "IDT WinChip C6"); - /* - * http://www.centtech.com/c6_data_sheet.pdf - * - * I-12 RDTSC may return incoherent values in EDX:EAX - * I-13 RDTSC hangs when certain event counters are used - */ - tsc_freq = 0; break; case 0x580: strcpy(cpu_model, "IDT WinChip 2"); @@ -599,8 +567,6 @@ printcpuinfo(void) case 0x540: strcpy(cpu_model, "Geode SC1100"); cpu = CPU_GEODE1100; - if ((cpu_id & CPUID_STEPPING) == 0) - tsc_freq = 0; break; default: strcpy(cpu_model, "Geode/NSC unknown"); @@ -1110,10 +1076,20 @@ finishidentcpu(void) cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; } + if (cpu_high > 0 && + (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_TRANSMETA || + cpu_vendor_id == CPU_VENDOR_CENTAUR || + cpu_vendor_id == CPU_VENDOR_NSC)) { + do_cpuid(0x80000000, regs); + if (regs[0] >= 0x80000000) + cpu_exthigh = regs[0]; + } + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD) { - init_exthigh(); if (cpu_exthigh >= 0x80000001) { do_cpuid(0x80000001, regs); amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); @@ -1128,7 +1104,6 @@ finishidentcpu(void) cpu_procinfo2 = regs[2]; } } else if (cpu_vendor_id == CPU_VENDOR_CENTAUR) { - init_exthigh(); if (cpu_exthigh >= 0x80000001) { do_cpuid(0x80000001, regs); amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Thu Sep 4 02:14:57 2014 (r271081) +++ head/sys/x86/x86/tsc.c Thu Sep 4 02:25:59 2014 (r271082) @@ -324,6 +324,39 @@ init_TSC(void) if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) return; +#ifdef __i386__ + /* The TSC is known to be broken on certain CPUs. */ + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + switch (cpu_id & 0xFF0) { + case 0x500: + /* K5 Model 0 */ + return; + } + break; + case CPU_VENDOR_CENTAUR: + switch (cpu_id & 0xff0) { + case 0x540: + /* + * http://www.centtech.com/c6_data_sheet.pdf + * + * I-12 RDTSC may return incoherent values in EDX:EAX + * I-13 RDTSC hangs when certain event counters are used + */ + return; + } + break; + case CPU_VENDOR_NSC: + switch (cpu_id & 0xff0) { + case 0x540: + if ((cpu_id & CPUID_STEPPING) == 0) + return; + break; + } + break; + } +#endif + probe_tsc_freq(); /* From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 02:28:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89EF0888; Thu, 4 Sep 2014 02:28:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 678A71AE5; Thu, 4 Sep 2014 02:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s842SIp9017273; Thu, 4 Sep 2014 02:28:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s842SIdk017272; Thu, 4 Sep 2014 02:28:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409040228.s842SIdk017272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 02:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271083 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 02:28:18 -0000 Author: jhb Date: Thu Sep 4 02:28:17 2014 New Revision: 271083 URL: http://svnweb.freebsd.org/changeset/base/271083 Log: Remove a stray blank line from the Intel cache and TLB info. Modified: head/sys/i386/i386/identcpu.c Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Thu Sep 4 02:25:59 2014 (r271082) +++ head/sys/i386/i386/identcpu.c Thu Sep 4 02:28:17 2014 (r271083) @@ -1327,11 +1327,9 @@ print_INTEL_info(void) nway = 1 << (nwaycode / 2); else nway = 0; - printf("\nL2 cache: %u kbytes, %u-way associative, %u bytes/line", + printf("L2 cache: %u kbytes, %u-way associative, %u bytes/line\n", (regs[2] >> 16) & 0xffff, nway, regs[2] & 0xff); } - - printf("\n"); } static void @@ -1343,160 +1341,160 @@ print_INTEL_TLB(u_int data) default: break; case 0x1: - printf("\nInstruction TLB: 4 KB pages, 4-way set associative, 32 entries"); + printf("Instruction TLB: 4 KB pages, 4-way set associative, 32 entries\n"); break; case 0x2: - printf("\nInstruction TLB: 4 MB pages, fully associative, 2 entries"); + printf("Instruction TLB: 4 MB pages, fully associative, 2 entries\n"); break; case 0x3: - printf("\nData TLB: 4 KB pages, 4-way set associative, 64 entries"); + printf("Data TLB: 4 KB pages, 4-way set associative, 64 entries\n"); break; case 0x4: - printf("\nData TLB: 4 MB Pages, 4-way set associative, 8 entries"); + printf("Data TLB: 4 MB Pages, 4-way set associative, 8 entries\n"); break; case 0x6: - printf("\n1st-level instruction cache: 8 KB, 4-way set associative, 32 byte line size"); + printf("1st-level instruction cache: 8 KB, 4-way set associative, 32 byte line size\n"); break; case 0x8: - printf("\n1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size"); + printf("1st-level instruction cache: 16 KB, 4-way set associative, 32 byte line size\n"); break; case 0xa: - printf("\n1st-level data cache: 8 KB, 2-way set associative, 32 byte line size"); + printf("1st-level data cache: 8 KB, 2-way set associative, 32 byte line size\n"); break; case 0xc: - printf("\n1st-level data cache: 16 KB, 4-way set associative, 32 byte line size"); + printf("1st-level data cache: 16 KB, 4-way set associative, 32 byte line size\n"); break; case 0x22: - printf("\n3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size"); + printf("3rd-level cache: 512 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x23: - printf("\n3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size"); + printf("3rd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x25: - printf("\n3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size"); + printf("3rd-level cache: 2 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x29: - printf("\n3rd-level cache: 4 MB, 8-way set associative, sectored cache, 64 byte line size"); + printf("3rd-level cache: 4 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x2c: - printf("\n1st-level data cache: 32 KB, 8-way set associative, 64 byte line size"); + printf("1st-level data cache: 32 KB, 8-way set associative, 64 byte line size\n"); break; case 0x30: - printf("\n1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size"); + printf("1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size\n"); break; case 0x39: - printf("\n2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 128 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x3b: - printf("\n2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 128 KB, 2-way set associative, sectored cache, 64 byte line size\n"); break; case 0x3c: - printf("\n2nd-level cache: 256 KB, 4-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 256 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x41: - printf("\n2nd-level cache: 128 KB, 4-way set associative, 32 byte line size"); + printf("2nd-level cache: 128 KB, 4-way set associative, 32 byte line size\n"); break; case 0x42: - printf("\n2nd-level cache: 256 KB, 4-way set associative, 32 byte line size"); + printf("2nd-level cache: 256 KB, 4-way set associative, 32 byte line size\n"); break; case 0x43: - printf("\n2nd-level cache: 512 KB, 4-way set associative, 32 byte line size"); + printf("2nd-level cache: 512 KB, 4-way set associative, 32 byte line size\n"); break; case 0x44: - printf("\n2nd-level cache: 1 MB, 4-way set associative, 32 byte line size"); + printf("2nd-level cache: 1 MB, 4-way set associative, 32 byte line size\n"); break; case 0x45: - printf("\n2nd-level cache: 2 MB, 4-way set associative, 32 byte line size"); + printf("2nd-level cache: 2 MB, 4-way set associative, 32 byte line size\n"); break; case 0x46: - printf("\n3rd-level cache: 4 MB, 4-way set associative, 64 byte line size"); + printf("3rd-level cache: 4 MB, 4-way set associative, 64 byte line size\n"); break; case 0x47: - printf("\n3rd-level cache: 8 MB, 8-way set associative, 64 byte line size"); + printf("3rd-level cache: 8 MB, 8-way set associative, 64 byte line size\n"); break; case 0x50: - printf("\nInstruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 64 entries"); + printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 64 entries\n"); break; case 0x51: - printf("\nInstruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 128 entries"); + printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 128 entries\n"); break; case 0x52: - printf("\nInstruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 256 entries"); + printf("Instruction TLB: 4 KB, 2 MB or 4 MB pages, fully associative, 256 entries\n"); break; case 0x5b: - printf("\nData TLB: 4 KB or 4 MB pages, fully associative, 64 entries"); + printf("Data TLB: 4 KB or 4 MB pages, fully associative, 64 entries\n"); break; case 0x5c: - printf("\nData TLB: 4 KB or 4 MB pages, fully associative, 128 entries"); + printf("Data TLB: 4 KB or 4 MB pages, fully associative, 128 entries\n"); break; case 0x5d: - printf("\nData TLB: 4 KB or 4 MB pages, fully associative, 256 entries"); + printf("Data TLB: 4 KB or 4 MB pages, fully associative, 256 entries\n"); break; case 0x60: - printf("\n1st-level data cache: 16 KB, 8-way set associative, sectored cache, 64 byte line size"); + printf("1st-level data cache: 16 KB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x66: - printf("\n1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte line size"); + printf("1st-level data cache: 8 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x67: - printf("\n1st-level data cache: 16 KB, 4-way set associative, sectored cache, 64 byte line size"); + printf("1st-level data cache: 16 KB, 4-way set associative, sectored cache, 64 byte line size\n"); break; case 0x68: - printf("\n1st-level data cache: 32 KB, 4 way set associative, sectored cache, 64 byte line size"); + printf("1st-level data cache: 32 KB, 4 way set associative, sectored cache, 64 byte line size\n"); break; case 0x70: - printf("\nTrace cache: 12K-uops, 8-way set associative"); + printf("Trace cache: 12K-uops, 8-way set associative\n"); break; case 0x71: - printf("\nTrace cache: 16K-uops, 8-way set associative"); + printf("Trace cache: 16K-uops, 8-way set associative\n"); break; case 0x72: - printf("\nTrace cache: 32K-uops, 8-way set associative"); + printf("Trace cache: 32K-uops, 8-way set associative\n"); break; case 0x78: - printf("\n2nd-level cache: 1 MB, 4-way set associative, 64-byte line size"); + printf("2nd-level cache: 1 MB, 4-way set associative, 64-byte line size\n"); break; case 0x79: - printf("\n2nd-level cache: 128 KB, 8-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 128 KB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x7a: - printf("\n2nd-level cache: 256 KB, 8-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 256 KB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x7b: - printf("\n2nd-level cache: 512 KB, 8-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 512 KB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x7c: - printf("\n2nd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size"); + printf("2nd-level cache: 1 MB, 8-way set associative, sectored cache, 64 byte line size\n"); break; case 0x7d: - printf("\n2nd-level cache: 2-MB, 8-way set associative, 64-byte line size"); + printf("2nd-level cache: 2-MB, 8-way set associative, 64-byte line size\n"); break; case 0x7f: - printf("\n2nd-level cache: 512-KB, 2-way set associative, 64-byte line size"); + printf("2nd-level cache: 512-KB, 2-way set associative, 64-byte line size\n"); break; case 0x82: - printf("\n2nd-level cache: 256 KB, 8-way set associative, 32 byte line size"); + printf("2nd-level cache: 256 KB, 8-way set associative, 32 byte line size\n"); break; case 0x83: - printf("\n2nd-level cache: 512 KB, 8-way set associative, 32 byte line size"); + printf("2nd-level cache: 512 KB, 8-way set associative, 32 byte line size\n"); break; case 0x84: - printf("\n2nd-level cache: 1 MB, 8-way set associative, 32 byte line size"); + printf("2nd-level cache: 1 MB, 8-way set associative, 32 byte line size\n"); break; case 0x85: - printf("\n2nd-level cache: 2 MB, 8-way set associative, 32 byte line size"); + printf("2nd-level cache: 2 MB, 8-way set associative, 32 byte line size\n"); break; case 0x86: - printf("\n2nd-level cache: 512 KB, 4-way set associative, 64 byte line size"); + printf("2nd-level cache: 512 KB, 4-way set associative, 64 byte line size\n"); break; case 0x87: - printf("\n2nd-level cache: 1 MB, 8-way set associative, 64 byte line size"); + printf("2nd-level cache: 1 MB, 8-way set associative, 64 byte line size\n"); break; case 0xb0: - printf("\nInstruction TLB: 4 KB Pages, 4-way set associative, 128 entries"); + printf("Instruction TLB: 4 KB Pages, 4-way set associative, 128 entries\n"); break; case 0xb3: - printf("\nData TLB: 4 KB Pages, 4-way set associative, 128 entries"); + printf("Data TLB: 4 KB Pages, 4-way set associative, 128 entries\n"); break; } } From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 02:37:34 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 152A8A7F; Thu, 4 Sep 2014 02:37:34 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C63A1BDC; Thu, 4 Sep 2014 02:37:33 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s842bLJn092072; Wed, 3 Sep 2014 19:37:25 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201409040237.s842bLJn092072@gw.catspoiler.org> Date: Wed, 3 Sep 2014 19:37:21 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 To: jhb@FreeBSD.org In-Reply-To: <201409040146.s841k7uo098240@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 02:37:34 -0000 On 4 Sep, John Baldwin wrote: > Author: jhb > Date: Thu Sep 4 01:46:06 2014 > New Revision: 271076 > URL: http://svnweb.freebsd.org/changeset/base/271076 > > Log: > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. That certainly brings back memories ... From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 03:04:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0457E143; Thu, 4 Sep 2014 03:04:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E426B1F0F; Thu, 4 Sep 2014 03:04:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8434bBR036083; Thu, 4 Sep 2014 03:04:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8434b3m036081; Thu, 4 Sep 2014 03:04:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409040304.s8434b3m036081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 03:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271084 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 03:04:38 -0000 Author: ian Date: Thu Sep 4 03:04:37 2014 New Revision: 271084 URL: http://svnweb.freebsd.org/changeset/base/271084 Log: The imx5x and imx6 chips have an onboard IOMUX device which also contains a few "general purpose registers" whose values control chip behavior in ways that have nothing to do with IO pin mux control. Define a simple API that other soc-specific code can use to read and write the registers, and provide the imx51 implementation of them. Added: head/sys/arm/freescale/imx/imx_iomuxvar.h (contents, props changed) Modified: head/sys/arm/freescale/imx/imx51_iomux.c Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 02:28:17 2014 (r271083) +++ head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 03:04:37 2014 (r271084) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -216,6 +217,41 @@ iomux_input_config(const struct iomux_in } #endif +uint32_t +imx_iomux_gpr_get(u_int regnum) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_get() called before attach")); + KASSERT(regnum >= 0 && renum <= 1, + ("imx_iomux_gpr_get bad regnum %u", regnum)); + return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); +} + +void +imx_iomux_gpr_set(u_int regnum, uint32_t val) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set() called before attach")); + KASSERT(regnum >= 0 && renum <= 1, + ("imx_iomux_gpr_set bad regnum %u", regnum)); + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + +void +imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +{ + uint32_t val; + + KASSERT(iomuxsc != NULL, + ("imx_iomux_gpr_set_masked called before attach")); + KASSERT(regnum >= 0 && renum <= 1, + ("imx_iomux_gpr_set_masked bad regnum %u", regnum)); + + val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); + val = (val & ~clrbits) | setbits; + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + static device_method_t imx_iomux_methods[] = { DEVMETHOD(device_probe, iomux_probe), DEVMETHOD(device_attach, iomux_attach), Added: head/sys/arm/freescale/imx/imx_iomuxvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_iomuxvar.h Thu Sep 4 03:04:37 2014 (r271084) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * 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$ + */ + +#ifndef IMX_IOMUXVAR_H +#define IMX_IOMUXVAR_H + +/* + * The IOMUX Controller device has a small set of "general purpose registers" + * which control various aspects of SoC operation that really have nothing to do + * with IO pin assignments or pad control. These functions let other soc level + * code manipulate these values. + */ +uint32_t imx_iomux_gpr_get(u_int regnum); +void imx_iomux_gpr_set(u_int regnum, uint32_t val); +void imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits); + +#endif From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 03:31:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2591699; Thu, 4 Sep 2014 03:31:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8483A12C0; Thu, 4 Sep 2014 03:31:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s843VnsT048906; Thu, 4 Sep 2014 03:31:49 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s843Vn5c048905; Thu, 4 Sep 2014 03:31:49 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201409040331.s843Vn5c048905@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 4 Sep 2014 03:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271085 - head/lib/libgeom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 03:31:49 -0000 Author: benno Date: Thu Sep 4 03:31:48 2014 New Revision: 271085 URL: http://svnweb.freebsd.org/changeset/base/271085 Log: Systems with lots of geom providers can end up with a kern.geom.confxml value too large for the buffer allocated. Work around this by retrying a few times with larger buffer sizes. Submitted by: Scott Ferris Reviewed by: mlaier, ngie Sponsored by: EMC Isilon Storage Division Modified: head/lib/libgeom/geom_getxml.c Modified: head/lib/libgeom/geom_getxml.c ============================================================================== --- head/lib/libgeom/geom_getxml.c Thu Sep 4 03:04:37 2014 (r271084) +++ head/lib/libgeom/geom_getxml.c Thu Sep 4 03:31:48 2014 (r271085) @@ -31,10 +31,23 @@ #include #include +#include #include #include #include "libgeom.h" +/* + * Amount of extra space we allocate to try and anticipate the size of + * confxml. + */ +#define GEOM_GETXML_SLACK 4096 + +/* + * Number of times to retry in the face of the size of confxml exceeding + * that of our buffer. + */ +#define GEOM_GETXML_RETRIES 4 + char * geom_getxml(void) { @@ -42,19 +55,33 @@ geom_getxml(void) size_t l = 0; int mib[3]; size_t sizep; + int retries; sizep = sizeof(mib) / sizeof(*mib); if (sysctlnametomib("kern.geom.confxml", mib, &sizep) != 0) return (NULL); if (sysctl(mib, sizep, NULL, &l, NULL, 0) != 0) return (NULL); - l += 4096; - p = malloc(l); - if (p == NULL) - return (NULL); - if (sysctl(mib, sizep, p, &l, NULL, 0) != 0) { + l += GEOM_GETXML_SLACK; + + for (retries = 0; retries < GEOM_GETXML_RETRIES; retries++) { + p = malloc(l); + if (p == NULL) + return (NULL); + if (sysctl(mib, sizep, p, &l, NULL, 0) == 0) + return (reallocf(p, strlen(p) + 1)); + free(p); - return (NULL); + + if (errno != ENOMEM) + return (NULL); + + /* + * Our buffer wasn't big enough. Make it bigger and + * try again. + */ + l *= 2; } - return (reallocf(p, strlen(p) + 1)); + + return (NULL); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 09:07:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D622CA75; Thu, 4 Sep 2014 09:07:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1616196E; Thu, 4 Sep 2014 09:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8497EdK000778; Thu, 4 Sep 2014 09:07:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8497Emt000776; Thu, 4 Sep 2014 09:07:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409040907.s8497Emt000776@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 09:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271088 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 09:07:14 -0000 Author: glebius Date: Thu Sep 4 09:07:14 2014 New Revision: 271088 URL: http://svnweb.freebsd.org/changeset/base/271088 Log: Provide m_catpkt(), a wrapper around m_cat() that deals with M_PKTHDR mbufs. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Sep 4 06:07:32 2014 (r271087) +++ head/sys/kern/uipc_mbuf.c Thu Sep 4 09:07:14 2014 (r271088) @@ -990,6 +990,22 @@ m_cat(struct mbuf *m, struct mbuf *n) } } +/* + * Concatenate two pkthdr mbuf chains. + */ +void +m_catpkt(struct mbuf *m, struct mbuf *n) +{ + + M_ASSERTPKTHDR(m); + M_ASSERTPKTHDR(n); + + m->m_pkthdr.len += n->m_pkthdr.len; + m_demote(n, 1); + + m_cat(m, n); +} + void m_adj(struct mbuf *mp, int req_len) { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Sep 4 06:07:32 2014 (r271087) +++ head/sys/sys/mbuf.h Thu Sep 4 09:07:14 2014 (r271088) @@ -915,6 +915,7 @@ int m_apply(struct mbuf *, int, int, int (*)(void *, void *, u_int), void *); int m_append(struct mbuf *, int, c_caddr_t); void m_cat(struct mbuf *, struct mbuf *); +void m_catpkt(struct mbuf *, struct mbuf *); int m_extadd(struct mbuf *, caddr_t, u_int, void (*)(struct mbuf *, void *, void *), void *, void *, int, int, int); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 09:15:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0B19E39; Thu, 4 Sep 2014 09:15:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C4EF1A4A; Thu, 4 Sep 2014 09:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s849Fi9M005616; Thu, 4 Sep 2014 09:15:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s849FiTT005615; Thu, 4 Sep 2014 09:15:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409040915.s849FiTT005615@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 09:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271089 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 09:15:44 -0000 Author: glebius Date: Thu Sep 4 09:15:44 2014 New Revision: 271089 URL: http://svnweb.freebsd.org/changeset/base/271089 Log: Improve r265338. When inserting mbufs into TCP reassembly queue, try to collapse adjacent pieces using m_catpkt(). In best case scenario it copies data and frees mbufs, making mbuf exhaustion attack harder. Suggested by: Jonathan Looney Security: Hardens against remote mbuf exhaustion attack. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Sep 4 09:07:14 2014 (r271088) +++ head/sys/netinet/tcp_reass.c Thu Sep 4 09:15:44 2014 (r271089) @@ -214,16 +214,29 @@ tcp_reass(struct tcpcb *tp, struct tcphd mq = nq; } - /* Insert the new segment queue entry into place. */ + /* + * Insert the new segment queue entry into place. Try to collapse + * mbuf chains if segments are adjacent. + */ if (mp) { - m->m_nextpkt = mp->m_nextpkt; - mp->m_nextpkt = m; + if (M_TCPHDR(mp)->th_seq + mp->m_pkthdr.len == th->th_seq) + m_catpkt(mp, m); + else { + m->m_nextpkt = mp->m_nextpkt; + mp->m_nextpkt = m; + m->m_pkthdr.pkt_tcphdr = th; + } } else { - m->m_nextpkt = tp->t_segq; - tp->t_segq = m ; + mq = tp->t_segq; + tp->t_segq = m; + if (mq && th->th_seq + *tlenp == M_TCPHDR(mq)->th_seq) { + m->m_nextpkt = mq->m_nextpkt; + m_catpkt(m, mq); + } else + m->m_nextpkt = mq; + m->m_pkthdr.pkt_tcphdr = th; } - m->m_pkthdr.pkt_tcphdr = th; - tp->t_segqlen += m->m_pkthdr.len; + tp->t_segqlen += *tlenp; present: /* From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 09:18:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA19FFCA; Thu, 4 Sep 2014 09:18:48 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58A301A69; Thu, 4 Sep 2014 09:18:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s849IiGC011171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Sep 2014 13:18:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s849IiCh011170; Thu, 4 Sep 2014 13:18:44 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 4 Sep 2014 13:18:44 +0400 From: Gleb Smirnoff To: John-Mark Gurney Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140904091844.GC7693@FreeBSD.org> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> <20140903094916.GO7693@FreeBSD.org> <20140903191028.GG71691@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140903191028.GG71691@funkthat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , kib@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 09:18:49 -0000 On Wed, Sep 03, 2014 at 12:10:28PM -0700, John-Mark Gurney wrote: J> > M> > + if (p->p_pptr) { J> > M> > kp->ki_ppid = proc_realparent(p)->p_pid; J> > M> > - if (p->p_flag & P_TRACED) J> > M> > - kp->ki_tracer = p->p_pptr->p_pid; J> > M> > + if (p->p_flag & P_TRACED) J> > M> > + kp->ki_tracer = p->p_pptr->p_pid; J> > M> > + } J> > M> > } J> > M> > J> > M> > /* J> > M> > J> > M> J> > M> p_pptr must be non-NULL if P_TRACED is set. If there is no way to J> > M> annotate it for coverity, this change deserves a comment in the code J> > M> (and in retrospect previous code should have had appropriate comment as J> > M> well). J> > J> > Thanks for explanation. J> > J> > I'd suggest to leave the change in, since now it is a micro-micro-optimization :) J> J> If you must leave it in, then at least compare the pointer against J> NULL, and collapse two if statements into one... J> J> We should never introduce new pointer checks that aren't against NULL... I don't see how two if statements can be collapsed? We need to assign ki_ppid regardless of P_TRACED flag. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 12:44:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59781F0; Thu, 4 Sep 2014 12:44:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42E1C1180; Thu, 4 Sep 2014 12:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84CigWH003354; Thu, 4 Sep 2014 12:44:42 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84Cieb4003342; Thu, 4 Sep 2014 12:44:40 GMT (envelope-from br@FreeBSD.org) Message-Id: <201409041244.s84Cieb4003342@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 4 Sep 2014 12:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271093 - in head/sys: arm/altera arm/altera/socfpga arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 12:44:42 -0000 Author: br Date: Thu Sep 4 12:44:40 2014 New Revision: 271093 URL: http://svnweb.freebsd.org/changeset/base/271093 Log: Add initial support for Altera SOCFPGA (heterogeneous ARM/FPGA) SoC family. Include board configuration for Terasic SoCKit (Altera Cyclone V). Sponsored by: DARPA, AFRL Added: head/sys/arm/altera/ head/sys/arm/altera/socfpga/ head/sys/arm/altera/socfpga/files.socfpga (contents, props changed) head/sys/arm/altera/socfpga/socfpga_common.c (contents, props changed) head/sys/arm/altera/socfpga/socfpga_machdep.c (contents, props changed) head/sys/arm/altera/socfpga/std.socfpga (contents, props changed) head/sys/arm/conf/SOCKIT (contents, props changed) head/sys/boot/fdt/dts/arm/socfpga-sockit.dts (contents, props changed) head/sys/boot/fdt/dts/arm/socfpga.dtsi (contents, props changed) Added: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/files.socfpga Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +kern/kern_clocksource.c standard + +arm/arm/bus_space_generic.c standard +arm/arm/bus_space_asm_generic.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_arm10.S standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv7.S standard + +arm/arm/bus_space-v6.c standard +arm/arm/gic.c standard +arm/arm/mpcore_timer.c standard + +arm/altera/socfpga/socfpga_common.c standard +arm/altera/socfpga/socfpga_machdep.c standard Added: head/sys/arm/altera/socfpga/socfpga_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/socfpga_common.c Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define RESMAN_BASE 0xFFD05000 +#define RESMAN_CTRL 0x4 +#define SWWARMRSTREQ (1 << 1) + +void +cpu_reset(void) +{ + bus_addr_t vaddr; + + if (bus_space_map(fdtbus_bs_tag, RESMAN_BASE, 0x10, 0, &vaddr) == 0) { + bus_space_write_4(fdtbus_bs_tag, vaddr, + RESMAN_CTRL, SWWARMRSTREQ); + } + + while (1); +} + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "arm,gic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_pic_decode_ic, + NULL +}; Added: head/sys/arm/altera/socfpga/socfpga_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/socfpga_machdep.c Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,107 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_ddb.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +vm_offset_t +platform_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +platform_probe_and_attach(void) +{ + +} + +void +platform_gpio_init(void) +{ + +} + +void +platform_late_init(void) +{ + +} + +int +platform_devmap_init(void) +{ + + /* UART */ + arm_devmap_add_entry(0xffc00000, 0x100000); + + /* + * USB OTG + * + * We use static device map for USB due to some bug in the Altera + * which throws Translation Fault (P) exception on high load. + * It might be caused due to some power save options being turned + * on or something else. + */ + arm_devmap_add_entry(0xffb00000, 0x100000); + + return (0); +} + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + + return (0); +} Added: head/sys/arm/altera/socfpga/std.socfpga ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/std.socfpga Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +makeoption ARM_LITTLE_ENDIAN + +cpu CPU_CORTEXA +machine arm armv6 + +options PHYSADDR=0x00000000 + +makeoptions KERNPHYSADDR=0x00f00000 +options KERNPHYSADDR=0x00f00000 + +makeoptions KERNVIRTADDR=0xc0f00000 +options KERNVIRTADDR=0xc0f00000 + +options ARM_L2_PIPT + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../altera/socfpga/files.socfpga" Added: head/sys/arm/conf/SOCKIT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SOCKIT Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,136 @@ +# Kernel configuration for Terasic SoCKit (Altera Cyclone V SoC). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident SOCKIT +include "../altera/socfpga/std.socfpga" + +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options GEOM_PART_GPT # GUID partition tables +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +#options SMP + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device dwcotg + +device umass +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass + +# Serial ports +device uart +device uart_ns8250 + +# I2C (TWSI) +device iic +device iicbus + +# SPI +device spibus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=socfpga-sockit.dts Added: head/sys/boot/fdt/dts/arm/socfpga-sockit.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/socfpga-sockit.dts Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +/dts-v1/; + +/include/ "socfpga.dtsi" + +/ { + model = "Terasic SoCKit"; + compatible = "altr,socfpga-cyclone5", "altr,socfpga"; + + memory { + device_type = "memory"; + reg = < 0x00000000 0x40000000 >; /* 1G RAM */ + }; + + SOC: socfpga { + serial0: serial@ffc02000 { + status = "okay"; + }; + + usb1: usb@ffb40000 { + status = "okay"; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial0"; + stdout = "serial0"; + }; +}; Added: head/sys/boot/fdt/dts/arm/socfpga.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/socfpga.dtsi Thu Sep 4 12:44:40 2014 (r271093) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +/ { + compatible = "altr,socfpga"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&GIC>; + + aliases { + soc = &SOC; + serial0 = &serial0; + serial1 = &serial1; + }; + + SOC: socfpga { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@fffed000 { + compatible = "arm,gic"; + reg = < 0xfffed000 0x1000 >, /* Distributor */ + < 0xfffec100 0x100 >; /* CPU Interface */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + mp_tmr@40002100 { + compatible = "arm,mpcore-timers"; + clock-frequency = <200000000>; + #address-cells = <1>; + #size-cells = <0>; + reg = < 0xfffec200 0x100 >, /* Global Timer */ + < 0xfffec600 0x100 >; /* Private Timer */ + interrupts = < 27 29 >; + interrupt-parent = < &GIC >; + }; + + serial0: serial@ffc02000 { + compatible = "ns16550"; + reg = <0xffc02000 0x1000>; + reg-shift = <2>; + interrupts = <194>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 100000000 >; + status = "disabled"; + }; + + serial1: serial@ffc03000 { + compatible = "ns16550"; + reg = <0xffc03000 0x1000>; + reg-shift = <2>; + interrupts = <195>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 100000000 >; + status = "disabled"; + }; + + usb0: usb@ffb00000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0xffb00000 0xffff>; + interrupts = <157>; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + usb1: usb@ffb40000 { + compatible = "synopsys,designware-hs-otg2"; + reg = <0xffb40000 0xffff>; + interrupts = <160>; + interrupt-parent = <&GIC>; + dr_mode = "host"; + status = "disabled"; + }; + }; +}; From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 13:13:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9B008A0; Thu, 4 Sep 2014 13:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D511B1547; Thu, 4 Sep 2014 13:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84DDglk017512; Thu, 4 Sep 2014 13:13:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84DDgl0017511; Thu, 4 Sep 2014 13:13:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041313.s84DDgl0017511@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 13:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271094 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 13:13:43 -0000 Author: ian Date: Thu Sep 4 13:13:42 2014 New Revision: 271094 URL: http://svnweb.freebsd.org/changeset/base/271094 Log: Fix typo in variable name. Modified: head/sys/arm/freescale/imx/imx51_iomux.c Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 12:44:40 2014 (r271093) +++ head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 13:13:42 2014 (r271094) @@ -222,7 +222,7 @@ imx_iomux_gpr_get(u_int regnum) { KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_get() called before attach")); - KASSERT(regnum >= 0 && renum <= 1, + KASSERT(regnum >= 0 && regnum <= 1, ("imx_iomux_gpr_get bad regnum %u", regnum)); return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); } @@ -232,7 +232,7 @@ imx_iomux_gpr_set(u_int regnum, uint32_t { KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set() called before attach")); - KASSERT(regnum >= 0 && renum <= 1, + KASSERT(regnum >= 0 && regnum <= 1, ("imx_iomux_gpr_set bad regnum %u", regnum)); IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); } @@ -244,7 +244,7 @@ imx_iomux_gpr_set_masked(u_int regnum, u KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set_masked called before attach")); - KASSERT(regnum >= 0 && renum <= 1, + KASSERT(regnum >= 0 && regnum <= 1, ("imx_iomux_gpr_set_masked bad regnum %u", regnum)); val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:25:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3647B488; Thu, 4 Sep 2014 14:25:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2026C1EBF; Thu, 4 Sep 2014 14:25:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84EPWi2054175; Thu, 4 Sep 2014 14:25:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84EPW6i054170; Thu, 4 Sep 2014 14:25:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041425.s84EPW6i054170@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 14:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271097 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:25:33 -0000 Author: ian Date: Thu Sep 4 14:25:32 2014 New Revision: 271097 URL: http://svnweb.freebsd.org/changeset/base/271097 Log: Add a basic iomux driver for imx6. Submitted by: bsam@ Added: head/sys/arm/freescale/imx/imx6_iomux.c (contents, props changed) head/sys/arm/freescale/imx/imx6_iomuxreg.h (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx_iomuxvar.h Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 13:47:55 2014 (r271096) +++ head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 14:25:32 2014 (r271097) @@ -19,11 +19,12 @@ arm/arm/bus_space-v6.c standard arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard -arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx6_ccm.c standard +arm/freescale/imx/imx6_iomux.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard +arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio Added: head/sys/arm/freescale/imx/imx6_iomux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_iomux.c Thu Sep 4 14:25:32 2014 (r271097) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2014 Boris Samorodov + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include "imx6_iomuxreg.h" + +#define IOMUX_WRITE(_sc, _r, _v) \ + bus_write_4((_sc)->sc_res, (_r), (_v)) +#define IOMUX_READ(_sc, _r) \ + bus_read_4((_sc)->sc_res, (_r)) +#define IOMUX_SET(_sc, _r, _m) \ + IOMUX_WRITE((_sc), (_r), IOMUX_READ((_sc), (_r)) | (_m)) +#define IOMUX_CLEAR(_sc, _r, _m) \ + IOMUX_WRITE((_sc), (_r), IOMUX_READ((_sc), (_r)) & ~(_m)) + +struct imx6_iomux_softc { + struct resource *sc_res; + device_t sc_dev; +}; + +static struct imx6_iomux_softc *iomuxsc = NULL; + +static struct resource_spec imx6_iomux_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +imx6_iomux_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx6-iomux")) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 IO pins multiplexor"); + return (BUS_PROBE_DEFAULT); + +} + +static int +imx6_iomux_attach(device_t dev) +{ + struct imx6_iomux_softc * sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, imx6_iomux_spec, &sc->sc_res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + iomuxsc = sc; + + /* + * XXX: place to fetch all info about pinmuxing from loader data + * (FDT blob) and apply. Loader (1st one) must care about + * device-to-device difference. + */ + + return (0); +} + +static int +imx6_iomux_detach(device_t dev) +{ + + /* IOMUX registers are always accessible. */ + return (EBUSY); +} + +static void +iomux_set_pad_sub(struct imx6_iomux_softc *sc, uint32_t pin, uint32_t config) +{ + bus_size_t pad_ctl_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin); + + if (pad_ctl_reg != IOMUX_PAD_NONE) + IOMUX_WRITE(sc, pad_ctl_reg, config); +} + +void +iomux_set_pad(unsigned int pin, unsigned int config) +{ + + if (iomuxsc == NULL) + return; + iomux_set_pad_sub(iomuxsc, pin, config); +} + +static void +iomux_set_function_sub(struct imx6_iomux_softc *sc, uint32_t pin, uint32_t fn) +{ + bus_size_t mux_ctl_reg = IOMUX_PIN_TO_MUX_ADDRESS(pin); + + if (mux_ctl_reg != IOMUX_MUX_NONE) + IOMUX_WRITE(sc, mux_ctl_reg, fn); +} + +void +iomux_set_function(unsigned int pin, unsigned int fn) +{ + + if (iomuxsc == NULL) + return; + iomux_set_function_sub(iomuxsc, pin, fn); +} + +static uint32_t +iomux_get_pad_config_sub(struct imx6_iomux_softc *sc, uint32_t pin) +{ + bus_size_t pad_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin); + uint32_t result; + + result = IOMUX_READ(sc, pad_reg); + + return(result); +} + +unsigned int +iomux_get_pad_config(unsigned int pin) +{ + + return(iomux_get_pad_config_sub(iomuxsc, pin)); +} + +static device_method_t imx6_iomux_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx6_iomux_probe), + DEVMETHOD(device_attach, imx6_iomux_attach), + DEVMETHOD(device_detach, imx6_iomux_detach), + + DEVMETHOD_END +}; + +static driver_t imx6_iomux_driver = { + "imx6_iomux", + imx6_iomux_methods, + sizeof(struct imx6_iomux_softc), +}; + +static devclass_t imx6_iomux_devclass; + +EARLY_DRIVER_MODULE(imx6_iomux, simplebus, imx6_iomux_driver, + imx6_iomux_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_LATE); + + Added: head/sys/arm/freescale/imx/imx6_iomuxreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_iomuxreg.h Thu Sep 4 14:25:32 2014 (r271097) @@ -0,0 +1,798 @@ +/*- + * Copyright (c) 2014 Boris Samorodov + * 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$ + */ + +/* + * Pad : pin ("pin" is used at electric schemes, + * while at HW SOC it's named "pad"). + * Drive strength : the current that can be drawn with + * appropriate voltage (varies inversely with + * the supply impedance of the output pin). + * Drive strength enable (DSE) : The value of the current the pin uses. + * HiZ (HYZ) : high input impedance value. + * Daisy chain (DAISY) : the one after another interconnection of + * devices. + * On die termination (ODT) : the termination resistor for impedance + * matching. + * Software input on (SION) : the value to force the pin to be an input + * one (i.e. to force the pin state reading). + * Hysteresis (HYS) : Controls if the value of the input pin + * remains the same until a sufficient change + * is applied. + * Slow rate enable (SRE) : How slow the pin value changes (slow rate + * saves power). + * Open drain enable (ODE) : If the input pin drains on low input or + * goes down. + * Pull/keep enable (PKE) : Enables pull/keep functionality. + * PUll/keep select (PUE) : Selects if the pin is pullup/pulldown one + * or remains it's previous role. + * A note: I'm not sure why it's not PKS... + * Pullup (Pic.1)/pulldown (Pic.2): the pin's resistor connected to VCC (GND) + * to prevent random value drai. + * Pullup/pulldown select (PUS) : Selects the value of pullup/pulldown + * resistor. + * Open drain (Pic.3) : the output signal is applied to the base + * of a transistor whose collector is used + * as a pin. + * + * VCC o VCC o Open drain + * | | ----> pin + * +++ o| / + * | | R | Switch / + * +++ pullup o| .---. + * | | / |/ \ + * >---+------> Pin >---+------> Pin >---{--| ) + * | | \ |\ / + * o| +++ `--v' + * | Switch | | R \ + * o| +++ pulldown | + * | | | + * ----- ----- ----- + * --- --- --- + * - - - + * + * Pic.1 Pic.2 Pic.3 + */ + +#ifndef IMX6_IOMUXREG_H +#define IMX6_IOMUXREG_H + +/* + * Multiplex control + */ +#define IOMUXC_MUX_CTL 0x004c +#define IOMUX_CONFIG_SION (1<<4) +#define IOMUX_CONFIG_ALT0 0 +#define IOMUX_CONFIG_ALT1 1 +#define IOMUX_CONFIG_ALT2 2 +#define IOMUX_CONFIG_ALT3 3 +#define IOMUX_CONFIG_ALT4 4 +#define IOMUX_CONFIG_ALT5 5 +#define IOMUX_CONFIG_ALT6 6 +#define IOMUX_CONFIG_ALT7 7 + +/* + * Pad control + */ +#define IOMUXC_PAD_CTL 0x0360 + /* DDR Select Field */ +#define PAD_CTL_DDR_SEL_0 (0x0<<18) +#define PAD_CTL_DDR_SEL_1 (0x1<<18) +#define PAD_CTL_DDR_SEL_2 (0x2<<18) +#define PAD_CTL_DDR_SEL_3 (0x3<<18) +#define PAD_CTL_DDR_INPUT (0x1<<17) /* DDR/CMOS Input Mode Field */ +#define PAD_CTL_HYS (1<<16) /* Hysteresis Enable Field */ + /* PullUp/Down Config Field: */ +#define PAD_CTL_PUS_100K_PD (0x0<<14) /* 100K Ohm Pull Down */ +#define PAD_CTL_PUS_47K_PU (0x1<<14) /* 47K Ohn Pull Up */ +#define PAD_CTL_PUS_100K_PU (0x2<<14) /* 100K Ohm Pull Up */ +#define PAD_CTL_PUS_22K_PU (0x3<<14) /* 22K Ohm Pull Up */ +#define PAD_CTL_PUE (1<<13) /* Pull/Keep Select Field */ +#define PAD_CTL_PKE (1<<12) /* Pull/Keep Enable Field */ +#define PAD_CTL_ODE (1<<11) /* Open Drain Enable Field */ + /* On Die Termination Field: */ +#define PAD_CTL_ODT_DISABLED (0x0<<8) /* Disabled */ +#define PAD_CTL_ODT_1 (0x1<<8) +#define PAD_CTL_ODT_2 (0x2<<8) +#define PAD_CTL_ODT_3 (0x3<<8) +#define PAD_CTL_ODT_4 (0x4<<8) +#define PAD_CTL_ODT_5 (0x5<<8) +#define PAD_CTL_ODT_6 (0x6<<8) +#define PAD_CTL_ODT_7 (0x7<<8) + /* Speed Field: */ +#define PAD_CTL_SPEED_RESERVED0 (0x0<<6) /* RESERVED */ +#define PAD_CTL_SPEED_50_MHZ (0x1<<6) /* 50 MHz */ +#define PAD_CTL_SPEED_100_MHZ (0x2<<6) /* 100 MHz */ +#define PAD_CTL_SPEED_200_MHZ (0x3<<6) /* 200 MHz */ + /* Drive Strength Field */ +#define PAD_CTL_DSE_HIZ (0x0<<3) /* HI-Z */ +#define PAD_CTL_DSE_1 (0x1<<3) +#define PAD_CTL_DSE_2 (0x2<<3) +#define PAD_CTL_DSE_3 (0x3<<3) +#define PAD_CTL_DSE_4 (0x4<<3) +#define PAD_CTL_DSE_5 (0x5<<3) +#define PAD_CTL_DSE_6 (0x6<<3) +#define PAD_CTL_DSE_7 (0x7<<3) +#define PAD_CTL_SRE (0x1<<0) /* Slew rate Field */ + +/* + * Input control + */ +#define IOMUXC_INPUT_CTL 0x07b0 /* input control */ +#define INPUT_DAISY_0 0 +#define INPUT_DAISY_1 1 +#define INPUT_DAISY_2 2 +#define INPUT_DAISY_3 3 +#define INPUT_DAISY_4 4 +#define INPUT_DAISY_5 5 +#define INPUT_DAISY_6 6 +#define INPUT_DAISY_7 7 + +/* + * IOMUX index + */ +#define IOMUX_PIN_TO_MUX_ADDRESS(pin) (((pin) >> 16) & 0xffff) +#define IOMUX_PIN_TO_PAD_ADDRESS(pin) (((pin) >> 0) & 0xffff) +#define IOMUX_PIN(mux_adr, pad_adr) \ + (((mux_adr) << 16) | (((pad_adr) << 0))) +#define IOMUX_MUX_NONE 0xffff +#define IOMUX_PAD_NONE 0xffff + +/* + * MUX & PAD Control + */ +#define MUX_PIN(name) \ + IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_##name, \ + IOMUXC_SW_PAD_CTL_PAD_##name) + +#define MUX_PIN_MUX(name) \ + IOMUX_PIN(IOMUXC_SW_MUX_CTL_PAD_##name, IOMUX_PAD_NONE) + +#define MUX_PIN_PAD(name) \ + IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_PAD_##name) + +#define MUX_PIN_GRP(name) \ + IOMUX_PIN(IOMUX_MUX_NONE, IOMUXC_SW_PAD_CTL_GRP_##name) + +#define MUX_PIN_PATH(name) \ + IOMUX_PIN(IOMUXC_##name##_SELECT_INPUT, IOMUX_MUX_NONE) + +/* + * INPUT Control + */ +#define MUX_SELECT(name) (name##_SELECT_INPUT) + +/* + * Register names, offset addresses (and reset values for reference) + * from Chapter 36 IOMUX Controller (IOMUXC), IMX6DQRM, Rev.1, 04/2013 + * + * General Purpose Registers + */ +#define IOMUXC_GPR0 0x0000 /* 0x00000000 */ +#define IOMUXC_GPR1 0x0004 /* 0x48400005 */ +#define IOMUXC_GPR2 0x0008 /* 0x00000000 */ +#define IOMUXC_GPR3 0x000c /* 0x01e00000 */ +#define IOMUXC_GPR4 0x0010 /* 0x00000000 */ +#define IOMUXC_GPR5 0x0014 /* 0x00000000 */ +#define IOMUXC_GPR6 0x0018 /* 0x22222222 */ +#define IOMUXC_GPR7 0x001c /* 0x22222222 */ +#define IOMUXC_GPR8 0x0020 /* 0x00000000 */ +#define IOMUXC_GPR9 0x0024 /* 0x00000000 */ +#define IOMUXC_GPR10 0x0028 /* 0x00003800 */ +#define IOMUXC_GPR11 0x002c /* 0x00003800 */ +#define IOMUXC_GPR12 0x0030 /* 0x0f000000 */ +#define IOMUXC_GPR13 0x0034 /* 0x059124c4 */ +/* + * Pad Mux Registers + */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA1 0x004c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA2 0x0050 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA0 0x0054 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TXC 0x0058 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD0 0x005c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD1 0x0060 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD2 0x0064 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TD3 0x0068 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RX_CTL 0x006c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD0 0x0070 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_TX_CTL 0x0074 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD1 0x0078 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD2 0x007c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RD3 0x0080 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_RGMII_RXC 0x0084 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR25 0x0088 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB2_B 0x008c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA16 0x0090 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA17 0x0094 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA18 0x0098 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA19 0x009c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA20 0x00a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA21 0x00a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA22 0x00a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA23 0x00ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB3_B 0x00b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA24 0x00b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA25 0x00b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA26 0x00bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA27 0x00c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA28 0x00c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA29 0x00c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA30 0x00cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_DATA31 0x00d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR24 0x00d4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR23 0x00d8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR22 0x00dc /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR21 0x00e0 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR20 0x00e4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR19 0x00e8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR18 0x00ec /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR17 0x00f0 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_ADDR16 0x00f4 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_CS0_B 0x00f8 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_CS1_B 0x00fc /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_OE_B 0x0100 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_RW 0x0104 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_LBA_B 0x0108 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB0_B 0x010c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_EB1_B 0x0110 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD00 0x0114 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD01 0x0118 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD02 0x011c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD03 0x0120 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD04 0x0124 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD05 0x0128 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD06 0x012c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD07 0x0130 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD08 0x0134 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD09 0x0138 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD10 0x013c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD11 0x0140 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD12 0x0144 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD13 0x0148 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD14 0x014c /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_AD15 0x0150 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_WAIT_B 0x0154 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_EIM_BCLK 0x0158 /* 0x00000000 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_DISP_CLK 0x015c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN15 0x0160 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN02 0x0164 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN03 0x0168 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DI0_PIN04 0x016c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA00 0x0170 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA01 0x0174 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA02 0x0178 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA03 0x017c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA04 0x0180 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA05 0x0184 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA06 0x0188 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA07 0x018c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA08 0x0190 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA09 0x0194 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA10 0x0198 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA11 0x019c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA12 0x01a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA13 0x01a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA14 0x01a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA15 0x01ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA16 0x01b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA17 0x01b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA18 0x01b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA19 0x01bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA20 0x01c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA21 0x01c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA22 0x01c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_DISP0_DATA23 0x01cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_MDIO 0x01d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_REF_CLK 0x01d4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_ER 0x01d8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_CRS_DV 0x01dc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA1 0x01e0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_RX_DATA0 0x01e4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_EN 0x01e8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_DATA1 0x01ec /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_TX_DATA0 0x01f0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_ENET_MDC 0x01f4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL0 0x01f8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW0 0x01fc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL1 0x0200 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW1 0x0204 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL2 0x0208 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW2 0x020c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL3 0x0210 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW3 0x0214 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_COL4 0x0218 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_KEY_ROW4 0x021c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO00 0x0220 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO01 0x0224 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO09 0x0228 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO03 0x022c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO06 0x0230 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO02 0x0234 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO04 0x0238 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO05 0x023c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO07 0x0240 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO08 0x0244 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO16 0x0248 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO17 0x024c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO18 0x0250 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_GPIO19 0x0254 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_PIXCLK 0x0258 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_HSYNC 0x025c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA_EN 0x0260 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_VSYNC 0x0264 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA04 0x0268 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA05 0x026c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA06 0x0270 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA07 0x0274 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA08 0x0278 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA09 0x027c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA10 0x0280 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA11 0x0284 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA12 0x0288 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA13 0x028c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA14 0x0290 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA15 0x0294 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA16 0x0298 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA17 0x029c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA18 0x02a0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_CSI0_DATA19 0x02a4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA7 0x02a8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA6 0x02ac /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA5 0x02b0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA4 0x02b4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_CMD 0x02b8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_CLK 0x02bc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA0 0x02c0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA1 0x02c4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA2 0x02c8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_DATA3 0x02cc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD3_RESET 0x02d0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CLE 0x02d4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_ALE 0x02d8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_WP_B 0x02dc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_READY_B 0x02e0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS0_B 0x02e4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS1_B 0x02e8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS2_B 0x02ec /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_CS3_B 0x02f0 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_CMD 0x02f4 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_CLK 0x02f8 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA00 0x02fc /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA01 0x0300 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA02 0x0304 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA03 0x0308 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA04 0x030c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA05 0x0310 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA06 0x0314 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_NAND_DATA07 0x0318 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA0 0x031c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1 0x0320 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA2 0x0324 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA3 0x0328 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA4 0x032c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA5 0x0330 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA6 0x0334 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD4_DATA7 0x0338 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA1 0x033c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA0 0x0340 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA3 0x0344 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_CMD 0x0348 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_DATA2 0x034c /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD1_CLK 0x0350 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_CLK 0x0354 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_CMD 0x0358 /* 0x00000005 */ +#define IOMUXC_SW_MUX_CTL_PAD_SD2_DATA3 0x035c /* 0x00000005 */ +/* + * Pad Control registers + */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1 0x0360 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA2 0x0364 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0 0x0368 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TXC 0x036c /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD0 0x0370 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD1 0x0374 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD2 0x0378 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TD3 0x037c /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RX_CTL 0x0380 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD0 0x0384 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_TX_CTL 0x0388 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD1 0x038c /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD2 0x0390 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RD3 0x0394 /* 0x0001b030 */ +#define IOMUXC_SW_PAD_CTL_PAD_RGMII_RXC 0x0398 /* 0x00013030 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR25 0x039c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB2_B 0x03a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA16 0x03a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA17 0x03a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA18 0x03ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA19 0x03b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA20 0x03b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA21 0x03b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA22 0x03bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA23 0x03c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB3_B 0x03c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA24 0x03c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA25 0x03cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA26 0x03d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA27 0x03d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA28 0x03d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA29 0x03dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA30 0x03e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_DATA31 0x03e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR24 0x03e8 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR23 0x03ec /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR22 0x03f0 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR21 0x03f4 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR20 0x03f8 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR19 0x03fc /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR18 0x0400 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR17 0x0404 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_ADDR16 0x0408 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_CS0_B 0x040c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_CS1_B 0x0410 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_OE_B 0x0414 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_RW 0x0418 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_LBA_B 0x041c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB0_B 0x0420 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_EB1_B 0x0424 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD00 0x0428 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD01 0x042c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD02 0x0430 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD03 0x0434 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD04 0x0438 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD05 0x043c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD06 0x0440 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD07 0x0444 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD08 0x0448 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD09 0x044c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD10 0x0450 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD11 0x0454 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD12 0x0458 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD13 0x045c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD14 0x0460 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_AD15 0x0464 /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_WAIT_B 0x0468 /* 0x0000b060 */ +#define IOMUXC_SW_PAD_CTL_PAD_EIM_BCLK 0x046c /* 0x0000b0b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_DISP_CLK 0x0470 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN15 0x0474 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN02 0x0478 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN03 0x047c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DI0_PIN04 0x0480 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA00 0x0484 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA01 0x0488 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA02 0x048c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA03 0x0490 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA04 0x0494 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA05 0x0498 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA06 0x049c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA07 0x04a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA08 0x04a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA09 0x04a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA10 0x04ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA11 0x04b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA12 0x04b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA13 0x04b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA14 0x04bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA15 0x04c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA16 0x04c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA17 0x04c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA18 0x04cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA19 0x04d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA20 0x04d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA21 0x04d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA22 0x04dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DISP0_DATA23 0x04e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_MDIO 0x04e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_REF_CLK 0x04e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_ER 0x04ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_CRS_DV 0x04f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_DATA1 0x04f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_RX_DATA0 0x04f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_EN 0x04fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_DATA1 0x0500 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_TX_DATA0 0x0504 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_ENET_MDC 0x0508 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS5_P 0x050c /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM5 0x0510 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM4 0x0514 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS4_P 0x0518 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS3_P 0x051c /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM3 0x0520 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS2_P 0x0524 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM2 0x0528 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR00 0x052c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR01 0x0530 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR02 0x0534 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR03 0x0538 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR04 0x053c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR05 0x0540 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR06 0x0544 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR07 0x0548 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR08 0x054c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR09 0x0550 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR10 0x0554 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR11 0x0558 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR12 0x055c /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR13 0x0560 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR14 0x0564 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ADDR15 0x0568 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CAS_B 0x056c /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CS0_B 0x0570 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_CS1_B 0x0574 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_RAS_B 0x0578 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_RESET 0x057c /* 0x00083030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA0 0x0580 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA1 0x0584 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK0_P 0x0588 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA2 0x058c /* 0x0000b000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE0 0x0590 /* 0x00003000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK1_P 0x0594 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE1 0x0598 /* 0x00003000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ODT0 0x059c /* 0x00003030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_ODT1 0x05a0 /* 0x00003030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDWE_B 0x05a4 /* 0x00008000 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS0_P 0x05a8 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM0 0x05ac /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS1_P 0x05b0 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM1 0x05b4 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS6_P 0x05b8 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM6 0x05bc /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS7_P 0x05c0 /* 0x00002030 */ +#define IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM7 0x05c4 /* 0x00008030 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL0 0x05c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW0 0x05cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL1 0x05d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW1 0x05d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL2 0x05d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW2 0x05dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL3 0x05e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW3 0x05e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_COL4 0x05e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_KEY_ROW4 0x05ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO00 0x05f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO01 0x05f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO09 0x05f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO03 0x05fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO06 0x0600 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO02 0x0604 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO04 0x0608 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO05 0x060c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO07 0x0610 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO08 0x0614 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO16 0x0618 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO17 0x061c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO18 0x0620 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_GPIO19 0x0624 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_PIXCLK 0x0628 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_HSYNC 0x062c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA_EN 0x0630 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_VSYNC 0x0634 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA04 0x0638 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA05 0x063c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA06 0x0640 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA07 0x0644 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA08 0x0648 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA09 0x064c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA10 0x0650 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA11 0x0654 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA12 0x0658 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA13 0x065c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA14 0x0660 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA15 0x0664 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA16 0x0668 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA17 0x066c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA18 0x0670 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_CSI0_DATA19 0x0674 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TMS 0x0678 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_MOD 0x067c /* 0x0000b060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TRSTB 0x0680 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TDI 0x0684 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TCK 0x0688 /* 0x00007060 */ +#define IOMUXC_SW_PAD_CTL_PAD_JTAG_TDO 0x068c /* 0x000090b1 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA7 0x0690 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA6 0x0694 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA5 0x0698 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA4 0x069c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_CMD 0x06a0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_CLK 0x06a4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA0 0x06a8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA1 0x06ac /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA2 0x06b0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_DATA3 0x06b4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD3_RESET 0x06b8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CLE 0x06bc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_ALE 0x06c0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_WP_B 0x06c4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_READY_B 0x06c8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS0_B 0x06cc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS1_B 0x06d0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS2_B 0x06d4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_CS3_B 0x06d8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_CMD 0x06dc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_CLK 0x06e0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA00 0x06e4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA01 0x06e8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA02 0x06ec /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA03 0x06f0 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA04 0x06f4 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA05 0x06f8 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA06 0x06fc /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_NAND_DATA07 0x0700 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA0 0x0704 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1 0x0708 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA2 0x070c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA3 0x0710 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA4 0x0714 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA5 0x0718 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA6 0x071c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD4_DATA7 0x0720 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA1 0x0724 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA0 0x0728 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA3 0x072c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_CMD 0x0730 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_DATA2 0x0734 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD1_CLK 0x0738 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_CLK 0x073c /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_CMD 0x0740 /* 0x0001b0b0 */ +#define IOMUXC_SW_PAD_CTL_PAD_SD2_DATA3 0x0744 /* 0x0001b0b0 */ +/* + * Pad Group Control Registers + */ +#define IOMUXC_SW_PAD_CTL_GRP_B7DS 0x0748 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_ADDDS 0x074c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRMODE_CTL 0x0750 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL0 0x0754 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRPKE 0x0758 /* 0x00001000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL1 0x075c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL2 0x0760 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL3 0x0764 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRPK 0x0768 /* 0x00002000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL4 0x076c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRHYS 0x0770 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDRMODE 0x0774 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL5 0x0778 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL6 0x077c /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_TERM_CTL7 0x0780 /* 0x00000000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B0DS 0x0784 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B1DS 0x0788 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_CTLDS 0x078c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII 0x0790 /* 0x00080000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B2DS 0x0794 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE 0x0798 /* 0x00080000 */ +#define IOMUXC_SW_PAD_CTL_GRP_B3DS 0x079c /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B4DS 0x07a0 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B5DS 0x07a4 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_B6DS 0x07a8 /* 0x00000030 */ +#define IOMUXC_SW_PAD_CTL_GRP_RGMII_TERM 0x07ac /* 0x00000000 */ +/* + * Select Input Registers + */ +#define IOMUXC_ASRC_ASRCK_CLOCK_6_SELECT_INPUT 0x07b0 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_DA_AMX_SELECT_INPUT 0x07b4 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_DB_AMX_SELECT_INPUT 0x07b8 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_RXCLK_AMX_SELECT_INPUT 0x07bc /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_RXFS_AMX_SELECT_INPUT 0x07c0 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_TXCLK_AMX_SELECT_INPUT 0x07c4 /* 0x00000000 */ +#define IOMUXC_AUD4_INPUT_TXFS_AMX_SELECT_INPUT 0x07c8 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_DA_AMX_SELECT_INPUT 0x07cc /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_DB_AMX_SELECT_INPUT 0x07d0 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_RXCLK_AMX_SELECT_INPUT 0x07d4 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_RXFS_AMX_SELECT_INPUT 0x07d8 /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_TXCLK_AMX_SELECT_INPUT 0x07dc /* 0x00000000 */ +#define IOMUXC_AUD5_INPUT_TXFS_AMX_SELECT_INPUT 0x07e0 /* 0x00000000 */ +#define IOMUXC_FLEXCAN1_RX_SELECT_INPUT 0x07e4 /* 0x00000000 */ +#define IOMUXC_FLEXCAN2_RX_SELECT_INPUT 0x07e8 /* 0x00000000 */ +#define IOMUXC_CCM_PMIC_READY_SELECT_INPUT 0x07f0 /* 0x00000000 */ +#define IOMUXC_ECSPI1_CSPI_CLK_IN_SELECT_INPUT 0x07f4 /* 0x00000000 */ +#define IOMUXC_ECSPI1_MISO_SELECT_INPUT 0x07f8 /* 0x00000000 */ +#define IOMUXC_ECSPI1_MOSI_SELECT_INPUT 0x07fc /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS0_SELECT_INPUT 0x0800 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS1_SELECT_INPUT 0x0804 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS2_SELECT_INPUT 0x0808 /* 0x00000000 */ +#define IOMUXC_ECSPI1_SS3_SELECT_INPUT 0x080c /* 0x00000000 */ +#define IOMUXC_ECSPI2_CSPI_CLK_IN_SELECT_INPUT 0x0810 /* 0x00000000 */ +#define IOMUXC_ECSPI2_MISO_SELECT_INPUT 0x0814 /* 0x00000000 */ +#define IOMUXC_ECSPI2_MOSI_SELECT_INPUT 0x0818 /* 0x00000000 */ +#define IOMUXC_ECSPI2_SS0_SELECT_INPUT 0x081c /* 0x00000000 */ +#define IOMUXC_ECSPI2_SS1_SELECT_INPUT 0x0820 /* 0x00000000 */ +#define IOMUXC_ECSPI4_SS0_SELECT_INPUT 0x0824 /* 0x00000000 */ +#define IOMUXC_ECSPI5_CSPI_CLK_IN_SELECT_INPUT 0x0828 /* 0x00000000 */ +#define IOMUXC_ECSPI5_MISO_SELECT_INPUT 0x082c /* 0x00000000 */ +#define IOMUXC_ECSPI5_MOSI_SELECT_INPUT 0x0830 /* 0x00000000 */ +#define IOMUXC_ECSPI5_SS0_SELECT_INPUT 0x0834 /* 0x00000000 */ +#define IOMUXC_ECSPI5_SS1_SELECT_INPUT 0x0838 /* 0x00000000 */ +#define IOMUXC_ENET_REF_CLK_SELECT_INPUT 0x083c /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_MDIO_SELECT_INPUT 0x0840 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_CLK_SELECT_INPUT 0x0844 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA0_SELECT_INPUT 0x0848 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA1_SELECT_INPUT 0x084c /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA2_SELECT_INPUT 0x0850 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_DATA3_SELECT_INPUT 0x0854 /* 0x00000000 */ +#define IOMUXC_ENET_MAC0_RX_EN_SELECT_INPUT 0x0858 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_FS_SELECT_INPUT 0x085c /* 0x00000000 */ +#define IOMUXC_ESAI_TX_FS_SELECT_INPUT 0x0860 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_HF_CLK_SELECT_INPUT 0x0864 /* 0x00000000 */ +#define IOMUXC_ESAI_TX_HF_CLK_SELECT_INPUT 0x0868 /* 0x00000000 */ +#define IOMUXC_ESAI_RX_CLK_SELECT_INPUT 0x086c /* 0x00000000 */ +#define IOMUXC_ESAI_TX_CLK_SELECT_INPUT 0x0870 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO0_SELECT_INPUT 0x0874 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO1_SELECT_INPUT 0x0878 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO2_SDI3_SELECT_INPUT 0x087c /* 0x00000000 */ +#define IOMUXC_ESAI_SDO3_SDI2_SELECT_INPUT 0x0880 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO4_SDI1_SELECT_INPUT 0x0884 /* 0x00000000 */ +#define IOMUXC_ESAI_SDO5_SDI0_SELECT_INPUT 0x0888 /* 0x00000000 */ +#define IOMUXC_HDMI_ICECIN_SELECT_INPUT 0x088c /* 0x00000000 */ +#define IOMUXC_HDMI_II2C_CLKIN_SELECT_INPUT 0x0890 /* 0x00000000 */ +#define IOMUXC_HDMI_II2C_DATAIN_SELECT_INPUT 0x0894 /* 0x00000000 */ +#define IOMUXC_I2C1_SCL_IN_SELECT_INPUT 0x0898 /* 0x00000000 */ +#define IOMUXC_I2C1_SDA_IN_SELECT_INPUT 0x089c /* 0x00000000 */ +#define IOMUXC_I2C2_SCL_IN_SELECT_INPUT 0x08a0 /* 0x00000000 */ +#define IOMUXC_I2C2_SDA_IN_SELECT_INPUT 0x08a4 /* 0x00000000 */ +#define IOMUXC_I2C3_SCL_IN_SELECT_INPUT 0x08a8 /* 0x00000000 */ +#define IOMUXC_I2C3_SDA_IN_SELECT_INPUT 0x08ac /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA10_SELECT_INPUT 0x08b0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA11_SELECT_INPUT 0x08b4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA12_SELECT_INPUT 0x08b8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA13_SELECT_INPUT 0x08bc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA14_SELECT_INPUT 0x08c0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA15_SELECT_INPUT 0x08c4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA16_SELECT_INPUT 0x08c8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA17_SELECT_INPUT 0x08cc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA18_SELECT_INPUT 0x08d0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA19_SELECT_INPUT 0x08d4 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_DATA_EN_SELECT_INPUT 0x08d8 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_HSYNC_SELECT_INPUT 0x08dc /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_PIX_CLK_SELECT_INPUT 0x08e0 /* 0x00000000 */ +#define IOMUXC_IPU2_SENS1_VSYNC_SELECT_INPUT 0x08e4 /* 0x00000000 */ +#define IOMUXC_KEY_COL5_SELECT_INPUT 0x08e8 /* 0x00000000 */ +#define IOMUXC_KEY_COL6_SELECT_INPUT 0x08ec /* 0x00000000 */ +#define IOMUXC_KEY_COL7_SELECT_INPUT 0x08f0 /* 0x00000000 */ +#define IOMUXC_KEY_ROW5_SELECT_INPUT 0x08f4 /* 0x00000000 */ +#define IOMUXC_KEY_ROW6_SELECT_INPUT 0x08f8 /* 0x00000000 */ +#define IOMUXC_KEY_ROW7_SELECT_INPUT 0x08fc /* 0x00000000 */ +#define IOMUXC_MLB_MLB_CLK_IN_SELECT_INPUT 0x0900 /* 0x00000000 */ +#define IOMUXC_MLB_MLB_DATA_IN_SELECT_INPUT 0x0904 /* 0x00000000 */ +#define IOMUXC_MLB_MLB_SIG_IN_SELECT_INPUT 0x0908 /* 0x00000000 */ +#define IOMUXC_SDMA_EVENTS14_SELECT_INPUT 0x090c /* 0x00000000 */ +#define IOMUXC_SDMA_EVENTS15_SELECT_INPUT 0x0910 /* 0x00000000 */ +#define IOMUXC_SPDIF_SPDIF_IN1_SELECT_INPUT 0x0914 /* 0x00000000 */ +#define IOMUXC_SPDIF_TX_CLK2_SELECT_INPUT 0x0918 /* 0x00000000 */ +#define IOMUXC_UART1_UART_RTS_B_SELECT_INPUT 0x091c /* 0x00000000 */ +#define IOMUXC_UART1_UART_RX_DATA_SELECT_INPUT 0x0920 /* 0x00000000 */ +#define IOMUXC_UART2_UART_RTS_B_SELECT_INPUT 0x0924 /* 0x00000000 */ +#define IOMUXC_UART2_UART_RX_DATA_SELECT_INPUT 0x0928 /* 0x00000000 */ +#define IOMUXC_UART3_UART_RTS_B_SELECT_INPUT 0x092c /* 0x00000000 */ +#define IOMUXC_UART3_UART_RX_DATA_SELECT_INPUT 0x0930 /* 0x00000000 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:26:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB0F45CD; Thu, 4 Sep 2014 14:26:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B51321ECC; Thu, 4 Sep 2014 14:26:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84EQQTd054349; Thu, 4 Sep 2014 14:26:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84EQPSS054343; Thu, 4 Sep 2014 14:26:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409041426.s84EQPSS054343@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 14:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271098 - in head/sys: amd64/amd64 conf i386/i386 i386/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:26:26 -0000 Author: jhb Date: Thu Sep 4 14:26:25 2014 New Revision: 271098 URL: http://svnweb.freebsd.org/changeset/base/271098 Log: Merge the amd64 and i386 identcpu.c into a single x86 implementation. This brings the structured extended features mask and VT-x reporting to i386 and Intel cache and TLB info (under bootverbose) to amd64. Added: head/sys/x86/x86/identcpu.c - copied, changed from r271083, head/sys/amd64/amd64/identcpu.c Deleted: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/i386/initcpu.c head/sys/i386/include/md_var.h Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Sep 4 14:25:32 2014 (r271097) +++ head/sys/conf/files.amd64 Thu Sep 4 14:26:25 2014 (r271098) @@ -103,7 +103,6 @@ amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard amd64/amd64/gdb_machdep.c optional gdb -amd64/amd64/identcpu.c standard amd64/amd64/in_cksum.c optional inet | inet6 amd64/amd64/initcpu.c standard amd64/amd64/io.c optional io @@ -542,6 +541,7 @@ x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt +x86/x86/identcpu.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c standard x86/x86/legacy.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Sep 4 14:25:32 2014 (r271097) +++ head/sys/conf/files.i386 Thu Sep 4 14:26:25 2014 (r271098) @@ -443,7 +443,6 @@ i386/xen/exception.s optional xen i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode i386/i386/i686_mem.c optional mem -i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io @@ -581,6 +580,7 @@ x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt +x86/x86/identcpu.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/legacy.c optional native Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Sep 4 14:25:32 2014 (r271097) +++ head/sys/conf/files.pc98 Thu Sep 4 14:26:25 2014 (r271098) @@ -140,7 +140,6 @@ i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/i686_mem.c optional mem -i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io @@ -248,6 +247,7 @@ x86/pci/pci_bus.c optional pci x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard +x86/x86/identcpu.c standard x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional apic x86/x86/legacy.c standard Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Thu Sep 4 14:25:32 2014 (r271097) +++ head/sys/i386/i386/initcpu.c Thu Sep 4 14:26:25 2014 (r271098) @@ -95,6 +95,7 @@ u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ #endif u_int cpu_clflush_line_size = 32; +u_int cpu_stdext_feature; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Thu Sep 4 14:25:32 2014 (r271097) +++ head/sys/i386/include/md_var.h Thu Sep 4 14:26:25 2014 (r271098) @@ -48,6 +48,7 @@ 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_stdext_feature; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Copied and modified: head/sys/x86/x86/identcpu.c (from r271083, head/sys/amd64/amd64/identcpu.c) ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Sep 4 02:28:17 2014 (r271083, copy source) +++ head/sys/x86/x86/identcpu.c Thu Sep 4 14:26:25 2014 (r271098) @@ -57,21 +57,32 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include +#ifdef __i386__ +#define IDENTBLUE_CYRIX486 0 +#define IDENTBLUE_IBMCPU 1 +#define IDENTBLUE_CYRIXM2 2 + +static void identifycyrix(void); +static void print_transmeta_info(void); +#endif static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); +static void print_INTEL_info(void); +static void print_INTEL_TLB(u_int data); static void print_via_padlock_info(void); static void print_vmx_info(void); int cpu_class; -char machine[] = "amd64"; +char machine[] = MACHINE; +#ifdef __amd64__ #ifdef SCTL_MASK32 extern int adaptive_machine_arch; #endif @@ -95,6 +106,10 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_hw_machine, "A", "Machine class"); +#else +SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, + machine, 0, "Machine class"); +#endif static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, @@ -108,12 +123,48 @@ static eventhandler_tag tsc_post_tag; static char cpu_brand[48]; +#ifdef __i386__ +#define MAX_BRAND_INDEX 8 + +static const char *cpu_brandtable[MAX_BRAND_INDEX + 1] = { + NULL, /* No brand */ + "Intel Celeron", + "Intel Pentium III", + "Intel Pentium III Xeon", + NULL, + NULL, + NULL, + NULL, + "Intel Pentium 4" +}; +#endif + static struct { char *cpu_name; int cpu_class; -} amd64_cpus[] = { +} cpus[] = { +#ifdef __i386__ + { "Intel 80286", CPUCLASS_286 }, /* CPU_286 */ + { "i386SX", CPUCLASS_386 }, /* CPU_386SX */ + { "i386DX", CPUCLASS_386 }, /* CPU_386 */ + { "i486SX", CPUCLASS_486 }, /* CPU_486SX */ + { "i486DX", CPUCLASS_486 }, /* CPU_486 */ + { "Pentium", CPUCLASS_586 }, /* CPU_586 */ + { "Cyrix 486", CPUCLASS_486 }, /* CPU_486DLC */ + { "Pentium Pro", CPUCLASS_686 }, /* CPU_686 */ + { "Cyrix 5x86", CPUCLASS_486 }, /* CPU_M1SC */ + { "Cyrix 6x86", CPUCLASS_486 }, /* CPU_M1 */ + { "Blue Lightning", CPUCLASS_486 }, /* CPU_BLUE */ + { "Cyrix 6x86MX", CPUCLASS_686 }, /* CPU_M2 */ + { "NexGen 586", CPUCLASS_386 }, /* CPU_NX586 (XXX) */ + { "Cyrix 486S/DX", CPUCLASS_486 }, /* CPU_CY486DX */ + { "Pentium II", CPUCLASS_686 }, /* CPU_PII */ + { "Pentium III", CPUCLASS_686 }, /* CPU_PIII */ + { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ +#else { "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */ { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ +#endif }; static struct { @@ -123,18 +174,30 @@ static struct { { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ +#ifdef __i386__ + { NSC_VENDOR_ID, CPU_VENDOR_NSC }, /* Geode by NSC */ + { CYRIX_VENDOR_ID, CPU_VENDOR_CYRIX }, /* CyrixInstead */ + { TRANSMETA_VENDOR_ID, CPU_VENDOR_TRANSMETA }, /* GenuineTMx86 */ + { SIS_VENDOR_ID, CPU_VENDOR_SIS }, /* SiS SiS SiS */ + { UMC_VENDOR_ID, CPU_VENDOR_UMC }, /* UMC UMC UMC */ + { NEXGEN_VENDOR_ID, CPU_VENDOR_NEXGEN }, /* NexGenDriven */ + { RISE_VENDOR_ID, CPU_VENDOR_RISE }, /* RiseRiseRise */ +#if 0 + /* XXX CPUID 8000_0000h and 8086_0000h, not 0000_0000h */ + { "TransmetaCPU", CPU_VENDOR_TRANSMETA }, +#endif +#endif }; - void printcpuinfo(void) { u_int regs[4], i; char *brand; - cpu_class = amd64_cpus[cpu].cpu_class; + cpu_class = cpus[cpu].cpu_class; printf("CPU: "); - strncpy(cpu_model, amd64_cpus[cpu].cpu_name, sizeof (cpu_model)); + strncpy(cpu_model, cpus[cpu].cpu_name, sizeof (cpu_model)); /* Check for extended CPUID information and a processor name. */ if (cpu_exthigh >= 0x80000004) { @@ -148,8 +211,143 @@ printcpuinfo(void) switch (cpu_vendor_id) { case CPU_VENDOR_INTEL: +#ifdef __i386__ + if ((cpu_id & 0xf00) > 0x300) { + u_int brand_index; + + cpu_model[0] = '\0'; + + switch (cpu_id & 0x3000) { + case 0x1000: + strcpy(cpu_model, "Overdrive "); + break; + case 0x2000: + strcpy(cpu_model, "Dual "); + break; + } + + switch (cpu_id & 0xf00) { + case 0x400: + strcat(cpu_model, "i486 "); + /* Check the particular flavor of 486 */ + switch (cpu_id & 0xf0) { + case 0x00: + case 0x10: + strcat(cpu_model, "DX"); + break; + case 0x20: + strcat(cpu_model, "SX"); + break; + case 0x30: + strcat(cpu_model, "DX2"); + break; + case 0x40: + strcat(cpu_model, "SL"); + break; + case 0x50: + strcat(cpu_model, "SX2"); + break; + case 0x70: + strcat(cpu_model, + "DX2 Write-Back Enhanced"); + break; + case 0x80: + strcat(cpu_model, "DX4"); + break; + } + break; + case 0x500: + /* Check the particular flavor of 586 */ + strcat(cpu_model, "Pentium"); + switch (cpu_id & 0xf0) { + case 0x00: + strcat(cpu_model, " A-step"); + break; + case 0x10: + strcat(cpu_model, "/P5"); + break; + case 0x20: + strcat(cpu_model, "/P54C"); + break; + case 0x30: + strcat(cpu_model, "/P24T"); + break; + case 0x40: + strcat(cpu_model, "/P55C"); + break; + case 0x70: + strcat(cpu_model, "/P54C"); + break; + case 0x80: + strcat(cpu_model, "/P55C (quarter-micron)"); + break; + default: + /* nothing */ + break; + } +#if defined(I586_CPU) && !defined(NO_F00F_HACK) + /* + * XXX - If/when Intel fixes the bug, this + * should also check the version of the + * CPU, not just that it's a Pentium. + */ + has_f00f_bug = 1; +#endif + break; + case 0x600: + /* Check the particular flavor of 686 */ + switch (cpu_id & 0xf0) { + case 0x00: + strcat(cpu_model, "Pentium Pro A-step"); + break; + case 0x10: + strcat(cpu_model, "Pentium Pro"); + break; + case 0x30: + case 0x50: + case 0x60: + strcat(cpu_model, + "Pentium II/Pentium II Xeon/Celeron"); + cpu = CPU_PII; + break; + case 0x70: + case 0x80: + case 0xa0: + case 0xb0: + strcat(cpu_model, + "Pentium III/Pentium III Xeon/Celeron"); + cpu = CPU_PIII; + break; + default: + strcat(cpu_model, "Unknown 80686"); + break; + } + break; + case 0xf00: + strcat(cpu_model, "Pentium 4"); + cpu = CPU_P4; + break; + default: + strcat(cpu_model, "unknown"); + break; + } + + /* + * If we didn't get a brand name from the extended + * CPUID, try to look it up in the brand table. + */ + if (cpu_high > 0 && *cpu_brand == '\0') { + brand_index = cpu_procinfo & CPUID_BRAND_INDEX; + if (brand_index <= MAX_BRAND_INDEX && + cpu_brandtable[brand_index] != NULL) + strcpy(cpu_brand, + cpu_brandtable[brand_index]); + } + } +#else /* Please make up your mind folks! */ strcat(cpu_model, "EM64T"); +#endif break; case CPU_VENDOR_AMD: /* @@ -158,18 +356,297 @@ printcpuinfo(void) * (also describes ``Features'' encodings. */ strcpy(cpu_model, "AMD "); +#ifdef __i386__ + switch (cpu_id & 0xFF0) { + case 0x410: + strcat(cpu_model, "Standard Am486DX"); + break; + case 0x430: + strcat(cpu_model, "Enhanced Am486DX2 Write-Through"); + break; + case 0x470: + strcat(cpu_model, "Enhanced Am486DX2 Write-Back"); + break; + case 0x480: + strcat(cpu_model, "Enhanced Am486DX4/Am5x86 Write-Through"); + break; + case 0x490: + strcat(cpu_model, "Enhanced Am486DX4/Am5x86 Write-Back"); + break; + case 0x4E0: + strcat(cpu_model, "Am5x86 Write-Through"); + break; + case 0x4F0: + strcat(cpu_model, "Am5x86 Write-Back"); + break; + case 0x500: + strcat(cpu_model, "K5 model 0"); + break; + case 0x510: + strcat(cpu_model, "K5 model 1"); + break; + case 0x520: + strcat(cpu_model, "K5 PR166 (model 2)"); + break; + case 0x530: + strcat(cpu_model, "K5 PR200 (model 3)"); + break; + case 0x560: + strcat(cpu_model, "K6"); + break; + case 0x570: + strcat(cpu_model, "K6 266 (model 1)"); + break; + case 0x580: + strcat(cpu_model, "K6-2"); + break; + case 0x590: + strcat(cpu_model, "K6-III"); + break; + case 0x5a0: + strcat(cpu_model, "Geode LX"); + /* + * Make sure the TSC runs through suspension, + * otherwise we can't use it as timecounter + */ + wrmsr(0x1900, rdmsr(0x1900) | 0x20ULL); + break; + default: + strcat(cpu_model, "Unknown"); + break; + } +#if defined(I586_CPU) && defined(CPU_WT_ALLOC) + if ((cpu_id & 0xf00) == 0x500) { + if (((cpu_id & 0x0f0) > 0) + && ((cpu_id & 0x0f0) < 0x60) + && ((cpu_id & 0x00f) > 3)) + enable_K5_wt_alloc(); + else if (((cpu_id & 0x0f0) > 0x80) + || (((cpu_id & 0x0f0) == 0x80) + && (cpu_id & 0x00f) > 0x07)) + enable_K6_2_wt_alloc(); + else if ((cpu_id & 0x0f0) > 0x50) + enable_K6_wt_alloc(); + } +#endif +#else if ((cpu_id & 0xf00) == 0xf00) strcat(cpu_model, "AMD64 Processor"); else strcat(cpu_model, "Unknown"); +#endif + break; +#ifdef __i386__ + case CPU_VENDOR_CYRIX: + strcpy(cpu_model, "Cyrix "); + switch (cpu_id & 0xff0) { + case 0x440: + strcat(cpu_model, "MediaGX"); + break; + case 0x520: + strcat(cpu_model, "6x86"); + break; + case 0x540: + cpu_class = CPUCLASS_586; + strcat(cpu_model, "GXm"); + break; + case 0x600: + strcat(cpu_model, "6x86MX"); + break; + default: + /* + * Even though CPU supports the cpuid + * instruction, it can be disabled. + * Therefore, this routine supports all Cyrix + * CPUs. + */ + switch (cyrix_did & 0xf0) { + case 0x00: + switch (cyrix_did & 0x0f) { + case 0x00: + strcat(cpu_model, "486SLC"); + break; + case 0x01: + strcat(cpu_model, "486DLC"); + break; + case 0x02: + strcat(cpu_model, "486SLC2"); + break; + case 0x03: + strcat(cpu_model, "486DLC2"); + break; + case 0x04: + strcat(cpu_model, "486SRx"); + break; + case 0x05: + strcat(cpu_model, "486DRx"); + break; + case 0x06: + strcat(cpu_model, "486SRx2"); + break; + case 0x07: + strcat(cpu_model, "486DRx2"); + break; + case 0x08: + strcat(cpu_model, "486SRu"); + break; + case 0x09: + strcat(cpu_model, "486DRu"); + break; + case 0x0a: + strcat(cpu_model, "486SRu2"); + break; + case 0x0b: + strcat(cpu_model, "486DRu2"); + break; + default: + strcat(cpu_model, "Unknown"); + break; + } + break; + case 0x10: + switch (cyrix_did & 0x0f) { + case 0x00: + strcat(cpu_model, "486S"); + break; + case 0x01: + strcat(cpu_model, "486S2"); + break; + case 0x02: + strcat(cpu_model, "486Se"); + break; + case 0x03: + strcat(cpu_model, "486S2e"); + break; + case 0x0a: + strcat(cpu_model, "486DX"); + break; + case 0x0b: + strcat(cpu_model, "486DX2"); + break; + case 0x0f: + strcat(cpu_model, "486DX4"); + break; + default: + strcat(cpu_model, "Unknown"); + break; + } + break; + case 0x20: + if ((cyrix_did & 0x0f) < 8) + strcat(cpu_model, "6x86"); /* Where did you get it? */ + else + strcat(cpu_model, "5x86"); + break; + case 0x30: + strcat(cpu_model, "6x86"); + break; + case 0x40: + if ((cyrix_did & 0xf000) == 0x3000) { + cpu_class = CPUCLASS_586; + strcat(cpu_model, "GXm"); + } else + strcat(cpu_model, "MediaGX"); + break; + case 0x50: + strcat(cpu_model, "6x86MX"); + break; + case 0xf0: + switch (cyrix_did & 0x0f) { + case 0x0d: + strcat(cpu_model, "Overdrive CPU"); + break; + case 0x0e: + strcpy(cpu_model, "Texas Instruments 486SXL"); + break; + case 0x0f: + strcat(cpu_model, "486SLC/DLC"); + break; + default: + strcat(cpu_model, "Unknown"); + break; + } + break; + default: + strcat(cpu_model, "Unknown"); + break; + } + break; + } + break; + case CPU_VENDOR_RISE: + strcpy(cpu_model, "Rise "); + switch (cpu_id & 0xff0) { + case 0x500: /* 6401 and 6441 (Kirin) */ + case 0x520: /* 6510 (Lynx) */ + strcat(cpu_model, "mP6"); + break; + default: + strcat(cpu_model, "Unknown"); + } break; +#endif case CPU_VENDOR_CENTAUR: +#ifdef __i386__ + switch (cpu_id & 0xff0) { + case 0x540: + strcpy(cpu_model, "IDT WinChip C6"); + break; + case 0x580: + strcpy(cpu_model, "IDT WinChip 2"); + break; + case 0x590: + strcpy(cpu_model, "IDT WinChip 3"); + break; + case 0x660: + strcpy(cpu_model, "VIA C3 Samuel"); + break; + case 0x670: + if (cpu_id & 0x8) + strcpy(cpu_model, "VIA C3 Ezra"); + else + strcpy(cpu_model, "VIA C3 Samuel 2"); + break; + case 0x680: + strcpy(cpu_model, "VIA C3 Ezra-T"); + break; + case 0x690: + strcpy(cpu_model, "VIA C3 Nehemiah"); + break; + case 0x6a0: + case 0x6d0: + strcpy(cpu_model, "VIA C7 Esther"); + break; + case 0x6f0: + strcpy(cpu_model, "VIA Nano"); + break; + default: + strcpy(cpu_model, "VIA/IDT Unknown"); + } +#else strcpy(cpu_model, "VIA "); if ((cpu_id & 0xff0) == 0x6f0) strcat(cpu_model, "Nano Processor"); else strcat(cpu_model, "Unknown"); +#endif + break; +#ifdef __i386__ + case CPU_VENDOR_IBM: + strcpy(cpu_model, "Blue Lightning CPU"); break; + case CPU_VENDOR_NSC: + switch (cpu_id & 0xff0) { + case 0x540: + strcpy(cpu_model, "Geode SC1100"); + cpu = CPU_GEODE1100; + break; + default: + strcpy(cpu_model, "Geode/NSC unknown"); + break; + } + break; +#endif default: strcat(cpu_model, "Unknown"); break; @@ -186,16 +663,40 @@ printcpuinfo(void) strcpy(cpu_model, brand); printf("%s (", cpu_model); + if (tsc_freq != 0) { + hw_clockrate = (tsc_freq + 5000) / 1000000; + printf("%jd.%02d-MHz ", + (intmax_t)(tsc_freq + 4999) / 1000000, + (u_int)((tsc_freq + 4999) / 10000) % 100); + } switch(cpu_class) { +#ifdef __i386__ + case CPUCLASS_286: + printf("286"); + break; + case CPUCLASS_386: + printf("386"); + break; +#if defined(I486_CPU) + case CPUCLASS_486: + printf("486"); + break; +#endif +#if defined(I586_CPU) + case CPUCLASS_586: + printf("586"); + break; +#endif +#if defined(I686_CPU) + case CPUCLASS_686: + printf("686"); + break; +#endif +#else case CPUCLASS_K8: - if (tsc_freq != 0) { - hw_clockrate = (tsc_freq + 5000) / 1000000; - printf("%jd.%02d-MHz ", - (intmax_t)(tsc_freq + 4999) / 1000000, - (u_int)((tsc_freq + 4999) / 10000) % 100); - } printf("K8"); break; +#endif default: printf("Unknown"); /* will panic below... */ } @@ -207,10 +708,21 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || - cpu_vendor_id == CPU_VENDOR_CENTAUR) { + cpu_vendor_id == CPU_VENDOR_CENTAUR || +#ifdef __i386__ + cpu_vendor_id == CPU_VENDOR_TRANSMETA || + cpu_vendor_id == CPU_VENDOR_RISE || + cpu_vendor_id == CPU_VENDOR_NSC || + (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500)) || +#endif + 0) { printf(" Family=0x%x", CPUID_TO_FAMILY(cpu_id)); printf(" Model=0x%x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping=%u", cpu_id & CPUID_STEPPING); +#ifdef __i386__ + if (cpu_vendor_id == CPU_VENDOR_CYRIX) + printf("\n DIR=0x%04x", cyrix_did); +#endif /* * AMD CPUID Specification @@ -441,7 +953,18 @@ printcpuinfo(void) } } +#ifdef __i386__ + } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { + printf(" DIR=0x%04x", cyrix_did); + printf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); + printf(" Revision=%u", (cyrix_did & 0x0f00) >> 8); +#ifndef CYRIX_CACHE_REALLY_WORKS + if (cpu == CPU_M1 && (cyrix_did & 0xff00) < 0x1700) + printf("\n CPU cache: write-through mode"); +#endif +#endif } + /* Avoid ugly blank lines: only print newline when we have to. */ if (*cpu_vendor || cpu_id) printf("\n"); @@ -451,30 +974,189 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_AMD) print_AMD_info(); + else if (cpu_vendor_id == CPU_VENDOR_INTEL) + print_INTEL_info(); +#ifdef __i386__ + else if (cpu_vendor_id == CPU_VENDOR_TRANSMETA) + print_transmeta_info(); +#endif } void panicifcpuunsupported(void) { +#ifdef __i386__ +#if !defined(lint) +#if !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU) +#error This kernel is not configured for one of the supported CPUs +#endif +#else /* lint */ +#endif /* lint */ +#else /* __amd64__ */ #ifndef HAMMER #error "You need to specify a cpu type" #endif +#endif /* * Now that we have told the user what they have, * let them know if that machine type isn't configured. */ switch (cpu_class) { +#ifdef __i386__ + case CPUCLASS_286: /* a 286 should not make it this far, anyway */ + case CPUCLASS_386: +#if !defined(I486_CPU) + case CPUCLASS_486: +#endif +#if !defined(I586_CPU) + case CPUCLASS_586: +#endif +#if !defined(I686_CPU) + case CPUCLASS_686: +#endif +#else /* __amd64__ */ case CPUCLASS_X86: #ifndef HAMMER case CPUCLASS_K8: #endif +#endif panic("CPU class not configured"); default: break; } } +#ifdef __i386__ +static volatile u_int trap_by_rdmsr; + +/* + * Special exception 6 handler. + * The rdmsr instruction generates invalid opcodes fault on 486-class + * Cyrix CPU. Stacked eip register points the rdmsr instruction in the + * function identblue() when this handler is called. Stacked eip should + * be advanced. + */ +inthand_t bluetrap6; +#ifdef __GNUCLIKE_ASM +__asm +(" \n\ + .text \n\ + .p2align 2,0x90 \n\ + .type " __XSTRING(CNAME(bluetrap6)) ",@function \n\ +" __XSTRING(CNAME(bluetrap6)) ": \n\ + ss \n\ + movl $0xa8c1d," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ + addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ + iret \n\ +"); +#endif + +/* + * Special exception 13 handler. + * Accessing non-existent MSR generates general protection fault. + */ +inthand_t bluetrap13; +#ifdef __GNUCLIKE_ASM +__asm +(" \n\ + .text \n\ + .p2align 2,0x90 \n\ + .type " __XSTRING(CNAME(bluetrap13)) ",@function \n\ +" __XSTRING(CNAME(bluetrap13)) ": \n\ + ss \n\ + movl $0xa89c4," __XSTRING(CNAME(trap_by_rdmsr)) " \n\ + popl %eax /* discard error code */ \n\ + addl $2, (%esp) /* rdmsr is a 2-byte instruction */ \n\ + iret \n\ +"); +#endif + +/* + * Distinguish IBM Blue Lightning CPU from Cyrix CPUs that does not + * support cpuid instruction. This function should be called after + * loading interrupt descriptor table register. + * + * I don't like this method that handles fault, but I couldn't get + * information for any other methods. Does blue giant know? + */ +static int +identblue(void) +{ + + trap_by_rdmsr = 0; + + /* + * Cyrix 486-class CPU does not support rdmsr instruction. + * The rdmsr instruction generates invalid opcode fault, and exception + * will be trapped by bluetrap6() on Cyrix 486-class CPU. The + * bluetrap6() set the magic number to trap_by_rdmsr. + */ + setidt(IDT_UD, bluetrap6, SDT_SYS386TGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); + + /* + * Certain BIOS disables cpuid instruction of Cyrix 6x86MX CPU. + * In this case, rdmsr generates general protection fault, and + * exception will be trapped by bluetrap13(). + */ + setidt(IDT_GP, bluetrap13, SDT_SYS386TGT, SEL_KPL, + GSEL(GCODE_SEL, SEL_KPL)); + + rdmsr(0x1002); /* Cyrix CPU generates fault. */ + + if (trap_by_rdmsr == 0xa8c1d) + return IDENTBLUE_CYRIX486; + else if (trap_by_rdmsr == 0xa89c4) + return IDENTBLUE_CYRIXM2; + return IDENTBLUE_IBMCPU; +} + + +/* + * identifycyrix() set lower 16 bits of cyrix_did as follows: + * + * F E D C B A 9 8 7 6 5 4 3 2 1 0 + * +-------+-------+---------------+ + * | SID | RID | Device ID | + * | (DIR 1) | (DIR 0) | + * +-------+-------+---------------+ + */ +static void +identifycyrix(void) +{ + register_t saveintr; + int ccr2_test = 0, dir_test = 0; + u_char ccr2, ccr3; + + saveintr = intr_disable(); + + ccr2 = read_cyrix_reg(CCR2); + write_cyrix_reg(CCR2, ccr2 ^ CCR2_LOCK_NW); + read_cyrix_reg(CCR2); + if (read_cyrix_reg(CCR2) != ccr2) + ccr2_test = 1; + write_cyrix_reg(CCR2, ccr2); + + ccr3 = read_cyrix_reg(CCR3); + write_cyrix_reg(CCR3, ccr3 ^ CCR3_MAPEN3); + read_cyrix_reg(CCR3); + if (read_cyrix_reg(CCR3) != ccr3) + dir_test = 1; /* CPU supports DIRs. */ + write_cyrix_reg(CCR3, ccr3); + + if (dir_test) { + /* Device ID registers are available. */ + cyrix_did = read_cyrix_reg(DIR1) << 8; + cyrix_did += read_cyrix_reg(DIR0); + } else if (ccr2_test) + cyrix_did = 0x0010; /* 486S A-step */ + else + cyrix_did = 0x00ff; /* Old 486SLC/DLC and TI486SXLC/SXL */ + + intr_restore(saveintr); +} +#endif /* Update TSC freq with the value indicated by the caller. */ static void @@ -505,24 +1187,35 @@ SYSINIT(hook_tsc_freq, SI_SUB_CONFIGURE, /* * Final stage of CPU identification. */ +#ifdef __i386__ +void +finishidentcpu(void) +#else void identify_cpu(void) +#endif { u_int regs[4], cpu_stdext_disable; +#ifdef __i386__ + u_char ccr3; +#endif +#ifdef __amd64__ do_cpuid(0, regs); cpu_high = regs[0]; ((u_int *)&cpu_vendor)[0] = regs[1]; ((u_int *)&cpu_vendor)[1] = regs[3]; ((u_int *)&cpu_vendor)[2] = regs[2]; cpu_vendor[12] = '\0'; - cpu_vendor_id = find_cpu_vendor_id(); do_cpuid(1, regs); cpu_id = regs[0]; cpu_procinfo = regs[1]; cpu_feature = regs[3]; cpu_feature2 = regs[2]; +#endif + + cpu_vendor_id = find_cpu_vendor_id(); /* * Clear "Limit CPUID Maxval" bit and get the largest standard CPUID @@ -530,7 +1223,9 @@ identify_cpu(void) * for probing correct CPU topology later. * XXX This is only done on the BSP package. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4) { + if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4 && + ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) >= 0xe))) { uint64_t msr; msr = rdmsr(MSR_IA32_MISC_ENABLE); if ((msr & 0x400000ULL) != 0) { @@ -566,12 +1261,25 @@ identify_cpu(void) cpu_stdext_feature &= ~cpu_stdext_disable; } +#ifdef __i386__ + if (cpu_high > 0 && + (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_TRANSMETA || + cpu_vendor_id == CPU_VENDOR_CENTAUR || + cpu_vendor_id == CPU_VENDOR_NSC)) { + do_cpuid(0x80000000, regs); + if (regs[0] >= 0x80000000) + cpu_exthigh = regs[0]; + } +#else if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; } +#endif if (cpu_exthigh >= 0x80000001) { do_cpuid(0x80000001, regs); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:53:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7E7B272 for ; Thu, 4 Sep 2014 14:53:10 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 468BE1305 for ; Thu, 4 Sep 2014 14:53:10 +0000 (UTC) Received: (qmail 79502 invoked by uid 89); 4 Sep 2014 14:53:02 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 4 Sep 2014 14:53:02 -0000 Received: (qmail 79419 invoked by uid 89); 4 Sep 2014 14:52:44 -0000 Received: by simscan 1.3.1 ppid: 79411, pid: 79415, t: 0.1011s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 4 Sep 2014 14:52:44 -0000 Received: (qmail 18342 invoked by uid 89); 4 Sep 2014 14:52:44 -0000 Received: by simscan 1.4.0 ppid: 18313, pid: 18328, t: 0.9655s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 4 Sep 2014 14:52:43 -0000 From: Jan Beich To: Stefan Esser Subject: Re: svn commit: r270232 - head/tools/tools/vt/keymaps References: <201408201707.s7KH7gtX009303@svn.freebsd.org> Date: Thu, 04 Sep 2014 16:52:38 +0200 In-Reply-To: <201408201707.s7KH7gtX009303@svn.freebsd.org> (Stefan Esser's message of "Wed, 20 Aug 2014 17:07:42 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:53:10 -0000 Stefan Esser writes: > Author: se > Date: Wed Aug 20 17:07:41 2014 > New Revision: 270232 > URL: http://svnweb.freebsd.org/changeset/base/270232 > > Log: > The conversion tools have been further improved and some erroneous > conversions have been detected and fixed. [...] > sub local_to_UCS_code > { > my ($char) = @_; > > - return prettyprint_token(ord(Encode::decode("UTF-8", local_to_UCS_string($char)))); > + my $ucs_char = ord(Encode::decode("UTF-8", local_to_UCS_string($char))); > + > + $current_char = lc(chr($ucs_char)), print("SETCUR: $ucs_char\n") > + if $current_char eq ""; The script now emits |SETCUR: 123| lines that kbdcontrol(1) doesn't like. Either removing debug |print| or adding STDERR seems to fix. $ perl tools/tools/vt/keymaps/convert-keymap.pl \ share/vt/keymaps/us.kbd ASCII >foo.kbd $ kbdcontrol -l ./foo.kbd Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D24F95A6; Thu, 4 Sep 2014 14:56:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE0A61332; Thu, 4 Sep 2014 14:56:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84EuOKb068914; Thu, 4 Sep 2014 14:56:24 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84EuOEU068913; Thu, 4 Sep 2014 14:56:24 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409041456.s84EuOEU068913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Thu, 4 Sep 2014 14:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271099 - head/sys/dev/xen/blkfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:56:24 -0000 Author: royger Date: Thu Sep 4 14:56:24 2014 New Revision: 271099 URL: http://svnweb.freebsd.org/changeset/base/271099 Log: Revert r269814: blkfront: add support for unmapped IO Current busdma code for unmapped bios will not properly align the segment size, causing corruption on blkfront devices. Revert the commit until busdma code is fixed. Reported by: mav MFC after: 1 day Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Thu Sep 4 14:26:25 2014 (r271098) +++ head/sys/dev/xen/blkfront/blkfront.c Thu Sep 4 14:56:24 2014 (r271099) @@ -272,12 +272,8 @@ xbd_queue_request(struct xbd_softc *sc, { int error; - if (cm->cm_bp != NULL) - error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, - cm->cm_bp, xbd_queue_cb, cm, 0); - else - error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, - cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); + error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, + cm->cm_datalen, xbd_queue_cb, cm, 0); if (error == EINPROGRESS) { /* * Maintain queuing order by freezing the queue. The next @@ -337,6 +333,8 @@ xbd_bio_command(struct xbd_softc *sc) } cm->cm_bp = bp; + cm->cm_data = bp->bio_data; + cm->cm_datalen = bp->bio_bcount; cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; switch (bp->bio_cmd) { @@ -995,7 +993,7 @@ xbd_instance_create(struct xbd_softc *sc sc->xbd_disk->d_mediasize = sectors * sector_size; sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; - sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; + sc->xbd_disk->d_flags = 0; if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; device_printf(sc->xbd_dev, From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:57:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0ED88C1; Thu, 4 Sep 2014 14:57:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C62E1359; Thu, 4 Sep 2014 14:57:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84Ev5PK069214; Thu, 4 Sep 2014 14:57:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84Ev4ll069209; Thu, 4 Sep 2014 14:57:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041457.s84Ev4ll069209@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 14:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271100 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:57:05 -0000 Author: ian Date: Thu Sep 4 14:57:04 2014 New Revision: 271100 URL: http://svnweb.freebsd.org/changeset/base/271100 Log: Implement the same public interface in imx51 and imx6 iomux; use the common header file for both. Remove some unused code from imx51_iomux. The iomux drivers are required, not optional, adjust the files.* entries accordingly. Deleted: head/sys/arm/freescale/imx/imx51_iomuxvar.h Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx51_iomux.c Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx51 Thu Sep 4 14:57:04 2014 (r271100) @@ -19,7 +19,7 @@ arm/arm/bus_space-v6.c standard arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx53 Thu Sep 4 14:57:04 2014 (r271100) @@ -22,7 +22,7 @@ dev/uart/uart_dev_imx.c optional uart arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 14:57:04 2014 (r271100) @@ -52,6 +52,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # # Not ready yet... # -#arm/freescale/imx/imx51_iomux.c optional iomux -#dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 14:57:04 2014 (r271100) @@ -75,8 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include "imx51_iomuxreg.h" #define IOMUX_WRITE(_sc, _r, _v) \ @@ -177,45 +176,23 @@ iomux_set_pad(unsigned int pin, unsigned iomux_set_pad_sub(iomuxsc, pin, config); } -#ifdef notyet -void -iomux_set_input(unsigned int input, unsigned int config) +static uint32_t +iomux_get_pad_config_sub(struct iomux_softc *sc, uint32_t pin) { - bus_size_t input_ctl_reg = input; - - bus_space_write_4(iomuxsc->iomux_memt, iomuxsc->iomux_memh, - input_ctl_reg, config); -} -#endif + bus_size_t pad_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin); + uint32_t result; -void -iomux_mux_config(const struct iomux_conf *conflist) -{ - int i; + result = IOMUX_READ(sc, pad_reg); - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].pin != IOMUX_CONF_EOT; i++) { - iomux_set_pad_sub(iomuxsc, conflist[i].pin, conflist[i].pad); - iomux_set_function_sub(iomuxsc, conflist[i].pin, - conflist[i].mux); - } + return(result); } -#ifdef notyet -void -iomux_input_config(const struct iomux_input_conf *conflist) +unsigned int +iomux_get_pad_config(unsigned int pin) { - int i; - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].inout != -1; i++) { - iomux_set_inout(iomuxsc, conflist[i].inout, - conflist[i].inout_mode); - } + return(iomux_get_pad_config_sub(iomuxsc, pin)); } -#endif uint32_t imx_iomux_gpr_get(u_int regnum) @@ -268,5 +245,5 @@ static driver_t imx_iomux_driver = { static devclass_t imx_iomux_devclass; EARLY_DRIVER_MODULE(imx_iomux, simplebus, imx_iomux_driver, - imx_iomux_devclass, 0, 0, BUS_PASS_BUS - 1); + imx_iomux_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_LATE); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:59:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8DD5B67; Thu, 4 Sep 2014 14:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAFC3137A; Thu, 4 Sep 2014 14:59:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84ExScB069704; Thu, 4 Sep 2014 14:59:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84ExRXr069699; Thu, 4 Sep 2014 14:59:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041459.s84ExRXr069699@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 14:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271101 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:59:29 -0000 Author: ian Date: Thu Sep 4 14:59:27 2014 New Revision: 271101 URL: http://svnweb.freebsd.org/changeset/base/271101 Log: The iomux driver is no longer optional, all imx platforms have it as standard now, so remove it from kernel configs. Modified: head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Thu Sep 4 14:57:04 2014 (r271100) +++ head/sys/arm/conf/DIGI-CCWMX53 Thu Sep 4 14:59:27 2014 (r271101) @@ -120,8 +120,6 @@ device atapci # Only for helper funct device imxata options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Thu Sep 4 14:57:04 2014 (r271100) +++ head/sys/arm/conf/EFIKA_MX Thu Sep 4 14:59:27 2014 (r271101) @@ -116,8 +116,6 @@ device atapci # Only for helper funct device imxata options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Thu Sep 4 14:57:04 2014 (r271100) +++ head/sys/arm/conf/IMX53-QSB Thu Sep 4 14:59:27 2014 (r271101) @@ -119,8 +119,6 @@ options ALT_BREAK_TO_DEBUGGER #device imxata #options ATA_STATIC_ID # Static device numbering -device iomux # IO Multiplexor - device gpio device gpioled Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Thu Sep 4 14:57:04 2014 (r271100) +++ head/sys/arm/conf/IMX6 Thu Sep 4 14:59:27 2014 (r271101) @@ -80,7 +80,6 @@ device md # Memory "disks" device ether # Ethernet support device miibus # Required for ethernet device bpf # Berkeley packet filter (required for DHCP) -#device iomux # IO Multiplexor # General-purpose input/output device gpio From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:59:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F127CA0; Thu, 4 Sep 2014 14:59:36 +0000 (UTC) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05460137C; Thu, 4 Sep 2014 14:59:34 +0000 (UTC) Received: by mail-we0-f179.google.com with SMTP id t60so10273201wes.38 for ; Thu, 04 Sep 2014 07:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=WlUf4QtExXxuzCgG4OgCOewyY32pi5j3OMOlziHnsA0=; b=UsE1G7dDxhxfo4BBfREuzRn5GEtJLcYqllMnhkxV+irsrEsq8zNpRmNj5bmLm5JGRx JBqqpc3cq97l3aZxVxaYno19J0HGiDEfDG+B0Cdcj0GZeINDgH5qUN61m7HjYamOrbC5 MYs+1soPLhBmgixCnA/pW7JuYW/NNQ162j4awSWCwMU0bWXIftoufo/o9L9+H86RnWPU Tt4FEyWS/0ZeE9/Uf4DR/BgYVs0TLgLCogQ44ZSvTmoMQw2A0AXHfWTr5iTWCxVqNMgy Weln9m8uPZKhXu0qWN3fVDensd6nRrdzu8Deqn2X7xk/3k0u1vOZP5xA6W6Q0V4cVs+r MAsw== X-Received: by 10.180.102.130 with SMTP id fo2mr6553087wib.29.1409842772586; Thu, 04 Sep 2014 07:59:32 -0700 (PDT) Received: from [172.16.1.30] (124.Red-83-33-238.dynamicIP.rima-tde.net. [83.33.238.124]) by mx.google.com with ESMTPSA id kw2sm19681177wjb.30.2014.09.04.07.59.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Sep 2014 07:59:31 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <54087E4B.7070405@FreeBSD.org> Date: Thu, 04 Sep 2014 16:59:23 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Alexander Motin , John-Mark Gurney Subject: Re: svn commit: r269814 - head/sys/dev/xen/blkfront References: <53e8e31e.2179.30c1c657@svn.freebsd.org> <53FF7386.3050804@FreeBSD.org> <20140828184515.GV71691@funkthat.com> <53FF7BC4.6050801@FreeBSD.org> <5400BDC7.7020902@FreeBSD.org> <54058E1E.4050907@FreeBSD.org> <20140902171841.GX71691@funkthat.com> <5407385B.1000005@FreeBSD.org> <54073BC2.1000703@FreeBSD.org> In-Reply-To: <54073BC2.1000703@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, scottl@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, gibbs@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:59:36 -0000 El 03/09/14 a les 18.03, Alexander Motin ha escrit: > On 03.09.2014 18:48, Roger Pau Monné wrote: >> El 02/09/14 a les 19.18, John-Mark Gurney ha escrit: >>> Roger Pau Monn wrote this message on Tue, Sep 02, 2014 at 11:30 +0200: >>>> El 29/08/14 a les 19.52, Roger Pau Monné ha escrit: >>>>> El 28/08/14 a les 20.58, Alexander Motin ha escrit: >>>>>> On 28.08.2014 21:45, John-Mark Gurney wrote: >>>>>>> Alexander Motin wrote this message on Thu, Aug 28, 2014 at 21:23 +0300: >>>>>>>> Hi, Roger. >>>>>>>> >>>>>>>> It looks to me like this commit does not work as it should. I got >>>>>>>> problem when I just tried `newfs /dev/ada0 ; mount /dev/ada0 /mnt`. >>>>>>>> Somehow newfs does not produce valid filesystem. Problem is reliably >>>>>>>> repeatable and reverting this commit fixes it. >>>>>>>> >>>>>>>> I found at least one possible cause there: If original data buffer is >>>>>>>> unmapped, misaligned and not physically contiguous, then present x86 >>>>>>>> bus_dmamap_load_bio() implementation will process each physically >>>>>>>> contiguous segment separately. Due to the misalignment first and last >>>>>>>> physical segments may have size not multiple to 512 bytes. Since each >>>>>>>> segment processed separately, they are not joined together, and >>>>>>>> xbd_queue_cb() is getting segments not multiple to 512 bytes. Attempt to >>>>>>>> convert them to exact number of sectors in the driver cause data corruption. >>>>>>> >>>>>>> Are you sure this isn't a problem w/ the tag not properly specifying >>>>>>> the correct alignement? >>>>>> >>>>>> I don't know how to specify it stronger then this: >>>>>> error = bus_dma_tag_create( >>>>>> bus_get_dma_tag(sc->xbd_dev), /* parent */ >>>>>> 512, PAGE_SIZE, /* algnmnt, boundary */ >>>>>> BUS_SPACE_MAXADDR, /* lowaddr */ >>>>>> BUS_SPACE_MAXADDR, /* highaddr */ >>>>>> NULL, NULL, /* filter, filterarg */ >>>>>> sc->xbd_max_request_size, >>>>>> sc->xbd_max_request_segments, >>>>>> PAGE_SIZE, /* maxsegsize */ >>>>>> BUS_DMA_ALLOCNOW, /* flags */ >>>>>> busdma_lock_mutex, /* lockfunc */ >>>>>> &sc->xbd_io_lock, /* lockarg */ >>>>>> &sc->xbd_io_dmat); >>>>>> >>>>>>> Also, I don't think there is a way for busdma >>>>>>> to say that you MUST have a segment be a multiple of 512, though you >>>>>>> could use a 512 boundary, but that would force all segments to only be >>>>>>> 512 bytes... >>>>>> >>>>>> As I understand, that is mandatory requirement for this "hardware". >>>>>> Alike 4K alignment requirement also exist at least for SDHCI, and IIRC >>>>>> UHCI/OHCI hardware. Even AHCI requires both segment addresses and >>>>>> lengths to be even. >>>>>> >>>>>> I may be wrong, but I think it is quite likely that hardware that >>>>>> requires segment address alignment quite likely will have the same >>>>>> requirements for segments length. >>>> >>>> Hello, >>>> >>>> I have the following fix, which makes sure the total length and the >>>> size of each segment is aligned. I'm not very knowledgeable of the >>>> busdma code, so someone has to review it. >>> >>> I feel that this alignment should only be enforced via a new option on >>> the tag... I don't see how alignment and segment size should be >>> conflated... I could totally see a device that requires an alignement >>> of 8 bytes, but has a segment size of 16, or vice versa, and requiring >>> them to be the same means we will bounce unnecesarily... >>> >>> cc'd scottl since he knows this code better than I... and cperciva as >>> he touched it for similar reasons.. >>> >>> Oh, I just found PR 152818, where cperciva did a similar fix to >>> bounce_bus_dmamap_load_buffer for the exact same reason... It was >>> committed in r216194... >> >> Since Xen blkfront seems to be the only driver to have such segment >> size requirements, > > No, it is not. I've already posted other examples I can recall: SDHCI, > UHCI/OHCI and AHCI. Their limitations are different and less strict, but > still may need handling. For SDHCI, since it is quite slow and has many > other bugs, I practically implemented custom buffer bouncing. AHCI I > suppose works only because limitation is only for even addresses, and > odd ones happen extremely rarely (does not happen). For USB I am not > sure, but at least umass driver does not support unmapped I/O. > >> it might be best to just fix blkfront to always >> roundup segment size to 512, like the following: > > I think some coffee is needed here. ;) Rounding addresses won't make > data properly aligned. Some copy is unavoidable in such cases. It would > be good if it was done properly by default buffer bouncer. I've just reverted the commit, will look into fixing busdma when I'm back from vacations :). I really wanted to get this into 10.1 because it makes a noticeable speed improvement, but I think it's going to miss the release. Roger. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 15:11:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39CEE646; Thu, 4 Sep 2014 15:11:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25A85174D; Thu, 4 Sep 2014 15:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84FBw6u078743; Thu, 4 Sep 2014 15:11:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84FBwt4078742; Thu, 4 Sep 2014 15:11:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041511.s84FBwt4078742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 15:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271102 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 15:11:58 -0000 Author: ian Date: Thu Sep 4 15:11:57 2014 New Revision: 271102 URL: http://svnweb.freebsd.org/changeset/base/271102 Log: Implement the imx_iomux_get/set_gpr() interface for imx6. Modified: head/sys/arm/freescale/imx/imx6_iomux.c Modified: head/sys/arm/freescale/imx/imx6_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_iomux.c Thu Sep 4 14:59:27 2014 (r271101) +++ head/sys/arm/freescale/imx/imx6_iomux.c Thu Sep 4 15:11:57 2014 (r271102) @@ -166,6 +166,42 @@ iomux_get_pad_config(unsigned int pin) return(iomux_get_pad_config_sub(iomuxsc, pin)); } + +uint32_t +imx_iomux_gpr_get(u_int regnum) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_get() called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_get bad regnum %u", regnum)); + return (IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum)); +} + +void +imx_iomux_gpr_set(u_int regnum, uint32_t val) +{ + + KASSERT(iomuxsc != NULL, ("imx_iomux_gpr_set() called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_set bad regnum %u", regnum)); + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + +void +imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +{ + uint32_t val; + + KASSERT(iomuxsc != NULL, + ("imx_iomux_gpr_set_masked called before attach")); + KASSERT(regnum >= 0 && regnum <= 13, + ("imx_iomux_gpr_set_masked bad regnum %u", regnum)); + + val = IOMUX_READ(iomuxsc, IOMUXC_GPR0 + regnum); + val = (val & ~clrbits) | setbits; + IOMUX_WRITE(iomuxsc, IOMUXC_GPR0 + regnum, val); +} + static device_method_t imx6_iomux_methods[] = { /* Device interface */ DEVMETHOD(device_probe, imx6_iomux_probe), From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:49:14 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C027EEC; Thu, 4 Sep 2014 14:49:14 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24D84123F; Thu, 4 Sep 2014 14:49:13 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 345B11B30EA; Thu, 4 Sep 2014 10:49:13 -0400 (EDT) Received: from [127.0.0.1] (vnat004.nandomedia.com [166.108.31.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id B73481B30E5; Thu, 4 Sep 2014 10:49:09 -0400 (EDT) Message-ID: <54087BE4.6030601@mail.lifanov.com> Date: Thu, 04 Sep 2014 10:49:08 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Steven Hartland , Andriy Gapon , John Baldwin Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> <2230377.GgKARkJyaG@ralph.baldwin.cx> <540778A2.3080809@mail.lifanov.com> <5407816B.9000401@FreeBSD.org> <86292055B4114529874B693EEB441CB6@multiplay.co.uk> In-Reply-To: <86292055B4114529874B693EEB441CB6@multiplay.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 04 Sep 2014 15:35:50 +0000 Cc: src-committers@FreeBSD.org, Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:49:14 -0000 On 09/03/14 21:18, Steven Hartland wrote: > > ----- Original Message ----- From: "Andriy Gapon" > > >> on 03/09/2014 23:22 Nikolai Lifanov said the following: >>> On 09/03/14 15:22, John Baldwin wrote: >>>> On Wednesday, September 03, 2014 11:05:04 AM Nikolai Lifanov wrote: >>>>> On 09/03/14 04:09, Steven Hartland wrote: >>>>>> I'm looking to MFC this change so wanted to check if >>>>>> anyone had an final feedback / objections? >>>>>> >>>>>> I know we currently have Alan's feedback on changing >>>>>> the #ifdef __i386__ to #ifndef UMA_MD_SMALL_ALLOC >>>>>> which sounds sensible but waiting Peter to comment on. >>>>>> >>>>>> Regards >>>>>> Steve >>>>> >>>>> I have no technical input, but this change improves ARC usefulness for >>>>> me quite a bit. I would like to see the improvement in 10-STABLE. >>>> >>>> Can you verify that the current 10-STABLE (as of today) with all the >>>> various pagedaemon fixes still has ARC issues for your workload? >>>> >>> >>> It doesn't have any issues, but I noticed the improvement on CURRENT. I >>> observed that just after this change, my package builder is much more >>> likely to retain MFU and not evict useful things from there (the port >>> tree) after large builds. >>> However, I run a lot more 10.0-RELEASE than CURRENT and I would like to >>> see this improvement release-bound. >>> >>> I would be happy to test this on 10-STABLE if you think that this is >>> relevant. >> >> >> As noted before, unfortunately, this commit (plus its fixups) contains >> at least >> two related but distinct changes. So, to separate the wheat from the >> chaff, >> could you please try to comment out the following block in >> sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c, function >> arc_reclaim_needed: >> >> if (kmem_free_count() < zfs_arc_free_target) { >> DTRACE_PROBE2(arc__reclaim_freetarget, uint64_t, >> kmem_free_count(), uint64_t, zfs_arc_free_target); >> return (1); >> } >> >> Alternatively, I think that the same effect can be achieved by setting >> sysctl >> vfs.zfs.arc_free_target to the same value as vm.stats.vm.v_free_min. > > Thats correct that would achieve the same thing. > >> It's interesting to me whether you would still see the better >> performance or if >> that improvement would be undone. > > Indeed that would be interesting, but we might find that its quite > memory size > dependent given the scaling so confirming HW details would be nice too. > > I'd also be interested to know who wins the free race between the VM and > ARC > when using that value. > > For those following this thread but not the review, I've added some > additional > information there which you might be interested in: > https://reviews.freebsd.org/D702 > > Regards > Steve Just an update: I'm in the middle of testing this. I have to finish a large bulk build to observe the behavior one way or another. I have 32G of physical memory and 2x16G dedicated swap SSDs (L2ARC wasn't very useful, but I should probably retest this) on this machine. My ARC is usually at 14G with ~5G of MFU full of things I benefit from keeping there (port trees, base jails). Builds themselves happen in tmpfs and I usually have around 1.5G - 4G "Free" memory (unless building something like pypy). - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 15:56:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC87644A; Thu, 4 Sep 2014 15:56:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C43FD1CF4; Thu, 4 Sep 2014 15:56:10 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BD358B9C9; Thu, 4 Sep 2014 11:56:09 -0400 (EDT) From: John Baldwin To: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 Date: Thu, 04 Sep 2014 09:56:05 -0400 Message-ID: <4450256.opGGntPoIk@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409040237.s842bLJn092072@gw.catspoiler.org> References: <201409040237.s842bLJn092072@gw.catspoiler.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Sep 2014 11:56:09 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 15:56:11 -0000 On Wednesday, September 03, 2014 07:37:21 PM Don Lewis wrote: > On 4 Sep, John Baldwin wrote: > > Author: jhb > > Date: Thu Sep 4 01:46:06 2014 > > New Revision: 271076 > > URL: http://svnweb.freebsd.org/changeset/base/271076 > > > > Log: > > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. > > That certainly brings back memories ... Hopefully not too traumatic. :-P -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 15:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC405514; Thu, 4 Sep 2014 15:56:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A593E1CF6; Thu, 4 Sep 2014 15:56:11 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 845D9B95E; Thu, 4 Sep 2014 11:56:10 -0400 (EDT) From: John Baldwin To: Benno Rice Subject: Re: svn commit: r271085 - head/lib/libgeom Date: Thu, 04 Sep 2014 09:51:53 -0400 Message-ID: <3000146.5OWvozVApa@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409040331.s843Vn5c048905@svn.freebsd.org> References: <201409040331.s843Vn5c048905@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Sep 2014 11:56:10 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 15:56:12 -0000 On Thursday, September 04, 2014 03:31:49 AM Benno Rice wrote: > Author: benno > Date: Thu Sep 4 03:31:48 2014 > New Revision: 271085 > URL: http://svnweb.freebsd.org/changeset/base/271085 > > Log: > Systems with lots of geom providers can end up with a kern.geom.confxml > value too large for the buffer allocated. Work around this by retrying > a few times with larger buffer sizes. Are these systems having lots of changes to the GEOM tree while the sysctl handler is being invoked? If the tree is static, the first call with an old of NULL should return the correct length in 'l' regardless of the size as it generates the entire buffer and SYSCTL_OUT's it. (It doesn't do it piecemeal and fail on ENOMEM part way through the way some other broken sysctl handlers do.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 15:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D46216AD; Thu, 4 Sep 2014 15:56:12 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 885DD1CF8; Thu, 4 Sep 2014 15:56:12 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 94505B96C; Thu, 4 Sep 2014 11:56:11 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r271082 - in head/sys: i386/i386 x86/x86 Date: Thu, 04 Sep 2014 09:46:43 -0400 Message-ID: <2864186.iHqG44B5Un@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409040226.s842Q0VE016942@svn.freebsd.org> References: <201409040226.s842Q0VE016942@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Sep 2014 11:56:11 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 15:56:13 -0000 On Thursday, September 04, 2014 02:26:00 AM John Baldwin wrote: > Author: jhb > Date: Thu Sep 4 02:25:59 2014 > New Revision: 271082 > URL: http://svnweb.freebsd.org/changeset/base/271082 > > Log: > - Move blacklists of broken TSCs out of the printcpuinfo() function > and into the TSC probe routine. I believe the previous code that set tsc_freq to 0 didn't fully work since the ticker was still set to use the TSC in init_TC(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 16:24:19 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73C6667F; Thu, 4 Sep 2014 16:24:19 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5505F10B7; Thu, 4 Sep 2014 16:24:19 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s84GMm0g093821; Thu, 4 Sep 2014 09:22:52 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201409041622.s84GMm0g093821@gw.catspoiler.org> Date: Thu, 4 Sep 2014 09:22:48 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 To: jhb@FreeBSD.org In-Reply-To: <4450256.opGGntPoIk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 16:24:19 -0000 On 4 Sep, John Baldwin wrote: > On Wednesday, September 03, 2014 07:37:21 PM Don Lewis wrote: >> On 4 Sep, John Baldwin wrote: >> > Author: jhb >> > Date: Thu Sep 4 01:46:06 2014 >> > New Revision: 271076 >> > URL: http://svnweb.freebsd.org/changeset/base/271076 >> > >> > Log: >> > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. >> >> That certainly brings back memories ... > > Hopefully not too traumatic. :-P Not really. I remember the general sense of panic when the vulnerability was announced and then the sense of relief when the workaround was found. After that, I got lots of reminders because of the boot message. I've still got the old hardware and am often tempted to see if it will run a recent version of FreeBSD. I don't think I want to know how long it would take to run buildworld post-clang. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 16:29:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9087D9FE for ; Thu, 4 Sep 2014 16:29:29 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B648114F for ; Thu, 4 Sep 2014 16:29:29 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by gateway2.nyi.internal (Postfix) with ESMTP id 7FE3720424 for ; Thu, 4 Sep 2014 12:29:27 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 04 Sep 2014 12:29:27 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id :references:to; s=smtpout; bh=oVzTDre9eLFBF/xtAkRfzhyxBgU=; b=it fypXgCIc3QqM16ujzFXW4i2C2HO0r7ZN/ubPGvLijXFQCO+Q6t/mLmBM0u6Jz1Pf iGACwtCJ2qnX4N53UysYJdAB95LKuH2qqntz3aGqsf9+RS2KQWiTqbMX4Eyvt7Zj NOzyfEjGSTgJNo5TigsQfXvHaLy1wnVBDAilvEC0Y= X-Sasl-enc: 1FZvFKuIm0OXMseHBmaOC0dF3JIQQhpfjcvhC26Q7Jlf 1409848167 Received: from mitterweile2.jeamland.net (unknown [67.182.141.248]) by mail.messagingengine.com (Postfix) with ESMTPA id 4269668008D; Thu, 4 Sep 2014 12:29:26 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271085 - head/lib/libgeom From: Benno Rice In-Reply-To: <3000146.5OWvozVApa@ralph.baldwin.cx> Date: Thu, 4 Sep 2014 09:29:24 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <10BDD3FC-EED9-4A47-BAF4-8F3C2925A3E3@FreeBSD.org> References: <201409040331.s843Vn5c048905@svn.freebsd.org> <3000146.5OWvozVApa@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 16:29:29 -0000 On Sep 4, 2014, at 6:51 AM, John Baldwin wrote: > On Thursday, September 04, 2014 03:31:49 AM Benno Rice wrote: >> Author: benno >> Date: Thu Sep 4 03:31:48 2014 >> New Revision: 271085 >> URL: http://svnweb.freebsd.org/changeset/base/271085 >>=20 >> Log: >> Systems with lots of geom providers can end up with a = kern.geom.confxml >> value too large for the buffer allocated. Work around this by = retrying >> a few times with larger buffer sizes. >=20 > Are these systems having lots of changes to the GEOM tree while the = sysctl=20 > handler is being invoked? If the tree is static, the first call with = an old=20 > of NULL should return the correct length in 'l' regardless of the size = as it=20 > generates the entire buffer and SYSCTL_OUT's it. (It doesn't do it = piecemeal=20 > and fail on ENOMEM part way through the way some other broken sysctl = handlers=20 > do.) These systems have a lot of drives in them and around the time when = we=92re trying to enumerate there can be lots of activity. In the case = where the tree hasn=92t changed we=92re not doing that much extra work = here and it saves us having to retry everything that happens around the = geom_getxml calls inside libgeom when the tree does change.= From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 16:40:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99659B0; Thu, 4 Sep 2014 16:40:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 853581352; Thu, 4 Sep 2014 16:40:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84Gesu1018828; Thu, 4 Sep 2014 16:40:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84GesmM018827; Thu, 4 Sep 2014 16:40:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409041640.s84GesmM018827@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 4 Sep 2014 16:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271104 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 16:40:54 -0000 Author: imp Date: Thu Sep 4 16:40:54 2014 New Revision: 271104 URL: http://svnweb.freebsd.org/changeset/base/271104 Log: Wrap some long lines. Modified: head/sys/arm/at91/at91_pinctrl.c Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Thu Sep 4 16:05:12 2014 (r271103) +++ head/sys/arm/at91/at91_pinctrl.c Thu Sep 4 16:40:54 2014 (r271104) @@ -138,8 +138,8 @@ at91_pinctrl_setup_dinfo(device_t dev, p } if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1>\n"); + device_printf(dev, "Missing #interrupt-cells property," + " assuming <1>\n"); icells = 1; } if (icells < 1 || icells > nintr) { @@ -388,19 +388,22 @@ pinctrl_walk_tree(device_t bus, phandle_ OF_getprop(node, "status", status, sizeof(status)); OF_getprop(node, "name", name, sizeof(name)); if (strcmp(status, "okay") != 0) { -// printf("pinctrl: omitting node %s since it isn't active\n", name); +// printf("pinctrl: skipping node %s status %s\n", name, +// status); continue; } len = OF_getencprop(node, "pinctrl-0", pinctrl, sizeof(pinctrl)); if (len <= 0) { -// printf("pinctrl: no pinctrl-0 property for node %s, omitting\n", name); +// printf("pinctrl: skipping node %s no pinctrl-0\n", +// name, status); continue; } len /= sizeof(phandle_t); printf("pinctrl: Found active node %s\n", name); for (i = 0; i < len; i++) { scratch = OF_node_from_xref(pinctrl[i]); - npins = OF_getencprop(scratch, "atmel,pins", pins, sizeof(pins)); + npins = OF_getencprop(scratch, "atmel,pins", pins, + sizeof(pins)); if (npins <= 0) { printf("We're doing it wrong %s\n", name); continue; @@ -408,29 +411,40 @@ pinctrl_walk_tree(device_t bus, phandle_ memset(name, 0, sizeof(name)); OF_getprop(scratch, "name", name, sizeof(name)); npins /= (4 * 4); - printf("----> need to cope with %d more pins for %s\n", npins, name); + printf("----> need to cope with %d more pins for %s\n", + npins, name); for (j = 0; j < npins; j++) { uint32_t unit = pins[j * 4]; uint32_t pin = pins[j * 4 + 1]; uint32_t periph = pins[j * 4 + 2]; uint32_t flags = pins[j * 4 + 3]; - uint32_t pio = (0xfffffff & sc->ranges[0].bus) + 0x200 * unit; - printf("P%c%d %s %#x\n", unit + 'A', pin, periphs[periph], - flags); + uint32_t pio; + + pio = (0xfffffff & sc->ranges[0].bus) + + 0x200 * unit; + printf("P%c%d %s %#x\n", unit + 'A', pin, + periphs[periph], flags); switch (periph) { case 0: at91_pio_use_gpio(pio, 1u << pin); - at91_pio_gpio_pullup(pio, 1u << pin, !!(flags & 1)); - at91_pio_gpio_high_z(pio, 1u << pin, !!(flags & 2)); - at91_pio_gpio_set_deglitch(pio, 1u << pin, !!(flags & 4)); - // at91_pio_gpio_pulldown(pio, 1u << pin, !!(flags & 8)); - // at91_pio_gpio_dis_schmidt(pio, 1u << pin, !!(flags & 16)); + at91_pio_gpio_pullup(pio, 1u << pin, + !!(flags & 1)); + at91_pio_gpio_high_z(pio, 1u << pin, + !!(flags & 2)); + at91_pio_gpio_set_deglitch(pio, + 1u << pin, !!(flags & 4)); +// at91_pio_gpio_pulldown(pio, 1u << pin, +// !!(flags & 8)); +// at91_pio_gpio_dis_schmidt(pio, +// 1u << pin, !!(flags & 16)); break; case 1: - at91_pio_use_periph_a(pio, 1u << pin, flags); + at91_pio_use_periph_a(pio, 1u << pin, + flags); break; case 2: - at91_pio_use_periph_b(pio, 1u << pin, flags); + at91_pio_use_periph_b(pio, 1u << pin, + flags); break; } } @@ -493,8 +507,8 @@ static driver_t at91_pinctrl_driver = { static devclass_t at91_pinctrl_devclass; -EARLY_DRIVER_MODULE(at91_pinctrl, simplebus, at91_pinctrl_driver, at91_pinctrl_devclass, - NULL, NULL, BUS_PASS_BUS); +EARLY_DRIVER_MODULE(at91_pinctrl, simplebus, at91_pinctrl_driver, + at91_pinctrl_devclass, NULL, NULL, BUS_PASS_BUS); /* * dummy driver to force pass BUS_PASS_PINMUX to happen. @@ -520,5 +534,5 @@ static driver_t at91_pingroup_driver = { static devclass_t at91_pingroup_devclass; -EARLY_DRIVER_MODULE(at91_pingroup, at91_pinctrl, at91_pingroup_driver, at91_pingroup_devclass, - NULL, NULL, BUS_PASS_PINMUX); +EARLY_DRIVER_MODULE(at91_pingroup, at91_pinctrl, at91_pingroup_driver, + at91_pingroup_devclass, NULL, NULL, BUS_PASS_PINMUX); From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 16:51:43 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 5D1B7454; Thu, 4 Sep 2014 16:51:43 +0000 (UTC) Date: Thu, 4 Sep 2014 16:51:43 +0000 From: Alexey Dokuchaev To: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 Message-ID: <20140904165143.GA81805@FreeBSD.org> References: <4450256.opGGntPoIk@ralph.baldwin.cx> <201409041622.s84GMm0g093821@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409041622.s84GMm0g093821@gw.catspoiler.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 16:51:43 -0000 On Thu, Sep 04, 2014 at 09:22:48AM -0700, Don Lewis wrote: > I've still got the old hardware and am often tempted to see if it will > run a recent version of FreeBSD. I don't think I want to know how long > it would take to run buildworld post-clang. My router machine at home is Mendocino-based, runs 9-STABLE flawlessly, not sure how long does it take to do buildworld (I don't disable Clang). I have a couple of P55-based mobos, but never bothered to install our fresh -CURRENT on them. I guess I should, just to see if we still rock. ;-) ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:05:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D640DCA; Thu, 4 Sep 2014 17:05:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19429179D; Thu, 4 Sep 2014 17:05:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84H5v6w032741; Thu, 4 Sep 2014 17:05:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84H5vsE032740; Thu, 4 Sep 2014 17:05:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409041705.s84H5vsE032740@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 17:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271107 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:05:58 -0000 Author: glebius Date: Thu Sep 4 17:05:57 2014 New Revision: 271107 URL: http://svnweb.freebsd.org/changeset/base/271107 Log: Fixes for tcp_respond() comment. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Sep 4 16:55:01 2014 (r271106) +++ head/sys/netinet/tcp_subr.c Thu Sep 4 17:05:57 2014 (r271107) @@ -539,16 +539,16 @@ tcpip_maketemplate(struct inpcb *inp) /* * Send a single message to the TCP at address specified by * the given TCP/IP header. If m == NULL, then we make a copy - * of the tcpiphdr at ti and send directly to the addressed host. + * of the tcpiphdr at th and send directly to the addressed host. * This is used to force keep alive messages out using the TCP * template for a connection. If flags are given then we send - * a message back to the TCP which originated the * segment ti, + * a message back to the TCP which originated the segment th, * and discard the mbuf containing it and any other attached mbufs. * * In any case the ack and sequence number of the transmitted * segment are as specified by the parameters. * - * NOTE: If m != NULL, then ti must point to *inside* the mbuf. + * NOTE: If m != NULL, then th must point to *inside* the mbuf. */ void tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:11:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACCFA203; Thu, 4 Sep 2014 17:11:53 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5F918A9; Thu, 4 Sep 2014 17:11:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s84HBqJV099263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2014 10:11:52 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s84HBq1W099262; Thu, 4 Sep 2014 10:11:52 -0700 (PDT) (envelope-from jmg) Date: Thu, 4 Sep 2014 10:11:52 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r270999 - head/sys/kern Message-ID: <20140904171151.GF82175@funkthat.com> References: <201409030814.s838E7A2084257@svn.freebsd.org> <20140903085523.GB13871@dft-labs.eu> <20140903094916.GO7693@FreeBSD.org> <20140903191028.GG71691@funkthat.com> <20140904091844.GC7693@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140904091844.GC7693@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Sep 2014 10:11:52 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , kib@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:11:53 -0000 Gleb Smirnoff wrote this message on Thu, Sep 04, 2014 at 13:18 +0400: > On Wed, Sep 03, 2014 at 12:10:28PM -0700, John-Mark Gurney wrote: > J> > M> > + if (p->p_pptr) { > J> > M> > kp->ki_ppid = proc_realparent(p)->p_pid; > J> > M> > - if (p->p_flag & P_TRACED) > J> > M> > - kp->ki_tracer = p->p_pptr->p_pid; > J> > M> > + if (p->p_flag & P_TRACED) > J> > M> > + kp->ki_tracer = p->p_pptr->p_pid; > J> > M> > + } > J> > M> > } > J> > M> > > J> > M> > /* > J> > M> > > J> > M> > J> > M> p_pptr must be non-NULL if P_TRACED is set. If there is no way to > J> > M> annotate it for coverity, this change deserves a comment in the code > J> > M> (and in retrospect previous code should have had appropriate comment as > J> > M> well). > J> > > J> > Thanks for explanation. > J> > > J> > I'd suggest to leave the change in, since now it is a micro-micro-optimization :) > J> > J> If you must leave it in, then at least compare the pointer against > J> NULL, and collapse two if statements into one... > J> > J> We should never introduce new pointer checks that aren't against NULL... > > I don't see how two if statements can be collapsed? We need to assign > ki_ppid regardless of P_TRACED flag. Sorry, misread the diff, you are correct... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:19:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95826631; Thu, 4 Sep 2014 17:19:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81E5C192C; Thu, 4 Sep 2014 17:19:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84HJGfX038116; Thu, 4 Sep 2014 17:19:16 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84HJGYi038115; Thu, 4 Sep 2014 17:19:16 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409041719.s84HJGYi038115@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 4 Sep 2014 17:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271108 - head/tools/tools/vt/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:19:16 -0000 Author: se Date: Thu Sep 4 17:19:16 2014 New Revision: 271108 URL: http://svnweb.freebsd.org/changeset/base/271108 Log: Fix debug output that has erroneously been committed with the last update. Obtained from: Jan Beich MFC after: 3 days Modified: head/tools/tools/vt/keymaps/convert-keymap.pl Modified: head/tools/tools/vt/keymaps/convert-keymap.pl ============================================================================== --- head/tools/tools/vt/keymaps/convert-keymap.pl Thu Sep 4 17:05:57 2014 (r271107) +++ head/tools/tools/vt/keymaps/convert-keymap.pl Thu Sep 4 17:19:16 2014 (r271108) @@ -51,7 +51,7 @@ sub local_to_UCS_code my $ucs_char = ord(Encode::decode("UTF-8", local_to_UCS_string($char))); - $current_char = lc(chr($ucs_char)), print("SETCUR: $ucs_char\n") + $current_char = lc(chr($ucs_char)) if $current_char eq ""; $ucs_char = 0x20ac # replace with Euro character From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:19:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C36B67AB; Thu, 4 Sep 2014 17:19:47 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 859451940; Thu, 4 Sep 2014 17:19:47 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s84HJkc1099374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2014 10:19:46 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s84HJkqQ099373; Thu, 4 Sep 2014 10:19:46 -0700 (PDT) (envelope-from jmg) Date: Thu, 4 Sep 2014 10:19:46 -0700 From: John-Mark Gurney To: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 Message-ID: <20140904171946.GG82175@funkthat.com> References: <4450256.opGGntPoIk@ralph.baldwin.cx> <201409041622.s84GMm0g093821@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409041622.s84GMm0g093821@gw.catspoiler.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Sep 2014 10:19:46 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:19:47 -0000 Don Lewis wrote this message on Thu, Sep 04, 2014 at 09:22 -0700: > On 4 Sep, John Baldwin wrote: > > On Wednesday, September 03, 2014 07:37:21 PM Don Lewis wrote: > >> On 4 Sep, John Baldwin wrote: > >> > Author: jhb > >> > Date: Thu Sep 4 01:46:06 2014 > >> > New Revision: 271076 > >> > URL: http://svnweb.freebsd.org/changeset/base/271076 > >> > > >> > Log: > >> > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. > >> > >> That certainly brings back memories ... > > > > Hopefully not too traumatic. :-P > > Not really. I remember the general sense of panic when the > vulnerability was announced and then the sense of relief when the > workaround was found. After that, I got lots of reminders because > of the boot message. > > I've still got the old hardware and am often tempted to see if it will > run a recent version of FreeBSD. I don't think I want to know how long > it would take to run buildworld post-clang. Almost as old: FreeBSD 11.0-CURRENT #0 r266964:267061M: Wed Jun 11 15:35:27 PDT 2014 jmg@carbon.funkthat.com:/usr/obj/i386.i386/usr/src/sys/serbox i386 FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 CPU: AMD-K6tm w/ multimedia extensions (200.46-MHz 586-class CPU) Origin="AuthenticAMD" Id=0x562 Family=0x5 Model=0x6 Stepping=2 Features=0x8001bf AMD Features=0x400<> Works great... :) Though I'll admit I didn't buildworld on this, but another newer machine and then dd'd an image onto a CF card.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:22:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 316EAB5A; Thu, 4 Sep 2014 17:22:52 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1DB1A0E; Thu, 4 Sep 2014 17:22:51 +0000 (UTC) Received: from fwd03.aul.t-online.de (fwd03.aul.t-online.de [172.20.27.148]) by mailout02.t-online.de (Postfix) with SMTP id 31F9840E502; Thu, 4 Sep 2014 19:22:43 +0200 (CEST) Received: from [192.168.119.33] (VyC95ZZYZhvspndnCSeyqB1zwNcDQvO6SGYscLGaFjXdo60v3WZnbuGlzAop1cWw4t@[84.154.101.219]) by fwd03.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XPak0-3K8d7I0; Thu, 4 Sep 2014 19:22:36 +0200 Message-ID: <54089FD4.9030002@freebsd.org> Date: Thu, 04 Sep 2014 19:22:28 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Jan Beich Subject: Re: svn commit: r270232 - head/tools/tools/vt/keymaps References: <201408201707.s7KH7gtX009303@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-ID: VyC95ZZYZhvspndnCSeyqB1zwNcDQvO6SGYscLGaFjXdo60v3WZnbuGlzAop1cWw4t X-TOI-MSGID: 267dcd3f-7457-46c1-8b49-67ae1781ae1e Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:22:52 -0000 Am 04.09.2014 um 16:52 schrieb Jan Beich: > Stefan Esser writes: > >> Author: se >> Date: Wed Aug 20 17:07:41 2014 >> New Revision: 270232 >> URL: http://svnweb.freebsd.org/changeset/base/270232 >> >> Log: >> The conversion tools have been further improved and some erroneous >> conversions have been detected and fixed. > [...] >> sub local_to_UCS_code >> { >> my ($char) = @_; >> >> - return prettyprint_token(ord(Encode::decode("UTF-8", local_to_UCS_string($char)))); >> + my $ucs_char = ord(Encode::decode("UTF-8", local_to_UCS_string($char))); >> + >> + $current_char = lc(chr($ucs_char)), print("SETCUR: $ucs_char\n") >> + if $current_char eq ""; > > The script now emits |SETCUR: 123| lines that kbdcontrol(1) doesn't like. > Either removing debug |print| or adding STDERR seems to fix. Hi Jan, this is (obviously) a left-over from some tests, which I have now removed again. Thanks for reporting! Best regards, STefan From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:31:38 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A09827B; Thu, 4 Sep 2014 17:31:38 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47F061AB2; Thu, 4 Sep 2014 17:31:38 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s84HVOv8093974; Thu, 4 Sep 2014 10:31:28 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201409041731.s84HVOv8093974@gw.catspoiler.org> Date: Thu, 4 Sep 2014 10:31:24 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 To: danfe@FreeBSD.org In-Reply-To: <20140904165143.GA81805@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:31:38 -0000 On 4 Sep, Alexey Dokuchaev wrote: > On Thu, Sep 04, 2014 at 09:22:48AM -0700, Don Lewis wrote: >> I've still got the old hardware and am often tempted to see if it will >> run a recent version of FreeBSD. I don't think I want to know how long >> it would take to run buildworld post-clang. > > My router machine at home is Mendocino-based, runs 9-STABLE flawlessly, not > sure how long does it take to do buildworld (I don't disable Clang). My first home machine had a Pentium II CPU. I've got a fair amount of retired Pentium III hardware around still, mostly socket 370 (both Coppermine and Tualatin), but there might be some slot 1 stuff as well. My firewall is still running on a Via C3 CPU in a socket 370, but I don't run buildworld on it. I just use PXE to reinstall for upgrades. > I have a couple of P55-based mobos, but never bothered to install our fresh > -CURRENT on them. I guess I should, just to see if we still rock. ;-) RAM size is the probably the biggest issue. Also, I think all of my boards use the Dallas RTC chip with builtin battery. These boards are approaching twenty years old and Li battery shelf life is only about ten years. Unfortunately this chip is soldered to the motherboard, which makes either the chip replacement or the battery replacement hack more difficult. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:36:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93419553; Thu, 4 Sep 2014 17:36:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9A31BAF; Thu, 4 Sep 2014 17:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84HaMUY047390; Thu, 4 Sep 2014 17:36:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84HaMBc047389; Thu, 4 Sep 2014 17:36:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409041736.s84HaMBc047389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 4 Sep 2014 17:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271110 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:36:22 -0000 Author: pfg Date: Thu Sep 4 17:36:21 2014 New Revision: 271110 URL: http://svnweb.freebsd.org/changeset/base/271110 Log: libc/locale: Remove a wrong comma. This only had some effect when debugging. Obtained from: DragonflyBSD MFC after: 3 days Modified: head/lib/libc/locale/lmonetary.c Modified: head/lib/libc/locale/lmonetary.c ============================================================================== --- head/lib/libc/locale/lmonetary.c Thu Sep 4 17:21:54 2014 (r271109) +++ head/lib/libc/locale/lmonetary.c Thu Sep 4 17:36:21 2014 (r271110) @@ -192,7 +192,7 @@ printf( "int_curr_symbol = %s\n" "n_cs_precedes = %d\n" "n_sep_by_space = %d\n" "p_sign_posn = %d\n" - "n_sign_posn = %d\n", + "n_sign_posn = %d\n" "int_p_cs_precedes = %d\n" "int_p_sep_by_space = %d\n" "int_n_cs_precedes = %d\n" From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 17:41:41 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD2058F9; Thu, 4 Sep 2014 17:41:41 +0000 (UTC) Received: from gw.catspoiler.org (cl-1657.chi-02.us.sixxs.net [IPv6:2001:4978:f:678::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49DF81CAD; Thu, 4 Sep 2014 17:41:41 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s84HfTZd093999; Thu, 4 Sep 2014 10:41:33 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201409041741.s84HfTZd093999@gw.catspoiler.org> Date: Thu, 4 Sep 2014 10:41:29 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 To: jmg@funkthat.com In-Reply-To: <20140904171946.GG82175@funkthat.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 17:41:41 -0000 On 4 Sep, John-Mark Gurney wrote: > Don Lewis wrote this message on Thu, Sep 04, 2014 at 09:22 -0700: >> On 4 Sep, John Baldwin wrote: >> > On Wednesday, September 03, 2014 07:37:21 PM Don Lewis wrote: >> >> On 4 Sep, John Baldwin wrote: >> >> > Author: jhb >> >> > Date: Thu Sep 4 01:46:06 2014 >> >> > New Revision: 271076 >> >> > URL: http://svnweb.freebsd.org/changeset/base/271076 >> >> > >> >> > Log: >> >> > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. >> >> >> >> That certainly brings back memories ... >> > >> > Hopefully not too traumatic. :-P >> >> Not really. I remember the general sense of panic when the >> vulnerability was announced and then the sense of relief when the >> workaround was found. After that, I got lots of reminders because >> of the boot message. >> >> I've still got the old hardware and am often tempted to see if it will >> run a recent version of FreeBSD. I don't think I want to know how long >> it would take to run buildworld post-clang. > > Almost as old: > FreeBSD 11.0-CURRENT #0 r266964:267061M: Wed Jun 11 15:35:27 PDT 2014 > jmg@carbon.funkthat.com:/usr/obj/i386.i386/usr/src/sys/serbox i386 > FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 > CPU: AMD-K6tm w/ multimedia extensions (200.46-MHz 586-class CPU) > Origin="AuthenticAMD" Id=0x562 Family=0x5 Model=0x6 Stepping=2 > Features=0x8001bf > AMD Features=0x400<> > > Works great... :) > > Though I'll admit I didn't buildworld on this, but another newer > machine and then dd'd an image onto a CF card.. How much RAM? I think my boards are using 16 MB DIMMs. Some have two and some have four. It's even ECC RAM. I suspect that ZFS is out of the question, though ... From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 18:13:44 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id F067A57A; Thu, 4 Sep 2014 18:13:44 +0000 (UTC) Date: Thu, 4 Sep 2014 18:13:44 +0000 From: Alexey Dokuchaev To: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 Message-ID: <20140904181344.GA8688@FreeBSD.org> References: <20140904165143.GA81805@FreeBSD.org> <201409041731.s84HVOv8093974@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409041731.s84HVOv8093974@gw.catspoiler.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 18:13:45 -0000 On Thu, Sep 04, 2014 at 10:31:24AM -0700, Don Lewis wrote: > On 4 Sep, Alexey Dokuchaev wrote: > > I have a couple of P55-based mobos, but never bothered to install our > > fresh -CURRENT on them. I guess I should, just to see if we still rock. > > RAM size is the probably the biggest issue. [...] Moments like this I thank that FreeBSD is pretty much the same from the user POV, be it now or 15 years ago. It's still the same console-based install process, with no one pouring full X11 stack on you by default. Not sure how much RAM is required these days to boot into single user and gpart && untar the kernel+base distsets to obtain a minimal working system, but should not be too much. Did anyone try to find out the minimum? 16MB? 32MB? ./danfe P.S. ZFS, well yes, is probably out of question. But UFS is very good FS even by modern standards (no pun intended). From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 18:54:16 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AB002EE; Thu, 4 Sep 2014 18:54:16 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E839915DF; Thu, 4 Sep 2014 18:54:15 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s84IsECj001473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2014 11:54:14 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s84IsER4001472; Thu, 4 Sep 2014 11:54:14 -0700 (PDT) (envelope-from jmg) Date: Thu, 4 Sep 2014 11:54:14 -0700 From: John-Mark Gurney To: Don Lewis Subject: Re: svn commit: r271076 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include pc98/pc98 Message-ID: <20140904185414.GL82175@funkthat.com> References: <20140904171946.GG82175@funkthat.com> <201409041741.s84HfTZd093999@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tjCHc7DPkfUGtrlw" Content-Disposition: inline In-Reply-To: <201409041741.s84HfTZd093999@gw.catspoiler.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Sep 2014 11:54:14 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 18:54:16 -0000 --tjCHc7DPkfUGtrlw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Don Lewis wrote this message on Thu, Sep 04, 2014 at 10:41 -0700: > On 4 Sep, John-Mark Gurney wrote: > > Don Lewis wrote this message on Thu, Sep 04, 2014 at 09:22 -0700: > >> On 4 Sep, John Baldwin wrote: > >> > On Wednesday, September 03, 2014 07:37:21 PM Don Lewis wrote: > >> >> On 4 Sep, John Baldwin wrote: > >> >> > Author: jhb > >> >> > Date: Thu Sep 4 01:46:06 2014 > >> >> > New Revision: 271076 > >> >> > URL: http://svnweb.freebsd.org/changeset/base/271076 > >> >> > > >> >> > Log: > >> >> > - Move the declaration of has_f00f_hack out of identcpu.c to machdep.c. > >> >> > >> >> That certainly brings back memories ... > >> > > >> > Hopefully not too traumatic. :-P > >> > >> Not really. I remember the general sense of panic when the > >> vulnerability was announced and then the sense of relief when the > >> workaround was found. After that, I got lots of reminders because > >> of the boot message. > >> > >> I've still got the old hardware and am often tempted to see if it will > >> run a recent version of FreeBSD. I don't think I want to know how long > >> it would take to run buildworld post-clang. > > > > Almost as old: > > FreeBSD 11.0-CURRENT #0 r266964:267061M: Wed Jun 11 15:35:27 PDT 2014 > > jmg@carbon.funkthat.com:/usr/obj/i386.i386/usr/src/sys/serbox i386 > > FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 > > CPU: AMD-K6tm w/ multimedia extensions (200.46-MHz 586-class CPU) > > Origin="AuthenticAMD" Id=0x562 Family=0x5 Model=0x6 Stepping=2 > > Features=0x8001bf > > AMD Features=0x400<> > > > > Works great... :) > > > > Though I'll admit I didn't buildworld on this, but another newer > > machine and then dd'd an image onto a CF card.. > > How much RAM? I think my boards are using 16 MB DIMMs. Some have two > and some have four. It's even ECC RAM. I suspect that ZFS is out of > the question, though ... It has 128MB... I think I have sticks that I could up it 256MB iirc, but for it's needs (serial terminal server), it doesn't need that much ram... I've attached /var/run/dmesg.boot... The other nice thing is that USB finally works on this thing.. :) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --tjCHc7DPkfUGtrlw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.boot" Copyright (c) 1992-2014 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-CURRENT #0 r266964:267061M: Wed Jun 11 15:35:27 PDT 2014 jmg@carbon.funkthat.com:/usr/obj/i386.i386/usr/src/sys/serbox i386 FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 CPU: AMD-K6tm w/ multimedia extensions (200.46-MHz 586-class CPU) Origin="AuthenticAMD" Id=0x562 Family=0x5 Model=0x6 Stepping=2 Features=0x8001bf AMD Features=0x400<> real memory = 134217728 (128 MB) avail memory = 120770560 (115 MB) random: initialized kbd1 at kbdmux0 ACPI BIOS Error (bug): A valid RSDP was not found (20130823/tbxfroot-223) ACPI: Table initialisation failed: AE_NOT_FOUND ACPI: Try disabling either ACPI or apic support. pcib0 pcibus 0 on motherboard pir0: on motherboard pci0: on pcib0 $PIR: No matching entry for 0.7.INTD isab0: at device 7.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x6000-0x600f at device 7.1 on pci0 ata0: at channel 0 on atapci0 ata1: at channel 1 on atapci0 uhci0: port 0x6400-0x641f irq 10 at device 7.2 on pci0 usbus0 on uhci0 fxp0: port 0x6800-0x683f mem 0xe0100000-0xe0100fff,0xe0000000-0xe00fffff irq 11 at device 10.0 on pci0 miibus0: on fxp0 inphy0: PHY 1 on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow fxp0: Ethernet address: 00:d0:b7:90:17:c9 cpu0 on motherboard attimer0: at port 0x40-0x43 irq 0 pnpid PNP0100 on isa0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: at port 0x70-0x71 irq 8 pnpid PNP0b00 on isa0 Event timer "RTC" frequency 32768 Hz quality 0 atkbdc0: at port 0x60,0x64 irq 1 pnpid PNP0303 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] unknown: can't assign resources (memory) uart0: <16550 or compatible> at port 0x3f8-0x3ff irq 4 flags 0x10 pnpid PNP0501 on isa0 fdc0: at port 0x3f2-0x3f3,0x3f4-0x3f5,0x3f7 irq 6 drq 2 pnpid PNP0700 on isa0 ppc0: at port 0x378-0x37f,0x778-0x77b irq 7 pnpid PNP0400 on isa0 ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode ppbus0: on ppc0 lpt0: on ppbus0 lpt0: Interrupt-driven port ppi0: on ppbus0 uart1: <16550 or compatible> at port 0x2f8-0x2ff irq 3 pnpid PNP0501 on isa0 orm0: at iomem 0xc0000-0xc7fff,0xc8000-0xc8fff pnpid ORM0000 on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 unknown: can't assign resources (memory) Timecounters tick every 1.000 msec usbus0: 12Mbps Full Speed USB v1.0 ugen0.1: at usbus0 uhub0: on usbus0 ada0 at ata0 bus 0 scbus0 target 0 lun 0 ada0: ATA-0 device ada0: Serial Number 0 0011B1EA ada0: 16.700MB/s transfers (PIO4, PIO 512bytes) ada0: 15296MB (31326208 512 byte sectors: 15H 63S/T 16383C) ada0: Previously was known as ad0 random: unblocking device. Timecounter "TSC" frequency 200460356 Hz quality 800 uhub0: 2 ports with 2 removable, self powered Root mount waiting for: usbus0 usb_alloc_device: set address 2 failed (USB_ERR_IOERROR, ignored) Root mount waiting for: usbus0 usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR Root mount waiting for: usbus0 usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) Root mount waiting for: usbus0 Root mount waiting for: usbus0 usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR Root mount waiting for: usbus0 usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) Root mount waiting for: usbus0 Root mount waiting for: usbus0 usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) Root mount waiting for: usbus0 Root mount waiting for: usbus0 usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR Root mount waiting for: usbus0 usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_IOERROR, ignored) Root mount waiting for: usbus0 Root mount waiting for: usbus0 usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR ugen0.2: at usbus0 (disconnected) uhub_reattach_port: could not allocate new device Root mount waiting for: usbus0 ugen0.2: at usbus0 Trying to mount root from ufs:/dev/ada0s1a [rw]... ugen0.3: at usbus0 uhub1: on usbus0 uhub1: 4 ports with 4 removable, self powered ugen0.4: at usbus0 uhub2: on usbus0 uhub2: 4 ports with 4 removable, self powered ugen0.5: at usbus0 ugen0.6: at usbus0 uplcom0: on usbus0 uplcom1: on usbus0 uplcom2: on usbus0 --tjCHc7DPkfUGtrlw-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 19:09:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EC60A46; Thu, 4 Sep 2014 19:09:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3F61896; Thu, 4 Sep 2014 19:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84J99to093320; Thu, 4 Sep 2014 19:09:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84J98oC093318; Thu, 4 Sep 2014 19:09:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409041909.s84J98oC093318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 4 Sep 2014 19:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271119 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:09:09 -0000 Author: jhb Date: Thu Sep 4 19:09:08 2014 New Revision: 271119 URL: http://svnweb.freebsd.org/changeset/base/271119 Log: In tcp_input(), don't acquire the pcbinfo global write lock for SYN packets targeting a listening socket. Permit to reduce TCP input processing starvation in context of high SYN load (e.g. short-lived TCP connections or SYN flood). Submitted by: Julien Charbon Reviewed by: adrian, hiren, jhb, Mike Bentkofsky Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Sep 4 18:54:01 2014 (r271118) +++ head/sys/netinet/tcp_input.c Thu Sep 4 19:09:08 2014 (r271119) @@ -748,12 +748,12 @@ tcp_input(struct mbuf **mp, int *offp, i /* * Locate pcb for segment; if we're likely to add or remove a - * connection then first acquire pcbinfo lock. There are two cases + * connection then first acquire pcbinfo lock. There are three cases * where we might discover later we need a write lock despite the - * flags: ACKs moving a connection out of the syncache, and ACKs for - * a connection in TIMEWAIT. + * flags: ACKs moving a connection out of the syncache, ACKs for a + * connection in TIMEWAIT and SYNs not targeting a listening socket. */ - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0) { + if ((thflags & (TH_FIN | TH_RST)) != 0) { INP_INFO_WLOCK(&V_tcbinfo); ti_locked = TI_WLOCKED; } else @@ -982,10 +982,11 @@ relocked: * now be in TIMEWAIT. */ #ifdef INVARIANTS - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0) + if ((thflags & (TH_FIN | TH_RST)) != 0) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); #endif - if (tp->t_state != TCPS_ESTABLISHED) { + if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || + (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN)))) { if (ti_locked == TI_UNLOCKED) { if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); @@ -1026,17 +1027,13 @@ relocked: /* * When the socket is accepting connections (the INPCB is in LISTEN * state) we look into the SYN cache if this is a new connection - * attempt or the completion of a previous one. Because listen - * sockets are never in TCPS_ESTABLISHED, the V_tcbinfo lock will be - * held in this case. + * attempt or the completion of a previous one. */ if (so->so_options & SO_ACCEPTCONN) { struct in_conninfo inc; KASSERT(tp->t_state == TCPS_LISTEN, ("%s: so accepting but " "tp not listening", __func__)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - bzero(&inc, sizeof(inc)); #ifdef INET6 if (isipv6) { @@ -1059,6 +1056,8 @@ relocked: * socket appended to the listen queue in SYN_RECEIVED state. */ if ((thflags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK) { + + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* * Parse the TCP options here because * syncookies need access to the reflected @@ -1339,8 +1338,12 @@ relocked: syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL); /* * Entry added to syncache and mbuf consumed. - * Everything already unlocked by syncache_add(). + * Only the listen socket is unlocked by syncache_add(). */ + if (ti_locked == TI_WLOCKED) { + INP_INFO_WUNLOCK(&V_tcbinfo); + ti_locked = TI_UNLOCKED; + } INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return (IPPROTO_DONE); } else if (tp->t_state == TCPS_LISTEN) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Sep 4 18:54:01 2014 (r271118) +++ head/sys/netinet/tcp_syncache.c Thu Sep 4 19:09:08 2014 (r271119) @@ -1118,7 +1118,6 @@ syncache_add(struct in_conninfo *inc, st struct syncache scs; struct ucred *cred; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, ("%s: unexpected tcp flags", __func__)); @@ -1149,13 +1148,11 @@ syncache_add(struct in_conninfo *inc, st #ifdef MAC if (mac_syncache_init(&maclabel) != 0) { INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); goto done; } else mac_syncache_create(maclabel, inp); #endif INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); /* * Remember the IP options, if any. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 19:11:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1D30BCF; Thu, 4 Sep 2014 19:11:43 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88EB4193A; Thu, 4 Sep 2014 19:11:43 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 975C2B97F; Thu, 4 Sep 2014 15:11:42 -0400 (EDT) From: John Baldwin To: Benno Rice Subject: Re: svn commit: r271085 - head/lib/libgeom Date: Thu, 04 Sep 2014 13:49:51 -0400 Message-ID: <15042946.uzA1DvBfCL@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <10BDD3FC-EED9-4A47-BAF4-8F3C2925A3E3@FreeBSD.org> References: <201409040331.s843Vn5c048905@svn.freebsd.org> <3000146.5OWvozVApa@ralph.baldwin.cx> <10BDD3FC-EED9-4A47-BAF4-8F3C2925A3E3@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Sep 2014 15:11:42 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:11:43 -0000 On Thursday, September 04, 2014 09:29:24 AM Benno Rice wrote: > On Sep 4, 2014, at 6:51 AM, John Baldwin wrote: > > On Thursday, September 04, 2014 03:31:49 AM Benno Rice wrote: > >> Author: benno > >> Date: Thu Sep 4 03:31:48 2014 > >> New Revision: 271085 > >> URL: http://svnweb.freebsd.org/changeset/base/271085 > >>=20 > >> Log: > >> Systems with lots of geom providers can end up with a kern.geom.c= onfxml > >> value too large for the buffer allocated. Work around this by ret= rying > >> a few times with larger buffer sizes. > >=20 > > Are these systems having lots of changes to the GEOM tree while the= sysctl > > handler is being invoked? If the tree is static, the first call wi= th an > > old of NULL should return the correct length in 'l' regardless of t= he > > size as it generates the entire buffer and SYSCTL_OUT's it. (It do= esn't > > do it piecemeal and fail on ENOMEM part way through the way some ot= her > > broken sysctl handlers do.) >=20 > These systems have a lot of drives in them and around the time when w= e=E2=80=99re > trying to enumerate there can be lots of activity. In the case where = the > tree hasn=E2=80=99t changed we=E2=80=99re not doing that much extra w= ork here and it saves > us having to retry everything that happens around the geom_getxml cal= ls > inside libgeom when the tree does change. I more meant that the commit message implied you needed this to handle = a large=20 buffer, but that shouldn't be true. You should only need this to handl= e large=20 changes in the size of the buffer. (I.e. it grows by more than 4k in b= etween=20 the first two sysctl() invocations.) Doubling the size on each iterati= on is=20 one approach (and is fine), another common one is to keep both sysctls = in the=20 loop so you fetch the new size in each iteration, e.g.: buf =3D NULL; for (;;) { sysctl(..., NULL, &len); buf =3D realloc(buf, len); sysctl(..., buf, &len); } --=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 19:27:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44D7F606; Thu, 4 Sep 2014 19:27:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 305711AB6; Thu, 4 Sep 2014 19:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84JRVwI003846; Thu, 4 Sep 2014 19:27:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84JRVkn003845; Thu, 4 Sep 2014 19:27:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409041927.s84JRVkn003845@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 19:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271122 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:27:31 -0000 Author: glebius Date: Thu Sep 4 19:27:30 2014 New Revision: 271122 URL: http://svnweb.freebsd.org/changeset/base/271122 Log: Change a very strange code in m_demote() to simple assertion. Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Sep 4 19:22:01 2014 (r271121) +++ head/sys/kern/uipc_mbuf.c Thu Sep 4 19:27:30 2014 (r271122) @@ -393,17 +393,13 @@ m_demote(struct mbuf *m0, int all) struct mbuf *m; for (m = all ? m0 : m0->m_next; m != NULL; m = m->m_next) { + KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt in m %p, m0 %p", + __func__, m, m0)); if (m->m_flags & M_PKTHDR) { m_tag_delete_chain(m, NULL); m->m_flags &= ~M_PKTHDR; bzero(&m->m_pkthdr, sizeof(struct pkthdr)); } - if (m != m0 && m->m_nextpkt != NULL) { - KASSERT(m->m_nextpkt == NULL, - ("%s: m_nextpkt not NULL", __func__)); - m_freem(m->m_nextpkt); - m->m_nextpkt = NULL; - } m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); } } From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 19:28:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68ED574F; Thu, 4 Sep 2014 19:28:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5456D1AC9; Thu, 4 Sep 2014 19:28:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84JS3UD003973; Thu, 4 Sep 2014 19:28:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84JS3Oo003972; Thu, 4 Sep 2014 19:28:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409041928.s84JS3Oo003972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 19:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271123 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:28:03 -0000 Author: glebius Date: Thu Sep 4 19:28:02 2014 New Revision: 271123 URL: http://svnweb.freebsd.org/changeset/base/271123 Log: Satisfy assertion in m_demote(). Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Sep 4 19:27:30 2014 (r271122) +++ head/sys/netinet/tcp_reass.c Thu Sep 4 19:28:02 2014 (r271123) @@ -231,6 +231,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd tp->t_segq = m; if (mq && th->th_seq + *tlenp == M_TCPHDR(mq)->th_seq) { m->m_nextpkt = mq->m_nextpkt; + mq->m_nextpkt = NULL; m_catpkt(m, mq); } else m->m_nextpkt = mq; From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 19:52:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4CCFE3F; Thu, 4 Sep 2014 19:52:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8742B1D7B; Thu, 4 Sep 2014 19:52:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84JqIrc017320; Thu, 4 Sep 2014 19:52:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84JqHfL017311; Thu, 4 Sep 2014 19:52:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041952.s84JqHfL017311@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 19:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271124 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 19:52:18 -0000 Author: ian Date: Thu Sep 4 19:52:17 2014 New Revision: 271124 URL: http://svnweb.freebsd.org/changeset/base/271124 Log: Stop setting the iomux device status to disabled, now that we have a driver. Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi head/sys/boot/fdt/dts/arm/wandboard-dual.dts head/sys/boot/fdt/dts/arm/wandboard-quad.dts head/sys/boot/fdt/dts/arm/wandboard-solo.dts Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Thu Sep 4 19:28:02 2014 (r271123) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Thu Sep 4 19:52:17 2014 (r271124) @@ -134,7 +134,6 @@ reg = <0x020e0000 0x4000>; interrupt-parent = <&gic>; interrupts = <32>; - status = "disabled"; }; gpio1: gpio@0209c000 { Modified: head/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-dual.dts Thu Sep 4 19:28:02 2014 (r271123) +++ head/sys/boot/fdt/dts/arm/wandboard-dual.dts Thu Sep 4 19:52:17 2014 (r271124) @@ -44,7 +44,6 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ - iomux@020e0000 { status = "disabled"; }; gpio@0209c000 { status = "okay"; }; gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-quad.dts Thu Sep 4 19:28:02 2014 (r271123) +++ head/sys/boot/fdt/dts/arm/wandboard-quad.dts Thu Sep 4 19:52:17 2014 (r271124) @@ -44,7 +44,6 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ - iomux@020e0000 { status = "disabled"; }; gpio@0209c000 { status = "okay"; }; gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-solo.dts Thu Sep 4 19:28:02 2014 (r271123) +++ head/sys/boot/fdt/dts/arm/wandboard-solo.dts Thu Sep 4 19:52:17 2014 (r271124) @@ -44,7 +44,6 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ - iomux@020e0000 { status = "disabled"; }; gpio@0209c000 { status = "okay"; }; gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 20:48:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D50E11A; Thu, 4 Sep 2014 20:48:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 141BA1349; Thu, 4 Sep 2014 20:48:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84KmJFb042835; Thu, 4 Sep 2014 20:48:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84KmGsG042814; Thu, 4 Sep 2014 20:48:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409042048.s84KmGsG042814@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 4 Sep 2014 20:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271133 - in head/sys/gnu/dts/include/dt-bindings: clk clock dma gpio input interrupt-controller mfd phy pinctrl pwm reset reset-controller soc sound spmi thermal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 20:48:19 -0000 Author: imp Date: Thu Sep 4 20:48:16 2014 New Revision: 271133 URL: http://svnweb.freebsd.org/changeset/base/271133 Log: Update bindings to latest vendor branch representing 3.17-rc2 level of Linux DTS API. Added: - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clk/ti-dra7-atl.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/at91.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm21664.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm281xx.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2q.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/clps711x-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos-audss-clk.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos3250.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos5260-clk.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos5410.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/hip04-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/hix5hd2-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/imx1-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/imx21-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/imx27-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/imx6qdl-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/imx6sx-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/lsi,axm5516-clks.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-apq8084.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-ipq806x.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/qcom,mmcc-apq8084.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/r7s72100-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/r8a7779-clock.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/rk3066a-cru.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/rk3188-cru-common.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/rk3188-cru.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/rk3288-cru.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/s3c2410.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/s3c2412.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/s3c2443.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/s5pv210-audss.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/s5pv210.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/stih415-clks.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/clock/stih416-clks.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/dma/nbpfaxi.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/mfd/palmas.h - copied from r270866, vendor/device-tree/dist/include/dt-bindings/phy/ - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h - copied from r270866, vendor/device-tree/dist/include/dt-bindings/reset-controller/ - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/reset/altr,rst-mgr.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/reset/qcom,gcc-apq8084.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/reset/qcom,gcc-ipq806x.h - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/reset/qcom,mmcc-apq8084.h - copied from r270866, vendor/device-tree/dist/include/dt-bindings/soc/ - copied unchanged from r270866, vendor/device-tree/dist/include/dt-bindings/sound/tlv320aic31xx-micbias.h - copied from r270866, vendor/device-tree/dist/include/dt-bindings/spmi/ Directory Properties: head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih415-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih416-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/palmas.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/ (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset-controller/ (props changed) head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/ (props changed) head/sys/gnu/dts/include/dt-bindings/sound/tlv320aic31xx-micbias.h (props changed) head/sys/gnu/dts/include/dt-bindings/spmi/ (props changed) Modified: head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5440.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3620-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/mfd/as3722.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8960.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8960.h (contents, props changed) Directory Properties: head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/include/dt-bindings/ (props changed) head/sys/gnu/dts/include/dt-bindings/clk/ (props changed) head/sys/gnu/dts/include/dt-bindings/clk/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/clk/exynos-audss-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/ (props changed) head/sys/gnu/dts/include/dt-bindings/clock/efm32-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx5-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mpc512x-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/ (props changed) head/sys/gnu/dts/include/dt-bindings/dma/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/ (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/input/ (props changed) head/sys/gnu/dts/include/dt-bindings/input/input.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/ (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/arm-gic.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/ (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/dbx500-prcmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-miphy365x.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/ (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/nomadik.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h (props changed) head/sys/gnu/dts/include/dt-bindings/pwm/ (props changed) head/sys/gnu/dts/include/dt-bindings/pwm/pwm.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/ (props changed) head/sys/gnu/dts/include/dt-bindings/reset-controller/stih415-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset-controller/stih416-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8660.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/qcom,gsbi.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/ (props changed) head/sys/gnu/dts/include/dt-bindings/sound/fsl-imx-audmux.h (props changed) head/sys/gnu/dts/include/dt-bindings/spmi/spmi.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/ (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/thermal.h (props changed) Copied: head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clk/ti-dra7-atl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clk/ti-dra7-atl.h) @@ -0,0 +1,40 @@ +/* + * This header provides constants for DRA7 ATL (Audio Tracking Logic) + * + * The constants defined in this header are used in dts files + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * Peter Ujfalusi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _DT_BINDINGS_CLK_DRA7_ATL_H +#define _DT_BINDINGS_CLK_DRA7_ATL_H + +#define DRA7_ATL_WS_MCASP1_FSR 0 +#define DRA7_ATL_WS_MCASP1_FSX 1 +#define DRA7_ATL_WS_MCASP2_FSR 2 +#define DRA7_ATL_WS_MCASP2_FSX 3 +#define DRA7_ATL_WS_MCASP3_FSX 4 +#define DRA7_ATL_WS_MCASP4_FSX 5 +#define DRA7_ATL_WS_MCASP5_FSX 6 +#define DRA7_ATL_WS_MCASP6_FSX 7 +#define DRA7_ATL_WS_MCASP7_FSX 8 +#define DRA7_ATL_WS_MCASP8_FSX 9 +#define DRA7_ATL_WS_MCASP8_AHCLKX 10 +#define DRA7_ATL_WS_XREF_CLK3 11 +#define DRA7_ATL_WS_XREF_CLK0 12 +#define DRA7_ATL_WS_XREF_CLK1 13 +#define DRA7_ATL_WS_XREF_CLK2 14 +#define DRA7_ATL_WS_OSC1_X1 15 + +#endif Copied: head/sys/gnu/dts/include/dt-bindings/clock/at91.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/at91.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/at91.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/at91.h) @@ -0,0 +1,22 @@ +/* + * This header provides constants for AT91 pmc status. + * + * The constants defined in this header are being used in dts. + * + * Licensed under GPLv2 or later. + */ + +#ifndef _DT_BINDINGS_CLK_AT91_H +#define _DT_BINDINGS_CLK_AT91_H + +#define AT91_PMC_MOSCS 0 /* MOSCS Flag */ +#define AT91_PMC_LOCKA 1 /* PLLA Lock */ +#define AT91_PMC_LOCKB 2 /* PLLB Lock */ +#define AT91_PMC_MCKRDY 3 /* Master Clock */ +#define AT91_PMC_LOCKU 6 /* UPLL Lock */ +#define AT91_PMC_PCKRDY(id) (8 + (id)) /* Programmable Clock */ +#define AT91_PMC_MOSCSELS 16 /* Main Oscillator Selection */ +#define AT91_PMC_MOSCRCS 17 /* Main On-Chip RC */ +#define AT91_PMC_CFDEV 18 /* Clock Failure Detector Event */ + +#endif Copied: head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm21664.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm21664.h) @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * Copyright 2013 Linaro Limited + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _CLOCK_BCM21664_H +#define _CLOCK_BCM21664_H + +/* + * This file defines the values used to specify clocks provided by + * the clock control units (CCUs) on Broadcom BCM21664 family SoCs. + */ + +/* bcm21664 CCU device tree "compatible" strings */ +#define BCM21664_DT_ROOT_CCU_COMPAT "brcm,bcm21664-root-ccu" +#define BCM21664_DT_AON_CCU_COMPAT "brcm,bcm21664-aon-ccu" +#define BCM21664_DT_MASTER_CCU_COMPAT "brcm,bcm21664-master-ccu" +#define BCM21664_DT_SLAVE_CCU_COMPAT "brcm,bcm21664-slave-ccu" + +/* root CCU clock ids */ + +#define BCM21664_ROOT_CCU_FRAC_1M 0 +#define BCM21664_ROOT_CCU_CLOCK_COUNT 1 + +/* aon CCU clock ids */ + +#define BCM21664_AON_CCU_HUB_TIMER 0 +#define BCM21664_AON_CCU_CLOCK_COUNT 1 + +/* master CCU clock ids */ + +#define BCM21664_MASTER_CCU_SDIO1 0 +#define BCM21664_MASTER_CCU_SDIO2 1 +#define BCM21664_MASTER_CCU_SDIO3 2 +#define BCM21664_MASTER_CCU_SDIO4 3 +#define BCM21664_MASTER_CCU_SDIO1_SLEEP 4 +#define BCM21664_MASTER_CCU_SDIO2_SLEEP 5 +#define BCM21664_MASTER_CCU_SDIO3_SLEEP 6 +#define BCM21664_MASTER_CCU_SDIO4_SLEEP 7 +#define BCM21664_MASTER_CCU_CLOCK_COUNT 8 + +/* slave CCU clock ids */ + +#define BCM21664_SLAVE_CCU_UARTB 0 +#define BCM21664_SLAVE_CCU_UARTB2 1 +#define BCM21664_SLAVE_CCU_UARTB3 2 +#define BCM21664_SLAVE_CCU_BSC1 3 +#define BCM21664_SLAVE_CCU_BSC2 4 +#define BCM21664_SLAVE_CCU_BSC3 5 +#define BCM21664_SLAVE_CCU_BSC4 6 +#define BCM21664_SLAVE_CCU_CLOCK_COUNT 7 + +#endif /* _CLOCK_BCM21664_H */ Copied: head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm281xx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/bcm281xx.h) @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * Copyright 2013 Linaro Limited + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _CLOCK_BCM281XX_H +#define _CLOCK_BCM281XX_H + +/* + * This file defines the values used to specify clocks provided by + * the clock control units (CCUs) on Broadcom BCM281XX family SoCs. + */ + +/* + * These are the bcm281xx CCU device tree "compatible" strings. + * We're stuck with using "bcm11351" in the string because wild + * cards aren't allowed, and that name was the first one defined + * in this family of devices. + */ +#define BCM281XX_DT_ROOT_CCU_COMPAT "brcm,bcm11351-root-ccu" +#define BCM281XX_DT_AON_CCU_COMPAT "brcm,bcm11351-aon-ccu" +#define BCM281XX_DT_HUB_CCU_COMPAT "brcm,bcm11351-hub-ccu" +#define BCM281XX_DT_MASTER_CCU_COMPAT "brcm,bcm11351-master-ccu" +#define BCM281XX_DT_SLAVE_CCU_COMPAT "brcm,bcm11351-slave-ccu" + +/* root CCU clock ids */ + +#define BCM281XX_ROOT_CCU_FRAC_1M 0 +#define BCM281XX_ROOT_CCU_CLOCK_COUNT 1 + +/* aon CCU clock ids */ + +#define BCM281XX_AON_CCU_HUB_TIMER 0 +#define BCM281XX_AON_CCU_PMU_BSC 1 +#define BCM281XX_AON_CCU_PMU_BSC_VAR 2 +#define BCM281XX_AON_CCU_CLOCK_COUNT 3 + +/* hub CCU clock ids */ + +#define BCM281XX_HUB_CCU_TMON_1M 0 +#define BCM281XX_HUB_CCU_CLOCK_COUNT 1 + +/* master CCU clock ids */ + +#define BCM281XX_MASTER_CCU_SDIO1 0 +#define BCM281XX_MASTER_CCU_SDIO2 1 +#define BCM281XX_MASTER_CCU_SDIO3 2 +#define BCM281XX_MASTER_CCU_SDIO4 3 +#define BCM281XX_MASTER_CCU_USB_IC 4 +#define BCM281XX_MASTER_CCU_HSIC2_48M 5 +#define BCM281XX_MASTER_CCU_HSIC2_12M 6 +#define BCM281XX_MASTER_CCU_CLOCK_COUNT 7 + +/* slave CCU clock ids */ + +#define BCM281XX_SLAVE_CCU_UARTB 0 +#define BCM281XX_SLAVE_CCU_UARTB2 1 +#define BCM281XX_SLAVE_CCU_UARTB3 2 +#define BCM281XX_SLAVE_CCU_UARTB4 3 +#define BCM281XX_SLAVE_CCU_SSP0 4 +#define BCM281XX_SLAVE_CCU_SSP2 5 +#define BCM281XX_SLAVE_CCU_BSC1 6 +#define BCM281XX_SLAVE_CCU_BSC2 7 +#define BCM281XX_SLAVE_CCU_BSC3 8 +#define BCM281XX_SLAVE_CCU_PWM 9 +#define BCM281XX_SLAVE_CCU_CLOCK_COUNT 10 + +#endif /* _CLOCK_BCM281XX_H */ Copied: head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2.h) @@ -0,0 +1,45 @@ +/* + * Berlin2 BG2/BG2CD clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_CPU 1 +#define CLKID_DRMFIGO 2 +#define CLKID_CFG 3 +#define CLKID_GFX 4 +#define CLKID_ZSP 5 +#define CLKID_PERIF 6 +#define CLKID_PCUBE 7 +#define CLKID_VSCOPE 8 +#define CLKID_NFC_ECC 9 +#define CLKID_VPP 10 +#define CLKID_APP 11 +#define CLKID_AUDIO0 12 +#define CLKID_AUDIO2 13 +#define CLKID_AUDIO3 14 +#define CLKID_AUDIO1 15 +#define CLKID_GFX3D_CORE 16 +#define CLKID_GFX3D_SYS 17 +#define CLKID_ARC 18 +#define CLKID_VIP 19 +#define CLKID_SDIO0XIN 20 +#define CLKID_SDIO1XIN 21 +#define CLKID_GFX3D_EXTRA 22 +#define CLKID_GC360 23 +#define CLKID_SDIO_DLLMST 24 +#define CLKID_GETH0 25 +#define CLKID_GETH1 26 +#define CLKID_SATA 27 +#define CLKID_AHBAPB 28 +#define CLKID_USB0 29 +#define CLKID_USB1 30 +#define CLKID_PBRIDGE 31 +#define CLKID_SDIO0 32 +#define CLKID_SDIO1 33 +#define CLKID_NFC 34 +#define CLKID_SMEMC 35 +#define CLKID_AUDIOHD 36 +#define CLKID_VIDEO0 37 +#define CLKID_VIDEO1 38 +#define CLKID_VIDEO2 39 +#define CLKID_TWD 40 Copied: head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2q.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/berlin2q.h) @@ -0,0 +1,31 @@ +/* + * Berlin2 BG2Q clock tree IDs + */ + +#define CLKID_SYS 0 +#define CLKID_DRMFIGO 1 +#define CLKID_CFG 2 +#define CLKID_GFX2D 3 +#define CLKID_ZSP 4 +#define CLKID_PERIF 5 +#define CLKID_PCUBE 6 +#define CLKID_VSCOPE 7 +#define CLKID_NFC_ECC 8 +#define CLKID_VPP 9 +#define CLKID_APP 10 +#define CLKID_SDIO0XIN 11 +#define CLKID_SDIO1XIN 12 +#define CLKID_GFX2DAXI 13 +#define CLKID_GETH0 14 +#define CLKID_SATA 15 +#define CLKID_AHBAPB 16 +#define CLKID_USB0 17 +#define CLKID_USB1 18 +#define CLKID_USB2 19 +#define CLKID_USB3 20 +#define CLKID_PBRIDGE 21 +#define CLKID_SDIO 22 +#define CLKID_NFC 23 +#define CLKID_SMEMC 24 +#define CLKID_PCIE 25 +#define CLKID_TWD 26 Copied: head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/clps711x-clock.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/clps711x-clock.h) @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 Alexander Shiyan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DT_BINDINGS_CLOCK_CLPS711X_H +#define __DT_BINDINGS_CLOCK_CLPS711X_H + +#define CLPS711X_CLK_DUMMY 0 +#define CLPS711X_CLK_CPU 1 +#define CLPS711X_CLK_BUS 2 +#define CLPS711X_CLK_PLL 3 +#define CLPS711X_CLK_TIMERREF 4 +#define CLPS711X_CLK_TIMER1 5 +#define CLPS711X_CLK_TIMER2 6 +#define CLPS711X_CLK_PWM 7 +#define CLPS711X_CLK_SPIREF 8 +#define CLPS711X_CLK_SPI 9 +#define CLPS711X_CLK_UART 10 +#define CLPS711X_CLK_TICK 11 +#define CLPS711X_CLK_MAX 12 + +#endif Copied: head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos-audss-clk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos-audss-clk.h) @@ -0,0 +1,26 @@ +/* + * This header provides constants for Samsung audio subsystem + * clock controller. + * + * The constants defined in this header are being used in dts + * and exynos audss driver. + */ + +#ifndef _DT_BINDINGS_CLK_EXYNOS_AUDSS_H +#define _DT_BINDINGS_CLK_EXYNOS_AUDSS_H + +#define EXYNOS_MOUT_AUDSS 0 +#define EXYNOS_MOUT_I2S 1 +#define EXYNOS_DOUT_SRP 2 +#define EXYNOS_DOUT_AUD_BUS 3 +#define EXYNOS_DOUT_I2S 4 +#define EXYNOS_SRP_CLK 5 +#define EXYNOS_I2S_BUS 6 +#define EXYNOS_SCLK_I2S 7 +#define EXYNOS_PCM_BUS 8 +#define EXYNOS_SCLK_PCM 9 +#define EXYNOS_ADMA 10 + +#define EXYNOS_AUDSS_MAX_CLKS 11 + +#endif Copied: head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos3250.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos3250.h) @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Author: Tomasz Figa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Device Tree binding constants for Samsung Exynos3250 clock controllers. + */ + +#ifndef _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H +#define _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H + +/* + * Let each exported clock get a unique index, which is used on DT-enabled + * platforms to lookup the clock from a clock specifier. These indices are + * therefore considered an ABI and so must not be changed. This implies + * that new clocks should be added either in free spaces between clock groups + * or at the end. + */ + + +/* + * Main CMU + */ + +#define CLK_OSCSEL 1 +#define CLK_FIN_PLL 2 +#define CLK_FOUT_APLL 3 +#define CLK_FOUT_VPLL 4 +#define CLK_FOUT_UPLL 5 +#define CLK_FOUT_MPLL 6 + +/* Muxes */ +#define CLK_MOUT_MPLL_USER_L 16 +#define CLK_MOUT_GDL 17 +#define CLK_MOUT_MPLL_USER_R 18 +#define CLK_MOUT_GDR 19 +#define CLK_MOUT_EBI 20 +#define CLK_MOUT_ACLK_200 21 +#define CLK_MOUT_ACLK_160 22 +#define CLK_MOUT_ACLK_100 23 +#define CLK_MOUT_ACLK_266_1 24 +#define CLK_MOUT_ACLK_266_0 25 +#define CLK_MOUT_ACLK_266 26 +#define CLK_MOUT_VPLL 27 +#define CLK_MOUT_EPLL_USER 28 +#define CLK_MOUT_EBI_1 29 +#define CLK_MOUT_UPLL 30 +#define CLK_MOUT_ACLK_400_MCUISP_SUB 31 +#define CLK_MOUT_MPLL 32 +#define CLK_MOUT_ACLK_400_MCUISP 33 +#define CLK_MOUT_VPLLSRC 34 +#define CLK_MOUT_CAM1 35 +#define CLK_MOUT_CAM_BLK 36 +#define CLK_MOUT_MFC 37 +#define CLK_MOUT_MFC_1 38 +#define CLK_MOUT_MFC_0 39 +#define CLK_MOUT_G3D 40 +#define CLK_MOUT_G3D_1 41 +#define CLK_MOUT_G3D_0 42 +#define CLK_MOUT_MIPI0 43 +#define CLK_MOUT_FIMD0 44 +#define CLK_MOUT_UART_ISP 45 +#define CLK_MOUT_SPI1_ISP 46 +#define CLK_MOUT_SPI0_ISP 47 +#define CLK_MOUT_TSADC 48 +#define CLK_MOUT_MMC1 49 +#define CLK_MOUT_MMC0 50 +#define CLK_MOUT_UART1 51 +#define CLK_MOUT_UART0 52 +#define CLK_MOUT_SPI1 53 +#define CLK_MOUT_SPI0 54 +#define CLK_MOUT_AUDIO 55 +#define CLK_MOUT_MPLL_USER_C 56 +#define CLK_MOUT_HPM 57 +#define CLK_MOUT_CORE 58 +#define CLK_MOUT_APLL 59 +#define CLK_MOUT_ACLK_266_SUB 60 + +/* Dividers */ +#define CLK_DIV_GPL 64 +#define CLK_DIV_GDL 65 +#define CLK_DIV_GPR 66 +#define CLK_DIV_GDR 67 +#define CLK_DIV_MPLL_PRE 68 +#define CLK_DIV_ACLK_400_MCUISP 69 +#define CLK_DIV_EBI 70 +#define CLK_DIV_ACLK_200 71 +#define CLK_DIV_ACLK_160 72 +#define CLK_DIV_ACLK_100 73 +#define CLK_DIV_ACLK_266 74 +#define CLK_DIV_CAM1 75 +#define CLK_DIV_CAM_BLK 76 +#define CLK_DIV_MFC 77 +#define CLK_DIV_G3D 78 +#define CLK_DIV_MIPI0_PRE 79 +#define CLK_DIV_MIPI0 80 +#define CLK_DIV_FIMD0 81 +#define CLK_DIV_UART_ISP 82 +#define CLK_DIV_SPI1_ISP_PRE 83 +#define CLK_DIV_SPI1_ISP 84 +#define CLK_DIV_SPI0_ISP_PRE 85 +#define CLK_DIV_SPI0_ISP 86 +#define CLK_DIV_TSADC_PRE 87 +#define CLK_DIV_TSADC 88 +#define CLK_DIV_MMC1_PRE 89 +#define CLK_DIV_MMC1 90 +#define CLK_DIV_MMC0_PRE 91 +#define CLK_DIV_MMC0 92 +#define CLK_DIV_UART1 93 +#define CLK_DIV_UART0 94 +#define CLK_DIV_SPI1_PRE 95 +#define CLK_DIV_SPI1 96 +#define CLK_DIV_SPI0_PRE 97 +#define CLK_DIV_SPI0 98 +#define CLK_DIV_PCM 99 +#define CLK_DIV_AUDIO 100 +#define CLK_DIV_I2S 101 +#define CLK_DIV_CORE2 102 +#define CLK_DIV_APLL 103 +#define CLK_DIV_PCLK_DBG 104 +#define CLK_DIV_ATB 105 +#define CLK_DIV_COREM 106 +#define CLK_DIV_CORE 107 +#define CLK_DIV_HPM 108 +#define CLK_DIV_COPY 109 + +/* Gates */ +#define CLK_ASYNC_G3D 128 +#define CLK_ASYNC_MFCL 129 +#define CLK_PPMULEFT 130 +#define CLK_GPIO_LEFT 131 +#define CLK_ASYNC_ISPMX 132 +#define CLK_ASYNC_FSYSD 133 +#define CLK_ASYNC_LCD0X 134 +#define CLK_ASYNC_CAMX 135 +#define CLK_PPMURIGHT 136 +#define CLK_GPIO_RIGHT 137 +#define CLK_MONOCNT 138 +#define CLK_TZPC6 139 +#define CLK_PROVISIONKEY1 140 +#define CLK_PROVISIONKEY0 141 +#define CLK_CMU_ISPPART 142 +#define CLK_TMU_APBIF 143 +#define CLK_KEYIF 144 +#define CLK_RTC 145 +#define CLK_WDT 146 +#define CLK_MCT 147 +#define CLK_SECKEY 148 +#define CLK_TZPC5 149 +#define CLK_TZPC4 150 +#define CLK_TZPC3 151 +#define CLK_TZPC2 152 +#define CLK_TZPC1 153 +#define CLK_TZPC0 154 +#define CLK_CMU_COREPART 155 +#define CLK_CMU_TOPPART 156 +#define CLK_PMU_APBIF 157 +#define CLK_SYSREG 158 +#define CLK_CHIP_ID 159 +#define CLK_QEJPEG 160 +#define CLK_PIXELASYNCM1 161 +#define CLK_PIXELASYNCM0 162 +#define CLK_PPMUCAMIF 163 +#define CLK_QEM2MSCALER 164 +#define CLK_QEGSCALER1 165 +#define CLK_QEGSCALER0 166 +#define CLK_SMMUJPEG 167 +#define CLK_SMMUM2M2SCALER 168 +#define CLK_SMMUGSCALER1 169 +#define CLK_SMMUGSCALER0 170 +#define CLK_JPEG 171 +#define CLK_M2MSCALER 172 +#define CLK_GSCALER1 173 +#define CLK_GSCALER0 174 +#define CLK_QEMFC 175 +#define CLK_PPMUMFC_L 176 +#define CLK_SMMUMFC_L 177 +#define CLK_MFC 178 +#define CLK_SMMUG3D 179 +#define CLK_QEG3D 180 +#define CLK_PPMUG3D 181 +#define CLK_G3D 182 +#define CLK_QE_CH1_LCD 183 +#define CLK_QE_CH0_LCD 184 +#define CLK_PPMULCD0 185 +#define CLK_SMMUFIMD0 186 +#define CLK_DSIM0 187 +#define CLK_FIMD0 188 +#define CLK_CAM1 189 +#define CLK_UART_ISP_TOP 190 +#define CLK_SPI1_ISP_TOP 191 +#define CLK_SPI0_ISP_TOP 192 +#define CLK_TSADC 193 +#define CLK_PPMUFILE 194 +#define CLK_USBOTG 195 +#define CLK_USBHOST 196 +#define CLK_SROMC 197 +#define CLK_SDMMC1 198 +#define CLK_SDMMC0 199 +#define CLK_PDMA1 200 +#define CLK_PDMA0 201 +#define CLK_PWM 202 +#define CLK_PCM 203 +#define CLK_I2S 204 +#define CLK_SPI1 205 +#define CLK_SPI0 206 +#define CLK_I2C7 207 +#define CLK_I2C6 208 +#define CLK_I2C5 209 +#define CLK_I2C4 210 +#define CLK_I2C3 211 +#define CLK_I2C2 212 +#define CLK_I2C1 213 +#define CLK_I2C0 214 +#define CLK_UART1 215 +#define CLK_UART0 216 +#define CLK_BLOCK_LCD 217 +#define CLK_BLOCK_G3D 218 +#define CLK_BLOCK_MFC 219 +#define CLK_BLOCK_CAM 220 +#define CLK_SMIES 221 + +/* Special clocks */ +#define CLK_SCLK_JPEG 224 +#define CLK_SCLK_M2MSCALER 225 +#define CLK_SCLK_GSCALER1 226 +#define CLK_SCLK_GSCALER0 227 +#define CLK_SCLK_MFC 228 +#define CLK_SCLK_G3D 229 +#define CLK_SCLK_MIPIDPHY2L 230 +#define CLK_SCLK_MIPI0 231 +#define CLK_SCLK_FIMD0 232 +#define CLK_SCLK_CAM1 233 +#define CLK_SCLK_UART_ISP 234 +#define CLK_SCLK_SPI1_ISP 235 +#define CLK_SCLK_SPI0_ISP 236 +#define CLK_SCLK_UPLL 237 +#define CLK_SCLK_TSADC 238 +#define CLK_SCLK_EBI 239 +#define CLK_SCLK_MMC1 240 +#define CLK_SCLK_MMC0 241 +#define CLK_SCLK_I2S 242 +#define CLK_SCLK_PCM 243 +#define CLK_SCLK_SPI1 244 +#define CLK_SCLK_SPI0 245 +#define CLK_SCLK_UART1 246 +#define CLK_SCLK_UART0 247 + +/* + * Total number of clocks of main CMU. + * NOTE: Must be equal to last clock ID increased by one. + */ +#define CLK_NR_CLKS 248 + +#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_EXYNOS3250_CLOCK_H */ Modified: head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h Thu Sep 4 20:47:14 2014 (r271132) +++ head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h Thu Sep 4 20:48:16 2014 (r271133) @@ -1,6 +1,6 @@ /* * Copyright (c) 2013 Samsung Electronics Co., Ltd. - * Author: Andrzej Haja + * Author: Andrzej Hajda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -33,6 +33,12 @@ #define CLK_MOUT_MPLL_USER_C 18 /* Exynos4x12 only */ #define CLK_MOUT_CORE 19 #define CLK_MOUT_APLL 20 +#define CLK_SCLK_HDMIPHY 22 +#define CLK_OUT_DMC 23 +#define CLK_OUT_TOP 24 +#define CLK_OUT_LEFTBUS 25 +#define CLK_OUT_RIGHTBUS 26 +#define CLK_OUT_CPU 27 /* gate for special clocks (sclk) */ #define CLK_SCLK_FIMC0 128 @@ -181,7 +187,6 @@ #define CLK_KEYIF 347 #define CLK_AUDSS 348 #define CLK_MIPI_HSI 349 /* Exynos4210 only */ -#define CLK_MDMA2 350 /* Exynos4210 only */ #define CLK_PIXELASYNCM0 351 #define CLK_PIXELASYNCM1 352 #define CLK_FIMC_LITE0 353 /* Exynos4x12 only */ @@ -230,6 +235,24 @@ #define CLK_MOUT_G3D 394 #define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ +/* gate clocks - ppmu */ +#define CLK_PPMULEFT 400 +#define CLK_PPMURIGHT 401 +#define CLK_PPMUCAMIF 402 +#define CLK_PPMUTV 403 +#define CLK_PPMUMFC_L 404 +#define CLK_PPMUMFC_R 405 +#define CLK_PPMUG3D 406 +#define CLK_PPMUIMAGE 407 +#define CLK_PPMULCD0 408 +#define CLK_PPMULCD1 409 /* Exynos4210 only */ +#define CLK_PPMUFILE 410 +#define CLK_PPMUGPS 411 +#define CLK_PPMUDMC0 412 +#define CLK_PPMUDMC1 413 +#define CLK_PPMUCPU 414 +#define CLK_PPMUACP 415 + /* div clocks */ #define CLK_DIV_ISP0 450 /* Exynos4x12 only */ #define CLK_DIV_ISP1 451 /* Exynos4x12 only */ Modified: head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h ============================================================================== --- head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h Thu Sep 4 20:47:14 2014 (r271132) +++ head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h Thu Sep 4 20:48:16 2014 (r271133) @@ -1,6 +1,6 @@ /* * Copyright (c) 2013 Samsung Electronics Co., Ltd. - * Author: Andrzej Haja + * Author: Andrzej Hajda * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -150,11 +150,30 @@ #define CLK_G2D 345 #define CLK_MDMA0 346 #define CLK_SMMU_MDMA0 347 +#define CLK_SSS 348 +#define CLK_G3D 349 +#define CLK_SMMU_TV 350 +#define CLK_SMMU_FIMD1 351 +#define CLK_SMMU_2D 352 +#define CLK_SMMU_FIMC_ISP 353 +#define CLK_SMMU_FIMC_DRC 354 +#define CLK_SMMU_FIMC_SCC 355 +#define CLK_SMMU_FIMC_SCP 356 +#define CLK_SMMU_FIMC_FD 357 +#define CLK_SMMU_FIMC_MCU 358 +#define CLK_SMMU_FIMC_ODC 359 +#define CLK_SMMU_FIMC_DIS0 360 +#define CLK_SMMU_FIMC_DIS1 361 +#define CLK_SMMU_FIMC_3DNR 362 +#define CLK_SMMU_FIMC_LITE0 363 +#define CLK_SMMU_FIMC_LITE1 364 +#define CLK_CAMIF_TOP 365 /* mux clocks */ #define CLK_MOUT_HDMI 1024 +#define CLK_MOUT_GPLL 1025 /* must be greater than maximal clock id */ -#define CLK_NR_CLKS 1025 +#define CLK_NR_CLKS 1026 #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */ Copied: head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h (from r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos5260-clk.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h Thu Sep 4 20:48:16 2014 (r271133, copy of r270866, vendor/device-tree/dist/include/dt-bindings/clock/exynos5260-clk.h) @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Author: Rahul Sharma + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Provides Constants for Exynos5260 clocks. +*/ + +#ifndef _DT_BINDINGS_CLK_EXYNOS5260_H +#define _DT_BINDINGS_CLK_EXYNOS5260_H + +/* Clock names: */ + +/* List Of Clocks For CMU_TOP */ + +#define TOP_FOUT_DISP_PLL 1 +#define TOP_FOUT_AUD_PLL 2 +#define TOP_MOUT_AUDTOP_PLL_USER 3 +#define TOP_MOUT_AUD_PLL 4 +#define TOP_MOUT_DISP_PLL 5 +#define TOP_MOUT_BUSTOP_PLL_USER 6 +#define TOP_MOUT_MEMTOP_PLL_USER 7 +#define TOP_MOUT_MEDIATOP_PLL_USER 8 +#define TOP_MOUT_DISP_DISP_333 9 +#define TOP_MOUT_ACLK_DISP_333 10 +#define TOP_MOUT_DISP_DISP_222 11 +#define TOP_MOUT_ACLK_DISP_222 12 +#define TOP_MOUT_DISP_MEDIA_PIXEL 13 +#define TOP_MOUT_FIMD1 14 +#define TOP_MOUT_SCLK_PERI_SPI0_CLK 15 +#define TOP_MOUT_SCLK_PERI_SPI1_CLK 16 +#define TOP_MOUT_SCLK_PERI_SPI2_CLK 17 +#define TOP_MOUT_SCLK_PERI_UART0_UCLK 18 +#define TOP_MOUT_SCLK_PERI_UART2_UCLK 19 +#define TOP_MOUT_SCLK_PERI_UART1_UCLK 20 +#define TOP_MOUT_BUS4_BUSTOP_100 21 +#define TOP_MOUT_BUS4_BUSTOP_400 22 +#define TOP_MOUT_BUS3_BUSTOP_100 23 +#define TOP_MOUT_BUS3_BUSTOP_400 24 +#define TOP_MOUT_BUS2_BUSTOP_400 25 +#define TOP_MOUT_BUS2_BUSTOP_100 26 +#define TOP_MOUT_BUS1_BUSTOP_100 27 +#define TOP_MOUT_BUS1_BUSTOP_400 28 +#define TOP_MOUT_SCLK_FSYS_USB 29 +#define TOP_MOUT_SCLK_FSYS_MMC0_SDCLKIN_A 30 +#define TOP_MOUT_SCLK_FSYS_MMC1_SDCLKIN_A 31 +#define TOP_MOUT_SCLK_FSYS_MMC2_SDCLKIN_A 32 +#define TOP_MOUT_SCLK_FSYS_MMC0_SDCLKIN_B 33 +#define TOP_MOUT_SCLK_FSYS_MMC1_SDCLKIN_B 34 +#define TOP_MOUT_SCLK_FSYS_MMC2_SDCLKIN_B 35 +#define TOP_MOUT_ACLK_ISP1_266 36 +#define TOP_MOUT_ISP1_MEDIA_266 37 +#define TOP_MOUT_ACLK_ISP1_400 38 +#define TOP_MOUT_ISP1_MEDIA_400 39 +#define TOP_MOUT_SCLK_ISP1_SPI0 40 +#define TOP_MOUT_SCLK_ISP1_SPI1 41 +#define TOP_MOUT_SCLK_ISP1_UART 42 +#define TOP_MOUT_SCLK_ISP1_SENSOR2 43 +#define TOP_MOUT_SCLK_ISP1_SENSOR1 44 +#define TOP_MOUT_SCLK_ISP1_SENSOR0 45 +#define TOP_MOUT_ACLK_MFC_333 46 +#define TOP_MOUT_MFC_BUSTOP_333 47 +#define TOP_MOUT_ACLK_G2D_333 48 +#define TOP_MOUT_G2D_BUSTOP_333 49 +#define TOP_MOUT_ACLK_GSCL_FIMC 50 +#define TOP_MOUT_GSCL_BUSTOP_FIMC 51 +#define TOP_MOUT_ACLK_GSCL_333 52 +#define TOP_MOUT_GSCL_BUSTOP_333 53 +#define TOP_MOUT_ACLK_GSCL_400 54 +#define TOP_MOUT_M2M_MEDIATOP_400 55 +#define TOP_DOUT_ACLK_MFC_333 56 +#define TOP_DOUT_ACLK_G2D_333 57 +#define TOP_DOUT_SCLK_ISP1_SENSOR2_A 58 +#define TOP_DOUT_SCLK_ISP1_SENSOR1_A 59 +#define TOP_DOUT_SCLK_ISP1_SENSOR0_A 60 +#define TOP_DOUT_ACLK_GSCL_FIMC 61 +#define TOP_DOUT_ACLK_GSCL_400 62 +#define TOP_DOUT_ACLK_GSCL_333 63 +#define TOP_DOUT_SCLK_ISP1_SPI0_B 64 +#define TOP_DOUT_SCLK_ISP1_SPI0_A 65 +#define TOP_DOUT_ACLK_ISP1_400 66 +#define TOP_DOUT_ACLK_ISP1_266 67 +#define TOP_DOUT_SCLK_ISP1_UART 68 +#define TOP_DOUT_SCLK_ISP1_SPI1_B 69 +#define TOP_DOUT_SCLK_ISP1_SPI1_A 70 +#define TOP_DOUT_SCLK_ISP1_SENSOR2_B 71 +#define TOP_DOUT_SCLK_ISP1_SENSOR1_B 72 +#define TOP_DOUT_SCLK_ISP1_SENSOR0_B 73 +#define TOP_DOUTTOP__SCLK_HPM_TARGETCLK 74 +#define TOP_DOUT_SCLK_DISP_PIXEL 75 +#define TOP_DOUT_ACLK_DISP_222 76 +#define TOP_DOUT_ACLK_DISP_333 77 +#define TOP_DOUT_ACLK_BUS4_100 78 +#define TOP_DOUT_ACLK_BUS4_400 79 +#define TOP_DOUT_ACLK_BUS3_100 80 +#define TOP_DOUT_ACLK_BUS3_400 81 +#define TOP_DOUT_ACLK_BUS2_100 82 +#define TOP_DOUT_ACLK_BUS2_400 83 +#define TOP_DOUT_ACLK_BUS1_100 84 +#define TOP_DOUT_ACLK_BUS1_400 85 +#define TOP_DOUT_SCLK_PERI_SPI1_B 86 +#define TOP_DOUT_SCLK_PERI_SPI1_A 87 +#define TOP_DOUT_SCLK_PERI_SPI0_B 88 +#define TOP_DOUT_SCLK_PERI_SPI0_A 89 +#define TOP_DOUT_SCLK_PERI_UART0 90 +#define TOP_DOUT_SCLK_PERI_UART2 91 +#define TOP_DOUT_SCLK_PERI_UART1 92 +#define TOP_DOUT_SCLK_PERI_SPI2_B 93 +#define TOP_DOUT_SCLK_PERI_SPI2_A 94 +#define TOP_DOUT_ACLK_PERI_AUD 95 +#define TOP_DOUT_ACLK_PERI_66 96 +#define TOP_DOUT_SCLK_FSYS_MMC0_SDCLKIN_B 97 +#define TOP_DOUT_SCLK_FSYS_MMC0_SDCLKIN_A 98 +#define TOP_DOUT_SCLK_FSYS_USBDRD30_SUSPEND_CLK 99 +#define TOP_DOUT_ACLK_FSYS_200 100 +#define TOP_DOUT_SCLK_FSYS_MMC2_SDCLKIN_B 101 +#define TOP_DOUT_SCLK_FSYS_MMC2_SDCLKIN_A 102 +#define TOP_DOUT_SCLK_FSYS_MMC1_SDCLKIN_B 103 +#define TOP_DOUT_SCLK_FSYS_MMC1_SDCLKIN_A 104 +#define TOP_SCLK_FIMD1 105 +#define TOP_SCLK_MMC2 106 +#define TOP_SCLK_MMC1 107 +#define TOP_SCLK_MMC0 108 +#define PHYCLK_DPTX_PHY_CH3_TXD_CLK 109 +#define PHYCLK_DPTX_PHY_CH2_TXD_CLK 110 +#define PHYCLK_DPTX_PHY_CH1_TXD_CLK 111 +#define PHYCLK_DPTX_PHY_CH0_TXD_CLK 112 +#define phyclk_hdmi_phy_tmds_clko 113 +#define PHYCLK_HDMI_PHY_PIXEL_CLKO 114 +#define PHYCLK_HDMI_LINK_O_TMDS_CLKHI 115 +#define PHYCLK_MIPI_DPHY_4L_M_TXBYTECLKHS 116 +#define PHYCLK_DPTX_PHY_O_REF_CLK_24M 117 +#define PHYCLK_DPTX_PHY_CLK_DIV2 118 +#define PHYCLK_MIPI_DPHY_4L_M_RXCLKESC0 119 +#define PHYCLK_USBHOST20_PHY_PHYCLOCK 120 +#define PHYCLK_USBHOST20_PHY_FREECLK 121 +#define PHYCLK_USBHOST20_PHY_CLK48MOHCI 122 +#define PHYCLK_USBDRD30_UDRD30_PIPE_PCLK 123 +#define PHYCLK_USBDRD30_UDRD30_PHYCLOCK 124 +#define TOP_NR_CLK 125 + + +/* List Of Clocks For CMU_EGL */ + +#define EGL_FOUT_EGL_PLL 1 +#define EGL_FOUT_EGL_DPLL 2 +#define EGL_MOUT_EGL_B 3 +#define EGL_MOUT_EGL_PLL 4 +#define EGL_DOUT_EGL_PLL 5 +#define EGL_DOUT_EGL_PCLK_DBG 6 +#define EGL_DOUT_EGL_ATCLK 7 +#define EGL_DOUT_PCLK_EGL 8 +#define EGL_DOUT_ACLK_EGL 9 +#define EGL_DOUT_EGL2 10 +#define EGL_DOUT_EGL1 11 +#define EGL_NR_CLK 12 + + +/* List Of Clocks For CMU_KFC */ + +#define KFC_FOUT_KFC_PLL 1 +#define KFC_MOUT_KFC_PLL 2 +#define KFC_MOUT_KFC 3 +#define KFC_DOUT_KFC_PLL 4 +#define KFC_DOUT_PCLK_KFC 5 +#define KFC_DOUT_ACLK_KFC 6 +#define KFC_DOUT_KFC_PCLK_DBG 7 +#define KFC_DOUT_KFC_ATCLK 8 +#define KFC_DOUT_KFC2 9 +#define KFC_DOUT_KFC1 10 +#define KFC_NR_CLK 11 + + +/* List Of Clocks For CMU_MIF */ + +#define MIF_FOUT_MEM_PLL 1 +#define MIF_FOUT_MEDIA_PLL 2 +#define MIF_FOUT_BUS_PLL 3 +#define MIF_MOUT_CLK2X_PHY 4 +#define MIF_MOUT_MIF_DREX2X 5 +#define MIF_MOUT_CLKM_PHY 6 +#define MIF_MOUT_MIF_DREX 7 +#define MIF_MOUT_MEDIA_PLL 8 +#define MIF_MOUT_BUS_PLL 9 +#define MIF_MOUT_MEM_PLL 10 +#define MIF_DOUT_ACLK_BUS_100 11 +#define MIF_DOUT_ACLK_BUS_200 12 +#define MIF_DOUT_ACLK_MIF_466 13 +#define MIF_DOUT_CLK2X_PHY 14 +#define MIF_DOUT_CLKM_PHY 15 +#define MIF_DOUT_BUS_PLL 16 +#define MIF_DOUT_MEM_PLL 17 +#define MIF_DOUT_MEDIA_PLL 18 +#define MIF_CLK_LPDDR3PHY_WRAP1 19 +#define MIF_CLK_LPDDR3PHY_WRAP0 20 +#define MIF_CLK_MONOCNT 21 +#define MIF_CLK_MIF_RTC 22 +#define MIF_CLK_DREX1 23 +#define MIF_CLK_DREX0 24 +#define MIF_CLK_INTMEM 25 +#define MIF_SCLK_LPDDR3PHY_WRAP_U1 26 +#define MIF_SCLK_LPDDR3PHY_WRAP_U0 27 +#define MIF_NR_CLK 28 + + +/* List Of Clocks For CMU_G3D */ + +#define G3D_FOUT_G3D_PLL 1 +#define G3D_MOUT_G3D_PLL 2 +#define G3D_DOUT_PCLK_G3D 3 +#define G3D_DOUT_ACLK_G3D 4 +#define G3D_CLK_G3D_HPM 5 +#define G3D_CLK_G3D 6 +#define G3D_NR_CLK 7 + + +/* List Of Clocks For CMU_AUD */ + +#define AUD_MOUT_SCLK_AUD_PCM 1 +#define AUD_MOUT_SCLK_AUD_I2S 2 +#define AUD_MOUT_AUD_PLL_USER 3 +#define AUD_DOUT_ACLK_AUD_131 4 +#define AUD_DOUT_SCLK_AUD_UART 5 +#define AUD_DOUT_SCLK_AUD_PCM 6 +#define AUD_DOUT_SCLK_AUD_I2S 7 +#define AUD_CLK_AUD_UART 8 +#define AUD_CLK_PCM 9 +#define AUD_CLK_I2S 10 +#define AUD_CLK_DMAC 11 +#define AUD_CLK_SRAMC 12 +#define AUD_SCLK_AUD_UART 13 +#define AUD_SCLK_PCM 14 +#define AUD_SCLK_I2S 15 +#define AUD_NR_CLK 16 + + +/* List Of Clocks For CMU_MFC */ + +#define MFC_MOUT_ACLK_MFC_333_USER 1 +#define MFC_DOUT_PCLK_MFC_83 2 +#define MFC_CLK_MFC 3 +#define MFC_CLK_SMMU2_MFCM1 4 +#define MFC_CLK_SMMU2_MFCM0 5 +#define MFC_NR_CLK 6 + + +/* List Of Clocks For CMU_GSCL */ + +#define GSCL_MOUT_ACLK_CSIS 1 +#define GSCL_MOUT_ACLK_GSCL_FIMC_USER 2 +#define GSCL_MOUT_ACLK_M2M_400_USER 3 +#define GSCL_MOUT_ACLK_GSCL_333_USER 4 +#define GSCL_DOUT_ACLK_CSIS_200 5 +#define GSCL_DOUT_PCLK_M2M_100 6 +#define GSCL_CLK_PIXEL_GSCL1 7 +#define GSCL_CLK_PIXEL_GSCL0 8 +#define GSCL_CLK_MSCL1 9 +#define GSCL_CLK_MSCL0 10 +#define GSCL_CLK_GSCL1 11 +#define GSCL_CLK_GSCL0 12 +#define GSCL_CLK_FIMC_LITE_D 13 +#define GSCL_CLK_FIMC_LITE_B 14 +#define GSCL_CLK_FIMC_LITE_A 15 +#define GSCL_CLK_CSIS1 16 +#define GSCL_CLK_CSIS0 17 +#define GSCL_CLK_SMMU3_LITE_D 18 +#define GSCL_CLK_SMMU3_LITE_B 19 +#define GSCL_CLK_SMMU3_LITE_A 20 +#define GSCL_CLK_SMMU3_GSCL0 21 +#define GSCL_CLK_SMMU3_GSCL1 22 +#define GSCL_CLK_SMMU3_MSCL0 23 +#define GSCL_CLK_SMMU3_MSCL1 24 +#define GSCL_SCLK_CSIS1_WRAP 25 +#define GSCL_SCLK_CSIS0_WRAP 26 +#define GSCL_NR_CLK 27 + + +/* List Of Clocks For CMU_FSYS */ + +#define FSYS_MOUT_PHYCLK_USBHOST20_PHYCLK_USER 1 +#define FSYS_MOUT_PHYCLK_USBHOST20_FREECLK_USER 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 21:06:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF448E0; Thu, 4 Sep 2014 21:06:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3185D15A6; Thu, 4 Sep 2014 21:06:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84L6Yha052441; Thu, 4 Sep 2014 21:06:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84L6XIb052438; Thu, 4 Sep 2014 21:06:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409042106.s84L6XIb052438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 4 Sep 2014 21:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271137 - in head/sys: amd64/conf conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:06:34 -0000 Author: markj Date: Thu Sep 4 21:06:33 2014 New Revision: 271137 URL: http://svnweb.freebsd.org/changeset/base/271137 Log: Add mrsas(4) to GENERIC for i386 and amd64. Approved by: ambrisko, kadesai MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Sep 4 21:05:04 2014 (r271136) +++ head/sys/amd64/conf/GENERIC Thu Sep 4 21:06:33 2014 (r271137) @@ -164,6 +164,7 @@ device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family +device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s #XXX pointer/int warnings #device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Sep 4 21:05:04 2014 (r271136) +++ head/sys/conf/NOTES Thu Sep 4 21:06:33 2014 (r271137) @@ -1677,6 +1677,7 @@ device amrp # SCSI Passthrough interfa device mfi # LSI MegaRAID SAS device mfip # LSI MegaRAID SAS passthrough, requires CAM options MFI_DEBUG +device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s # # 3ware ATA RAID Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Sep 4 21:05:04 2014 (r271136) +++ head/sys/i386/conf/GENERIC Thu Sep 4 21:06:33 2014 (r271137) @@ -168,6 +168,7 @@ device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family +device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s device pst # Promise Supertrak SX6000 device twe # 3ware ATA RAID From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 21:28:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C87C753F; Thu, 4 Sep 2014 21:28:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3EB1918; Thu, 4 Sep 2014 21:28:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84LSPmk062545; Thu, 4 Sep 2014 21:28:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84LSPkF062544; Thu, 4 Sep 2014 21:28:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409042128.s84LSPkF062544@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 4 Sep 2014 21:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271140 - head/sys/gnu/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:28:25 -0000 Author: imp Date: Thu Sep 4 21:28:25 2014 New Revision: 271140 URL: http://svnweb.freebsd.org/changeset/base/271140 Log: Delete old arm dts tree. This was created by cherry picking from a full vendor tree. This worked great until it was time to update, but now it is time to update. Hit the rest button by removing this branch and re-adding it by a full copy of whatever is in the vendor tree. Deleted: head/sys/gnu/dts/arm/ From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 21:31:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AB1F6BE; Thu, 4 Sep 2014 21:31:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B112194D; Thu, 4 Sep 2014 21:31:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84LVQmS065501; Thu, 4 Sep 2014 21:31:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84LVPh3065497; Thu, 4 Sep 2014 21:31:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409042131.s84LVPh3065497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 4 Sep 2014 21:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271141 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:31:26 -0000 Author: sbruno Date: Thu Sep 4 21:31:25 2014 New Revision: 271141 URL: http://svnweb.freebsd.org/changeset/base/271141 Log: Allow multiple image activators to run on the same execution by changing imgp->interpreted to a bitmask instead of, functionally, a bool. Each imgactivator now requires its own flag in interpreted to indicate whether or not it has already examined argv[0]. Change imgp->interpreted to an unsigned char to add one extra bit for future use. With this change, one can execute a shell script from a 64bit host native make and still get the binmisc image activator to fire for the script interpreter. Prior to this, execution would fail. Phabric: https://reviews.freebsd.org/D696 Reviewed by: jhb@ MFC after: 4 weeks Modified: head/sys/kern/imgact_binmisc.c head/sys/kern/imgact_shell.c head/sys/sys/imgact.h Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Thu Sep 4 21:28:25 2014 (r271140) +++ head/sys/kern/imgact_binmisc.c Thu Sep 4 21:31:25 2014 (r271141) @@ -600,12 +600,12 @@ imgact_binmisc_exec(struct image_params } /* No interpreter nesting allowed. */ - if (imgp->interpreted) { + if (imgp->interpreted & IMGACT_BINMISC) { mtx_unlock(&interp_list_mtx); return (ENOEXEC); } - imgp->interpreted = 1; + imgp->interpreted |= IMGACT_BINMISC; if (imgp->args->fname != NULL) { fname = imgp->args->fname; Modified: head/sys/kern/imgact_shell.c ============================================================================== --- head/sys/kern/imgact_shell.c Thu Sep 4 21:28:25 2014 (r271140) +++ head/sys/kern/imgact_shell.c Thu Sep 4 21:31:25 2014 (r271141) @@ -115,10 +115,10 @@ exec_shell_imgact(imgp) * Don't allow a shell script to be the shell for a shell * script. :-) */ - if (imgp->interpreted) + if (imgp->interpreted & IMGACT_SHELL) return (ENOEXEC); - imgp->interpreted = 1; + imgp->interpreted |= IMGACT_SHELL; /* * At this point we have the first page of the file mapped. Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Thu Sep 4 21:28:25 2014 (r271140) +++ head/sys/sys/imgact.h Thu Sep 4 21:31:25 2014 (r271141) @@ -61,7 +61,9 @@ struct image_params { unsigned long entry_addr; /* entry address of target executable */ unsigned long reloc_base; /* load address of image */ char vmspace_destroyed; /* flag - we've blown away original vm space */ - char interpreted; /* flag - this executable is interpreted */ +#define IMGACT_SHELL 0x1 +#define IMGACT_BINMISC 0x2 + unsigned char interpreted; /* mask of interpreters that have run */ char opened; /* flag - we have opened executable vnode */ char *interpreter_name; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 21:48:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EABB0C36; Thu, 4 Sep 2014 21:48:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC9641B23; Thu, 4 Sep 2014 21:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84LmX5D072267; Thu, 4 Sep 2014 21:48:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84LmXrC072266; Thu, 4 Sep 2014 21:48:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409042148.s84LmXrC072266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 4 Sep 2014 21:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271143 - head/sys/gnu/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:48:34 -0000 Author: imp Date: Thu Sep 4 21:48:33 2014 New Revision: 271143 URL: http://svnweb.freebsd.org/changeset/base/271143 Log: Reimport dts files from vendor repo now that it has been properly trimmed. Added: head/sys/gnu/dts/arm/ - copied from r271142, vendor/device-tree/dist/src/arm/ From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 21:48:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D954C37; Thu, 4 Sep 2014 21:48:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AFE1B24; Thu, 4 Sep 2014 21:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84LmYjn072287; Thu, 4 Sep 2014 21:48:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84LmYe7072285; Thu, 4 Sep 2014 21:48:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409042148.s84LmYe7072285@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 4 Sep 2014 21:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271144 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:48:34 -0000 Author: jilles Date: Thu Sep 4 21:48:33 2014 New Revision: 271144 URL: http://svnweb.freebsd.org/changeset/base/271144 Log: sh: Allow enabling job control without a tty in non-interactive mode. If no tty is available, 'set -m' is still useful to put jobs in their own process groups. Modified: head/bin/sh/jobs.c head/bin/sh/sh.1 Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Thu Sep 4 21:48:33 2014 (r271143) +++ head/bin/sh/jobs.c Thu Sep 4 21:48:33 2014 (r271144) @@ -118,6 +118,24 @@ static void showjob(struct job *, int); static int jobctl; #if JOBS +static void +jobctl_notty(void) +{ + if (ttyfd >= 0) { + close(ttyfd); + ttyfd = -1; + } + if (!iflag) { + setsignal(SIGTSTP); + setsignal(SIGTTOU); + setsignal(SIGTTIN); + jobctl = 1; + return; + } + out2fmt_flush("sh: can't access tty; job control turned off\n"); + mflag = 0; +} + void setjobctl(int on) { @@ -133,8 +151,10 @@ setjobctl(int on) while (i <= 2 && !isatty(i)) i++; if (i > 2 || - (ttyfd = fcntl(i, F_DUPFD_CLOEXEC, 10)) < 0) - goto out; + (ttyfd = fcntl(i, F_DUPFD_CLOEXEC, 10)) < 0) { + jobctl_notty(); + return; + } } if (ttyfd < 10) { /* @@ -142,9 +162,8 @@ setjobctl(int on) * the user's redirections. */ if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC, 10)) < 0) { - close(ttyfd); - ttyfd = -1; - goto out; + jobctl_notty(); + return; } close(ttyfd); ttyfd = i; @@ -152,11 +171,15 @@ setjobctl(int on) do { /* while we are in the background */ initialpgrp = tcgetpgrp(ttyfd); if (initialpgrp < 0) { -out: out2fmt_flush("sh: can't access tty; job control turned off\n"); - mflag = 0; + jobctl_notty(); return; } if (initialpgrp != getpgrp()) { + if (!iflag) { + initialpgrp = -1; + jobctl_notty(); + return; + } kill(0, SIGTTIN); continue; } @@ -168,9 +191,11 @@ out: out2fmt_flush("sh: can't access tcsetpgrp(ttyfd, rootpid); } else { /* turning job control off */ setpgid(0, initialpgrp); - tcsetpgrp(ttyfd, initialpgrp); - close(ttyfd); - ttyfd = -1; + if (ttyfd >= 0) { + tcsetpgrp(ttyfd, initialpgrp); + close(ttyfd); + ttyfd = -1; + } setsignal(SIGTSTP); setsignal(SIGTTOU); setsignal(SIGTTIN); @@ -195,7 +220,8 @@ fgcmd(int argc __unused, char **argv __u printjobcmd(jp); flushout(&output); pgrp = jp->ps[0].pid; - tcsetpgrp(ttyfd, pgrp); + if (ttyfd >= 0) + tcsetpgrp(ttyfd, pgrp); restartjob(jp); jp->foreground = 1; INTOFF; @@ -847,7 +873,8 @@ forkshell(struct job *jp, union node *n, pgrp = getpid(); else pgrp = jp->ps[0].pid; - if (setpgid(0, pgrp) == 0 && mode == FORK_FG) { + if (setpgid(0, pgrp) == 0 && mode == FORK_FG && + ttyfd >= 0) { /*** this causes superfluous TIOCSPGRPS ***/ if (tcsetpgrp(ttyfd, pgrp) < 0) error("tcsetpgrp failed, errno=%d", errno); @@ -1007,7 +1034,7 @@ waitforjob(struct job *jp, int *origstat dotrap(); #if JOBS if (jp->jobctl) { - if (tcsetpgrp(ttyfd, rootpid) < 0) + if (ttyfd >= 0 && tcsetpgrp(ttyfd, rootpid) < 0) error("tcsetpgrp failed, errno=%d\n", errno); } if (jp->state == JOBSTOPPED) Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Thu Sep 4 21:48:33 2014 (r271143) +++ head/bin/sh/sh.1 Thu Sep 4 21:48:33 2014 (r271144) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd January 26, 2014 +.Dd September 4, 2014 .Dt SH 1 .Os .Sh NAME @@ -259,6 +259,12 @@ from input when in interactive mode. Force the shell to behave interactively. .It Fl m Li monitor Turn on job control (set automatically when interactive). +A new process group is created for each pipeline (called a job). +It is possible to suspend jobs or to have them run in the foreground or +in the background. +In a non-interactive shell, +this option can be set even if no terminal is available +and is useful to place processes in separate process groups. .It Fl n Li noexec If not interactive, read commands but do not execute them. From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 22:00:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6565C1D6; Thu, 4 Sep 2014 22:00:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5111B1CBA; Thu, 4 Sep 2014 22:00:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84M0r33078355; Thu, 4 Sep 2014 22:00:53 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84M0rX5078354; Thu, 4 Sep 2014 22:00:53 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409042200.s84M0rX5078354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 4 Sep 2014 22:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271145 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 22:00:53 -0000 Author: hrs Date: Thu Sep 4 22:00:52 2014 New Revision: 271145 URL: http://svnweb.freebsd.org/changeset/base/271145 Log: Fix a bug which prevented mount.fstab parameter from being converted when jail_JID_devfs_enable=NO. Spotted by: peter Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Thu Sep 4 21:48:33 2014 (r271144) +++ head/etc/rc.d/jail Thu Sep 4 22:00:52 2014 (r271145) @@ -207,6 +207,10 @@ parse_options() extract_var $_j consolelog exec.consolelog - \ /var/log/jail_${_j}_console.log + if [ -r $_fstab ]; then + echo " mount.fstab = \"$_fstab\";" + fi + eval : \${jail_${_j}_devfs_enable:=${jail_devfs_enable:-NO}} if checkyesno jail_${_j}_devfs_enable; then echo " mount.devfs;" @@ -222,11 +226,7 @@ parse_options() ;; *) warn "devfs_ruleset must be an integer." ;; esac - if [ -r $_fstab ]; then - echo " mount.fstab = \"$_fstab\";" - fi fi - eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} if checkyesno jail_${_j}_fdescfs_enable; then echo " mount.fdescfs;" From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 22:22:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E75B5CD; Thu, 4 Sep 2014 22:22:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8880F1EB6; Thu, 4 Sep 2014 22:22:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84MMsnO090671; Thu, 4 Sep 2014 22:22:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84MMrsP090666; Thu, 4 Sep 2014 22:22:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409042222.s84MMrsP090666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 4 Sep 2014 22:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271146 - in head/sys: conf dev/ahci modules/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 22:22:54 -0000 Author: imp Date: Thu Sep 4 22:22:53 2014 New Revision: 271146 URL: http://svnweb.freebsd.org/changeset/base/271146 Log: Separate out PCI attachment from the main AHCI driver. Move checks of PCI IDs into quirks, which mostly fit (though you'd get no argument from me that AHCI_Q_SATA1_UNIT0 is oddly specific). Set these quirks in the PCI attachment. Make some shared functions public so that PCI and possibly other bus attachments can use them. The split isn't perfect yet, but it is functional. The split will be perfected as other bus attachments for AHCI are written. Sponsored by: Netflix Reviewed by: kan, mav Differential Revision: https://reviews.freebsd.org/D699 Added: head/sys/dev/ahci/ahci_pci.c - copied, changed from r271145, head/sys/dev/ahci/ahci.c Modified: head/sys/conf/files head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/modules/ahci/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Sep 4 22:00:52 2014 (r271145) +++ head/sys/conf/files Thu Sep 4 22:22:53 2014 (r271146) @@ -622,8 +622,9 @@ dev/aha/aha.c optional aha dev/aha/aha_isa.c optional aha isa dev/aha/aha_mca.c optional aha mca dev/ahb/ahb.c optional ahb eisa -dev/ahci/ahci.c optional ahci pci -dev/ahci/ahciem.c optional ahci pci +dev/ahci/ahci.c optional ahci +dev/ahci/ahciem.c optional ahci +dev/ahci/ahci_pci.c optional ahci pci dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/ahc_eisa.c optional ahc eisa Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Sep 4 22:00:52 2014 (r271145) +++ head/sys/dev/ahci/ahci.c Thu Sep 4 22:22:53 2014 (r271146) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include "ahci.h" #include @@ -52,12 +50,9 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ -static int ahci_setup_interrupt(device_t dev); static void ahci_intr(void *data); static void ahci_intr_one(void *data); static void ahci_intr_one_edge(void *data); -static int ahci_suspend(device_t dev); -static int ahci_resume(device_t dev); static int ahci_ch_init(device_t dev); static int ahci_ch_deinit(device_t dev); static int ahci_ch_suspend(device_t dev); @@ -66,8 +61,6 @@ static void ahci_ch_pm(void *arg); static void ahci_ch_intr(void *arg); static void ahci_ch_intr_direct(void *arg); static void ahci_ch_intr_main(struct ahci_channel *ch, uint32_t istatus); -static int ahci_ctlr_reset(device_t dev); -static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); static void ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void ahci_execute_transaction(struct ahci_slot *slot); @@ -99,366 +92,76 @@ static void ahcipoll(struct cam_sim *sim static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); -static struct { - uint32_t id; - uint8_t rev; - const char *name; - int quirks; -#define AHCI_Q_NOFORCE 1 -#define AHCI_Q_NOPMP 2 -#define AHCI_Q_NONCQ 4 -#define AHCI_Q_1CH 8 -#define AHCI_Q_2CH 16 -#define AHCI_Q_4CH 32 -#define AHCI_Q_EDGEIS 64 -#define AHCI_Q_SATA2 128 -#define AHCI_Q_NOBSYRES 256 -#define AHCI_Q_NOAA 512 -#define AHCI_Q_NOCOUNT 1024 -#define AHCI_Q_ALTSIG 2048 -#define AHCI_Q_NOMSI 4096 - -#define AHCI_Q_BIT_STRING \ - "\020" \ - "\001NOFORCE" \ - "\002NOPMP" \ - "\003NONCQ" \ - "\0041CH" \ - "\0052CH" \ - "\0064CH" \ - "\007EDGEIS" \ - "\010SATA2" \ - "\011NOBSYRES" \ - "\012NOAA" \ - "\013NOCOUNT" \ - "\014ALTSIG" \ - "\015NOMSI" -} ahci_ids[] = { - {0x43801002, 0x00, "AMD SB600", AHCI_Q_NOMSI}, - {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43951002, 0x00, "AMD SB8x0/SB9x0", 0}, - {0x78001022, 0x00, "AMD Hudson-2", 0}, - {0x78011022, 0x00, "AMD Hudson-2", 0}, - {0x78021022, 0x00, "AMD Hudson-2", 0}, - {0x78031022, 0x00, "AMD Hudson-2", 0}, - {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, - {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, - {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, - {0x26818086, 0x00, "Intel ESB2", 0}, - {0x26828086, 0x00, "Intel ESB2", 0}, - {0x26838086, 0x00, "Intel ESB2", 0}, - {0x27c18086, 0x00, "Intel ICH7", 0}, - {0x27c38086, 0x00, "Intel ICH7", 0}, - {0x27c58086, 0x00, "Intel ICH7M", 0}, - {0x27c68086, 0x00, "Intel ICH7M", 0}, - {0x28218086, 0x00, "Intel ICH8", 0}, - {0x28228086, 0x00, "Intel ICH8", 0}, - {0x28248086, 0x00, "Intel ICH8", 0}, - {0x28298086, 0x00, "Intel ICH8M", 0}, - {0x282a8086, 0x00, "Intel ICH8M", 0}, - {0x29228086, 0x00, "Intel ICH9", 0}, - {0x29238086, 0x00, "Intel ICH9", 0}, - {0x29248086, 0x00, "Intel ICH9", 0}, - {0x29258086, 0x00, "Intel ICH9", 0}, - {0x29278086, 0x00, "Intel ICH9", 0}, - {0x29298086, 0x00, "Intel ICH9M", 0}, - {0x292a8086, 0x00, "Intel ICH9M", 0}, - {0x292b8086, 0x00, "Intel ICH9M", 0}, - {0x292c8086, 0x00, "Intel ICH9M", 0}, - {0x292f8086, 0x00, "Intel ICH9M", 0}, - {0x294d8086, 0x00, "Intel ICH9", 0}, - {0x294e8086, 0x00, "Intel ICH9M", 0}, - {0x3a058086, 0x00, "Intel ICH10", 0}, - {0x3a228086, 0x00, "Intel ICH10", 0}, - {0x3a258086, 0x00, "Intel ICH10", 0}, - {0x3b228086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x3b238086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x3b258086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x3b298086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x3b2c8086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x3b2f8086, 0x00, "Intel 5 Series/3400 Series", 0}, - {0x1c028086, 0x00, "Intel Cougar Point", 0}, - {0x1c038086, 0x00, "Intel Cougar Point", 0}, - {0x1c048086, 0x00, "Intel Cougar Point", 0}, - {0x1c058086, 0x00, "Intel Cougar Point", 0}, - {0x1d028086, 0x00, "Intel Patsburg", 0}, - {0x1d048086, 0x00, "Intel Patsburg", 0}, - {0x1d068086, 0x00, "Intel Patsburg", 0}, - {0x28268086, 0x00, "Intel Patsburg (RAID)", 0}, - {0x1e028086, 0x00, "Intel Panther Point", 0}, - {0x1e038086, 0x00, "Intel Panther Point", 0}, - {0x1e048086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1e058086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1e068086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1e078086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1e0e8086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1e0f8086, 0x00, "Intel Panther Point (RAID)", 0}, - {0x1f228086, 0x00, "Intel Avoton", 0}, - {0x1f238086, 0x00, "Intel Avoton", 0}, - {0x1f248086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f258086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f268086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f278086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f2e8086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f2f8086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f328086, 0x00, "Intel Avoton", 0}, - {0x1f338086, 0x00, "Intel Avoton", 0}, - {0x1f348086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f358086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f368086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f378086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f3e8086, 0x00, "Intel Avoton (RAID)", 0}, - {0x1f3f8086, 0x00, "Intel Avoton (RAID)", 0}, - {0x23a38086, 0x00, "Intel Coleto Creek", 0}, - {0x28238086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x28278086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x8c028086, 0x00, "Intel Lynx Point", 0}, - {0x8c038086, 0x00, "Intel Lynx Point", 0}, - {0x8c048086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8c058086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8c068086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8c078086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8c0e8086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8c0f8086, 0x00, "Intel Lynx Point (RAID)", 0}, - {0x8d028086, 0x00, "Intel Wellsburg", 0}, - {0x8d048086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x8d068086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x8d628086, 0x00, "Intel Wellsburg", 0}, - {0x8d648086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x8d668086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x8d6e8086, 0x00, "Intel Wellsburg (RAID)", 0}, - {0x9c028086, 0x00, "Intel Lynx Point-LP", 0}, - {0x9c038086, 0x00, "Intel Lynx Point-LP", 0}, - {0x9c048086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x9c058086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x9c068086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x9c078086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x9c0e8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x9c0f8086, 0x00, "Intel Lynx Point-LP (RAID)", 0}, - {0x23238086, 0x00, "Intel DH89xxCC", 0}, - {0x2360197b, 0x00, "JMicron JMB360", 0}, - {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, - {0x2362197b, 0x00, "JMicron JMB362", 0}, - {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, - {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, - {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, - {0x2368197b, 0x00, "JMicron JMB368", AHCI_Q_NOFORCE}, - {0x611111ab, 0x00, "Marvell 88SE6111", AHCI_Q_NOFORCE | AHCI_Q_1CH | - AHCI_Q_EDGEIS}, - {0x612111ab, 0x00, "Marvell 88SE6121", AHCI_Q_NOFORCE | AHCI_Q_2CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614111ab, 0x00, "Marvell 88SE6141", AHCI_Q_NOFORCE | AHCI_Q_4CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | - AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES}, - {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, - {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, - {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, - {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, - {0x91831b4b, 0x00, "Marvell 88SS9183", AHCI_Q_NOBSYRES}, - {0x91a01b4b, 0x00, "Marvell 88SE91Ax", AHCI_Q_NOBSYRES}, - {0x92151b4b, 0x00, "Marvell 88SE9215", AHCI_Q_NOBSYRES}, - {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x92351b4b, 0x00, "Marvell 88SE9235", AHCI_Q_NOBSYRES}, - {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, - {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, - {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, - {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, - {0x06401103, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, - {0x06401b4b, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, - {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, - {0x06441b4b, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, - {0x06411103, 0x00, "HighPoint RocketRAID 640L", AHCI_Q_NOBSYRES}, - {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_NOBSYRES}, - {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_NOBSYRES}, - {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x044f10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x045c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x045d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x045e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x045f10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, - {0x055010de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055110de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055210de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055310de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055410de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055510de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055610de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055710de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055810de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055910de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055A10de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x055B10de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x058410de, 0x00, "NVIDIA MCP67", AHCI_Q_NOAA}, - {0x07f010de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f110de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f210de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f310de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f410de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f510de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f610de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f710de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f810de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07f910de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07fa10de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x07fb10de, 0x00, "NVIDIA MCP73", AHCI_Q_NOAA}, - {0x0ad010de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad110de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad210de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad310de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad410de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad510de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad610de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad710de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad810de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ad910de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ada10de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0adb10de, 0x00, "NVIDIA MCP77", AHCI_Q_NOAA}, - {0x0ab410de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0ab510de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0ab610de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0ab710de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0ab810de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0ab910de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0aba10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0abb10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0abc10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0abd10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0abe10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0abf10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, - {0x0d8410de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOFORCE|AHCI_Q_NOAA}, - {0x0d8610de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8710de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8810de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8910de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8a10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8b10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8c10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8d10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8e10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8f10de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x33491106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, - {0x62871106, 0x00, "VIA VT8251", AHCI_Q_NOPMP|AHCI_Q_NONCQ}, - {0x11841039, 0x00, "SiS 966", 0}, - {0x11851039, 0x00, "SiS 968", 0}, - {0x01861039, 0x00, "SiS 968", 0}, - {0x00000000, 0x00, NULL, 0} -}; - #define recovery_type spriv_field0 #define RECOVERY_NONE 0 #define RECOVERY_READ_LOG 1 #define RECOVERY_REQUEST_SENSE 2 #define recovery_slot spriv_field1 -static int force_ahci = 1; -TUNABLE_INT("hw.ahci.force", &force_ahci); - -static int -ahci_probe(device_t dev) +int +ahci_ctlr_setup(device_t dev) { - char buf[64]; - int i, valid = 0; - uint32_t devid = pci_get_devid(dev); - uint8_t revid = pci_get_revid(dev); - - /* - * Ensure it is not a PCI bridge (some vendors use - * the same PID and VID in PCI bridge and AHCI cards). - */ - if (pci_get_class(dev) == PCIC_BRIDGE) - return (ENXIO); - - /* Is this a possible AHCI candidate? */ - if (pci_get_class(dev) == PCIC_STORAGE && - pci_get_subclass(dev) == PCIS_STORAGE_SATA && - pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) - valid = 1; - /* Is this a known AHCI chip? */ - for (i = 0; ahci_ids[i].id != 0; i++) { - if (ahci_ids[i].id == devid && - ahci_ids[i].rev <= revid && - (valid || (force_ahci == 1 && - !(ahci_ids[i].quirks & AHCI_Q_NOFORCE)))) { - /* Do not attach JMicrons with single PCI function. */ - if (pci_get_vendor(dev) == 0x197b && - (pci_read_config(dev, 0xdf, 1) & 0x40) == 0) - return (ENXIO); - snprintf(buf, sizeof(buf), "%s AHCI SATA controller", - ahci_ids[i].name); - device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); + struct ahci_controller *ctlr = device_get_softc(dev); + /* Clear interrupts */ + ATA_OUTL(ctlr->r_mem, AHCI_IS, ATA_INL(ctlr->r_mem, AHCI_IS)); + /* Configure CCC */ + if (ctlr->ccc) { + ATA_OUTL(ctlr->r_mem, AHCI_CCCP, ATA_INL(ctlr->r_mem, AHCI_PI)); + ATA_OUTL(ctlr->r_mem, AHCI_CCCC, + (ctlr->ccc << AHCI_CCCC_TV_SHIFT) | + (4 << AHCI_CCCC_CC_SHIFT) | + AHCI_CCCC_EN); + ctlr->cccv = (ATA_INL(ctlr->r_mem, AHCI_CCCC) & + AHCI_CCCC_INT_MASK) >> AHCI_CCCC_INT_SHIFT; + if (bootverbose) { + device_printf(dev, + "CCC with %dms/4cmd enabled on vector %d\n", + ctlr->ccc, ctlr->cccv); } } - if (!valid) - return (ENXIO); - device_set_desc_copy(dev, "AHCI SATA controller"); - return (BUS_PROBE_VENDOR); + /* Enable AHCI interrupts */ + ATA_OUTL(ctlr->r_mem, AHCI_GHC, + ATA_INL(ctlr->r_mem, AHCI_GHC) | AHCI_GHC_IE); + return (0); } -static int -ahci_ata_probe(device_t dev) +int +ahci_ctlr_reset(device_t dev) { - char buf[64]; - int i; - uint32_t devid = pci_get_devid(dev); - uint8_t revid = pci_get_revid(dev); + struct ahci_controller *ctlr = device_get_softc(dev); + int timeout; - if ((intptr_t)device_get_ivars(dev) >= 0) - return (ENXIO); - /* Is this a known AHCI chip? */ - for (i = 0; ahci_ids[i].id != 0; i++) { - if (ahci_ids[i].id == devid && - ahci_ids[i].rev <= revid) { - snprintf(buf, sizeof(buf), "%s AHCI SATA controller", - ahci_ids[i].name); - device_set_desc_copy(dev, buf); - return (BUS_PROBE_VENDOR); - } + /* Enable AHCI mode */ + ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); + /* Reset AHCI controller */ + ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE|AHCI_GHC_HR); + for (timeout = 1000; timeout > 0; timeout--) { + DELAY(1000); + if ((ATA_INL(ctlr->r_mem, AHCI_GHC) & AHCI_GHC_HR) == 0) + break; } - device_set_desc_copy(dev, "AHCI SATA controller"); - return (BUS_PROBE_VENDOR); + if (timeout == 0) { + device_printf(dev, "AHCI controller reset failure\n"); + return ENXIO; + } + /* Reenable AHCI mode */ + ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); + return (0); } -static int + +int ahci_attach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); - device_t child; - int error, unit, speed, i; - u_int u; - uint32_t devid = pci_get_devid(dev); - uint8_t revid = pci_get_revid(dev); + int error, i, u, speed, unit; u_int32_t version; + device_t child; ctlr->dev = dev; - i = 0; - while (ahci_ids[i].id != 0 && - (ahci_ids[i].id != devid || - ahci_ids[i].rev > revid)) - i++; - ctlr->quirks = ahci_ids[i].quirks; resource_int_value(device_get_name(dev), device_get_unit(dev), "ccc", &ctlr->ccc); - /* if we have a memory BAR(5) we are likely on an AHCI part */ - ctlr->r_rid = PCIR_BAR(5); - if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &ctlr->r_rid, RF_ACTIVE))) - return ENXIO; + /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); ctlr->sc_iomem.rm_end = rman_get_end(ctlr->r_mem); @@ -474,13 +177,6 @@ ahci_attach(device_t dev) rman_fini(&ctlr->sc_iomem); return (error); } - pci_enable_busmaster(dev); - /* Reset controller */ - if ((error = ahci_ctlr_reset(dev)) != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - rman_fini(&ctlr->sc_iomem); - return (error); - }; /* Get the HW capabilities */ version = ATA_INL(ctlr->r_mem, AHCI_VS); ctlr->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); @@ -533,13 +229,7 @@ ahci_attach(device_t dev) } ahci_ctlr_setup(dev); - /* Setup interrupts. */ - if (ahci_setup_interrupt(dev)) { - bus_dma_tag_destroy(ctlr->dma_tag); - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - rman_fini(&ctlr->sc_iomem); - return ENXIO; - } + i = 0; for (u = ctlr->ichannels; u != 0; u >>= 1) i += (u & 1); @@ -619,7 +309,7 @@ ahci_attach(device_t dev) return 0; } -static int +int ahci_detach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); @@ -637,7 +327,6 @@ ahci_detach(device_t dev) ctlr->irqs[i].r_irq_rid, ctlr->irqs[i].r_irq); } } - pci_release_msi(dev); bus_dma_tag_destroy(ctlr->dma_tag); /* Free memory. */ rman_fini(&ctlr->sc_iomem); @@ -646,109 +335,12 @@ ahci_detach(device_t dev) return (0); } -static int -ahci_ctlr_reset(device_t dev) -{ - struct ahci_controller *ctlr = device_get_softc(dev); - int timeout; - - if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == 0x28298086 && - (pci_read_config(dev, 0x92, 1) & 0xfe) == 0x04) - pci_write_config(dev, 0x92, 0x01, 1); - /* Enable AHCI mode */ - ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); - /* Reset AHCI controller */ - ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE|AHCI_GHC_HR); - for (timeout = 1000; timeout > 0; timeout--) { - DELAY(1000); - if ((ATA_INL(ctlr->r_mem, AHCI_GHC) & AHCI_GHC_HR) == 0) - break; - } - if (timeout == 0) { - device_printf(dev, "AHCI controller reset failure\n"); - return ENXIO; - } - /* Reenable AHCI mode */ - ATA_OUTL(ctlr->r_mem, AHCI_GHC, AHCI_GHC_AE); - return (0); -} - -static int -ahci_ctlr_setup(device_t dev) -{ - struct ahci_controller *ctlr = device_get_softc(dev); - /* Clear interrupts */ - ATA_OUTL(ctlr->r_mem, AHCI_IS, ATA_INL(ctlr->r_mem, AHCI_IS)); - /* Configure CCC */ - if (ctlr->ccc) { - ATA_OUTL(ctlr->r_mem, AHCI_CCCP, ATA_INL(ctlr->r_mem, AHCI_PI)); - ATA_OUTL(ctlr->r_mem, AHCI_CCCC, - (ctlr->ccc << AHCI_CCCC_TV_SHIFT) | - (4 << AHCI_CCCC_CC_SHIFT) | - AHCI_CCCC_EN); - ctlr->cccv = (ATA_INL(ctlr->r_mem, AHCI_CCCC) & - AHCI_CCCC_INT_MASK) >> AHCI_CCCC_INT_SHIFT; - if (bootverbose) { - device_printf(dev, - "CCC with %dms/4cmd enabled on vector %d\n", - ctlr->ccc, ctlr->cccv); - } - } - /* Enable AHCI interrupts */ - ATA_OUTL(ctlr->r_mem, AHCI_GHC, - ATA_INL(ctlr->r_mem, AHCI_GHC) | AHCI_GHC_IE); - return (0); -} - -static int -ahci_suspend(device_t dev) -{ - struct ahci_controller *ctlr = device_get_softc(dev); - - bus_generic_suspend(dev); - /* Disable interupts, so the state change(s) doesn't trigger */ - ATA_OUTL(ctlr->r_mem, AHCI_GHC, - ATA_INL(ctlr->r_mem, AHCI_GHC) & (~AHCI_GHC_IE)); - return 0; -} - -static int -ahci_resume(device_t dev) -{ - int res; - - if ((res = ahci_ctlr_reset(dev)) != 0) - return (res); - ahci_ctlr_setup(dev); - return (bus_generic_resume(dev)); -} - -static int +int ahci_setup_interrupt(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); int i; - ctlr->msi = 2; - /* Process hints. */ - if (ctlr->quirks & AHCI_Q_NOMSI) - ctlr->msi = 0; - resource_int_value(device_get_name(dev), - device_get_unit(dev), "msi", &ctlr->msi); - ctlr->numirqs = 1; - if (ctlr->msi < 0) - ctlr->msi = 0; - else if (ctlr->msi == 1) - ctlr->msi = min(1, pci_msi_count(dev)); - else if (ctlr->msi > 1) { - ctlr->msi = 2; - ctlr->numirqs = pci_msi_count(dev); - } - /* Allocate MSI if needed/present. */ - if (ctlr->msi && pci_alloc_msi(dev, &ctlr->numirqs) != 0) { - ctlr->msi = 0; - ctlr->numirqs = 1; - } /* Check for single MSI vector fallback. */ if (ctlr->numirqs > 1 && (ATA_INL(ctlr->r_mem, AHCI_GHC) & AHCI_GHC_MRSM) != 0) { @@ -864,9 +456,9 @@ ahci_intr_one_edge(void *data) ctlr->interrupt[unit].function(arg); } -static struct resource * +struct resource * ahci_alloc_resource(device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + u_long start, u_long end, u_long count, u_int flags) { struct ahci_controller *ctlr = device_get_softc(dev); struct resource *res; @@ -915,9 +507,9 @@ ahci_alloc_resource(device_t dev, device return (res); } -static int +int ahci_release_resource(device_t dev, device_t child, int type, int rid, - struct resource *r) + struct resource *r) { switch (type) { @@ -932,10 +524,10 @@ ahci_release_resource(device_t dev, devi return (EINVAL); } -static int +int ahci_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_filter_t *filter, driver_intr_t *function, - void *argument, void **cookiep) + int flags, driver_filter_t *filter, driver_intr_t *function, + void *argument, void **cookiep) { struct ahci_controller *ctlr = device_get_softc(dev); int unit = (intptr_t)device_get_ivars(child); @@ -949,9 +541,9 @@ ahci_setup_intr(device_t dev, device_t c return (0); } -static int +int ahci_teardown_intr(device_t dev, device_t child, struct resource *irq, - void *cookie) + void *cookie) { struct ahci_controller *ctlr = device_get_softc(dev); int unit = (intptr_t)device_get_ivars(child); @@ -961,7 +553,7 @@ ahci_teardown_intr(device_t dev, device_ return (0); } -static int +int ahci_print_child(device_t dev, device_t child) { int retval, channel; @@ -974,7 +566,7 @@ ahci_print_child(device_t dev, device_t return (retval); } -static int +int ahci_child_location_str(device_t dev, device_t child, char *buf, size_t buflen) { @@ -986,7 +578,7 @@ ahci_child_location_str(device_t dev, de return (0); } -static bus_dma_tag_t +bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t child) { struct ahci_controller *ctlr = device_get_softc(dev); @@ -994,51 +586,6 @@ ahci_get_dma_tag(device_t dev, device_t return (ctlr->dma_tag); } -devclass_t ahci_devclass; -static device_method_t ahci_methods[] = { - DEVMETHOD(device_probe, ahci_probe), - DEVMETHOD(device_attach, ahci_attach), - DEVMETHOD(device_detach, ahci_detach), - DEVMETHOD(device_suspend, ahci_suspend), - DEVMETHOD(device_resume, ahci_resume), - DEVMETHOD(bus_print_child, ahci_print_child), - DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), - DEVMETHOD(bus_release_resource, ahci_release_resource), - DEVMETHOD(bus_setup_intr, ahci_setup_intr), - DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), - DEVMETHOD(bus_child_location_str, ahci_child_location_str), - DEVMETHOD(bus_get_dma_tag, ahci_get_dma_tag), - { 0, 0 } -}; -static driver_t ahci_driver = { - "ahci", - ahci_methods, - sizeof(struct ahci_controller) -}; -DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, 0, 0); -static device_method_t ahci_ata_methods[] = { - DEVMETHOD(device_probe, ahci_ata_probe), - DEVMETHOD(device_attach, ahci_attach), - DEVMETHOD(device_detach, ahci_detach), - DEVMETHOD(device_suspend, ahci_suspend), - DEVMETHOD(device_resume, ahci_resume), - DEVMETHOD(bus_print_child, ahci_print_child), - DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), - DEVMETHOD(bus_release_resource, ahci_release_resource), - DEVMETHOD(bus_setup_intr, ahci_setup_intr), - DEVMETHOD(bus_teardown_intr,ahci_teardown_intr), - DEVMETHOD(bus_child_location_str, ahci_child_location_str), - { 0, 0 } -}; -static driver_t ahci_ata_driver = { - "ahci", - ahci_ata_methods, - sizeof(struct ahci_controller) -}; -DRIVER_MODULE(ahci, atapci, ahci_ata_driver, ahci_devclass, 0, 0); -MODULE_VERSION(ahci, 1); -MODULE_DEPEND(ahci, cam, 1, 1, 1); - static int ahci_ch_probe(device_t dev) { @@ -1061,6 +608,10 @@ ahci_ch_attach(device_t dev) ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; ch->quirks = ctlr->quirks; + ch->vendorid = ctlr->vendorid; + ch->deviceid = ctlr->deviceid; + ch->subvendorid = ctlr->subvendorid; + ch->subdeviceid = ctlr->subdeviceid; ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1; mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF); resource_int_value(device_get_name(dev), @@ -1069,12 +620,8 @@ ahci_ch_attach(device_t dev) if (ch->pm_level > 3) callout_init_mtx(&ch->pm_timer, &ch->mtx, 0); callout_init_mtx(&ch->reset_timer, &ch->mtx, 0); - /* Limit speed for my onboard JMicron external port. - * It is not eSATA really. */ - if (pci_get_devid(ctlr->dev) == 0x2363197b && - pci_get_subvendor(ctlr->dev) == 0x1043 && - pci_get_subdevice(ctlr->dev) == 0x81e4 && - ch->unit == 0) + /* JMicron external ports (0) sometimes limited */ + if ((ctlr->quirks & AHCI_Q_SATA1_UNIT0) && ch->unit == 0) sata_rev = 1; if (ch->quirks & AHCI_Q_SATA2) sata_rev = 2; @@ -1979,7 +1526,7 @@ ahci_execute_transaction(struct ahci_slo } /* Workaround for ATI SB600/SB700 chipsets. */ if (ccb->ccb_h.target_id == 15 && - pci_get_vendor(device_get_parent(dev)) == 0x1002 && + (ch->quirks & AHCI_Q_ATI_PMP_BUG) && (ATA_INL(ch->r_mem, AHCI_P_IS) & AHCI_P_IX_IPM)) { et = AHCI_ERR_TIMEOUT; break; @@ -3085,12 +2632,12 @@ ahciaction(struct cam_sim *sim, union cc cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = MAXPHYS; /* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */ - if (pci_get_devid(parent) == 0x43801002) + if (ch->quirks & AHCI_Q_MAXIO_64K) cpi->maxio = min(cpi->maxio, 128 * 512); - cpi->hba_vendor = pci_get_vendor(parent); - cpi->hba_device = pci_get_device(parent); - cpi->hba_subvendor = pci_get_subvendor(parent); - cpi->hba_subdevice = pci_get_subdevice(parent); + cpi->hba_vendor = ch->vendorid; + cpi->hba_device = ch->deviceid; + cpi->hba_subvendor = ch->subvendorid; + cpi->hba_subdevice = ch->subdeviceid; cpi->ccb_h.status = CAM_REQ_CMP; break; } @@ -3117,3 +2664,5 @@ ahcipoll(struct cam_sim *sim) ahci_reset_to(ch->dev); } } +MODULE_VERSION(ahci, 1); +MODULE_DEPEND(ahci, cam, 1, 1, 1); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Thu Sep 4 22:00:52 2014 (r271145) +++ head/sys/dev/ahci/ahci.h Thu Sep 4 22:22:53 2014 (r271146) @@ -415,6 +415,10 @@ struct ahci_channel { uint32_t caps2; /* Controller capabilities */ uint32_t chcaps; /* Channel capabilities */ uint32_t chscaps; /* Channel sleep capabilities */ + uint16_t vendorid; /* Vendor ID from the bus */ + uint16_t deviceid; /* Device ID from the bus */ + uint16_t subvendorid; /* Subvendor ID from the bus */ + uint16_t subdeviceid; /* Subdevice ID from the bus */ int quirks; int numslots; /* Number of present slots */ int pm_level; /* power management level */ @@ -474,6 +478,10 @@ struct ahci_controller { device_t dev; bus_dma_tag_t dma_tag; int r_rid; + uint16_t vendorid; /* Vendor ID from the bus */ + uint16_t deviceid; /* Device ID from the bus */ + uint16_t subvendorid; /* Subvendor ID from the bus */ + uint16_t subdeviceid; /* Subdevice ID from the bus */ struct resource *r_mem; struct rman sc_iomem; struct ahci_controller_irq { @@ -544,3 +552,59 @@ enum ahci_err_type { bus_write_multi_4((res), (offset), (addr), (count)) #define ATA_OUTSL_STRM(res, offset, addr, count) \ bus_write_multi_stream_4((res), (offset), (addr), (count)) + + +#define AHCI_Q_NOFORCE 1 +#define AHCI_Q_NOPMP 2 +#define AHCI_Q_NONCQ 4 +#define AHCI_Q_1CH 8 +#define AHCI_Q_2CH 0x10 +#define AHCI_Q_4CH 0x20 +#define AHCI_Q_EDGEIS 0x40 +#define AHCI_Q_SATA2 0x80 +#define AHCI_Q_NOBSYRES 0x100 +#define AHCI_Q_NOAA 0x200 +#define AHCI_Q_NOCOUNT 0x400 +#define AHCI_Q_ALTSIG 0x800 +#define AHCI_Q_NOMSI 0x1000 +#define AHCI_Q_ATI_PMP_BUG 0x2000 +#define AHCI_Q_MAXIO_64K 0x4000 +#define AHCI_Q_SATA1_UNIT0 0x8000 /* need better method for this */ + +#define AHCI_Q_BIT_STRING \ + "\020" \ + "\001NOFORCE" \ + "\002NOPMP" \ + "\003NONCQ" \ + "\0041CH" \ + "\0052CH" \ + "\0064CH" \ + "\007EDGEIS" \ + "\010SATA2" \ + "\011NOBSYRES" \ + "\012NOAA" \ + "\013NOCOUNT" \ + "\014ALTSIG" \ + "\015NOMSI" \ + "\016ATI_PMP_BUG" \ + "\017MAXIO_64K" \ + "\020SATA1_UNIT0" + +int ahci_attach(device_t dev); +int ahci_detach(device_t dev); +int ahci_setup_interrupt(device_t dev); +int ahci_print_child(device_t dev, device_t child); +struct resource *ahci_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags); +int ahci_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r); +int ahci_setup_intr(device_t dev, device_t child, struct resource *irq, + int flags, driver_filter_t *filter, driver_intr_t *function, + void *argument, void **cookiep); +int ahci_teardown_intr(device_t dev, device_t child, struct resource *irq, + void *cookie); +int ahci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen); +bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t child); +int ahci_ctlr_reset(device_t dev); +int ahci_ctlr_setup(device_t dev); Copied and modified: head/sys/dev/ahci/ahci_pci.c (from r271145, head/sys/dev/ahci/ahci.c) ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Sep 4 22:00:52 2014 (r271145, copy source) +++ head/sys/dev/ahci/ahci_pci.c Thu Sep 4 22:22:53 2014 (r271146) @@ -45,102 +45,24 @@ __FBSDID("$FreeBSD$"); #include #include "ahci.h" -#include -#include -#include -#include -#include - -/* local prototypes */ -static int ahci_setup_interrupt(device_t dev); -static void ahci_intr(void *data); -static void ahci_intr_one(void *data); -static void ahci_intr_one_edge(void *data); -static int ahci_suspend(device_t dev); -static int ahci_resume(device_t dev); -static int ahci_ch_init(device_t dev); -static int ahci_ch_deinit(device_t dev); -static int ahci_ch_suspend(device_t dev); -static int ahci_ch_resume(device_t dev); -static void ahci_ch_pm(void *arg); -static void ahci_ch_intr(void *arg); -static void ahci_ch_intr_direct(void *arg); -static void ahci_ch_intr_main(struct ahci_channel *ch, uint32_t istatus); -static int ahci_ctlr_reset(device_t dev); -static int ahci_ctlr_setup(device_t dev); -static void ahci_begin_transaction(device_t dev, union ccb *ccb); -static void ahci_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); -static void ahci_execute_transaction(struct ahci_slot *slot); -static void ahci_timeout(struct ahci_slot *slot); -static void ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et); -static int ahci_setup_fis(device_t dev, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag); -static void ahci_dmainit(device_t dev); -static void ahci_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); -static void ahci_dmafini(device_t dev); -static void ahci_slotsalloc(device_t dev); -static void ahci_slotsfree(device_t dev); -static void ahci_reset(device_t dev); -static void ahci_start(device_t dev, int fbs); -static void ahci_stop(device_t dev); -static void ahci_clo(device_t dev); -static void ahci_start_fr(device_t dev); -static void ahci_stop_fr(device_t dev); - -static int ahci_sata_connect(struct ahci_channel *ch); -static int ahci_sata_phy_reset(device_t dev); -static int ahci_wait_ready(device_t dev, int t, int t0); - -static void ahci_issue_recovery(device_t dev); -static void ahci_process_read_log(device_t dev, union ccb *ccb); -static void ahci_process_request_sense(device_t dev, union ccb *ccb); - -static void ahciaction(struct cam_sim *sim, union ccb *ccb); -static void ahcipoll(struct cam_sim *sim); - -static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); +static int force_ahci = 1; +TUNABLE_INT("hw.ahci.force", &force_ahci); static struct { uint32_t id; uint8_t rev; const char *name; int quirks; -#define AHCI_Q_NOFORCE 1 -#define AHCI_Q_NOPMP 2 -#define AHCI_Q_NONCQ 4 -#define AHCI_Q_1CH 8 -#define AHCI_Q_2CH 16 -#define AHCI_Q_4CH 32 -#define AHCI_Q_EDGEIS 64 -#define AHCI_Q_SATA2 128 -#define AHCI_Q_NOBSYRES 256 -#define AHCI_Q_NOAA 512 -#define AHCI_Q_NOCOUNT 1024 -#define AHCI_Q_ALTSIG 2048 -#define AHCI_Q_NOMSI 4096 - -#define AHCI_Q_BIT_STRING \ - "\020" \ - "\001NOFORCE" \ - "\002NOPMP" \ - "\003NONCQ" \ - "\0041CH" \ - "\0052CH" \ - "\0064CH" \ - "\007EDGEIS" \ - "\010SATA2" \ - "\011NOBSYRES" \ - "\012NOAA" \ - "\013NOCOUNT" \ - "\014ALTSIG" \ - "\015NOMSI" } ahci_ids[] = { - {0x43801002, 0x00, "AMD SB600", AHCI_Q_NOMSI}, - {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, - {0x43951002, 0x00, "AMD SB8x0/SB9x0", 0}, + {0x43801002, 0x00, "AMD SB600", + AHCI_Q_NOMSI | AHCI_Q_ATI_PMP_BUG | AHCI_Q_MAXIO_64K}, + {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 23:50:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75141573; Thu, 4 Sep 2014 23:50:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 609C91822; Thu, 4 Sep 2014 23:50:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84No62w031155; Thu, 4 Sep 2014 23:50:06 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84No6dX030978; Thu, 4 Sep 2014 23:50:06 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409042350.s84No6dX030978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Thu, 4 Sep 2014 23:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271147 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 23:50:06 -0000 Author: kargl Date: Thu Sep 4 23:50:05 2014 New Revision: 271147 URL: http://svnweb.freebsd.org/changeset/base/271147 Log: Remove an initialized, but otherwise, unused variable. Modified: head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Thu Sep 4 22:22:53 2014 (r271146) +++ head/lib/msun/src/e_lgamma_r.c Thu Sep 4 23:50:05 2014 (r271147) @@ -90,7 +90,6 @@ static const volatile double vzero = 0; static const double zero= 0.00000000000000000000e+00, -two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ Modified: head/lib/msun/src/e_lgammaf_r.c ============================================================================== --- head/lib/msun/src/e_lgammaf_r.c Thu Sep 4 22:22:53 2014 (r271146) +++ head/lib/msun/src/e_lgammaf_r.c Thu Sep 4 23:50:05 2014 (r271147) @@ -23,7 +23,6 @@ static const volatile float vzero = 0; static const float zero= 0.0000000000e+00, -two23= 8.3886080000e+06, /* 0x4b000000 */ half= 5.0000000000e-01, /* 0x3f000000 */ one = 1.0000000000e+00, /* 0x3f800000 */ pi = 3.1415927410e+00, /* 0x40490fdb */ From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 23:53:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 730797AB; Thu, 4 Sep 2014 23:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8C918BB; Thu, 4 Sep 2014 23:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84Nrq3Y034958; Thu, 4 Sep 2014 23:53:52 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84NrpSW034955; Thu, 4 Sep 2014 23:53:51 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201409042353.s84NrpSW034955@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 4 Sep 2014 23:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271148 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 23:53:52 -0000 Author: jmg Date: Thu Sep 4 23:53:51 2014 New Revision: 271148 URL: http://svnweb.freebsd.org/changeset/base/271148 Log: use a straight buffer instead of an iov w/ 1 segment... The aesni driver when it hits a mbuf/iov buffer, it mallocs and copies the data for processing.. This improves perf by ~8-10% on my machine... I have thoughts of fixing AES-NI so that it can better handle segmented buffers, which should help improve IPSEC performance, but that is for the future... Modified: head/sys/geom/eli/g_eli_crypto.c head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli_crypto.c ============================================================================== --- head/sys/geom/eli/g_eli_crypto.c Thu Sep 4 23:50:05 2014 (r271147) +++ head/sys/geom/eli/g_eli_crypto.c Thu Sep 4 23:53:51 2014 (r271148) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #else #include #include @@ -63,8 +62,6 @@ g_eli_crypto_cipher(u_int algo, int enc, struct cryptoini cri; struct cryptop *crp; struct cryptodesc *crd; - struct uio *uio; - struct iovec *iov; uint64_t sid; u_char *p; int error; @@ -79,24 +76,13 @@ g_eli_crypto_cipher(u_int algo, int enc, error = crypto_newsession(&sid, &cri, CRYPTOCAP_F_SOFTWARE); if (error != 0) return (error); - p = malloc(sizeof(*crp) + sizeof(*crd) + sizeof(*uio) + sizeof(*iov), - M_ELI, M_NOWAIT | M_ZERO); + p = malloc(sizeof(*crp) + sizeof(*crd), M_ELI, M_NOWAIT | M_ZERO); if (p == NULL) { crypto_freesession(sid); return (ENOMEM); } crp = (struct cryptop *)p; p += sizeof(*crp); crd = (struct cryptodesc *)p; p += sizeof(*crd); - uio = (struct uio *)p; p += sizeof(*uio); - iov = (struct iovec *)p; p += sizeof(*iov); - - iov->iov_len = datasize; - iov->iov_base = data; - - uio->uio_iov = iov; - uio->uio_iovcnt = 1; - uio->uio_segflg = UIO_SYSSPACE; - uio->uio_resid = datasize; crd->crd_skip = 0; crd->crd_len = datasize; @@ -114,8 +100,8 @@ g_eli_crypto_cipher(u_int algo, int enc, crp->crp_olen = datasize; crp->crp_opaque = NULL; crp->crp_callback = g_eli_crypto_done; - crp->crp_buf = (void *)uio; - crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; + crp->crp_buf = (void *)data; + crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; crp->crp_desc = crd; error = crypto_dispatch(crp); Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Thu Sep 4 23:50:05 2014 (r271147) +++ head/sys/geom/eli/g_eli_integrity.c Thu Sep 4 23:53:51 2014 (r271148) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -363,8 +362,6 @@ g_eli_auth_read(struct g_eli_softc *sc, size += sizeof(struct cryptop) * nsec; size += sizeof(struct cryptodesc) * nsec * 2; size += G_ELI_AUTH_SECKEYLEN * nsec; - size += sizeof(struct uio) * nsec; - size += sizeof(struct iovec) * nsec; cbp->bio_offset = (bp->bio_offset / bp->bio_to->sectorsize) * sc->sc_bytes_per_sector; bp->bio_driver2 = malloc(size, M_ELI, M_WAITOK); cbp->bio_data = bp->bio_driver2; @@ -409,8 +406,6 @@ g_eli_auth_run(struct g_eli_worker *wr, struct g_eli_softc *sc; struct cryptop *crp; struct cryptodesc *crde, *crda; - struct uio *uio; - struct iovec *iov; u_int i, lsec, nsec, data_secsize, decr_secsize, encr_secsize; off_t dstoff; int err, error; @@ -449,8 +444,6 @@ g_eli_auth_run(struct g_eli_worker *wr, size += sizeof(*crde) * nsec; size += sizeof(*crda) * nsec; size += G_ELI_AUTH_SECKEYLEN * nsec; - size += sizeof(*uio) * nsec; - size += sizeof(*iov) * nsec; data = malloc(size, M_ELI, M_WAITOK); bp->bio_driver2 = data; p = data + encr_secsize * nsec; @@ -464,8 +457,6 @@ g_eli_auth_run(struct g_eli_worker *wr, crde = (struct cryptodesc *)p; p += sizeof(*crde); crda = (struct cryptodesc *)p; p += sizeof(*crda); authkey = (u_char *)p; p += G_ELI_AUTH_SECKEYLEN; - uio = (struct uio *)p; p += sizeof(*uio); - iov = (struct iovec *)p; p += sizeof(*iov); data_secsize = sc->sc_data_per_sector; if ((i % lsec) == 0) @@ -482,21 +473,13 @@ g_eli_auth_run(struct g_eli_worker *wr, plaindata += data_secsize; } - iov->iov_len = sc->sc_alen + data_secsize; - iov->iov_base = data; - data += encr_secsize; - - uio->uio_iov = iov; - uio->uio_iovcnt = 1; - uio->uio_segflg = UIO_SYSSPACE; - uio->uio_resid = iov->iov_len; - crp->crp_sid = wr->w_sid; - crp->crp_ilen = uio->uio_resid; + crp->crp_ilen = sc->sc_alen + data_secsize; crp->crp_olen = data_secsize; crp->crp_opaque = (void *)bp; - crp->crp_buf = (void *)uio; - crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; + crp->crp_buf = (void *)data; + data += encr_secsize; + crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; if (g_eli_batch) crp->crp_flags |= CRYPTO_F_BATCH; if (bp->bio_cmd == BIO_WRITE) { Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Thu Sep 4 23:50:05 2014 (r271147) +++ head/sys/geom/eli/g_eli_privacy.c Thu Sep 4 23:53:51 2014 (r271148) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -230,8 +229,6 @@ g_eli_crypto_run(struct g_eli_worker *wr struct g_eli_softc *sc; struct cryptop *crp; struct cryptodesc *crd; - struct uio *uio; - struct iovec *iov; u_int i, nsec, secsize; int err, error; off_t dstoff; @@ -254,8 +251,6 @@ g_eli_crypto_run(struct g_eli_worker *wr */ size = sizeof(*crp) * nsec; size += sizeof(*crd) * nsec; - size += sizeof(*uio) * nsec; - size += sizeof(*iov) * nsec; /* * If we write the data we cannot destroy current bio_data content, * so we need to allocate more memory for encrypted data. @@ -280,28 +275,18 @@ g_eli_crypto_run(struct g_eli_worker *wr for (i = 0, dstoff = bp->bio_offset; i < nsec; i++, dstoff += secsize) { crp = (struct cryptop *)p; p += sizeof(*crp); crd = (struct cryptodesc *)p; p += sizeof(*crd); - uio = (struct uio *)p; p += sizeof(*uio); - iov = (struct iovec *)p; p += sizeof(*iov); - - iov->iov_len = secsize; - iov->iov_base = data; - data += secsize; - - uio->uio_iov = iov; - uio->uio_iovcnt = 1; - uio->uio_segflg = UIO_SYSSPACE; - uio->uio_resid = secsize; crp->crp_sid = wr->w_sid; crp->crp_ilen = secsize; crp->crp_olen = secsize; crp->crp_opaque = (void *)bp; - crp->crp_buf = (void *)uio; + crp->crp_buf = (void *)data; + data += secsize; if (bp->bio_cmd == BIO_WRITE) crp->crp_callback = g_eli_crypto_write_done; else /* if (bp->bio_cmd == BIO_READ) */ crp->crp_callback = g_eli_crypto_read_done; - crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; + crp->crp_flags = CRYPTO_F_CBIFSYNC | CRYPTO_F_REL; if (g_eli_batch) crp->crp_flags |= CRYPTO_F_BATCH; crp->crp_desc = crd; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 01:06:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2662552; Fri, 5 Sep 2014 01:06:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C354E1EDB; Fri, 5 Sep 2014 01:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8516j53069292; Fri, 5 Sep 2014 01:06:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8516jBR069290; Fri, 5 Sep 2014 01:06:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409050106.s8516jBR069290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 5 Sep 2014 01:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271149 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 01:06:46 -0000 Author: pfg Date: Fri Sep 5 01:06:45 2014 New Revision: 271149 URL: http://svnweb.freebsd.org/changeset/base/271149 Log: Apply known workarounds for modern MacBooks. The legacy USB circuit tends to give trouble on MacBook. While the original report covered MacBook, extend the fix preemptively for the newer MacBookPro too. PR: 191693 Reviewed by: emaste MFC after: 5 days 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 Thu Sep 4 23:53:51 2014 (r271148) +++ head/sys/amd64/amd64/machdep.c Fri Sep 5 01:06:45 2014 (r271149) @@ -250,9 +250,11 @@ cpu_startup(dummy) if (sysenv != NULL) { if (strncmp(sysenv, "MacBook1,1", 10) == 0 || strncmp(sysenv, "MacBook3,1", 10) == 0 || + strncmp(sysenv, "MacBook4,1", 10) == 0 || strncmp(sysenv, "MacBookPro1,1", 13) == 0 || strncmp(sysenv, "MacBookPro1,2", 13) == 0 || strncmp(sysenv, "MacBookPro3,1", 13) == 0 || + strncmp(sysenv, "MacBookPro4,1", 13) == 0 || strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Sep 4 23:53:51 2014 (r271148) +++ head/sys/i386/i386/machdep.c Fri Sep 5 01:06:45 2014 (r271149) @@ -273,9 +273,11 @@ cpu_startup(dummy) if (sysenv != NULL) { if (strncmp(sysenv, "MacBook1,1", 10) == 0 || strncmp(sysenv, "MacBook3,1", 10) == 0 || + strncmp(sysenv, "MacBook4,1", 10) == 0 || strncmp(sysenv, "MacBookPro1,1", 13) == 0 || strncmp(sysenv, "MacBookPro1,2", 13) == 0 || strncmp(sysenv, "MacBookPro3,1", 13) == 0 || + strncmp(sysenv, "MacBookPro4,1", 13) == 0 || strncmp(sysenv, "Macmini1,1", 10) == 0) { if (bootverbose) printf("Disabling LEGACY_USB_EN bit on " From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 02:21:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAF17482; Fri, 5 Sep 2014 02:21:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5E7C17FC; Fri, 5 Sep 2014 02:21:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s852LjqB006013; Fri, 5 Sep 2014 02:21:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s852LjQg006010; Fri, 5 Sep 2014 02:21:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409050221.s852LjQg006010@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 5 Sep 2014 02:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271151 - head/sys/gnu/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 02:21:45 -0000 Author: imp Date: Fri Sep 5 02:21:45 2014 New Revision: 271151 URL: http://svnweb.freebsd.org/changeset/base/271151 Log: Merge forgotten .h files from vendor branch. Added: head/sys/gnu/dts/arm/imx51-pinfunc.h - copied unchanged from r271150, vendor/device-tree/dist/src/arm/imx51-pinfunc.h head/sys/gnu/dts/arm/imx53-pinfunc.h - copied unchanged from r271150, vendor/device-tree/dist/src/arm/imx53-pinfunc.h head/sys/gnu/dts/arm/imx6dl-pinfunc.h - copied unchanged from r271150, vendor/device-tree/dist/src/arm/imx6dl-pinfunc.h head/sys/gnu/dts/arm/imx6q-pinfunc.h - copied unchanged from r271150, vendor/device-tree/dist/src/arm/imx6q-pinfunc.h head/sys/gnu/dts/arm/imx6sl-pinfunc.h - copied unchanged from r271150, vendor/device-tree/dist/src/arm/imx6sl-pinfunc.h Modified: Directory Properties: head/sys/gnu/dts/arm/ (props changed) Copied: head/sys/gnu/dts/arm/imx51-pinfunc.h (from r271150, vendor/device-tree/dist/src/arm/imx51-pinfunc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/imx51-pinfunc.h Fri Sep 5 02:21:45 2014 (r271151, copy of r271150, vendor/device-tree/dist/src/arm/imx51-pinfunc.h) @@ -0,0 +1,773 @@ +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DTS_IMX51_PINFUNC_H +#define __DTS_IMX51_PINFUNC_H + +/* + * The pin function ID is a tuple of + * + */ +#define MX51_PAD_EIM_D16__AUD4_RXFS 0x05c 0x3f0 0x000 0x5 0x0 +#define MX51_PAD_EIM_D16__AUD5_TXD 0x05c 0x3f0 0x8d8 0x7 0x0 +#define MX51_PAD_EIM_D16__EIM_D16 0x05c 0x3f0 0x000 0x0 0x0 +#define MX51_PAD_EIM_D16__GPIO2_0 0x05c 0x3f0 0x000 0x1 0x0 +#define MX51_PAD_EIM_D16__I2C1_SDA 0x05c 0x3f0 0x9b4 0x4 0x0 +#define MX51_PAD_EIM_D16__UART2_CTS 0x05c 0x3f0 0x000 0x3 0x0 +#define MX51_PAD_EIM_D16__USBH2_DATA0 0x05c 0x3f0 0x000 0x2 0x0 +#define MX51_PAD_EIM_D17__AUD5_RXD 0x060 0x3f4 0x8d4 0x7 0x0 +#define MX51_PAD_EIM_D17__EIM_D17 0x060 0x3f4 0x000 0x0 0x0 +#define MX51_PAD_EIM_D17__GPIO2_1 0x060 0x3f4 0x000 0x1 0x0 +#define MX51_PAD_EIM_D17__UART2_RXD 0x060 0x3f4 0x9ec 0x3 0x0 +#define MX51_PAD_EIM_D17__UART3_CTS 0x060 0x3f4 0x000 0x4 0x0 +#define MX51_PAD_EIM_D17__USBH2_DATA1 0x060 0x3f4 0x000 0x2 0x0 +#define MX51_PAD_EIM_D18__AUD5_TXC 0x064 0x3f8 0x8e4 0x7 0x0 +#define MX51_PAD_EIM_D18__EIM_D18 0x064 0x3f8 0x000 0x0 0x0 +#define MX51_PAD_EIM_D18__GPIO2_2 0x064 0x3f8 0x000 0x1 0x0 +#define MX51_PAD_EIM_D18__UART2_TXD 0x064 0x3f8 0x000 0x3 0x0 +#define MX51_PAD_EIM_D18__UART3_RTS 0x064 0x3f8 0x9f0 0x4 0x1 +#define MX51_PAD_EIM_D18__USBH2_DATA2 0x064 0x3f8 0x000 0x2 0x0 +#define MX51_PAD_EIM_D19__AUD4_RXC 0x068 0x3fc 0x000 0x5 0x0 +#define MX51_PAD_EIM_D19__AUD5_TXFS 0x068 0x3fc 0x8e8 0x7 0x0 +#define MX51_PAD_EIM_D19__EIM_D19 0x068 0x3fc 0x000 0x0 0x0 +#define MX51_PAD_EIM_D19__GPIO2_3 0x068 0x3fc 0x000 0x1 0x0 +#define MX51_PAD_EIM_D19__I2C1_SCL 0x068 0x3fc 0x9b0 0x4 0x0 +#define MX51_PAD_EIM_D19__UART2_RTS 0x068 0x3fc 0x9e8 0x3 0x1 +#define MX51_PAD_EIM_D19__USBH2_DATA3 0x068 0x3fc 0x000 0x2 0x0 +#define MX51_PAD_EIM_D20__AUD4_TXD 0x06c 0x400 0x8c8 0x5 0x0 +#define MX51_PAD_EIM_D20__EIM_D20 0x06c 0x400 0x000 0x0 0x0 +#define MX51_PAD_EIM_D20__GPIO2_4 0x06c 0x400 0x000 0x1 0x0 +#define MX51_PAD_EIM_D20__SRTC_ALARM_DEB 0x06c 0x400 0x000 0x4 0x0 +#define MX51_PAD_EIM_D20__USBH2_DATA4 0x06c 0x400 0x000 0x2 0x0 +#define MX51_PAD_EIM_D21__AUD4_RXD 0x070 0x404 0x8c4 0x5 0x0 +#define MX51_PAD_EIM_D21__EIM_D21 0x070 0x404 0x000 0x0 0x0 +#define MX51_PAD_EIM_D21__GPIO2_5 0x070 0x404 0x000 0x1 0x0 +#define MX51_PAD_EIM_D21__SRTC_ALARM_DEB 0x070 0x404 0x000 0x3 0x0 +#define MX51_PAD_EIM_D21__USBH2_DATA5 0x070 0x404 0x000 0x2 0x0 +#define MX51_PAD_EIM_D22__AUD4_TXC 0x074 0x408 0x8cc 0x5 0x0 +#define MX51_PAD_EIM_D22__EIM_D22 0x074 0x408 0x000 0x0 0x0 +#define MX51_PAD_EIM_D22__GPIO2_6 0x074 0x408 0x000 0x1 0x0 +#define MX51_PAD_EIM_D22__USBH2_DATA6 0x074 0x408 0x000 0x2 0x0 +#define MX51_PAD_EIM_D23__AUD4_TXFS 0x078 0x40c 0x8d0 0x5 0x0 +#define MX51_PAD_EIM_D23__EIM_D23 0x078 0x40c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D23__GPIO2_7 0x078 0x40c 0x000 0x1 0x0 +#define MX51_PAD_EIM_D23__SPDIF_OUT1 0x078 0x40c 0x000 0x4 0x0 +#define MX51_PAD_EIM_D23__USBH2_DATA7 0x078 0x40c 0x000 0x2 0x0 +#define MX51_PAD_EIM_D24__AUD6_RXFS 0x07c 0x410 0x8f8 0x5 0x0 +#define MX51_PAD_EIM_D24__EIM_D24 0x07c 0x410 0x000 0x0 0x0 +#define MX51_PAD_EIM_D24__GPIO2_8 0x07c 0x410 0x000 0x1 0x0 +#define MX51_PAD_EIM_D24__I2C2_SDA 0x07c 0x410 0x9bc 0x4 0x0 +#define MX51_PAD_EIM_D24__UART3_CTS 0x07c 0x410 0x000 0x3 0x0 +#define MX51_PAD_EIM_D24__USBOTG_DATA0 0x07c 0x410 0x000 0x2 0x0 +#define MX51_PAD_EIM_D25__EIM_D25 0x080 0x414 0x000 0x0 0x0 +#define MX51_PAD_EIM_D25__KEY_COL6 0x080 0x414 0x9c8 0x1 0x0 +#define MX51_PAD_EIM_D25__UART2_CTS 0x080 0x414 0x000 0x4 0x0 +#define MX51_PAD_EIM_D25__UART3_RXD 0x080 0x414 0x9f4 0x3 0x0 +#define MX51_PAD_EIM_D25__USBOTG_DATA1 0x080 0x414 0x000 0x2 0x0 +#define MX51_PAD_EIM_D26__EIM_D26 0x084 0x418 0x000 0x0 0x0 +#define MX51_PAD_EIM_D26__KEY_COL7 0x084 0x418 0x9cc 0x1 0x0 +#define MX51_PAD_EIM_D26__UART2_RTS 0x084 0x418 0x9e8 0x4 0x3 +#define MX51_PAD_EIM_D26__UART3_TXD 0x084 0x418 0x000 0x3 0x0 +#define MX51_PAD_EIM_D26__USBOTG_DATA2 0x084 0x418 0x000 0x2 0x0 +#define MX51_PAD_EIM_D27__AUD6_RXC 0x088 0x41c 0x8f4 0x5 0x0 +#define MX51_PAD_EIM_D27__EIM_D27 0x088 0x41c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D27__GPIO2_9 0x088 0x41c 0x000 0x1 0x0 +#define MX51_PAD_EIM_D27__I2C2_SCL 0x088 0x41c 0x9b8 0x4 0x0 +#define MX51_PAD_EIM_D27__UART3_RTS 0x088 0x41c 0x9f0 0x3 0x3 +#define MX51_PAD_EIM_D27__USBOTG_DATA3 0x088 0x41c 0x000 0x2 0x0 +#define MX51_PAD_EIM_D28__AUD6_TXD 0x08c 0x420 0x8f0 0x5 0x0 +#define MX51_PAD_EIM_D28__EIM_D28 0x08c 0x420 0x000 0x0 0x0 +#define MX51_PAD_EIM_D28__KEY_ROW4 0x08c 0x420 0x9d0 0x1 0x0 +#define MX51_PAD_EIM_D28__USBOTG_DATA4 0x08c 0x420 0x000 0x2 0x0 +#define MX51_PAD_EIM_D29__AUD6_RXD 0x090 0x424 0x8ec 0x5 0x0 +#define MX51_PAD_EIM_D29__EIM_D29 0x090 0x424 0x000 0x0 0x0 +#define MX51_PAD_EIM_D29__KEY_ROW5 0x090 0x424 0x9d4 0x1 0x0 +#define MX51_PAD_EIM_D29__USBOTG_DATA5 0x090 0x424 0x000 0x2 0x0 +#define MX51_PAD_EIM_D30__AUD6_TXC 0x094 0x428 0x8fc 0x5 0x0 +#define MX51_PAD_EIM_D30__EIM_D30 0x094 0x428 0x000 0x0 0x0 +#define MX51_PAD_EIM_D30__KEY_ROW6 0x094 0x428 0x9d8 0x1 0x0 +#define MX51_PAD_EIM_D30__USBOTG_DATA6 0x094 0x428 0x000 0x2 0x0 +#define MX51_PAD_EIM_D31__AUD6_TXFS 0x098 0x42c 0x900 0x5 0x0 +#define MX51_PAD_EIM_D31__EIM_D31 0x098 0x42c 0x000 0x0 0x0 +#define MX51_PAD_EIM_D31__KEY_ROW7 0x098 0x42c 0x9dc 0x1 0x0 +#define MX51_PAD_EIM_D31__USBOTG_DATA7 0x098 0x42c 0x000 0x2 0x0 +#define MX51_PAD_EIM_A16__EIM_A16 0x09c 0x430 0x000 0x0 0x0 +#define MX51_PAD_EIM_A16__GPIO2_10 0x09c 0x430 0x000 0x1 0x0 +#define MX51_PAD_EIM_A16__OSC_FREQ_SEL0 0x09c 0x430 0x000 0x7 0x0 +#define MX51_PAD_EIM_A17__EIM_A17 0x0a0 0x434 0x000 0x0 0x0 +#define MX51_PAD_EIM_A17__GPIO2_11 0x0a0 0x434 0x000 0x1 0x0 +#define MX51_PAD_EIM_A17__OSC_FREQ_SEL1 0x0a0 0x434 0x000 0x7 0x0 +#define MX51_PAD_EIM_A18__BOOT_LPB0 0x0a4 0x438 0x000 0x7 0x0 +#define MX51_PAD_EIM_A18__EIM_A18 0x0a4 0x438 0x000 0x0 0x0 +#define MX51_PAD_EIM_A18__GPIO2_12 0x0a4 0x438 0x000 0x1 0x0 +#define MX51_PAD_EIM_A19__BOOT_LPB1 0x0a8 0x43c 0x000 0x7 0x0 +#define MX51_PAD_EIM_A19__EIM_A19 0x0a8 0x43c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A19__GPIO2_13 0x0a8 0x43c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A20__BOOT_UART_SRC0 0x0ac 0x440 0x000 0x7 0x0 +#define MX51_PAD_EIM_A20__EIM_A20 0x0ac 0x440 0x000 0x0 0x0 +#define MX51_PAD_EIM_A20__GPIO2_14 0x0ac 0x440 0x000 0x1 0x0 +#define MX51_PAD_EIM_A21__BOOT_UART_SRC1 0x0b0 0x444 0x000 0x7 0x0 +#define MX51_PAD_EIM_A21__EIM_A21 0x0b0 0x444 0x000 0x0 0x0 +#define MX51_PAD_EIM_A21__GPIO2_15 0x0b0 0x444 0x000 0x1 0x0 +#define MX51_PAD_EIM_A22__EIM_A22 0x0b4 0x448 0x000 0x0 0x0 +#define MX51_PAD_EIM_A22__GPIO2_16 0x0b4 0x448 0x000 0x1 0x0 +#define MX51_PAD_EIM_A23__BOOT_HPN_EN 0x0b8 0x44c 0x000 0x7 0x0 +#define MX51_PAD_EIM_A23__EIM_A23 0x0b8 0x44c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A23__GPIO2_17 0x0b8 0x44c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A24__EIM_A24 0x0bc 0x450 0x000 0x0 0x0 +#define MX51_PAD_EIM_A24__GPIO2_18 0x0bc 0x450 0x000 0x1 0x0 +#define MX51_PAD_EIM_A24__USBH2_CLK 0x0bc 0x450 0x000 0x2 0x0 +#define MX51_PAD_EIM_A25__DISP1_PIN4 0x0c0 0x454 0x000 0x6 0x0 +#define MX51_PAD_EIM_A25__EIM_A25 0x0c0 0x454 0x000 0x0 0x0 +#define MX51_PAD_EIM_A25__GPIO2_19 0x0c0 0x454 0x000 0x1 0x0 +#define MX51_PAD_EIM_A25__USBH2_DIR 0x0c0 0x454 0x000 0x2 0x0 +#define MX51_PAD_EIM_A26__CSI1_DATA_EN 0x0c4 0x458 0x9a0 0x5 0x0 +#define MX51_PAD_EIM_A26__DISP2_EXT_CLK 0x0c4 0x458 0x908 0x6 0x0 +#define MX51_PAD_EIM_A26__EIM_A26 0x0c4 0x458 0x000 0x0 0x0 +#define MX51_PAD_EIM_A26__GPIO2_20 0x0c4 0x458 0x000 0x1 0x0 +#define MX51_PAD_EIM_A26__USBH2_STP 0x0c4 0x458 0x000 0x2 0x0 +#define MX51_PAD_EIM_A27__CSI2_DATA_EN 0x0c8 0x45c 0x99c 0x5 0x0 +#define MX51_PAD_EIM_A27__DISP1_PIN1 0x0c8 0x45c 0x9a4 0x6 0x0 +#define MX51_PAD_EIM_A27__EIM_A27 0x0c8 0x45c 0x000 0x0 0x0 +#define MX51_PAD_EIM_A27__GPIO2_21 0x0c8 0x45c 0x000 0x1 0x0 +#define MX51_PAD_EIM_A27__USBH2_NXT 0x0c8 0x45c 0x000 0x2 0x0 +#define MX51_PAD_EIM_EB0__EIM_EB0 0x0cc 0x460 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB1__EIM_EB1 0x0d0 0x464 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB2__AUD5_RXFS 0x0d4 0x468 0x8e0 0x6 0x0 +#define MX51_PAD_EIM_EB2__CSI1_D2 0x0d4 0x468 0x000 0x5 0x0 +#define MX51_PAD_EIM_EB2__EIM_EB2 0x0d4 0x468 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB2__FEC_MDIO 0x0d4 0x468 0x954 0x3 0x0 +#define MX51_PAD_EIM_EB2__GPIO2_22 0x0d4 0x468 0x000 0x1 0x0 +#define MX51_PAD_EIM_EB2__GPT_CMPOUT1 0x0d4 0x468 0x000 0x7 0x0 +#define MX51_PAD_EIM_EB3__AUD5_RXC 0x0d8 0x46c 0x8dc 0x6 0x0 +#define MX51_PAD_EIM_EB3__CSI1_D3 0x0d8 0x46c 0x000 0x5 0x0 +#define MX51_PAD_EIM_EB3__EIM_EB3 0x0d8 0x46c 0x000 0x0 0x0 +#define MX51_PAD_EIM_EB3__FEC_RDATA1 0x0d8 0x46c 0x95c 0x3 0x0 +#define MX51_PAD_EIM_EB3__GPIO2_23 0x0d8 0x46c 0x000 0x1 0x0 +#define MX51_PAD_EIM_EB3__GPT_CMPOUT2 0x0d8 0x46c 0x000 0x7 0x0 +#define MX51_PAD_EIM_OE__EIM_OE 0x0dc 0x470 0x000 0x0 0x0 +#define MX51_PAD_EIM_OE__GPIO2_24 0x0dc 0x470 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS0__EIM_CS0 0x0e0 0x474 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS0__GPIO2_25 0x0e0 0x474 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS1__EIM_CS1 0x0e4 0x478 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS1__GPIO2_26 0x0e4 0x478 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS2__AUD5_TXD 0x0e8 0x47c 0x8d8 0x6 0x1 +#define MX51_PAD_EIM_CS2__CSI1_D4 0x0e8 0x47c 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS2__EIM_CS2 0x0e8 0x47c 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS2__FEC_RDATA2 0x0e8 0x47c 0x960 0x3 0x0 +#define MX51_PAD_EIM_CS2__GPIO2_27 0x0e8 0x47c 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS2__USBOTG_STP 0x0e8 0x47c 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS3__AUD5_RXD 0x0ec 0x480 0x8d4 0x6 0x1 +#define MX51_PAD_EIM_CS3__CSI1_D5 0x0ec 0x480 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS3__EIM_CS3 0x0ec 0x480 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS3__FEC_RDATA3 0x0ec 0x480 0x964 0x3 0x0 +#define MX51_PAD_EIM_CS3__GPIO2_28 0x0ec 0x480 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS3__USBOTG_NXT 0x0ec 0x480 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS4__AUD5_TXC 0x0f0 0x484 0x8e4 0x6 0x1 +#define MX51_PAD_EIM_CS4__CSI1_D6 0x0f0 0x484 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS4__EIM_CS4 0x0f0 0x484 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS4__FEC_RX_ER 0x0f0 0x484 0x970 0x3 0x0 +#define MX51_PAD_EIM_CS4__GPIO2_29 0x0f0 0x484 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS4__USBOTG_CLK 0x0f0 0x484 0x000 0x2 0x0 +#define MX51_PAD_EIM_CS5__AUD5_TXFS 0x0f4 0x488 0x8e8 0x6 0x1 +#define MX51_PAD_EIM_CS5__CSI1_D7 0x0f4 0x488 0x000 0x5 0x0 +#define MX51_PAD_EIM_CS5__DISP1_EXT_CLK 0x0f4 0x488 0x904 0x4 0x0 +#define MX51_PAD_EIM_CS5__EIM_CS5 0x0f4 0x488 0x000 0x0 0x0 +#define MX51_PAD_EIM_CS5__FEC_CRS 0x0f4 0x488 0x950 0x3 0x0 +#define MX51_PAD_EIM_CS5__GPIO2_30 0x0f4 0x488 0x000 0x1 0x0 +#define MX51_PAD_EIM_CS5__USBOTG_DIR 0x0f4 0x488 0x000 0x2 0x0 +#define MX51_PAD_EIM_DTACK__EIM_DTACK 0x0f8 0x48c 0x000 0x0 0x0 +#define MX51_PAD_EIM_DTACK__GPIO2_31 0x0f8 0x48c 0x000 0x1 0x0 +#define MX51_PAD_EIM_LBA__EIM_LBA 0x0fc 0x494 0x000 0x0 0x0 +#define MX51_PAD_EIM_LBA__GPIO3_1 0x0fc 0x494 0x978 0x1 0x0 +#define MX51_PAD_EIM_CRE__EIM_CRE 0x100 0x4a0 0x000 0x0 0x0 +#define MX51_PAD_EIM_CRE__GPIO3_2 0x100 0x4a0 0x97c 0x1 0x0 +#define MX51_PAD_DRAM_CS1__DRAM_CS1 0x104 0x4d0 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WE_B__GPIO3_3 0x108 0x4e4 0x980 0x3 0x0 +#define MX51_PAD_NANDF_WE_B__NANDF_WE_B 0x108 0x4e4 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WE_B__PATA_DIOW 0x108 0x4e4 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WE_B__SD3_DATA0 0x108 0x4e4 0x93c 0x2 0x0 +#define MX51_PAD_NANDF_RE_B__GPIO3_4 0x10c 0x4e8 0x984 0x3 0x0 +#define MX51_PAD_NANDF_RE_B__NANDF_RE_B 0x10c 0x4e8 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RE_B__PATA_DIOR 0x10c 0x4e8 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RE_B__SD3_DATA1 0x10c 0x4e8 0x940 0x2 0x0 +#define MX51_PAD_NANDF_ALE__GPIO3_5 0x110 0x4ec 0x988 0x3 0x0 +#define MX51_PAD_NANDF_ALE__NANDF_ALE 0x110 0x4ec 0x000 0x0 0x0 +#define MX51_PAD_NANDF_ALE__PATA_BUFFER_EN 0x110 0x4ec 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CLE__GPIO3_6 0x114 0x4f0 0x98c 0x3 0x0 +#define MX51_PAD_NANDF_CLE__NANDF_CLE 0x114 0x4f0 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CLE__PATA_RESET_B 0x114 0x4f0 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WP_B__GPIO3_7 0x118 0x4f4 0x990 0x3 0x0 +#define MX51_PAD_NANDF_WP_B__NANDF_WP_B 0x118 0x4f4 0x000 0x0 0x0 +#define MX51_PAD_NANDF_WP_B__PATA_DMACK 0x118 0x4f4 0x000 0x1 0x0 +#define MX51_PAD_NANDF_WP_B__SD3_DATA2 0x118 0x4f4 0x944 0x2 0x0 +#define MX51_PAD_NANDF_RB0__ECSPI2_SS1 0x11c 0x4f8 0x930 0x5 0x0 +#define MX51_PAD_NANDF_RB0__GPIO3_8 0x11c 0x4f8 0x994 0x3 0x0 +#define MX51_PAD_NANDF_RB0__NANDF_RB0 0x11c 0x4f8 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB0__PATA_DMARQ 0x11c 0x4f8 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RB0__SD3_DATA3 0x11c 0x4f8 0x948 0x2 0x0 +#define MX51_PAD_NANDF_RB1__CSPI_MOSI 0x120 0x4fc 0x91c 0x6 0x0 +#define MX51_PAD_NANDF_RB1__ECSPI2_RDY 0x120 0x4fc 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB1__GPIO3_9 0x120 0x4fc 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB1__NANDF_RB1 0x120 0x4fc 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB1__PATA_IORDY 0x120 0x4fc 0x000 0x1 0x0 +#define MX51_PAD_NANDF_RB1__SD4_CMD 0x120 0x4fc 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RB2__DISP2_WAIT 0x124 0x500 0x9a8 0x5 0x0 +#define MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x124 0x500 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB2__FEC_COL 0x124 0x500 0x94c 0x1 0x0 +#define MX51_PAD_NANDF_RB2__GPIO3_10 0x124 0x500 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB2__NANDF_RB2 0x124 0x500 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB2__USBH3_H3_DP 0x124 0x500 0x000 0x7 0x0 +#define MX51_PAD_NANDF_RB2__USBH3_NXT 0x124 0x500 0xa20 0x6 0x0 +#define MX51_PAD_NANDF_RB3__DISP1_WAIT 0x128 0x504 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x128 0x504 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RB3__FEC_RX_CLK 0x128 0x504 0x968 0x1 0x0 +#define MX51_PAD_NANDF_RB3__GPIO3_11 0x128 0x504 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RB3__NANDF_RB3 0x128 0x504 0x000 0x0 0x0 +#define MX51_PAD_NANDF_RB3__USBH3_CLK 0x128 0x504 0x9f8 0x6 0x0 +#define MX51_PAD_NANDF_RB3__USBH3_H3_DM 0x128 0x504 0x000 0x7 0x0 +#define MX51_PAD_GPIO_NAND__GPIO_NAND 0x12c 0x514 0x998 0x0 0x0 +#define MX51_PAD_GPIO_NAND__PATA_INTRQ 0x12c 0x514 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS0__GPIO3_16 0x130 0x518 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS0__NANDF_CS0 0x130 0x518 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS1__GPIO3_17 0x134 0x51c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS1__NANDF_CS1 0x134 0x51c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS2__CSPI_SCLK 0x138 0x520 0x914 0x6 0x0 +#define MX51_PAD_NANDF_CS2__FEC_TX_ER 0x138 0x520 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS2__GPIO3_18 0x138 0x520 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS2__NANDF_CS2 0x138 0x520 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS2__PATA_CS_0 0x138 0x520 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS2__SD4_CLK 0x138 0x520 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS2__USBH3_H1_DP 0x138 0x520 0x000 0x7 0x0 +#define MX51_PAD_NANDF_CS3__FEC_MDC 0x13c 0x524 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS3__GPIO3_19 0x13c 0x524 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS3__NANDF_CS3 0x13c 0x524 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS3__PATA_CS_1 0x13c 0x524 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS3__SD4_DAT0 0x13c 0x524 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS3__USBH3_H1_DM 0x13c 0x524 0x000 0x7 0x0 +#define MX51_PAD_NANDF_CS4__FEC_TDATA1 0x140 0x528 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS4__GPIO3_20 0x140 0x528 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS4__NANDF_CS4 0x140 0x528 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS4__PATA_DA_0 0x140 0x528 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS4__SD4_DAT1 0x140 0x528 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS4__USBH3_STP 0x140 0x528 0xa24 0x7 0x0 +#define MX51_PAD_NANDF_CS5__FEC_TDATA2 0x144 0x52c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS5__GPIO3_21 0x144 0x52c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS5__NANDF_CS5 0x144 0x52c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS5__PATA_DA_1 0x144 0x52c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS5__SD4_DAT2 0x144 0x52c 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS5__USBH3_DIR 0x144 0x52c 0xa1c 0x7 0x0 +#define MX51_PAD_NANDF_CS6__CSPI_SS3 0x148 0x530 0x928 0x7 0x0 +#define MX51_PAD_NANDF_CS6__FEC_TDATA3 0x148 0x530 0x000 0x2 0x0 +#define MX51_PAD_NANDF_CS6__GPIO3_22 0x148 0x530 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS6__NANDF_CS6 0x148 0x530 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS6__PATA_DA_2 0x148 0x530 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS6__SD4_DAT3 0x148 0x530 0x000 0x5 0x0 +#define MX51_PAD_NANDF_CS7__FEC_TX_EN 0x14c 0x534 0x000 0x1 0x0 +#define MX51_PAD_NANDF_CS7__GPIO3_23 0x14c 0x534 0x000 0x3 0x0 +#define MX51_PAD_NANDF_CS7__NANDF_CS7 0x14c 0x534 0x000 0x0 0x0 +#define MX51_PAD_NANDF_CS7__SD3_CLK 0x14c 0x534 0x000 0x5 0x0 +#define MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 0x150 0x538 0x000 0x2 0x0 +#define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x150 0x538 0x974 0x1 0x0 +#define MX51_PAD_NANDF_RDY_INT__GPIO3_24 0x150 0x538 0x000 0x3 0x0 +#define MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT 0x150 0x538 0x938 0x0 0x0 +#define MX51_PAD_NANDF_RDY_INT__SD3_CMD 0x150 0x538 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x154 0x53c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D15__GPIO3_25 0x154 0x53c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D15__NANDF_D15 0x154 0x53c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D15__PATA_DATA15 0x154 0x53c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D15__SD3_DAT7 0x154 0x53c 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D14__ECSPI2_SS3 0x158 0x540 0x934 0x2 0x0 +#define MX51_PAD_NANDF_D14__GPIO3_26 0x158 0x540 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D14__NANDF_D14 0x158 0x540 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D14__PATA_DATA14 0x158 0x540 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D14__SD3_DAT6 0x158 0x540 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D13__ECSPI2_SS2 0x15c 0x544 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D13__GPIO3_27 0x15c 0x544 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D13__NANDF_D13 0x15c 0x544 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D13__PATA_DATA13 0x15c 0x544 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D13__SD3_DAT5 0x15c 0x544 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D12__ECSPI2_SS1 0x160 0x548 0x930 0x2 0x1 +#define MX51_PAD_NANDF_D12__GPIO3_28 0x160 0x548 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D12__NANDF_D12 0x160 0x548 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D12__PATA_DATA12 0x160 0x548 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D12__SD3_DAT4 0x160 0x548 0x000 0x5 0x0 +#define MX51_PAD_NANDF_D11__FEC_RX_DV 0x164 0x54c 0x96c 0x2 0x0 +#define MX51_PAD_NANDF_D11__GPIO3_29 0x164 0x54c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D11__NANDF_D11 0x164 0x54c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D11__PATA_DATA11 0x164 0x54c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D11__SD3_DATA3 0x164 0x54c 0x948 0x5 0x1 +#define MX51_PAD_NANDF_D10__GPIO3_30 0x168 0x550 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D10__NANDF_D10 0x168 0x550 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D10__PATA_DATA10 0x168 0x550 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D10__SD3_DATA2 0x168 0x550 0x944 0x5 0x1 +#define MX51_PAD_NANDF_D9__FEC_RDATA0 0x16c 0x554 0x958 0x2 0x0 +#define MX51_PAD_NANDF_D9__GPIO3_31 0x16c 0x554 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D9__NANDF_D9 0x16c 0x554 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D9__PATA_DATA9 0x16c 0x554 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D9__SD3_DATA1 0x16c 0x554 0x940 0x5 0x1 +#define MX51_PAD_NANDF_D8__FEC_TDATA0 0x170 0x558 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D8__GPIO4_0 0x170 0x558 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D8__NANDF_D8 0x170 0x558 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D8__PATA_DATA8 0x170 0x558 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D8__SD3_DATA0 0x170 0x558 0x93c 0x5 0x1 +#define MX51_PAD_NANDF_D7__GPIO4_1 0x174 0x55c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D7__NANDF_D7 0x174 0x55c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D7__PATA_DATA7 0x174 0x55c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D7__USBH3_DATA0 0x174 0x55c 0x9fc 0x5 0x0 +#define MX51_PAD_NANDF_D6__GPIO4_2 0x178 0x560 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D6__NANDF_D6 0x178 0x560 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D6__PATA_DATA6 0x178 0x560 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D6__SD4_LCTL 0x178 0x560 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D6__USBH3_DATA1 0x178 0x560 0xa00 0x5 0x0 +#define MX51_PAD_NANDF_D5__GPIO4_3 0x17c 0x564 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D5__NANDF_D5 0x17c 0x564 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D5__PATA_DATA5 0x17c 0x564 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D5__SD4_WP 0x17c 0x564 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D5__USBH3_DATA2 0x17c 0x564 0xa04 0x5 0x0 +#define MX51_PAD_NANDF_D4__GPIO4_4 0x180 0x568 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D4__NANDF_D4 0x180 0x568 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D4__PATA_DATA4 0x180 0x568 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D4__SD4_CD 0x180 0x568 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D4__USBH3_DATA3 0x180 0x568 0xa08 0x5 0x0 +#define MX51_PAD_NANDF_D3__GPIO4_5 0x184 0x56c 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D3__NANDF_D3 0x184 0x56c 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D3__PATA_DATA3 0x184 0x56c 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D3__SD4_DAT4 0x184 0x56c 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D3__USBH3_DATA4 0x184 0x56c 0xa0c 0x5 0x0 +#define MX51_PAD_NANDF_D2__GPIO4_6 0x188 0x570 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D2__NANDF_D2 0x188 0x570 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D2__PATA_DATA2 0x188 0x570 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D2__SD4_DAT5 0x188 0x570 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D2__USBH3_DATA5 0x188 0x570 0xa10 0x5 0x0 +#define MX51_PAD_NANDF_D1__GPIO4_7 0x18c 0x574 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D1__NANDF_D1 0x18c 0x574 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D1__PATA_DATA1 0x18c 0x574 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D1__SD4_DAT6 0x18c 0x574 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D1__USBH3_DATA6 0x18c 0x574 0xa14 0x5 0x0 +#define MX51_PAD_NANDF_D0__GPIO4_8 0x190 0x578 0x000 0x3 0x0 +#define MX51_PAD_NANDF_D0__NANDF_D0 0x190 0x578 0x000 0x0 0x0 +#define MX51_PAD_NANDF_D0__PATA_DATA0 0x190 0x578 0x000 0x1 0x0 +#define MX51_PAD_NANDF_D0__SD4_DAT7 0x190 0x578 0x000 0x2 0x0 +#define MX51_PAD_NANDF_D0__USBH3_DATA7 0x190 0x578 0xa18 0x5 0x0 +#define MX51_PAD_CSI1_D8__CSI1_D8 0x194 0x57c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D8__GPIO3_12 0x194 0x57c 0x998 0x3 0x1 +#define MX51_PAD_CSI1_D9__CSI1_D9 0x198 0x580 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D9__GPIO3_13 0x198 0x580 0x000 0x3 0x0 +#define MX51_PAD_CSI1_D10__CSI1_D10 0x19c 0x584 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D11__CSI1_D11 0x1a0 0x588 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D12__CSI1_D12 0x1a4 0x58c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D13__CSI1_D13 0x1a8 0x590 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D14__CSI1_D14 0x1ac 0x594 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D15__CSI1_D15 0x1b0 0x598 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D16__CSI1_D16 0x1b4 0x59c 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D17__CSI1_D17 0x1b8 0x5a0 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D18__CSI1_D18 0x1bc 0x5a4 0x000 0x0 0x0 +#define MX51_PAD_CSI1_D19__CSI1_D19 0x1c0 0x5a8 0x000 0x0 0x0 +#define MX51_PAD_CSI1_VSYNC__CSI1_VSYNC 0x1c4 0x5ac 0x000 0x0 0x0 +#define MX51_PAD_CSI1_VSYNC__GPIO3_14 0x1c4 0x5ac 0x000 0x3 0x0 +#define MX51_PAD_CSI1_HSYNC__CSI1_HSYNC 0x1c8 0x5b0 0x000 0x0 0x0 +#define MX51_PAD_CSI1_HSYNC__GPIO3_15 0x1c8 0x5b0 0x000 0x3 0x0 +#define MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK 0x000 0x5b4 0x000 0x0 0x0 +#define MX51_PAD_CSI1_MCLK__CSI1_MCLK 0x000 0x5b8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D12__CSI2_D12 0x1cc 0x5bc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D12__GPIO4_9 0x1cc 0x5bc 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D13__CSI2_D13 0x1d0 0x5c0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D13__GPIO4_10 0x1d0 0x5c0 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D14__CSI2_D14 0x1d4 0x5c4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D15__CSI2_D15 0x1d8 0x5c8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D16__CSI2_D16 0x1dc 0x5cc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D17__CSI2_D17 0x1e0 0x5d0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D18__CSI2_D18 0x1e4 0x5d4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D18__GPIO4_11 0x1e4 0x5d4 0x000 0x3 0x0 +#define MX51_PAD_CSI2_D19__CSI2_D19 0x1e8 0x5d8 0x000 0x0 0x0 +#define MX51_PAD_CSI2_D19__GPIO4_12 0x1e8 0x5d8 0x000 0x3 0x0 +#define MX51_PAD_CSI2_VSYNC__CSI2_VSYNC 0x1ec 0x5dc 0x000 0x0 0x0 +#define MX51_PAD_CSI2_VSYNC__GPIO4_13 0x1ec 0x5dc 0x000 0x3 0x0 +#define MX51_PAD_CSI2_HSYNC__CSI2_HSYNC 0x1f0 0x5e0 0x000 0x0 0x0 +#define MX51_PAD_CSI2_HSYNC__GPIO4_14 0x1f0 0x5e0 0x000 0x3 0x0 +#define MX51_PAD_CSI2_PIXCLK__CSI2_PIXCLK 0x1f4 0x5e4 0x000 0x0 0x0 +#define MX51_PAD_CSI2_PIXCLK__GPIO4_15 0x1f4 0x5e4 0x000 0x3 0x0 +#define MX51_PAD_I2C1_CLK__GPIO4_16 0x1f8 0x5e8 0x000 0x3 0x0 +#define MX51_PAD_I2C1_CLK__I2C1_CLK 0x1f8 0x5e8 0x000 0x0 0x0 +#define MX51_PAD_I2C1_DAT__GPIO4_17 0x1fc 0x5ec 0x000 0x3 0x0 +#define MX51_PAD_I2C1_DAT__I2C1_DAT 0x1fc 0x5ec 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x200 0x5f0 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_TXD__GPIO4_18 0x200 0x5f0 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x204 0x5f4 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_RXD__GPIO4_19 0x204 0x5f4 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_RXD__UART3_RXD 0x204 0x5f4 0x9f4 0x1 0x2 +#define MX51_PAD_AUD3_BB_CK__AUD3_TXC 0x208 0x5f8 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_CK__GPIO4_20 0x208 0x5f8 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x20c 0x5fc 0x000 0x0 0x0 +#define MX51_PAD_AUD3_BB_FS__GPIO4_21 0x20c 0x5fc 0x000 0x3 0x0 +#define MX51_PAD_AUD3_BB_FS__UART3_TXD 0x20c 0x5fc 0x000 0x1 0x0 +#define MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x210 0x600 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_MOSI__GPIO4_22 0x210 0x600 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_MOSI__I2C1_SDA 0x210 0x600 0x9b4 0x1 0x1 +#define MX51_PAD_CSPI1_MISO__AUD4_RXD 0x214 0x604 0x8c4 0x1 0x1 +#define MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x214 0x604 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_MISO__GPIO4_23 0x214 0x604 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SS0__AUD4_TXC 0x218 0x608 0x8cc 0x1 0x1 +#define MX51_PAD_CSPI1_SS0__ECSPI1_SS0 0x218 0x608 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SS0__GPIO4_24 0x218 0x608 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SS1__AUD4_TXD 0x21c 0x60c 0x8c8 0x1 0x1 +#define MX51_PAD_CSPI1_SS1__ECSPI1_SS1 0x21c 0x60c 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SS1__GPIO4_25 0x21c 0x60c 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_RDY__AUD4_TXFS 0x220 0x610 0x8d0 0x1 0x1 +#define MX51_PAD_CSPI1_RDY__ECSPI1_RDY 0x220 0x610 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_RDY__GPIO4_26 0x220 0x610 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x224 0x614 0x000 0x0 0x0 +#define MX51_PAD_CSPI1_SCLK__GPIO4_27 0x224 0x614 0x000 0x3 0x0 +#define MX51_PAD_CSPI1_SCLK__I2C1_SCL 0x224 0x614 0x9b0 0x1 0x1 +#define MX51_PAD_UART1_RXD__GPIO4_28 0x228 0x618 0x000 0x3 0x0 +#define MX51_PAD_UART1_RXD__UART1_RXD 0x228 0x618 0x9e4 0x0 0x0 +#define MX51_PAD_UART1_TXD__GPIO4_29 0x22c 0x61c 0x000 0x3 0x0 +#define MX51_PAD_UART1_TXD__PWM2_PWMO 0x22c 0x61c 0x000 0x1 0x0 +#define MX51_PAD_UART1_TXD__UART1_TXD 0x22c 0x61c 0x000 0x0 0x0 +#define MX51_PAD_UART1_RTS__GPIO4_30 0x230 0x620 0x000 0x3 0x0 +#define MX51_PAD_UART1_RTS__UART1_RTS 0x230 0x620 0x9e0 0x0 0x0 +#define MX51_PAD_UART1_CTS__GPIO4_31 0x234 0x624 0x000 0x3 0x0 +#define MX51_PAD_UART1_CTS__UART1_CTS 0x234 0x624 0x000 0x0 0x0 +#define MX51_PAD_UART2_RXD__FIRI_TXD 0x238 0x628 0x000 0x1 0x0 +#define MX51_PAD_UART2_RXD__GPIO1_20 0x238 0x628 0x000 0x3 0x0 +#define MX51_PAD_UART2_RXD__UART2_RXD 0x238 0x628 0x9ec 0x0 0x2 +#define MX51_PAD_UART2_TXD__FIRI_RXD 0x23c 0x62c 0x000 0x1 0x0 +#define MX51_PAD_UART2_TXD__GPIO1_21 0x23c 0x62c 0x000 0x3 0x0 +#define MX51_PAD_UART2_TXD__UART2_TXD 0x23c 0x62c 0x000 0x0 0x0 +#define MX51_PAD_UART3_RXD__CSI1_D0 0x240 0x630 0x000 0x2 0x0 +#define MX51_PAD_UART3_RXD__GPIO1_22 0x240 0x630 0x000 0x3 0x0 +#define MX51_PAD_UART3_RXD__UART1_DTR 0x240 0x630 0x000 0x0 0x0 +#define MX51_PAD_UART3_RXD__UART3_RXD 0x240 0x630 0x9f4 0x1 0x4 +#define MX51_PAD_UART3_TXD__CSI1_D1 0x244 0x634 0x000 0x2 0x0 +#define MX51_PAD_UART3_TXD__GPIO1_23 0x244 0x634 0x000 0x3 0x0 +#define MX51_PAD_UART3_TXD__UART1_DSR 0x244 0x634 0x000 0x0 0x0 +#define MX51_PAD_UART3_TXD__UART3_TXD 0x244 0x634 0x000 0x1 0x0 +#define MX51_PAD_OWIRE_LINE__GPIO1_24 0x248 0x638 0x000 0x3 0x0 +#define MX51_PAD_OWIRE_LINE__OWIRE_LINE 0x248 0x638 0x000 0x0 0x0 +#define MX51_PAD_OWIRE_LINE__SPDIF_OUT 0x248 0x638 0x000 0x6 0x0 +#define MX51_PAD_KEY_ROW0__KEY_ROW0 0x24c 0x63c 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW1__KEY_ROW1 0x250 0x640 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW2__KEY_ROW2 0x254 0x644 0x000 0x0 0x0 +#define MX51_PAD_KEY_ROW3__KEY_ROW3 0x258 0x648 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL0__KEY_COL0 0x25c 0x64c 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL0__PLL1_BYP 0x25c 0x64c 0x90c 0x7 0x0 +#define MX51_PAD_KEY_COL1__KEY_COL1 0x260 0x650 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL1__PLL2_BYP 0x260 0x650 0x910 0x7 0x0 +#define MX51_PAD_KEY_COL2__KEY_COL2 0x264 0x654 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL2__PLL3_BYP 0x264 0x654 0x000 0x7 0x0 +#define MX51_PAD_KEY_COL3__KEY_COL3 0x268 0x658 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL4__I2C2_SCL 0x26c 0x65c 0x9b8 0x3 0x1 +#define MX51_PAD_KEY_COL4__KEY_COL4 0x26c 0x65c 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL4__SPDIF_OUT1 0x26c 0x65c 0x000 0x6 0x0 +#define MX51_PAD_KEY_COL4__UART1_RI 0x26c 0x65c 0x000 0x1 0x0 +#define MX51_PAD_KEY_COL4__UART3_RTS 0x26c 0x65c 0x9f0 0x2 0x4 +#define MX51_PAD_KEY_COL5__I2C2_SDA 0x270 0x660 0x9bc 0x3 0x1 +#define MX51_PAD_KEY_COL5__KEY_COL5 0x270 0x660 0x000 0x0 0x0 +#define MX51_PAD_KEY_COL5__UART1_DCD 0x270 0x660 0x000 0x1 0x0 +#define MX51_PAD_KEY_COL5__UART3_CTS 0x270 0x660 0x000 0x2 0x0 +#define MX51_PAD_USBH1_CLK__CSPI_SCLK 0x278 0x678 0x914 0x1 0x1 +#define MX51_PAD_USBH1_CLK__GPIO1_25 0x278 0x678 0x000 0x2 0x0 +#define MX51_PAD_USBH1_CLK__I2C2_SCL 0x278 0x678 0x9b8 0x5 0x2 +#define MX51_PAD_USBH1_CLK__USBH1_CLK 0x278 0x678 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DIR__CSPI_MOSI 0x27c 0x67c 0x91c 0x1 0x1 +#define MX51_PAD_USBH1_DIR__GPIO1_26 0x27c 0x67c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DIR__I2C2_SDA 0x27c 0x67c 0x9bc 0x5 0x2 +#define MX51_PAD_USBH1_DIR__USBH1_DIR 0x27c 0x67c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_STP__CSPI_RDY 0x280 0x680 0x000 0x1 0x0 +#define MX51_PAD_USBH1_STP__GPIO1_27 0x280 0x680 0x000 0x2 0x0 +#define MX51_PAD_USBH1_STP__UART3_RXD 0x280 0x680 0x9f4 0x5 0x6 +#define MX51_PAD_USBH1_STP__USBH1_STP 0x280 0x680 0x000 0x0 0x0 +#define MX51_PAD_USBH1_NXT__CSPI_MISO 0x284 0x684 0x918 0x1 0x0 +#define MX51_PAD_USBH1_NXT__GPIO1_28 0x284 0x684 0x000 0x2 0x0 +#define MX51_PAD_USBH1_NXT__UART3_TXD 0x284 0x684 0x000 0x5 0x0 +#define MX51_PAD_USBH1_NXT__USBH1_NXT 0x284 0x684 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA0__GPIO1_11 0x288 0x688 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA0__UART2_CTS 0x288 0x688 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x288 0x688 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA1__GPIO1_12 0x28c 0x68c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA1__UART2_RXD 0x28c 0x68c 0x9ec 0x1 0x4 +#define MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x28c 0x68c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA2__GPIO1_13 0x290 0x690 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA2__UART2_TXD 0x290 0x690 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x290 0x690 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA3__GPIO1_14 0x294 0x694 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA3__UART2_RTS 0x294 0x694 0x9e8 0x1 0x5 +#define MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x294 0x694 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA4__CSPI_SS0 0x298 0x698 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA4__GPIO1_15 0x298 0x698 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x298 0x698 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA5__CSPI_SS1 0x29c 0x69c 0x920 0x1 0x0 +#define MX51_PAD_USBH1_DATA5__GPIO1_16 0x29c 0x69c 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x29c 0x69c 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA6__CSPI_SS3 0x2a0 0x6a0 0x928 0x1 0x1 +#define MX51_PAD_USBH1_DATA6__GPIO1_17 0x2a0 0x6a0 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x2a0 0x6a0 0x000 0x0 0x0 +#define MX51_PAD_USBH1_DATA7__ECSPI1_SS3 0x2a4 0x6a4 0x000 0x1 0x0 +#define MX51_PAD_USBH1_DATA7__ECSPI2_SS3 0x2a4 0x6a4 0x934 0x5 0x1 +#define MX51_PAD_USBH1_DATA7__GPIO1_18 0x2a4 0x6a4 0x000 0x2 0x0 +#define MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x2a4 0x6a4 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN11__DI1_PIN11 0x2a8 0x6a8 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN11__ECSPI1_SS2 0x2a8 0x6a8 0x000 0x7 0x0 +#define MX51_PAD_DI1_PIN11__GPIO3_0 0x2a8 0x6a8 0x000 0x4 0x0 +#define MX51_PAD_DI1_PIN12__DI1_PIN12 0x2ac 0x6ac 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN12__GPIO3_1 0x2ac 0x6ac 0x978 0x4 0x1 +#define MX51_PAD_DI1_PIN13__DI1_PIN13 0x2b0 0x6b0 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN13__GPIO3_2 0x2b0 0x6b0 0x97c 0x4 0x1 +#define MX51_PAD_DI1_D0_CS__DI1_D0_CS 0x2b4 0x6b4 0x000 0x0 0x0 +#define MX51_PAD_DI1_D0_CS__GPIO3_3 0x2b4 0x6b4 0x980 0x4 0x1 +#define MX51_PAD_DI1_D1_CS__DI1_D1_CS 0x2b8 0x6b8 0x000 0x0 0x0 +#define MX51_PAD_DI1_D1_CS__DISP1_PIN14 0x2b8 0x6b8 0x000 0x2 0x0 +#define MX51_PAD_DI1_D1_CS__DISP1_PIN5 0x2b8 0x6b8 0x000 0x3 0x0 +#define MX51_PAD_DI1_D1_CS__GPIO3_4 0x2b8 0x6b8 0x984 0x4 0x1 +#define MX51_PAD_DISPB2_SER_DIN__DISP1_PIN1 0x2bc 0x6bc 0x9a4 0x2 0x1 +#define MX51_PAD_DISPB2_SER_DIN__DISPB2_SER_DIN 0x2bc 0x6bc 0x9c4 0x0 0x0 +#define MX51_PAD_DISPB2_SER_DIN__GPIO3_5 0x2bc 0x6bc 0x988 0x4 0x1 +#define MX51_PAD_DISPB2_SER_DIO__DISP1_PIN6 0x2c0 0x6c0 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_DIO__DISPB2_SER_DIO 0x2c0 0x6c0 0x9c4 0x0 0x1 +#define MX51_PAD_DISPB2_SER_DIO__GPIO3_6 0x2c0 0x6c0 0x98c 0x4 0x1 +#define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN17 0x2c4 0x6c4 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_CLK__DISP1_PIN7 0x2c4 0x6c4 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_CLK__DISPB2_SER_CLK 0x2c4 0x6c4 0x000 0x0 0x0 +#define MX51_PAD_DISPB2_SER_CLK__GPIO3_7 0x2c4 0x6c4 0x990 0x4 0x1 +#define MX51_PAD_DISPB2_SER_RS__DISP1_EXT_CLK 0x2c8 0x6c8 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISP1_PIN16 0x2c8 0x6c8 0x000 0x2 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISP1_PIN8 0x2c8 0x6c8 0x000 0x3 0x0 +#define MX51_PAD_DISPB2_SER_RS__DISPB2_SER_RS 0x2c8 0x6c8 0x000 0x0 0x0 +#define MX51_PAD_DISPB2_SER_RS__GPIO3_8 0x2c8 0x6c8 0x994 0x4 0x1 +#define MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x2cc 0x6cc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x2d0 0x6d0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x2d4 0x6d4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x2d8 0x6d8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x2dc 0x6dc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x2e0 0x6e0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT6__BOOT_USB_SRC 0x2e4 0x6e4 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x2e4 0x6e4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT7__BOOT_EEPROM_CFG 0x2e8 0x6e8 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x2e8 0x6e8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT8__BOOT_SRC0 0x2ec 0x6ec 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x2ec 0x6ec 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT9__BOOT_SRC1 0x2f0 0x6f0 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x2f0 0x6f0 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT10__BOOT_SPARE_SIZE 0x2f4 0x6f4 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x2f4 0x6f4 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT11__BOOT_LPB_FREQ2 0x2f8 0x6f8 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x2f8 0x6f8 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT12__BOOT_MLC_SEL 0x2fc 0x6fc 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x2fc 0x6fc 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT13__BOOT_MEM_CTL0 0x300 0x700 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x300 0x700 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT14__BOOT_MEM_CTL1 0x304 0x704 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x304 0x704 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT15__BOOT_BUS_WIDTH 0x308 0x708 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x308 0x708 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT16__BOOT_PAGE_SIZE0 0x30c 0x70c 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x30c 0x70c 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT17__BOOT_PAGE_SIZE1 0x310 0x710 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x310 0x710 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT18__BOOT_WEIM_MUXED0 0x314 0x714 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x314 0x714 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT18__DISP2_PIN11 0x314 0x714 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT18__DISP2_PIN5 0x314 0x714 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT19__BOOT_WEIM_MUXED1 0x318 0x718 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x318 0x718 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT19__DISP2_PIN12 0x318 0x718 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT19__DISP2_PIN6 0x318 0x718 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT20__BOOT_MEM_TYPE0 0x31c 0x71c 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x31c 0x71c 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT20__DISP2_PIN13 0x31c 0x71c 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT20__DISP2_PIN7 0x31c 0x71c 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT21__BOOT_MEM_TYPE1 0x320 0x720 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x320 0x720 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT21__DISP2_PIN14 0x320 0x720 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT21__DISP2_PIN8 0x320 0x720 0x000 0x4 0x0 +#define MX51_PAD_DISP1_DAT22__BOOT_LPB_FREQ0 0x324 0x724 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x324 0x724 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT22__DISP2_D0_CS 0x324 0x724 0x000 0x6 0x0 +#define MX51_PAD_DISP1_DAT22__DISP2_DAT16 0x324 0x724 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT23__BOOT_LPB_FREQ1 0x328 0x728 0x000 0x7 0x0 +#define MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x328 0x728 0x000 0x0 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_D1_CS 0x328 0x728 0x000 0x6 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_DAT17 0x328 0x728 0x000 0x5 0x0 +#define MX51_PAD_DISP1_DAT23__DISP2_SER_CS 0x328 0x728 0x000 0x4 0x0 +#define MX51_PAD_DI1_PIN3__DI1_PIN3 0x32c 0x72c 0x000 0x0 0x0 +#define MX51_PAD_DI1_PIN2__DI1_PIN2 0x330 0x734 0x000 0x0 0x0 +#define MX51_PAD_DI_GP2__DISP1_SER_CLK 0x338 0x740 0x000 0x0 0x0 +#define MX51_PAD_DI_GP2__DISP2_WAIT 0x338 0x740 0x9a8 0x2 0x1 +#define MX51_PAD_DI_GP3__CSI1_DATA_EN 0x33c 0x744 0x9a0 0x3 0x1 +#define MX51_PAD_DI_GP3__DISP1_SER_DIO 0x33c 0x744 0x9c0 0x0 0x0 +#define MX51_PAD_DI_GP3__FEC_TX_ER 0x33c 0x744 0x000 0x2 0x0 +#define MX51_PAD_DI2_PIN4__CSI2_DATA_EN 0x340 0x748 0x99c 0x3 0x1 +#define MX51_PAD_DI2_PIN4__DI2_PIN4 0x340 0x748 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN4__FEC_CRS 0x340 0x748 0x950 0x2 0x1 +#define MX51_PAD_DI2_PIN2__DI2_PIN2 0x344 0x74c 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN2__FEC_MDC 0x344 0x74c 0x000 0x2 0x0 +#define MX51_PAD_DI2_PIN3__DI2_PIN3 0x348 0x750 0x000 0x0 0x0 +#define MX51_PAD_DI2_PIN3__FEC_MDIO 0x348 0x750 0x954 0x2 0x1 +#define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x34c 0x754 0x000 0x0 0x0 +#define MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x34c 0x754 0x95c 0x2 0x1 +#define MX51_PAD_DI_GP4__DI2_PIN15 0x350 0x758 0x000 0x4 0x0 +#define MX51_PAD_DI_GP4__DISP1_SER_DIN 0x350 0x758 0x9c0 0x0 0x1 +#define MX51_PAD_DI_GP4__DISP2_PIN1 0x350 0x758 0x000 0x3 0x0 +#define MX51_PAD_DI_GP4__FEC_RDATA2 0x350 0x758 0x960 0x2 0x1 +#define MX51_PAD_DISP2_DAT0__DISP2_DAT0 0x354 0x75c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x354 0x75c 0x964 0x2 0x1 +#define MX51_PAD_DISP2_DAT0__KEY_COL6 0x354 0x75c 0x9c8 0x4 0x1 +#define MX51_PAD_DISP2_DAT0__UART3_RXD 0x354 0x75c 0x9f4 0x5 0x8 +#define MX51_PAD_DISP2_DAT0__USBH3_CLK 0x354 0x75c 0x9f8 0x3 0x1 +#define MX51_PAD_DISP2_DAT1__DISP2_DAT1 0x358 0x760 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x358 0x760 0x970 0x2 0x1 +#define MX51_PAD_DISP2_DAT1__KEY_COL7 0x358 0x760 0x9cc 0x4 0x1 +#define MX51_PAD_DISP2_DAT1__UART3_TXD 0x358 0x760 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT1__USBH3_DIR 0x358 0x760 0xa1c 0x3 0x1 +#define MX51_PAD_DISP2_DAT2__DISP2_DAT2 0x35c 0x764 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT3__DISP2_DAT3 0x360 0x768 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT4__DISP2_DAT4 0x364 0x76c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT5__DISP2_DAT5 0x368 0x770 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT6__DISP2_DAT6 0x36c 0x774 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x36c 0x774 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT6__GPIO1_19 0x36c 0x774 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT6__KEY_ROW4 0x36c 0x774 0x9d0 0x4 0x1 +#define MX51_PAD_DISP2_DAT6__USBH3_STP 0x36c 0x774 0xa24 0x3 0x1 +#define MX51_PAD_DISP2_DAT7__DISP2_DAT7 0x370 0x778 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x370 0x778 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT7__GPIO1_29 0x370 0x778 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT7__KEY_ROW5 0x370 0x778 0x9d4 0x4 0x1 +#define MX51_PAD_DISP2_DAT7__USBH3_NXT 0x370 0x778 0xa20 0x3 0x1 +#define MX51_PAD_DISP2_DAT8__DISP2_DAT8 0x374 0x77c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x374 0x77c 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT8__GPIO1_30 0x374 0x77c 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT8__KEY_ROW6 0x374 0x77c 0x9d8 0x4 0x1 +#define MX51_PAD_DISP2_DAT8__USBH3_DATA0 0x374 0x77c 0x9fc 0x3 0x1 +#define MX51_PAD_DISP2_DAT9__AUD6_RXC 0x378 0x780 0x8f4 0x4 0x1 +#define MX51_PAD_DISP2_DAT9__DISP2_DAT9 0x378 0x780 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x378 0x780 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT9__GPIO1_31 0x378 0x780 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT9__USBH3_DATA1 0x378 0x780 0xa00 0x3 0x1 +#define MX51_PAD_DISP2_DAT10__DISP2_DAT10 0x37c 0x784 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT10__DISP2_SER_CS 0x37c 0x784 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT10__FEC_COL 0x37c 0x784 0x94c 0x2 0x1 +#define MX51_PAD_DISP2_DAT10__KEY_ROW7 0x37c 0x784 0x9dc 0x4 0x1 +#define MX51_PAD_DISP2_DAT10__USBH3_DATA2 0x37c 0x784 0xa04 0x3 0x1 +#define MX51_PAD_DISP2_DAT11__AUD6_TXD 0x380 0x788 0x8f0 0x4 0x1 +#define MX51_PAD_DISP2_DAT11__DISP2_DAT11 0x380 0x788 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x380 0x788 0x968 0x2 0x1 +#define MX51_PAD_DISP2_DAT11__GPIO1_10 0x380 0x788 0x000 0x7 0x0 +#define MX51_PAD_DISP2_DAT11__USBH3_DATA3 0x380 0x788 0xa08 0x3 0x1 +#define MX51_PAD_DISP2_DAT12__AUD6_RXD 0x384 0x78c 0x8ec 0x4 0x1 +#define MX51_PAD_DISP2_DAT12__DISP2_DAT12 0x384 0x78c 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x384 0x78c 0x96c 0x2 0x1 +#define MX51_PAD_DISP2_DAT12__USBH3_DATA4 0x384 0x78c 0xa0c 0x3 0x1 +#define MX51_PAD_DISP2_DAT13__AUD6_TXC 0x388 0x790 0x8fc 0x4 0x1 +#define MX51_PAD_DISP2_DAT13__DISP2_DAT13 0x388 0x790 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x388 0x790 0x974 0x2 0x1 +#define MX51_PAD_DISP2_DAT13__USBH3_DATA5 0x388 0x790 0xa10 0x3 0x1 +#define MX51_PAD_DISP2_DAT14__AUD6_TXFS 0x38c 0x794 0x900 0x4 0x1 +#define MX51_PAD_DISP2_DAT14__DISP2_DAT14 0x38c 0x794 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x38c 0x794 0x958 0x2 0x1 +#define MX51_PAD_DISP2_DAT14__USBH3_DATA6 0x38c 0x794 0xa14 0x3 0x1 +#define MX51_PAD_DISP2_DAT15__AUD6_RXFS 0x390 0x798 0x8f8 0x4 0x1 +#define MX51_PAD_DISP2_DAT15__DISP1_SER_CS 0x390 0x798 0x000 0x5 0x0 +#define MX51_PAD_DISP2_DAT15__DISP2_DAT15 0x390 0x798 0x000 0x0 0x0 +#define MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x390 0x798 0x000 0x2 0x0 +#define MX51_PAD_DISP2_DAT15__USBH3_DATA7 0x390 0x798 0xa18 0x3 0x1 +#define MX51_PAD_SD1_CMD__AUD5_RXFS 0x394 0x79c 0x8e0 0x1 0x1 +#define MX51_PAD_SD1_CMD__CSPI_MOSI 0x394 0x79c 0x91c 0x2 0x2 +#define MX51_PAD_SD1_CMD__SD1_CMD 0x394 0x79c 0x000 0x0 0x0 +#define MX51_PAD_SD1_CLK__AUD5_RXC 0x398 0x7a0 0x8dc 0x1 0x1 +#define MX51_PAD_SD1_CLK__CSPI_SCLK 0x398 0x7a0 0x914 0x2 0x2 +#define MX51_PAD_SD1_CLK__SD1_CLK 0x398 0x7a0 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA0__AUD5_TXD 0x39c 0x7a4 0x8d8 0x1 0x2 +#define MX51_PAD_SD1_DATA0__CSPI_MISO 0x39c 0x7a4 0x918 0x2 0x1 +#define MX51_PAD_SD1_DATA0__SD1_DATA0 0x39c 0x7a4 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA0__EIM_DA0 0x01c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA1__EIM_DA1 0x020 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA2__EIM_DA2 0x024 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA3__EIM_DA3 0x028 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA1__AUD5_RXD 0x3a0 0x7a8 0x8d4 0x1 0x2 +#define MX51_PAD_SD1_DATA1__SD1_DATA1 0x3a0 0x7a8 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA4__EIM_DA4 0x02c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA5__EIM_DA5 0x030 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA6__EIM_DA6 0x034 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA7__EIM_DA7 0x038 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA2__AUD5_TXC 0x3a4 0x7ac 0x8e4 0x1 0x2 +#define MX51_PAD_SD1_DATA2__SD1_DATA2 0x3a4 0x7ac 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA10__EIM_DA10 0x044 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA11__EIM_DA11 0x048 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA8__EIM_DA8 0x03c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA9__EIM_DA9 0x040 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD1_DATA3__AUD5_TXFS 0x3a8 0x7b0 0x8e8 0x1 0x2 +#define MX51_PAD_SD1_DATA3__CSPI_SS1 0x3a8 0x7b0 0x920 0x2 0x1 +#define MX51_PAD_SD1_DATA3__SD1_DATA3 0x3a8 0x7b0 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_0__CSPI_SS2 0x3ac 0x7b4 0x924 0x2 0x0 +#define MX51_PAD_GPIO1_0__GPIO1_0 0x3ac 0x7b4 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_0__SD1_CD 0x3ac 0x7b4 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_1__CSPI_MISO 0x3b0 0x7b8 0x918 0x2 0x2 +#define MX51_PAD_GPIO1_1__GPIO1_1 0x3b0 0x7b8 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_1__SD1_WP 0x3b0 0x7b8 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA12__EIM_DA12 0x04c 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA13__EIM_DA13 0x050 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA14__EIM_DA14 0x054 0x000 0x000 0x0 0x0 +#define MX51_PAD_EIM_DA15__EIM_DA15 0x058 0x000 0x000 0x0 0x0 +#define MX51_PAD_SD2_CMD__CSPI_MOSI 0x3b4 0x7bc 0x91c 0x2 0x3 +#define MX51_PAD_SD2_CMD__I2C1_SCL 0x3b4 0x7bc 0x9b0 0x1 0x2 +#define MX51_PAD_SD2_CMD__SD2_CMD 0x3b4 0x7bc 0x000 0x0 0x0 +#define MX51_PAD_SD2_CLK__CSPI_SCLK 0x3b8 0x7c0 0x914 0x2 0x3 +#define MX51_PAD_SD2_CLK__I2C1_SDA 0x3b8 0x7c0 0x9b4 0x1 0x2 +#define MX51_PAD_SD2_CLK__SD2_CLK 0x3b8 0x7c0 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA0__CSPI_MISO 0x3bc 0x7c4 0x918 0x2 0x3 +#define MX51_PAD_SD2_DATA0__SD1_DAT4 0x3bc 0x7c4 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA0__SD2_DATA0 0x3bc 0x7c4 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA1__SD1_DAT5 0x3c0 0x7c8 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA1__SD2_DATA1 0x3c0 0x7c8 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA1__USBH3_H2_DP 0x3c0 0x7c8 0x000 0x2 0x0 +#define MX51_PAD_SD2_DATA2__SD1_DAT6 0x3c4 0x7cc 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA2__SD2_DATA2 0x3c4 0x7cc 0x000 0x0 0x0 +#define MX51_PAD_SD2_DATA2__USBH3_H2_DM 0x3c4 0x7cc 0x000 0x2 0x0 +#define MX51_PAD_SD2_DATA3__CSPI_SS2 0x3c8 0x7d0 0x924 0x2 0x1 +#define MX51_PAD_SD2_DATA3__SD1_DAT7 0x3c8 0x7d0 0x000 0x1 0x0 +#define MX51_PAD_SD2_DATA3__SD2_DATA3 0x3c8 0x7d0 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_2__CCM_OUT_2 0x3cc 0x7d4 0x000 0x5 0x0 +#define MX51_PAD_GPIO1_2__GPIO1_2 0x3cc 0x7d4 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_2__I2C2_SCL 0x3cc 0x7d4 0x9b8 0x2 0x3 +#define MX51_PAD_GPIO1_2__PLL1_BYP 0x3cc 0x7d4 0x90c 0x7 0x1 +#define MX51_PAD_GPIO1_2__PWM1_PWMO 0x3cc 0x7d4 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_3__GPIO1_3 0x3d0 0x7d8 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_3__I2C2_SDA 0x3d0 0x7d8 0x9bc 0x2 0x3 +#define MX51_PAD_GPIO1_3__PLL2_BYP 0x3d0 0x7d8 0x910 0x7 0x1 +#define MX51_PAD_GPIO1_3__PWM2_PWMO 0x3d0 0x7d8 0x000 0x1 0x0 +#define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ 0x3d4 0x7fc 0x000 0x0 0x0 +#define MX51_PAD_PMIC_INT_REQ__PMIC_PMU_IRQ_B 0x3d4 0x7fc 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_4__DISP2_EXT_CLK 0x3d8 0x804 0x908 0x4 0x1 +#define MX51_PAD_GPIO1_4__EIM_RDY 0x3d8 0x804 0x938 0x3 0x1 +#define MX51_PAD_GPIO1_4__GPIO1_4 0x3d8 0x804 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_4__WDOG1_WDOG_B 0x3d8 0x804 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_5__CSI2_MCLK 0x3dc 0x808 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_5__DISP2_PIN16 0x3dc 0x808 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_5__GPIO1_5 0x3dc 0x808 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_5__WDOG2_WDOG_B 0x3dc 0x808 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_6__DISP2_PIN17 0x3e0 0x80c 0x000 0x4 0x0 +#define MX51_PAD_GPIO1_6__GPIO1_6 0x3e0 0x80c 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_6__REF_EN_B 0x3e0 0x80c 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_7__CCM_OUT_0 0x3e4 0x810 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_7__GPIO1_7 0x3e4 0x810 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_7__SD2_WP 0x3e4 0x810 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_7__SPDIF_OUT1 0x3e4 0x810 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_8__CSI2_DATA_EN 0x3e8 0x814 0x99c 0x2 0x2 +#define MX51_PAD_GPIO1_8__GPIO1_8 0x3e8 0x814 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_8__SD2_CD 0x3e8 0x814 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_8__USBH3_PWR 0x3e8 0x814 0x000 0x1 0x0 +#define MX51_PAD_GPIO1_9__CCM_OUT_1 0x3ec 0x818 0x000 0x3 0x0 +#define MX51_PAD_GPIO1_9__DISP2_D1_CS 0x3ec 0x818 0x000 0x2 0x0 +#define MX51_PAD_GPIO1_9__DISP2_SER_CS 0x3ec 0x818 0x000 0x7 0x0 +#define MX51_PAD_GPIO1_9__GPIO1_9 0x3ec 0x818 0x000 0x0 0x0 +#define MX51_PAD_GPIO1_9__SD2_LCTL 0x3ec 0x818 0x000 0x6 0x0 +#define MX51_PAD_GPIO1_9__USBH3_OC 0x3ec 0x818 0x000 0x1 0x0 + +#endif /* __DTS_IMX51_PINFUNC_H */ Copied: head/sys/gnu/dts/arm/imx53-pinfunc.h (from r271150, vendor/device-tree/dist/src/arm/imx53-pinfunc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/imx53-pinfunc.h Fri Sep 5 02:21:45 2014 (r271151, copy of r271150, vendor/device-tree/dist/src/arm/imx53-pinfunc.h) @@ -0,0 +1,1189 @@ +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef __DTS_IMX53_PINFUNC_H +#define __DTS_IMX53_PINFUNC_H + +/* + * The pin function ID is a tuple of + * + */ +#define MX53_PAD_GPIO_19__KPP_COL_5 0x020 0x348 0x840 0x0 0x0 +#define MX53_PAD_GPIO_19__GPIO4_5 0x020 0x348 0x000 0x1 0x0 +#define MX53_PAD_GPIO_19__CCM_CLKO 0x020 0x348 0x000 0x2 0x0 +#define MX53_PAD_GPIO_19__SPDIF_OUT1 0x020 0x348 0x000 0x3 0x0 +#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 0x020 0x348 0x000 0x4 0x0 +#define MX53_PAD_GPIO_19__ECSPI1_RDY 0x020 0x348 0x000 0x5 0x0 +#define MX53_PAD_GPIO_19__FEC_TDATA_3 0x020 0x348 0x000 0x6 0x0 +#define MX53_PAD_GPIO_19__SRC_INT_BOOT 0x020 0x348 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL0__KPP_COL_0 0x024 0x34c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL0__GPIO4_6 0x024 0x34c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x024 0x34c 0x758 0x2 0x0 +#define MX53_PAD_KEY_COL0__UART4_TXD_MUX 0x024 0x34c 0x000 0x4 0x0 +#define MX53_PAD_KEY_COL0__ECSPI1_SCLK 0x024 0x34c 0x79c 0x5 0x0 +#define MX53_PAD_KEY_COL0__FEC_RDATA_3 0x024 0x34c 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL0__SRC_ANY_PU_RST 0x024 0x34c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW0__KPP_ROW_0 0x028 0x350 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW0__GPIO4_7 0x028 0x350 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x028 0x350 0x74c 0x2 0x0 +#define MX53_PAD_KEY_ROW0__UART4_RXD_MUX 0x028 0x350 0x890 0x4 0x1 +#define MX53_PAD_KEY_ROW0__ECSPI1_MOSI 0x028 0x350 0x7a4 0x5 0x0 +#define MX53_PAD_KEY_ROW0__FEC_TX_ER 0x028 0x350 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL1__KPP_COL_1 0x02c 0x354 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL1__GPIO4_8 0x02c 0x354 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x02c 0x354 0x75c 0x2 0x0 +#define MX53_PAD_KEY_COL1__UART5_TXD_MUX 0x02c 0x354 0x000 0x4 0x0 +#define MX53_PAD_KEY_COL1__ECSPI1_MISO 0x02c 0x354 0x7a0 0x5 0x0 +#define MX53_PAD_KEY_COL1__FEC_RX_CLK 0x02c 0x354 0x808 0x6 0x0 +#define MX53_PAD_KEY_COL1__USBPHY1_TXREADY 0x02c 0x354 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW1__KPP_ROW_1 0x030 0x358 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW1__GPIO4_9 0x030 0x358 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x030 0x358 0x748 0x2 0x0 +#define MX53_PAD_KEY_ROW1__UART5_RXD_MUX 0x030 0x358 0x898 0x4 0x1 +#define MX53_PAD_KEY_ROW1__ECSPI1_SS0 0x030 0x358 0x7a8 0x5 0x0 +#define MX53_PAD_KEY_ROW1__FEC_COL 0x030 0x358 0x800 0x6 0x0 +#define MX53_PAD_KEY_ROW1__USBPHY1_RXVALID 0x030 0x358 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL2__KPP_COL_2 0x034 0x35c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL2__GPIO4_10 0x034 0x35c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL2__CAN1_TXCAN 0x034 0x35c 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL2__FEC_MDIO 0x034 0x35c 0x804 0x4 0x0 +#define MX53_PAD_KEY_COL2__ECSPI1_SS1 0x034 0x35c 0x7ac 0x5 0x0 +#define MX53_PAD_KEY_COL2__FEC_RDATA_2 0x034 0x35c 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE 0x034 0x35c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW2__KPP_ROW_2 0x038 0x360 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW2__GPIO4_11 0x038 0x360 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW2__CAN1_RXCAN 0x038 0x360 0x760 0x2 0x0 +#define MX53_PAD_KEY_ROW2__FEC_MDC 0x038 0x360 0x000 0x4 0x0 +#define MX53_PAD_KEY_ROW2__ECSPI1_SS2 0x038 0x360 0x7b0 0x5 0x0 +#define MX53_PAD_KEY_ROW2__FEC_TDATA_2 0x038 0x360 0x000 0x6 0x0 +#define MX53_PAD_KEY_ROW2__USBPHY1_RXERROR 0x038 0x360 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL3__KPP_COL_3 0x03c 0x364 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL3__GPIO4_12 0x03c 0x364 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL3__USBOH3_H2_DP 0x03c 0x364 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL3__SPDIF_IN1 0x03c 0x364 0x870 0x3 0x0 +#define MX53_PAD_KEY_COL3__I2C2_SCL 0x03c 0x364 0x81c 0x4 0x0 +#define MX53_PAD_KEY_COL3__ECSPI1_SS3 0x03c 0x364 0x7b4 0x5 0x0 +#define MX53_PAD_KEY_COL3__FEC_CRS 0x03c 0x364 0x000 0x6 0x0 +#define MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK 0x03c 0x364 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW3__KPP_ROW_3 0x040 0x368 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW3__GPIO4_13 0x040 0x368 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW3__USBOH3_H2_DM 0x040 0x368 0x000 0x2 0x0 +#define MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK 0x040 0x368 0x768 0x3 0x0 +#define MX53_PAD_KEY_ROW3__I2C2_SDA 0x040 0x368 0x820 0x4 0x0 +#define MX53_PAD_KEY_ROW3__OSC32K_32K_OUT 0x040 0x368 0x000 0x5 0x0 +#define MX53_PAD_KEY_ROW3__CCM_PLL4_BYP 0x040 0x368 0x77c 0x6 0x0 +#define MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 0x040 0x368 0x000 0x7 0x0 +#define MX53_PAD_KEY_COL4__KPP_COL_4 0x044 0x36c 0x000 0x0 0x0 +#define MX53_PAD_KEY_COL4__GPIO4_14 0x044 0x36c 0x000 0x1 0x0 +#define MX53_PAD_KEY_COL4__CAN2_TXCAN 0x044 0x36c 0x000 0x2 0x0 +#define MX53_PAD_KEY_COL4__IPU_SISG_4 0x044 0x36c 0x000 0x3 0x0 +#define MX53_PAD_KEY_COL4__UART5_RTS 0x044 0x36c 0x894 0x4 0x0 +#define MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC 0x044 0x36c 0x89c 0x5 0x0 +#define MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 0x044 0x36c 0x000 0x7 0x0 +#define MX53_PAD_KEY_ROW4__KPP_ROW_4 0x048 0x370 0x000 0x0 0x0 +#define MX53_PAD_KEY_ROW4__GPIO4_15 0x048 0x370 0x000 0x1 0x0 +#define MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x048 0x370 0x764 0x2 0x0 +#define MX53_PAD_KEY_ROW4__IPU_SISG_5 0x048 0x370 0x000 0x3 0x0 +#define MX53_PAD_KEY_ROW4__UART5_CTS 0x048 0x370 0x000 0x4 0x0 +#define MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR 0x048 0x370 0x000 0x5 0x0 +#define MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID 0x048 0x370 0x000 0x7 0x0 +#define MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x04c 0x378 0x000 0x0 0x0 +#define MX53_PAD_DI0_DISP_CLK__GPIO4_16 0x04c 0x378 0x000 0x1 0x0 +#define MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR 0x04c 0x378 0x000 0x2 0x0 +#define MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 0x04c 0x378 0x000 0x5 0x0 +#define MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 0x04c 0x378 0x000 0x6 0x0 +#define MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID 0x04c 0x378 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x050 0x37c 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN15__GPIO4_17 0x050 0x37c 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC 0x050 0x37c 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 0x050 0x37c 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 0x050 0x37c 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN15__USBPHY1_BVALID 0x050 0x37c 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x054 0x380 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN2__GPIO4_18 0x054 0x380 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD 0x054 0x380 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 0x054 0x380 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 0x054 0x380 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION 0x054 0x380 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x058 0x384 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN3__GPIO4_19 0x058 0x384 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS 0x058 0x384 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 0x058 0x384 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 0x058 0x384 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN3__USBPHY1_IDDIG 0x058 0x384 0x000 0x7 0x0 +#define MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 0x05c 0x388 0x000 0x0 0x0 +#define MX53_PAD_DI0_PIN4__GPIO4_20 0x05c 0x388 0x000 0x1 0x0 +#define MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD 0x05c 0x388 0x000 0x2 0x0 +#define MX53_PAD_DI0_PIN4__ESDHC1_WP 0x05c 0x388 0x7fc 0x3 0x0 +#define MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD 0x05c 0x388 0x000 0x5 0x0 +#define MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 0x05c 0x388 0x000 0x6 0x0 +#define MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT 0x05c 0x388 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x060 0x38c 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT0__GPIO4_21 0x060 0x38c 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT0__CSPI_SCLK 0x060 0x38c 0x780 0x2 0x0 +#define MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 0x060 0x38c 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN 0x060 0x38c 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 0x060 0x38c 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY 0x060 0x38c 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x064 0x390 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT1__GPIO4_22 0x064 0x390 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT1__CSPI_MOSI 0x064 0x390 0x788 0x2 0x0 +#define MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 0x064 0x390 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL 0x064 0x390 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 0x064 0x390 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID 0x064 0x390 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x068 0x394 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT2__GPIO4_23 0x068 0x394 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT2__CSPI_MISO 0x068 0x394 0x784 0x2 0x0 +#define MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 0x068 0x394 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE 0x068 0x394 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 0x068 0x394 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE 0x068 0x394 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x06c 0x398 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT3__GPIO4_24 0x06c 0x398 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT3__CSPI_SS0 0x06c 0x398 0x78c 0x2 0x0 +#define MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 0x06c 0x398 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR 0x06c 0x398 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 0x06c 0x398 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR 0x06c 0x398 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x070 0x39c 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT4__GPIO4_25 0x070 0x39c 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT4__CSPI_SS1 0x070 0x39c 0x790 0x2 0x0 +#define MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 0x070 0x39c 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB 0x070 0x39c 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 0x070 0x39c 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK 0x070 0x39c 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x074 0x3a0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT5__GPIO4_26 0x074 0x3a0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT5__CSPI_SS2 0x074 0x3a0 0x794 0x2 0x0 +#define MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 0x074 0x3a0 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS 0x074 0x3a0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 0x074 0x3a0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 0x074 0x3a0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x078 0x3a4 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT6__GPIO4_27 0x078 0x3a4 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT6__CSPI_SS3 0x078 0x3a4 0x798 0x2 0x0 +#define MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 0x078 0x3a4 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE 0x078 0x3a4 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 0x078 0x3a4 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 0x078 0x3a4 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x07c 0x3a8 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT7__GPIO4_28 0x07c 0x3a8 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT7__CSPI_RDY 0x07c 0x3a8 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 0x07c 0x3a8 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 0x07c 0x3a8 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 0x07c 0x3a8 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID 0x07c 0x3a8 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x080 0x3ac 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT8__GPIO4_29 0x080 0x3ac 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT8__PWM1_PWMO 0x080 0x3ac 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B 0x080 0x3ac 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 0x080 0x3ac 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 0x080 0x3ac 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT8__USBPHY2_AVALID 0x080 0x3ac 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x084 0x3b0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT9__GPIO4_30 0x084 0x3b0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT9__PWM2_PWMO 0x084 0x3b0 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B 0x084 0x3b0 0x000 0x3 0x0 +#define MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 0x084 0x3b0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 0x084 0x3b0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 0x084 0x3b0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x088 0x3b4 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT10__GPIO4_31 0x088 0x3b4 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP 0x088 0x3b4 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 0x088 0x3b4 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 0x088 0x3b4 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 0x088 0x3b4 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x08c 0x3b8 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT11__GPIO5_5 0x08c 0x3b8 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT 0x08c 0x3b8 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 0x08c 0x3b8 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 0x08c 0x3b8 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 0x08c 0x3b8 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x090 0x3bc 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT12__GPIO5_6 0x090 0x3bc 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK 0x090 0x3bc 0x000 0x2 0x0 +#define MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 0x090 0x3bc 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 0x090 0x3bc 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 0x090 0x3bc 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x094 0x3c0 0x000 0x0 0x0 +#define MX53_PAD_DISP0_DAT13__GPIO5_7 0x094 0x3c0 0x000 0x1 0x0 +#define MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS 0x094 0x3c0 0x754 0x3 0x0 +#define MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 0x094 0x3c0 0x000 0x5 0x0 +#define MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 0x094 0x3c0 0x000 0x6 0x0 +#define MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 0x094 0x3c0 0x000 0x7 0x0 +#define MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x098 0x3c4 0x000 0x0 0x0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 02:50:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 382E88CA; Fri, 5 Sep 2014 02:50:44 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EDE61A8F; Fri, 5 Sep 2014 02:50:44 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1F3F8B968; Thu, 4 Sep 2014 22:50:43 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Thu, 04 Sep 2014 22:50:25 -0400 Message-ID: <3070015.668SIdAzOX@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140902154127.GD2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <201409021100.57493.jhb@freebsd.org> <20140902154127.GD2737@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 04 Sep 2014 22:50:43 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 02:50:44 -0000 On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote: > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > > I thought about that. I could easily make a parallel array, or perhaps > > use a separate 'susppcb' structure that includes a pcb and the savefpu > > union and change susppcbs to be an array of those. Which do you prefer? > > If we want to move some state out of the PCB on amd64 into this, then a > > separate struct for susppcbs might be the sanest. > > Yes, separate structure seems to be a way forward. Please see www.freebsd.org/~jhb/patches/susppcb.patch Note that I moved fpususpend() out into a C function on amd64 so that resumectx() could still operate on just a pcb. This also makes savectx and resumectx more symmetric and matches what I ended up doing on i386. This is tested for suspend and resume on both i386 and amd64. > FWIW, I do not understand the need for pcb in its current form, allocated > on the thread kernel stack, at all. It looks like a vestige of the > u-area, but serves no real purpose except to consume now precious stack > space. > > The idea of the part of the thread state that can be swapped out, together > with the stack, seems to become alien. Most of the thread state which is > not needed when the thread is not runnable, now goes to struct thread > anyway. Might be, we should move the pcb into td_md. People actively > object to the idea of the swappable kernel stack when they learn > hard that local vars cannot participate in the global lists. > > The only thing which is currently allocated below the pcb and which > seems to be reasonable to swap out, is the FPU context on amd64. I will defer to Peter on this as I believe he is the one that split the PCB out from the rest of the u-area (or what was left of it). My gut is that you are probably right and that it would be better to leave that room for the stack than to use it for the pcb. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 05:20:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68AB3F61; Fri, 5 Sep 2014 05:20:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 546C41A68; Fri, 5 Sep 2014 05:20:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s855Kruo088334; Fri, 5 Sep 2014 05:20:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s855Krvr088333; Fri, 5 Sep 2014 05:20:53 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409050520.s855Krvr088333@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 5 Sep 2014 05:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271154 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 05:20:53 -0000 Author: ed Date: Fri Sep 5 05:20:52 2014 New Revision: 271154 URL: http://svnweb.freebsd.org/changeset/base/271154 Log: Partially revert r271012. Incredibly weird: GCC 4.7/4.9 do support the _Noreturn and _Thread_local keywords, but not during bootstrapping. GCC is by far the weirdest compiler that I've ever used. Reported by: andreast@ Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Sep 5 05:07:38 2014 (r271153) +++ head/sys/sys/cdefs.h Fri Sep 5 05:20:52 2014 (r271154) @@ -280,13 +280,11 @@ #define _Atomic(T) struct { T volatile __val; } #endif -#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) && __cplusplus >= 201103L #define _Noreturn [[noreturn]] #else #define _Noreturn __dead2 #endif -#endif #if !__has_extension(c_static_assert) && !__GNUC_PREREQ__(4, 7) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ @@ -301,7 +299,7 @@ #endif #endif -#if !__has_extension(c_thread_local) && !__GNUC_PREREQ__(4, 9) +#if !__has_extension(c_thread_local) /* * XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode * without actually supporting the thread_local keyword. Don't check for From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 05:36:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7B0E2EA; Fri, 5 Sep 2014 05:36:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9B061C3A; Fri, 5 Sep 2014 05:36:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s855aXeq095860; Fri, 5 Sep 2014 05:36:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s855aXgD095858; Fri, 5 Sep 2014 05:36:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201409050536.s855aXgD095858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 5 Sep 2014 05:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271155 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 05:36:33 -0000 Author: ed Date: Fri Sep 5 05:36:32 2014 New Revision: 271155 URL: http://svnweb.freebsd.org/changeset/base/271155 Log: Roll back r271012 even more aggressively. I've looked at the GCC sources and I now understand what's going wrong. THe C11 keywords are simply nonexistent when using C++ mode. They are marked as C-only in the parser. This is absolutely impractical for multiple reasons: - The C11 keywords do not conflict with C++ naming rules. They all start with _[A-Z]. There is no reason to make them C-only. - It makes it practically impossible for people to use these keywords in C header files and expect them to work from within C++ sources. As I said in my previous commit message: GCC is by far the weirdest compiler that I've ever used. Modified: head/include/tgmath.h head/sys/sys/cdefs.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Fri Sep 5 05:20:52 2014 (r271154) +++ head/include/tgmath.h Fri Sep 5 05:36:32 2014 (r271155) @@ -61,7 +61,7 @@ */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ - __has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) + __has_extension(c_generic_selections) #define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ _Generic(x, \ long double _Complex: cfnl, \ Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Sep 5 05:20:52 2014 (r271154) +++ head/sys/sys/cdefs.h Fri Sep 5 05:36:32 2014 (r271155) @@ -254,7 +254,7 @@ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L -#if !__has_extension(c_alignas) && !__GNUC_PREREQ__(4, 7) +#if !__has_extension(c_alignas) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_alignas) #define _Alignas(x) alignas(x) @@ -264,13 +264,11 @@ #endif #endif -#if !__GNUC_PREREQ__(4, 7) #if defined(__cplusplus) && __cplusplus >= 201103L #define _Alignof(x) alignof(x) #else #define _Alignof(x) __alignof(x) #endif -#endif #if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) /* @@ -286,7 +284,7 @@ #define _Noreturn __dead2 #endif -#if !__has_extension(c_static_assert) && !__GNUC_PREREQ__(4, 7) +#if !__has_extension(c_static_assert) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) @@ -325,7 +323,7 @@ */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ - __has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9) + __has_extension(c_generic_selections) #define __generic(expr, t, yes, no) \ _Generic(expr, t: yes, default: no) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 07:42:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30A77453; Fri, 5 Sep 2014 07:42:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6D4198A; Fri, 5 Sep 2014 07:42:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s857gYqW054307; Fri, 5 Sep 2014 07:42:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s857gYeR054306; Fri, 5 Sep 2014 07:42:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409050742.s857gYeR054306@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Sep 2014 07:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271156 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 07:42:35 -0000 Author: mav Date: Fri Sep 5 07:42:34 2014 New Revision: 271156 URL: http://svnweb.freebsd.org/changeset/base/271156 Log: Add IDs for Intel Patsburg USB 2.0 controller. Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Fri Sep 5 05:36:32 2014 (r271155) +++ head/sys/dev/usb/controller/ehci_pci.c Fri Sep 5 07:42:34 2014 (r271156) @@ -120,6 +120,10 @@ ehci_pci_match(device_t self) case 0x43961002: return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller"); + case 0x1d268086: + return ("Intel Patsburg USB 2.0 controller"); + case 0x1d2d8086: + return ("Intel Patsburg USB 2.0 controller"); case 0x1e268086: return ("Intel Panther Point USB 2.0 controller"); case 0x1e2d8086: From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 08:43:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 460B0350; Fri, 5 Sep 2014 08:43:10 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC8991EFA; Fri, 5 Sep 2014 08:43:09 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s858h5co005526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Sep 2014 11:43:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s858h5co005526 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s858h5jn005525; Fri, 5 Sep 2014 11:43:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 5 Sep 2014 11:43:05 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Message-ID: <20140905084305.GN2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <201409021100.57493.jhb@freebsd.org> <20140902154127.GD2737@kib.kiev.ua> <3070015.668SIdAzOX@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x2SxEfr5rzNwq/hH" Content-Disposition: inline In-Reply-To: <3070015.668SIdAzOX@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 08:43:10 -0000 --x2SxEfr5rzNwq/hH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote: > On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote: > > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > > > I thought about that. I could easily make a parallel array, or perha= ps > > > use a separate 'susppcb' structure that includes a pcb and the savefpu > > > union and change susppcbs to be an array of those. Which do you pref= er?=20 > > > If we want to move some state out of the PCB on amd64 into this, then= a > > > separate struct for susppcbs might be the sanest. > >=20 > > Yes, separate structure seems to be a way forward. >=20 > Please see www.freebsd.org/~jhb/patches/susppcb.patch Note that I moved > fpususpend() out into a C function on amd64 so that resumectx() could sti= ll=20 > operate on just a pcb. This also makes savectx and resumectx more symmet= ric > and matches what I ended up doing on i386. This is tested for suspend and > resume on both i386 and amd64. The implementation of fpuresume() in C is definitely an improvement. You only moved the fpu context to the susppcb, I think this is good for now, we will want to move other bits later. Do we need to keep pcb layout for KBI compat ? I remember that pcb size is asserted to properly fit into pcpu area for percpu zones. But why keep the layout ? I.e. moving all padding bits to the end. There is one weird detail, not touched by your patch. Amd64 resume path calls initializecpu(), while i386 does not. I do not see any use for the call, the reload of CRX registers by trampoline/resumectx should already set everything to working state. E.g., enabling XMM in CR4 after fpu state is restored looks strange. Overall, it looks fine. Do you prefer to have alloc_fpusave() on i386 ? --x2SxEfr5rzNwq/hH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUCXeYAAoJEJDCuSvBvK1BQOkP/RY8Mb3aL0jGwDDRyTBdPzvV wuPQe+4SFtRdGt7anMzoQTdTMUfuYq8hdlKNbAUOHggZi94cu1IAFstqprHsSbGQ H0YV0+ExpjH8jGMoNDUQwsbOgslYBz4Cu1vvfQSGtkOlUPK1lTrMteyw967AOB9M BZ8nbUEafRHinGyTaod97g6NZo7aVKGZRe93OzvoApgrlAznWnmDs2EkyIIhaY30 FzE5LHML3vgBk93YjKKd00iDJrAtt/AmWRVmix+420yks+Wl5sxhoDLt1Kp7Ll5Q kd1x1EtgGZEdZJqfaXOJt/sHdScG9za8Tq5P4+1HNb61MQjQHQULvxUfuFJ6/sue D1roZQXY7mbGxWo7UKVxX9y6xVp/o97qnjcWcmJ2UYqucn8Ae/OHYrjPrB32pJB2 noPS8WodPqqanvzi4A8OMO/KAIHCMsI0pg6nrsTPuIs+lf9AnRzcjXcV7sf0bc21 mLM+xH6ibT+UdeYL4KQntbAfwT6uov2mTM1WhZg2EddzOrppZ4jWUP4P35WqgMy2 k2tcsPy+3FeA6FMs3dh5cjwa+lVrdogmFA5GWfci/9Kxk+AtN4k0jaRl0i4BQtRV I/cjmi1ZaRfXbIDSOB49fwkdxlEN0xdPNK4SqFanpQNbmn/oQa6r5c8SfLazQfv+ P2iRkSPwNaq2EH0hcVvc =41Qm -----END PGP SIGNATURE----- --x2SxEfr5rzNwq/hH-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 11:10:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D4EEC4D; Fri, 5 Sep 2014 11:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68DA7144D; Fri, 5 Sep 2014 11:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85BAiIk047542; Fri, 5 Sep 2014 11:10:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85BAiAc047541; Fri, 5 Sep 2014 11:10:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409051110.s85BAiAc047541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 5 Sep 2014 11:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271157 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 11:10:45 -0000 Author: trasz Date: Fri Sep 5 11:10:44 2014 New Revision: 271157 URL: http://svnweb.freebsd.org/changeset/base/271157 Log: Fix typo. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Fri Sep 5 07:42:34 2014 (r271156) +++ head/usr.sbin/ctld/login.c Fri Sep 5 11:10:44 2014 (r271157) @@ -720,8 +720,8 @@ login_negotiate_key(struct pdu *request, "MaxRecvDataSegmentLength"); } if (tmp > MAX_DATA_SEGMENT_LENGTH) { - log_debugx("capping MaxDataSegmentLength from %d to %d", - tmp, MAX_DATA_SEGMENT_LENGTH); + log_debugx("capping MaxRecvDataSegmentLength " + "from %d to %d", tmp, MAX_DATA_SEGMENT_LENGTH); tmp = MAX_DATA_SEGMENT_LENGTH; } conn->conn_max_data_segment_length = tmp; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 11:26:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 140DF1A8; Fri, 5 Sep 2014 11:26:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DC515B5; Fri, 5 Sep 2014 11:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85BQ0r7056607; Fri, 5 Sep 2014 11:26:00 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85BPwaE056586; Fri, 5 Sep 2014 11:25:58 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409051125.s85BPwaE056586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 5 Sep 2014 11:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 11:26:01 -0000 Author: kevlo Date: Fri Sep 5 11:25:58 2014 New Revision: 271159 URL: http://svnweb.freebsd.org/changeset/base/271159 Log: The USB LED driver for the Dream Cheeky WebMail Notifier. Reviewed by: hselasky Added: head/share/man/man4/uled.4 (contents, props changed) head/sys/dev/usb/misc/uled.c (contents, props changed) head/sys/dev/usb/uled_ioctl.h (contents, props changed) head/sys/modules/usb/uled/ head/sys/modules/usb/uled/Makefile (contents, props changed) Modified: head/Makefile head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs head/sys/modules/usb/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Sep 5 11:11:15 2014 (r271158) +++ head/Makefile Fri Sep 5 11:25:58 2014 (r271159) @@ -1,6 +1,42 @@ # # $FreeBSD$ # +# Copyright (c) 2014 Kevin Lo. 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/misc + +KMOD= uled +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + uled.c + +.include +# +# $FreeBSD$ +# # The user-driven targets are: # # universe - *Really* build *everything* (buildworld and Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 5 11:11:15 2014 (r271158) +++ head/share/man/man4/Makefile Fri Sep 5 11:25:58 2014 (r271159) @@ -527,6 +527,7 @@ MAN= aac.4 \ uhso.4 \ uipaq.4 \ ukbd.4 \ + uled.4 \ ulpt.4 \ umass.4 \ umcs.4 \ Added: head/share/man/man4/uled.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/uled.4 Fri Sep 5 11:25:58 2014 (r271159) @@ -0,0 +1,95 @@ +.\" +.\" Copyright (c) 2014 Kevin Lo +.\" 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$ +.\" +.Dd September 5, 2014 +.Dt ULED 4 +.Os +.Sh NAME +.Nm uled +.Nd USB LED driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines into +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uled" +.Cd "device usb" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +uled_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Dream Cheeky WebMail Notifier device. +.Pp +Subsequently, the +.Pa /dev/uled0 +device can be used by userland applications. +.Sh IOCTLS +The following +.Xr ioctl 2 +commands can be performed on +.Pa /dev/uled0 , +which are defined in +.In dev/usb/uled_ioctl.h : +.Bl -tag -width indent +.It Dv ULED_GET_COLOR +The command returns LED colors with values for RGB. +This +.Xr ioctl 2 +takes the following structure: +.Bd -literal +struct uled_color { + uint8_t red; + uint8_t green; + uint8_t blue; +}; +.Ed +.Pp +.It Dv ULED_SET_COLOR +The command sets LED colors with values for RGB. +It uses the same structure as above. +.El +.Sh FILES +.Bl -tag -width ".Pa /dev/uled0" -compact +.It Pa /dev/uled0 +blocking device node +.El +.Sh SEE ALSO +.Xr ohci 4 , +.Xr uhci 4 , +.Xr usb 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Kevin Lo Aq Mt kevlo@FreeBSD.org . Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Sep 5 11:11:15 2014 (r271158) +++ head/sys/conf/NOTES Fri Sep 5 11:25:58 2014 (r271159) @@ -2653,6 +2653,8 @@ device usb device udbp # USB Fm Radio device ufm +# USB LED +device uled # Human Interface Device (anything with buttons and dials) device uhid # USB keyboard Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Sep 5 11:11:15 2014 (r271158) +++ head/sys/conf/files Fri Sep 5 11:25:58 2014 (r271159) @@ -2542,6 +2542,7 @@ dev/usb/serial/usb_serial.c optional uc # dev/usb/misc/ufm.c optional ufm dev/usb/misc/udbp.c optional udbp +dev/usb/misc/uled.c optional uled # # USB input drivers # Added: head/sys/dev/usb/misc/uled.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/misc/uled.c Fri Sep 5 11:25:58 2014 (r271159) @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 2014 Kevin Lo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR usb_debug +#include + +#include + +struct uled_softc { + struct usb_fifo_sc sc_fifo; + struct mtx sc_mtx; + + struct usb_device *sc_udev; + struct uled_color sc_color; + + uint8_t sc_state; +#define ULED_ENABLED 0x01 +}; + +/* prototypes */ + +static device_probe_t uled_probe; +static device_attach_t uled_attach; +static device_detach_t uled_detach; + +static usb_fifo_open_t uled_open; +static usb_fifo_close_t uled_close; +static usb_fifo_ioctl_t uled_ioctl; + +static struct usb_fifo_methods uled_fifo_methods = { + .f_open = &uled_open, + .f_close = &uled_close, + .f_ioctl = &uled_ioctl, + .basename[0] = "uled", +}; + +static usb_error_t uled_ctrl_msg(struct uled_softc *, uint8_t, uint8_t, + uint16_t, uint16_t, void *buf, uint16_t); +static int uled_enable(struct uled_softc *); + +static devclass_t uled_devclass; + +static device_method_t uled_methods[] = { + DEVMETHOD(device_probe, uled_probe), + DEVMETHOD(device_attach, uled_attach), + DEVMETHOD(device_detach, uled_detach), + + DEVMETHOD_END +}; + +static driver_t uled_driver = { + .name = "uled", + .methods = uled_methods, + .size = sizeof(struct uled_softc), +}; + +DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL); +MODULE_DEPEND(uled, usb, 1, 1, 1); +MODULE_VERSION(uled, 1); + +static const STRUCT_USB_HOST_ID uled_devs[] = { + {USB_VPI(USB_VENDOR_DREAMLINK, USB_PRODUCT_DREAMLINK_DL100B, 0)}, +}; + +static int +uled_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bInterfaceClass != UICLASS_HID) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(uled_devs, sizeof(uled_devs), uaa)); +} + +static int +uled_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct uled_softc *sc; + int unit; + usb_error_t error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + unit = device_get_unit(dev); + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, "uled lock", NULL, MTX_DEF | MTX_RECURSE); + + sc->sc_udev = uaa->device; + + error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, + &uled_fifo_methods, &sc->sc_fifo, unit, -1, + uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); + if (error != 0) + goto detach; + + sc->sc_color.red = 0; + sc->sc_color.green = 0; + sc->sc_color.blue = 0; + + return (0); + +detach: + uled_detach(dev); + return (ENOMEM); +} + +static int +uled_detach(device_t dev) +{ + struct uled_softc *sc; + + sc = device_get_softc(dev); + usb_fifo_detach(&sc->sc_fifo); + mtx_destroy(&sc->sc_mtx); + return (0); +} + +static usb_error_t +uled_ctrl_msg(struct uled_softc *sc, uint8_t rt, uint8_t reqno, + uint16_t value, uint16_t index, void *buf, uint16_t buflen) +{ + struct usb_device_request req; + + req.bmRequestType = rt; + req.bRequest = reqno; + USETW(req.wValue, value); + USETW(req.wIndex, index); + USETW(req.wLength, buflen); + + return (usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, &req, buf, + 0, NULL, 2000)); +} + +static int +uled_enable(struct uled_softc *sc) +{ + static uint8_t cmdbuf[] = { 0x1f, 0x02, 0x00, 0x5f, 0x00, 0x00, 0x1a, + 0x03 }; + int error; + + sc->sc_state |= ULED_ENABLED; + mtx_lock(&sc->sc_mtx); + error = uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_SET_REPORT, + 0x200, 0, cmdbuf, sizeof(cmdbuf)); + mtx_unlock(&sc->sc_mtx); + return (error); +} + +static int +uled_open(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uled_softc *sc; + int rc; + + sc = usb_fifo_softc(fifo); + if (sc->sc_state & ULED_ENABLED) + return (EBUSY); + if ((rc = uled_enable(sc)) != 0) + return (rc); + } + return (0); +} + +static void +uled_close(struct usb_fifo *fifo, int fflags) +{ + if (fflags & FREAD) { + struct uled_softc *sc; + + sc = usb_fifo_softc(fifo); + sc->sc_state &= ~ULED_ENABLED; + } +} + +static int +uled_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags) +{ + struct uled_softc *sc; + struct uled_color color; + int error; + + sc = usb_fifo_softc(fifo); + error = 0; + + mtx_lock(&sc->sc_mtx); + + switch(cmd) { + case ULED_GET_COLOR: + *(struct uled_color *)addr = sc->sc_color; + break; + case ULED_SET_COLOR: + color = *(struct uled_color *)addr; + uint8_t buf[8]; + + sc->sc_color.red = color.red; + sc->sc_color.green = color.green; + sc->sc_color.blue = color.blue; + + buf[0] = color.red; + buf[1] = color.green; + buf[2] = color.blue; + buf[3] = buf[4] = buf[5] = 0; + buf[6] = 0x1a; + buf[7] = 0x05; + error = uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, + UR_SET_REPORT, 0x200, 0, buf, sizeof(buf)); + break; + default: + error = ENOTTY; + break; + } + + mtx_unlock(&sc->sc_mtx); + return (error); +} Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 5 11:11:15 2014 (r271158) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 5 11:25:58 2014 (r271159) @@ -110,6 +110,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(CYPRESS, SILVERSHIELD, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE), + USB_QUIRK(DREAMLINK, DL100B, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(ITUNERNET, USBLCD2X20, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE), USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x0000, 0xffff, UQ_HID_IGNORE), Added: head/sys/dev/usb/uled_ioctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/uled_ioctl.h Fri Sep 5 11:25:58 2014 (r271159) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2014 Kevin Lo + * 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$ + */ + +#ifndef _ULED_IOCTL_H_ +#define _ULED_IOCTL_H_ + +#include + +struct uled_color { + uint8_t red; + uint8_t green; + uint8_t blue; +}; + +#define ULED_GET_COLOR _IOR('U', 205, struct uled_color) +#define ULED_SET_COLOR _IOW('U', 206, struct uled_color) + +#endif /* _ULED_IOCTL_H_ */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Sep 5 11:11:15 2014 (r271158) +++ head/sys/dev/usb/usbdevs Fri Sep 5 11:25:58 2014 (r271159) @@ -713,6 +713,7 @@ vendor LONGCHEER 0x1c9e Longcheer Holdin vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik vendor NEOTEL 0x1d09 Neotel +vendor DREAMLINK 0x1d34 Dream Link vendor PEGATRON 0x1d4d Pegatron vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek @@ -1657,6 +1658,9 @@ product DMI DISK 0x2bcf Generic Disk /* DrayTek products */ product DRAYTEK VIGOR550 0x0550 Vigor550 +/* Dream Link products */ +product DREAMLINK DL100B 0x0004 USB Webmail Notifier + /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Fri Sep 5 11:11:15 2014 (r271158) +++ head/sys/modules/usb/Makefile Fri Sep 5 11:25:58 2014 (r271159) @@ -48,7 +48,7 @@ SUBDIR += ${_dwc_otg} ehci ${_musb} ohci ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += ${_urtwn} ${_urtwnfw} -SUBDIR += atp uhid ukbd ums udbp ufm uep wsp +SUBDIR += atp uhid ukbd ums udbp ufm uep wsp uled SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso ipheth Added: head/sys/modules/usb/uled/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uled/Makefile Fri Sep 5 11:25:58 2014 (r271159) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2014 Kevin Lo. 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/misc + +KMOD= uled +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + uled.c + +.include From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 09:24:27 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78B9BC5A; Fri, 5 Sep 2014 09:24:27 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6291472; Fri, 5 Sep 2014 09:24:25 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA19169; Fri, 05 Sep 2014 12:24:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XPpkQ-000PYs-Mg; Fri, 05 Sep 2014 12:24:02 +0300 Message-ID: <5409810E.1080705@FreeBSD.org> Date: Fri, 05 Sep 2014 12:23:26 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Steven Hartland Subject: Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm References: <201408281950.s7SJo90I047213@svn.freebsd.org> <169C94ED141B435BACEADB04A4824717@multiplay.co.uk> <54072E20.10802@mail.lifanov.com> <2230377.GgKARkJyaG@ralph.baldwin.cx> <540778A2.3080809@mail.lifanov.com> <5407816B.9000401@FreeBSD.org> <86292055B4114529874B693EEB441CB6@multiplay.co.uk> In-Reply-To: <86292055B4114529874B693EEB441CB6@multiplay.co.uk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 05 Sep 2014 11:33:51 +0000 Cc: src-committers@FreeBSD.org, John Baldwin , Peter Wemm , Alan Cox , svn-src-all@FreeBSD.org, Dmitry Morozovsky , "Matthew D. Fuller" , Nikolai Lifanov , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 09:24:27 -0000 on 04/09/2014 04:18 Steven Hartland said the following: > Indeed that would be interesting, but we might find that its quite memory size > dependent given the scaling so confirming HW details would be nice too. > > I'd also be interested to know who wins the free race between the VM and ARC > when using that value. BTW, I've written a small silly program that tests for a problem that affected me in the distant past: http://people.freebsd.org/~avg/arc-vs-swap.c It gobbles almost all of the memory and then just sits on it never accessing it again. At the same time it repeatedly reads blocks of data from a large file. The idea is that eventually the unused memory should be pushed out to the swap and the ARC is allowed to grow to accommodate for the data being read. I run this program on a freshly booted system without any other applications. Prior to r270759 the system behaves as expected. Although the pace of shifting balance between the ARC and the swap-backed pages is quite slow. After r270759 and with the default tuning the ARC always sits at its minimum size. To me this is a regression. To summarize: I really appreciate the improvements that you are making here https://reviews.freebsd.org/D702 Thanks! P.S. I wish there was an easy way to make the page cache and the ARC aware of each other. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 13:08:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6765EB34; Fri, 5 Sep 2014 13:08:37 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1021120A; Fri, 5 Sep 2014 13:08:36 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s85D8S3v093176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Sep 2014 16:08:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s85D8S3v093176 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s85D8Sen093175; Fri, 5 Sep 2014 16:08:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 5 Sep 2014 16:08:28 +0300 From: Konstantin Belousov To: Kevin Lo Subject: Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled Message-ID: <20140905130828.GQ2737@kib.kiev.ua> References: <201409051125.s85BPwaE056586@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="adQrqeOhWOaS1Na2" Content-Disposition: inline In-Reply-To: <201409051125.s85BPwaE056586@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 13:08:37 -0000 --adQrqeOhWOaS1Na2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2014 at 11:25:58AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Fri Sep 5 11:25:58 2014 > New Revision: 271159 > URL: http://svnweb.freebsd.org/changeset/base/271159 >=20 > Log: > The USB LED driver for the Dream Cheeky WebMail Notifier. > =20 > Reviewed by: hselasky >=20 > Added: > head/share/man/man4/uled.4 (contents, props changed) > head/sys/dev/usb/misc/uled.c (contents, props changed) > head/sys/dev/usb/uled_ioctl.h (contents, props changed) > head/sys/modules/usb/uled/ > head/sys/modules/usb/uled/Makefile (contents, props changed) > Modified: > head/Makefile ^^^^^^^^^ > head/share/man/man4/Makefile > head/sys/conf/NOTES > head/sys/conf/files > head/sys/dev/usb/quirk/usb_quirk.c > head/sys/dev/usb/usbdevs > head/sys/modules/usb/Makefile >=20 > Modified: head/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile Fri Sep 5 11:11:15 2014 (r271158) > +++ head/Makefile Fri Sep 5 11:25:58 2014 (r271159) > @@ -1,6 +1,42 @@ > # > # $FreeBSD$ > # > +# Copyright (c) 2014 Kevin Lo. 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 PUR= POSE > +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN= TIAL > +# 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, ST= RICT > +# 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. > +# > + > +S=3D ${.CURDIR}/../../.. > + > +.PATH: $S/dev/usb/misc > + > +KMOD=3D uled > +SRCS=3D opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usb= devs.h \ > + uled.c > + > +.include > +# > +# $FreeBSD$ > +# > # The user-driven targets are: > # > # universe - *Really* build *everything* (buildworld and >=20 It seems you mis-patched the commit tree. > Modified: head/share/man/man4/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man4/Makefile Fri Sep 5 11:11:15 2014 (r271158) > +++ head/share/man/man4/Makefile Fri Sep 5 11:25:58 2014 (r271159) > @@ -527,6 +527,7 @@ MAN=3D aac.4 \ > uhso.4 \ > uipaq.4 \ > ukbd.4 \ > + uled.4 \ > ulpt.4 \ > umass.4 \ > umcs.4 \ >=20 > Added: head/share/man/man4/uled.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/man/man4/uled.4 Fri Sep 5 11:25:58 2014 (r271159) > @@ -0,0 +1,95 @@ > +.\" > +.\" Copyright (c) 2014 Kevin Lo > +.\" 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 t= he > +.\" documentation and/or other materials provided with the distributi= on. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' A= ND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR P= URPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIA= BLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQU= ENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GO= ODS > +.\" 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 AN= Y WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY = OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd September 5, 2014 > +.Dt ULED 4 > +.Os > +.Sh NAME > +.Nm uled > +.Nd USB LED driver > +.Sh SYNOPSIS > +To compile this driver into the kernel, place the following lines into > +your kernel configuration file: > +.Bd -ragged -offset indent > +.Cd "device uled" > +.Cd "device usb" > +.Ed > +.Pp > +Alternatively, to load the driver as a module at boot time, > +place the following line in > +.Xr loader.conf 5 : > +.Bd -literal -offset indent > +uled_load=3D"YES" > +.Ed > +.Sh DESCRIPTION > +The > +.Nm > +driver provides support for the Dream Cheeky WebMail Notifier device. > +.Pp > +Subsequently, the > +.Pa /dev/uled0 > +device can be used by userland applications. > +.Sh IOCTLS > +The following > +.Xr ioctl 2 > +commands can be performed on > +.Pa /dev/uled0 , > +which are defined in > +.In dev/usb/uled_ioctl.h : > +.Bl -tag -width indent > +.It Dv ULED_GET_COLOR > +The command returns LED colors with values for RGB. > +This > +.Xr ioctl 2 > +takes the following structure: > +.Bd -literal > +struct uled_color { > + uint8_t red; > + uint8_t green; > + uint8_t blue; > +}; > +.Ed > +.Pp > +.It Dv ULED_SET_COLOR > +The command sets LED colors with values for RGB. > +It uses the same structure as above. > +.El > +.Sh FILES > +.Bl -tag -width ".Pa /dev/uled0" -compact > +.It Pa /dev/uled0 > +blocking device node > +.El > +.Sh SEE ALSO > +.Xr ohci 4 , > +.Xr uhci 4 , > +.Xr usb 4 > +.Sh AUTHORS > +.An -nosplit > +The > +.Nm > +driver was written by > +.An Kevin Lo Aq Mt kevlo@FreeBSD.org . >=20 > Modified: head/sys/conf/NOTES > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/NOTES Fri Sep 5 11:11:15 2014 (r271158) > +++ head/sys/conf/NOTES Fri Sep 5 11:25:58 2014 (r271159) > @@ -2653,6 +2653,8 @@ device usb > device udbp > # USB Fm Radio > device ufm > +# USB LED > +device uled > # Human Interface Device (anything with buttons and dials) > device uhid > # USB keyboard >=20 > Modified: head/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/files Fri Sep 5 11:11:15 2014 (r271158) > +++ head/sys/conf/files Fri Sep 5 11:25:58 2014 (r271159) > @@ -2542,6 +2542,7 @@ dev/usb/serial/usb_serial.c optional uc > # > dev/usb/misc/ufm.c optional ufm > dev/usb/misc/udbp.c optional udbp > +dev/usb/misc/uled.c optional uled > # > # USB input drivers > # >=20 > Added: head/sys/dev/usb/misc/uled.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/usb/misc/uled.c Fri Sep 5 11:25:58 2014 (r271159) > @@ -0,0 +1,275 @@ > +/*- > + * Copyright (c) 2014 Kevin Lo > + * 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 distributio= n. > + * > + * 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 PU= RPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABL= E FOR > + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include "usbdevs.h" > + > +#define USB_DEBUG_VAR usb_debug > +#include > + > +#include > + > +struct uled_softc { > + struct usb_fifo_sc sc_fifo; > + struct mtx sc_mtx; > + > + struct usb_device *sc_udev; > + struct uled_color sc_color; > + > + uint8_t sc_state; > +#define ULED_ENABLED 0x01 > +}; > + > +/* prototypes */ > + > +static device_probe_t uled_probe; > +static device_attach_t uled_attach; > +static device_detach_t uled_detach; > + > +static usb_fifo_open_t uled_open; > +static usb_fifo_close_t uled_close; > +static usb_fifo_ioctl_t uled_ioctl; > + > +static struct usb_fifo_methods uled_fifo_methods =3D { > + .f_open =3D &uled_open, > + .f_close =3D &uled_close, > + .f_ioctl =3D &uled_ioctl, > + .basename[0] =3D "uled", > +}; > + > +static usb_error_t uled_ctrl_msg(struct uled_softc *, uint8_t, uint8_t, > + uint16_t, uint16_t, void *buf, uint16_t); > +static int uled_enable(struct uled_softc *); > + > +static devclass_t uled_devclass; > + > +static device_method_t uled_methods[] =3D { > + DEVMETHOD(device_probe, uled_probe), > + DEVMETHOD(device_attach, uled_attach), > + DEVMETHOD(device_detach, uled_detach), > + > + DEVMETHOD_END > +}; > + > +static driver_t uled_driver =3D { > + .name =3D "uled", > + .methods =3D uled_methods, > + .size =3D sizeof(struct uled_softc), > +}; > + > +DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL); > +MODULE_DEPEND(uled, usb, 1, 1, 1); > +MODULE_VERSION(uled, 1); > + > +static const STRUCT_USB_HOST_ID uled_devs[] =3D { > + {USB_VPI(USB_VENDOR_DREAMLINK, USB_PRODUCT_DREAMLINK_DL100B, 0)}, > +}; > + > +static int > +uled_probe(device_t dev) > +{ > + struct usb_attach_arg *uaa; > + > + uaa =3D device_get_ivars(dev); > + if (uaa->usb_mode !=3D USB_MODE_HOST) > + return (ENXIO); > + if (uaa->info.bInterfaceClass !=3D UICLASS_HID) > + return (ENXIO); > + > + return (usbd_lookup_id_by_uaa(uled_devs, sizeof(uled_devs), uaa)); > +} > + > +static int > +uled_attach(device_t dev) > +{ > + struct usb_attach_arg *uaa; > + struct uled_softc *sc; > + int unit; > + usb_error_t error; > + > + uaa =3D device_get_ivars(dev); > + sc =3D device_get_softc(dev); > + unit =3D device_get_unit(dev); > + > + device_set_usb_desc(dev); > + mtx_init(&sc->sc_mtx, "uled lock", NULL, MTX_DEF | MTX_RECURSE); > + > + sc->sc_udev =3D uaa->device; > + > + error =3D usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, > + &uled_fifo_methods, &sc->sc_fifo, unit, -1, > + uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); > + if (error !=3D 0) > + goto detach; > + > + sc->sc_color.red =3D 0; > + sc->sc_color.green =3D 0; > + sc->sc_color.blue =3D 0; > + > + return (0); > + > +detach: > + uled_detach(dev); > + return (ENOMEM); > +} > + > +static int > +uled_detach(device_t dev) > +{ > + struct uled_softc *sc; > + > + sc =3D device_get_softc(dev); > + usb_fifo_detach(&sc->sc_fifo); > + mtx_destroy(&sc->sc_mtx); > + return (0); > +} > + > +static usb_error_t > +uled_ctrl_msg(struct uled_softc *sc, uint8_t rt, uint8_t reqno, > + uint16_t value, uint16_t index, void *buf, uint16_t buflen) > +{ > + struct usb_device_request req; > + > + req.bmRequestType =3D rt; > + req.bRequest =3D reqno; > + USETW(req.wValue, value); > + USETW(req.wIndex, index); > + USETW(req.wLength, buflen); > + > + return (usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, &req, buf, > + 0, NULL, 2000)); > +} > + > +static int > +uled_enable(struct uled_softc *sc) > +{ > + static uint8_t cmdbuf[] =3D { 0x1f, 0x02, 0x00, 0x5f, 0x00, 0x00, 0x1a, > + 0x03 }; > + int error; > + > + sc->sc_state |=3D ULED_ENABLED; > + mtx_lock(&sc->sc_mtx); > + error =3D uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_SET_REPORT, > + 0x200, 0, cmdbuf, sizeof(cmdbuf)); > + mtx_unlock(&sc->sc_mtx); > + return (error); > +} > + > +static int > +uled_open(struct usb_fifo *fifo, int fflags) > +{ > + if (fflags & FREAD) { > + struct uled_softc *sc; > + int rc; > + > + sc =3D usb_fifo_softc(fifo); > + if (sc->sc_state & ULED_ENABLED) > + return (EBUSY); > + if ((rc =3D uled_enable(sc)) !=3D 0) > + return (rc); > + } > + return (0); > +} > + > +static void > +uled_close(struct usb_fifo *fifo, int fflags) > +{ > + if (fflags & FREAD) { > + struct uled_softc *sc; > + > + sc =3D usb_fifo_softc(fifo); > + sc->sc_state &=3D ~ULED_ENABLED; > + } > +} > + =09 > +static int > +uled_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags) > +{ > + struct uled_softc *sc; > + struct uled_color color; > + int error; > + > + sc =3D usb_fifo_softc(fifo); > + error =3D 0; > + > + mtx_lock(&sc->sc_mtx); > + > + switch(cmd) { > + case ULED_GET_COLOR: > + *(struct uled_color *)addr =3D sc->sc_color; > + break; > + case ULED_SET_COLOR: > + color =3D *(struct uled_color *)addr; > + uint8_t buf[8]; > + > + sc->sc_color.red =3D color.red; > + sc->sc_color.green =3D color.green; > + sc->sc_color.blue =3D color.blue; > + > + buf[0] =3D color.red; > + buf[1] =3D color.green; > + buf[2] =3D color.blue; > + buf[3] =3D buf[4] =3D buf[5] =3D 0; > + buf[6] =3D 0x1a; > + buf[7] =3D 0x05; > + error =3D uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, > + UR_SET_REPORT, 0x200, 0, buf, sizeof(buf)); > + break; > + default: > + error =3D ENOTTY; > + break; > + } > + > + mtx_unlock(&sc->sc_mtx); > + return (error); > +} >=20 > Modified: head/sys/dev/usb/quirk/usb_quirk.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 5 11:11:15 2014 (r271158) > +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Sep 5 11:25:58 2014 (r271159) > @@ -110,6 +110,7 @@ static struct usb_quirk_entry usb_quirks > USB_QUIRK(CYBERPOWER, 1500CAVRLCD, 0x0000, 0xffff, UQ_HID_IGNORE), > USB_QUIRK(CYPRESS, SILVERSHIELD, 0x0000, 0xffff, UQ_HID_IGNORE), > USB_QUIRK(DELORME, EARTHMATE, 0x0000, 0xffff, UQ_HID_IGNORE), > + USB_QUIRK(DREAMLINK, DL100B, 0x0000, 0xffff, UQ_HID_IGNORE), > USB_QUIRK(ITUNERNET, USBLCD2X20, 0x0000, 0xffff, UQ_HID_IGNORE), > USB_QUIRK(ITUNERNET, USBLCD4X20, 0x0000, 0xffff, UQ_HID_IGNORE), > USB_QUIRK(LIEBERT, POWERSURE_PXT, 0x0000, 0xffff, UQ_HID_IGNORE), >=20 > Added: head/sys/dev/usb/uled_ioctl.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/usb/uled_ioctl.h Fri Sep 5 11:25:58 2014 (r271159) > @@ -0,0 +1,43 @@ > +/*- > + * Copyright (c) 2014 Kevin Lo > + * 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 distributio= n. > + * > + * 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 PU= RPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIAB= LE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _ULED_IOCTL_H_ > +#define _ULED_IOCTL_H_ > + > +#include > + > +struct uled_color { > + uint8_t red; > + uint8_t green; > + uint8_t blue; > +}; > + > +#define ULED_GET_COLOR _IOR('U', 205, struct uled_color) > +#define ULED_SET_COLOR _IOW('U', 206, struct uled_color) > + > +#endif /* _ULED_IOCTL_H_ */ >=20 > Modified: head/sys/dev/usb/usbdevs > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/usb/usbdevs Fri Sep 5 11:11:15 2014 (r271158) > +++ head/sys/dev/usb/usbdevs Fri Sep 5 11:25:58 2014 (r271159) > @@ -713,6 +713,7 @@ vendor LONGCHEER 0x1c9e Longcheer Holdin > vendor MPMAN 0x1cae MpMan > vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik > vendor NEOTEL 0x1d09 Neotel > +vendor DREAMLINK 0x1d34 Dream Link > vendor PEGATRON 0x1d4d Pegatron > vendor QISDA 0x1da5 Qisda > vendor METAGEEK2 0x1dd5 MetaGeek > @@ -1657,6 +1658,9 @@ product DMI DISK 0x2bcf Generic Disk > /* DrayTek products */ > product DRAYTEK VIGOR550 0x0550 Vigor550 > =20 > +/* Dream Link products */ > +product DREAMLINK DL100B 0x0004 USB Webmail Notifier > + > /* dresden elektronik products */ > product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard > product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Hand= held Terminal >=20 > Modified: head/sys/modules/usb/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/modules/usb/Makefile Fri Sep 5 11:11:15 2014 (r271158) > +++ head/sys/modules/usb/Makefile Fri Sep 5 11:25:58 2014 (r271159) > @@ -48,7 +48,7 @@ SUBDIR +=3D ${_dwc_otg} ehci ${_musb} ohci > ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg} > SUBDIR +=3D ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${= _urtw}=20 > SUBDIR +=3D ${_urtwn} ${_urtwnfw} > -SUBDIR +=3D atp uhid ukbd ums udbp ufm uep wsp > +SUBDIR +=3D atp uhid ukbd ums udbp ufm uep wsp uled > SUBDIR +=3D ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa ui= paq ulpt \ > umct umcs umodem umoscom uplcom uslcom uvisor uvscom > SUBDIR +=3D uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso = ipheth >=20 > Added: head/sys/modules/usb/uled/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/modules/usb/uled/Makefile Fri Sep 5 11:25:58 2014 (r271159) > @@ -0,0 +1,36 @@ > +# > +# $FreeBSD$ > +# > +# Copyright (c) 2014 Kevin Lo. 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 PUR= POSE > +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN= TIAL > +# 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, ST= RICT > +# 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. > +# > + > +S=3D ${.CURDIR}/../../.. > + > +.PATH: $S/dev/usb/misc > + > +KMOD=3D uled > +SRCS=3D opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usb= devs.h \ > + uled.c > + > +.include --adQrqeOhWOaS1Na2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUCbXMAAoJEJDCuSvBvK1BWNwP/2hMU+81dZny2AwZ2jOATW/n Dh2xMpmOGVDKsGB7Q8zDA5YrL0bb210PZvN+tTxHLmKnIxVqrq7jNIi2G6YP1dzJ p7sRqN2R1Uo7ragbA1vN0A6X81PCSeB1Dc1tB5fvMW2czZbGsVqU+cDdXv2arU75 CWpmtw2nUM6puD57FP8Rt9gF5LlA0bjyGZlLwnMy++/4OlJgOdFVOp/TCRKPmNHd Ie2kzzB8ogBqhfMbHy5WNRDoEH3vxtOzTfseh2Gbhk4B5Qp5G8DVXb6GIDf3QnYd FEvPWH9DUuAuVLEWLc8UUHZ/xdgTq6haIeVen8HTUoUETxpxeGQBMvOnsCUuv4FX RRKxyQiwMvbcxAzlkZtM+RuAlKBJm9T8KZRF7ENNwbw+CSHcZrKUhE39jHe7q4P4 cFO8RYoiZHhFhQCEoNt3gW8no+G6XIK1UyIA3862uOtP1v+Q6orIDAPX6BTR5tzt TOJJH0qYBu/o4QD/6lSxSRQarKntYeUyDvq9fmOlR6n50Hq938lOlBUUe6+YapLo l1riBWh392dJywOvWv8VqmQP3KwqP7RXC238QzvOc+wDFkS4+RXmAlrrFWqg7yAY Qxncp0Yme5qIzbj6DIsjy2/Fxjg/j35fzOFfLnW1v4/qFGb8GRDPKPohr0LxB6jW C22dYgmvm/tiMLTBWlVf =L1Un -----END PGP SIGNATURE----- --adQrqeOhWOaS1Na2-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 13:45:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D2F1A59; Fri, 5 Sep 2014 13:45:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0CD5174C; Fri, 5 Sep 2014 13:45:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85DjEYD021999; Fri, 5 Sep 2014 13:45:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85DjEJl021997; Fri, 5 Sep 2014 13:45:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409051345.s85DjEJl021997@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Sep 2014 13:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271163 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 13:45:15 -0000 Author: mav Date: Fri Sep 5 13:45:14 2014 New Revision: 271163 URL: http://svnweb.freebsd.org/changeset/base/271163 Log: Invert AHCI_Q_NOBSYRES quirk meaning, waiting for readiness by default. I gave up to update list of Marvell chips that require this quirk. The final nail was growing number of PCIe/M.2 SSDs where Marvell chips have PCI IDs of different vendors. MFC after: 1 week H/W donated by: I/O Switch Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Sep 5 13:25:27 2014 (r271162) +++ head/sys/dev/ahci/ahci.c Fri Sep 5 13:45:14 2014 (r271163) @@ -187,10 +187,9 @@ ahci_attach(device_t dev) ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI); /* Identify and set separate quirks for HBA and RAID f/w Marvells. */ - if ((ctlr->quirks & AHCI_Q_NOBSYRES) && - (ctlr->quirks & AHCI_Q_ALTSIG) && + if ((ctlr->quirks & AHCI_Q_ALTSIG) && (ctlr->caps & AHCI_CAP_SPM) == 0) - ctlr->quirks &= ~AHCI_Q_NOBSYRES; + ctlr->quirks |= AHCI_Q_NOBSYRES; if (ctlr->quirks & AHCI_Q_1CH) { ctlr->caps &= ~AHCI_CAP_NPMASK; @@ -1533,9 +1532,15 @@ ahci_execute_transaction(struct ahci_slo } } - /* Marvell controllers do not wait for readyness. */ - if ((ch->quirks & AHCI_Q_NOBSYRES) && softreset == 2 && - et == AHCI_ERR_NONE) { + /* + * Marvell HBAs with non-RAID firmware do not wait for + * readiness after soft reset, so we have to wait here. + * Marvell RAIDs have no this problem, but instead sometimes + * forget to update FIS receive area, breaking this wait. + */ + if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 && + (ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 && + softreset == 2 && et == AHCI_ERR_NONE) { while ((val = fis[2]) & ATA_S_BUSY) { DELAY(10); if (count++ >= timeout) Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Fri Sep 5 13:25:27 2014 (r271162) +++ head/sys/dev/ahci/ahci_pci.c Fri Sep 5 13:45:14 2014 (r271163) @@ -179,31 +179,31 @@ static struct { AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES}, - {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, - {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, - {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, - {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, - {0x91831b4b, 0x00, "Marvell 88SS9183", AHCI_Q_NOBSYRES}, - {0x91a01b4b, 0x00, "Marvell 88SE91Ax", AHCI_Q_NOBSYRES}, - {0x92151b4b, 0x00, "Marvell 88SE9215", AHCI_Q_NOBSYRES}, - {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, - {0x92351b4b, 0x00, "Marvell 88SE9235", AHCI_Q_NOBSYRES}, - {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, - {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, - {0x06221103, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, - {0x06221b4b, 0x00, "HighPoint RocketRAID 622", AHCI_Q_NOBSYRES}, - {0x06401103, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, - {0x06401b4b, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, - {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, - {0x06441b4b, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, - {0x06411103, 0x00, "HighPoint RocketRAID 640L", AHCI_Q_NOBSYRES}, - {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_NOBSYRES}, - {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_NOBSYRES}, + {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS}, + {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_ALTSIG}, + {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2}, + {0x91251b4b, 0x00, "Marvell 88SE9125", 0}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_ALTSIG}, + {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_ALTSIG}, + {0x91721b4b, 0x00, "Marvell 88SE9172", 0}, + {0x91821b4b, 0x00, "Marvell 88SE9182", 0}, + {0x91831b4b, 0x00, "Marvell 88SS9183", 0}, + {0x91a01b4b, 0x00, "Marvell 88SE91Ax", 0}, + {0x92151b4b, 0x00, "Marvell 88SE9215", 0}, + {0x92201b4b, 0x00, "Marvell 88SE9220", AHCI_Q_ALTSIG}, + {0x92301b4b, 0x00, "Marvell 88SE9230", AHCI_Q_ALTSIG}, + {0x92351b4b, 0x00, "Marvell 88SE9235", 0}, + {0x06201103, 0x00, "HighPoint RocketRAID 620", 0}, + {0x06201b4b, 0x00, "HighPoint RocketRAID 620", 0}, + {0x06221103, 0x00, "HighPoint RocketRAID 622", 0}, + {0x06221b4b, 0x00, "HighPoint RocketRAID 622", 0}, + {0x06401103, 0x00, "HighPoint RocketRAID 640", 0}, + {0x06401b4b, 0x00, "HighPoint RocketRAID 640", 0}, + {0x06441103, 0x00, "HighPoint RocketRAID 644", 0}, + {0x06441b4b, 0x00, "HighPoint RocketRAID 644", 0}, + {0x06411103, 0x00, "HighPoint RocketRAID 640L", 0}, + {0x06421103, 0x00, "HighPoint RocketRAID 642L", 0}, + {0x06451103, 0x00, "HighPoint RocketRAID 644L", 0}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:32:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B155C05; Fri, 5 Sep 2014 14:32:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 860721CB4; Fri, 5 Sep 2014 14:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85EW9Nk045746; Fri, 5 Sep 2014 14:32:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85EW9C7045745; Fri, 5 Sep 2014 14:32:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409051432.s85EW9C7045745@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 5 Sep 2014 14:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271167 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:32:09 -0000 Author: trasz Date: Fri Sep 5 14:32:09 2014 New Revision: 271167 URL: http://svnweb.freebsd.org/changeset/base/271167 Log: Make it possible to quote names in autofs maps using double quotes. Note that this is a workaround, not a proper solution. If you know lex well, and want to help - please let me know, I'll explain how it should work. PR: 192968 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/token.l Modified: head/usr.sbin/autofs/token.l ============================================================================== --- head/usr.sbin/autofs/token.l Fri Sep 5 14:19:02 2014 (r271166) +++ head/usr.sbin/autofs/token.l Fri Sep 5 14:32:09 2014 (r271167) @@ -48,6 +48,7 @@ extern int yylex(void); %option noyywrap %% +\"[^"]+\" { yytext++; yytext[strlen(yytext) - 1] = '\0'; return STR; }; [a-zA-Z0-9\.\+-_/\:\[\]$&{}]+ { return STR; } #.*\n { lineno++; return NEWLINE; }; \\\n { lineno++; }; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:35:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18ECFF77; Fri, 5 Sep 2014 14:35:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08751CE9; Fri, 5 Sep 2014 14:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85EZYSO046311; Fri, 5 Sep 2014 14:35:34 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85EZYD3046310; Fri, 5 Sep 2014 14:35:34 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409051435.s85EZYD3046310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 5 Sep 2014 14:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271168 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:35:35 -0000 Author: kevlo Date: Fri Sep 5 14:35:34 2014 New Revision: 271168 URL: http://svnweb.freebsd.org/changeset/base/271168 Log: Revert r271159, Mis-patched the tree. Pointed out by: kib Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Sep 5 14:32:09 2014 (r271167) +++ head/Makefile Fri Sep 5 14:35:34 2014 (r271168) @@ -1,42 +1,6 @@ # # $FreeBSD$ # -# Copyright (c) 2014 Kevin Lo. 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. -# - -S= ${.CURDIR}/../../.. - -.PATH: $S/dev/usb/misc - -KMOD= uled -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ - uled.c - -.include -# -# $FreeBSD$ -# # The user-driven targets are: # # universe - *Really* build *everything* (buildworld and From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:41:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB08460; Fri, 5 Sep 2014 14:41:40 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 179AB1DEC; Fri, 5 Sep 2014 14:41:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 887461FE027; Fri, 5 Sep 2014 16:41:37 +0200 (CEST) Message-ID: <5409CBA0.3080401@selasky.org> Date: Fri, 05 Sep 2014 16:41:36 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Konstantin Belousov , Kevin Lo Subject: Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled References: <201409051125.s85BPwaE056586@svn.freebsd.org> <20140905130828.GQ2737@kib.kiev.ua> In-Reply-To: <20140905130828.GQ2737@kib.kiev.ua> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:41:40 -0000 On 09/05/14 15:08, Konstantin Belousov wrote: > On Fri, Sep 05, 2014 at 11:25:58AM +0000, Kevin Lo wrote: >> Author: kevlo >> Date: Fri Sep 5 11:25:58 2014 >> New Revision: 271159 >> URL: http://svnweb.freebsd.org/changeset/base/271159 >> >> Log: >> The USB LED driver for the Dream Cheeky WebMail Notifier. >> >> Reviewed by: hselasky >> >> Added: >> head/share/man/man4/uled.4 (contents, props changed) >> head/sys/dev/usb/misc/uled.c (contents, props changed) >> head/sys/dev/usb/uled_ioctl.h (contents, props changed) >> head/sys/modules/usb/uled/ >> head/sys/modules/usb/uled/Makefile (contents, props changed) >> Modified: >> head/Makefile > ^^^^^^^^^ > Hi, The "head/Makefile" was not part of the reviewed patch sent to me. Anyway, USB modules rock also at toplevel ;-) --HPS From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:44:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BC8F6E7; Fri, 5 Sep 2014 14:44:33 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9298E1E2E; Fri, 5 Sep 2014 14:44:32 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s85EhPH9072448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 5 Sep 2014 22:43:25 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s85EhPpV072447; Fri, 5 Sep 2014 22:43:25 +0800 (CST) (envelope-from kevlo) Date: Fri, 5 Sep 2014 22:43:24 +0800 From: Kevin Lo To: Konstantin Belousov Subject: Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled Message-ID: <20140905144324.GA72438@ns.kevlo.org> References: <201409051125.s85BPwaE056586@svn.freebsd.org> <20140905130828.GQ2737@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140905130828.GQ2737@kib.kiev.ua> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:44:33 -0000 On Fri, Sep 05, 2014 at 04:08:28PM +0300, Konstantin Belousov wrote: > On Fri, Sep 05, 2014 at 11:25:58AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Sep 5 11:25:58 2014 > > New Revision: 271159 > > URL: http://svnweb.freebsd.org/changeset/base/271159 > > > > Log: > > The USB LED driver for the Dream Cheeky WebMail Notifier. > > > > Reviewed by: hselasky > > > > Added: > > head/share/man/man4/uled.4 (contents, props changed) > > head/sys/dev/usb/misc/uled.c (contents, props changed) > > head/sys/dev/usb/uled_ioctl.h (contents, props changed) > > head/sys/modules/usb/uled/ > > head/sys/modules/usb/uled/Makefile (contents, props changed) > > Modified: > > head/Makefile > ^^^^^^^^^ > > > head/share/man/man4/Makefile > > head/sys/conf/NOTES > > head/sys/conf/files > > head/sys/dev/usb/quirk/usb_quirk.c > > head/sys/dev/usb/usbdevs > > head/sys/modules/usb/Makefile > > > > Modified: head/Makefile > > ============================================================================== > > --- head/Makefile Fri Sep 5 11:11:15 2014 (r271158) > > +++ head/Makefile Fri Sep 5 11:25:58 2014 (r271159) > > @@ -1,6 +1,42 @@ > > # > > # $FreeBSD$ > > # > > +# Copyright (c) 2014 Kevin Lo. 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. > > +# > > + > > +S= ${.CURDIR}/../../.. > > + > > +.PATH: $S/dev/usb/misc > > + > > +KMOD= uled > > +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ > > + uled.c > > + > > +.include > > +# > > +# $FreeBSD$ > > +# > > # The user-driven targets are: > > # > > # universe - *Really* build *everything* (buildworld and > > > It seems you mis-patched the commit tree. I'm sorry that was my damn fault. Just committed a fix in r271168. Thanks for spotting. Kevin From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:48:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6FCFB1E; Fri, 5 Sep 2014 14:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A20AE1E63; Fri, 5 Sep 2014 14:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85Em6Am051457; Fri, 5 Sep 2014 14:48:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85Em6Mu051456; Fri, 5 Sep 2014 14:48:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409051448.s85Em6Mu051456@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 5 Sep 2014 14:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271169 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:48:06 -0000 Author: trasz Date: Fri Sep 5 14:48:06 2014 New Revision: 271169 URL: http://svnweb.freebsd.org/changeset/base/271169 Log: Turn two errors, which are possible to trigger only by bugs, into assertions. Discussed with: mav@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Sep 5 14:35:34 2014 (r271168) +++ head/usr.sbin/ctld/ctld.c Fri Sep 5 14:48:06 2014 (r271169) @@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_f client_salen = sizeof(client_sa); kernel_accept(&connection_id, &portal_id, (struct sockaddr *)&client_sa, &client_salen); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1806,10 +1804,8 @@ found: &client_salen); if (client_fd < 0) log_err(1, "accept"); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, - client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); + handle_connection(portal, client_fd, (struct sockaddr *)&client_sa, dont_fork); From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 14:58:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B57D8A; Fri, 5 Sep 2014 14:58:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59EAB1F57; Fri, 5 Sep 2014 14:58:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85EwPwZ056063; Fri, 5 Sep 2014 14:58:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85EwPgX056062; Fri, 5 Sep 2014 14:58:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409051458.s85EwPgX056062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 5 Sep 2014 14:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271170 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 14:58:25 -0000 Author: trasz Date: Fri Sep 5 14:58:24 2014 New Revision: 271170 URL: http://svnweb.freebsd.org/changeset/base/271170 Log: Document initiator-portal netmask support. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Fri Sep 5 14:48:06 2014 (r271169) +++ head/usr.sbin/ctld/ctl.conf.5 Fri Sep 5 14:58:24 2014 (r271170) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 2014 +.Dd September 5, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -118,8 +118,9 @@ If not defined, there will be no restric name. Otherwise, only initiators with names matching one of defined ones will be allowed to connect. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address or network. +.It Ic initiator-portal Ao Ar address Ac Ao Ar / prefixlen Ac +Specifies the iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by slash and prefix length. If not defined, there will be no restrictions based on initiator address. Otherwise, only initiators with addresses matching one of defined @@ -178,8 +179,9 @@ Otherwise, only initiators with names ma ones will be allowed to connect. This clause is mutually exclusive with auth-group; one cannot use both in a single target. -.It Ic initiator-portal Ao Ar address Ac -Specifies iSCSI initiator portal - IPv4 or IPv6 address. +.It Ic initiator-portal Ao Ar address Ac Ao Ar / prefixlen Ac +Specifies the iSCSI initiator portal: an IPv4 or IPv6 address, optionally +followed by slash and prefix length. If not defined, there will be no restrictions based on initiator address. Otherwise, only initiators with addresses matching one of defined @@ -234,6 +236,7 @@ pidfile /var/run/ctld.pid auth-group example2 { chap-mutual "user" "secret" "mutualuser" "mutualsecret" chap-mutual "user2" "secret2" "mutualuser" "mutualsecret" + initiator-portal 192.168.1.1/16 } portal-group example2 { From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 15:06:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20C11FE1; Fri, 5 Sep 2014 15:06:09 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ACBF4109C; Fri, 5 Sep 2014 15:06:08 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s85F51It072618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 5 Sep 2014 23:05:02 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s85F51Oc072617; Fri, 5 Sep 2014 23:05:01 +0800 (CST) (envelope-from kevlo) Date: Fri, 5 Sep 2014 23:05:01 +0800 From: Kevin Lo To: Hans Petter Selasky Subject: Re: svn commit: r271159 - in head: . share/man/man4 sys/conf sys/dev/usb sys/dev/usb/misc sys/dev/usb/quirk sys/modules/usb sys/modules/usb/uled Message-ID: <20140905150501.GA72605@ns.kevlo.org> References: <201409051125.s85BPwaE056586@svn.freebsd.org> <20140905130828.GQ2737@kib.kiev.ua> <5409CBA0.3080401@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5409CBA0.3080401@selasky.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 15:06:09 -0000 On Fri, Sep 05, 2014 at 04:41:36PM +0200, Hans Petter Selasky wrote: > > On 09/05/14 15:08, Konstantin Belousov wrote: > > On Fri, Sep 05, 2014 at 11:25:58AM +0000, Kevin Lo wrote: > >> Author: kevlo > >> Date: Fri Sep 5 11:25:58 2014 > >> New Revision: 271159 > >> URL: http://svnweb.freebsd.org/changeset/base/271159 > >> > >> Log: > >> The USB LED driver for the Dream Cheeky WebMail Notifier. > >> > >> Reviewed by: hselasky > >> > >> Added: > >> head/share/man/man4/uled.4 (contents, props changed) > >> head/sys/dev/usb/misc/uled.c (contents, props changed) > >> head/sys/dev/usb/uled_ioctl.h (contents, props changed) > >> head/sys/modules/usb/uled/ > >> head/sys/modules/usb/uled/Makefile (contents, props changed) > >> Modified: > >> head/Makefile > > ^^^^^^^^^ > > > > Hi, > > The "head/Makefile" was not part of the reviewed patch sent to me. Right. There was something wrong with my tree :( > Anyway, USB modules rock also at toplevel ;-) > > --HPS From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 15:53:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 746B4D1E; Fri, 5 Sep 2014 15:53:49 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD511914; Fri, 5 Sep 2014 15:53:49 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C99DFB948; Fri, 5 Sep 2014 11:53:47 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Fri, 5 Sep 2014 10:44:05 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <3070015.668SIdAzOX@ralph.baldwin.cx> <20140905084305.GN2737@kib.kiev.ua> In-Reply-To: <20140905084305.GN2737@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201409051044.05853.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 05 Sep 2014 11:53:47 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 15:53:49 -0000 On Friday, September 05, 2014 4:43:05 am Konstantin Belousov wrote: > On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote: > > On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote: > > > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > > > > I thought about that. I could easily make a parallel array, or perhaps > > > > use a separate 'susppcb' structure that includes a pcb and the savefpu > > > > union and change susppcbs to be an array of those. Which do you prefer? > > > > If we want to move some state out of the PCB on amd64 into this, then a > > > > separate struct for susppcbs might be the sanest. > > > > > > Yes, separate structure seems to be a way forward. > > > > Please see www.freebsd.org/~jhb/patches/susppcb.patch Note that I moved > > fpususpend() out into a C function on amd64 so that resumectx() could still > > operate on just a pcb. This also makes savectx and resumectx more symmetric > > and matches what I ended up doing on i386. This is tested for suspend and > > resume on both i386 and amd64. > > The implementation of fpuresume() in C is definitely an improvement. > > You only moved the fpu context to the susppcb, I think this is good for > now, we will want to move other bits later. > > Do we need to keep pcb layout for KBI compat ? I remember that pcb > size is asserted to properly fit into pcpu area for percpu zones. > But why keep the layout ? I.e. moving all padding bits to the end. I wasn't sure. I thought the padding was there for ABI reasons. If we don't need KBI compat, I would much rather consolidate all the padding at the end. > There is one weird detail, not touched by your patch. Amd64 resume > path calls initializecpu(), while i386 does not. I do not see any > use for the call, the reload of CRX registers by trampoline/resumectx > should already set everything to working state. E.g., enabling XMM > in CR4 after fpu state is restored looks strange. I can test that. > Overall, it looks fine. Do you prefer to have alloc_fpusave() on i386 ? Well, it might be nice to have XSAVE on i386. I'm not sure if Intel has any 32-bit only chips planned that will use AVX or MPX, etc. If they are, then I do think AVX on i386 would be nice to have. Barring XSAVE I think we can just use a static savefpu on i386 for now. We might also consider removing support for 486sx CPUs and requiring an on-CPU FPU for i386. If we do that we might able to use a common fpu.c which would be even nicer. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 16:40:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98E7E1B6; Fri, 5 Sep 2014 16:40:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77DB71DE9; Fri, 5 Sep 2014 16:40:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85GenX1006245; Fri, 5 Sep 2014 16:40:49 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85Gemme006236; Fri, 5 Sep 2014 16:40:48 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201409051640.s85Gemme006236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Fri, 5 Sep 2014 16:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271173 - in head/sys: conf gdb libkern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 16:40:49 -0000 Author: benno Date: Fri Sep 5 16:40:47 2014 New Revision: 271173 URL: http://svnweb.freebsd.org/changeset/base/271173 Log: Add support for gdb's memory searching capabilities to our in-kernel gdb server. Submitted by: Daniel O'Connor Reviewed by: jhb Sponsored by: EMC Isilon Storage Division Added: head/sys/libkern/memmem.c (contents, props changed) Modified: head/sys/conf/files head/sys/gdb/gdb_int.h head/sys/gdb/gdb_main.c head/sys/gdb/gdb_packet.c head/sys/sys/libkern.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Sep 5 15:45:20 2014 (r271172) +++ head/sys/conf/files Fri Sep 5 16:40:47 2014 (r271173) @@ -3176,8 +3176,9 @@ libkern/inet_pton.c standard libkern/jenkins_hash.c standard libkern/mcount.c optional profiling-routine libkern/memcchr.c standard -libkern/memchr.c optional fdt +libkern/memchr.c optional fdt | gdb libkern/memcmp.c standard +libkern/memmem.c optional gdb libkern/qsort.c standard libkern/qsort_r.c standard libkern/random.c standard Modified: head/sys/gdb/gdb_int.h ============================================================================== --- head/sys/gdb/gdb_int.h Fri Sep 5 15:45:20 2014 (r271172) +++ head/sys/gdb/gdb_int.h Fri Sep 5 16:40:47 2014 (r271173) @@ -60,6 +60,9 @@ void gdb_tx_begin(char); int gdb_tx_end(void); int gdb_tx_mem(const unsigned char *, size_t); void gdb_tx_reg(int); +int gdb_rx_bindata(unsigned char *data, size_t datalen, size_t *amt); +int gdb_search_mem(const unsigned char *addr, size_t size, + const unsigned char *pat, size_t patlen, const unsigned char **found); static __inline void gdb_tx_char(char c) Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Fri Sep 5 15:45:20 2014 (r271172) +++ head/sys/gdb/gdb_main.c Fri Sep 5 16:40:47 2014 (r271173) @@ -53,6 +53,8 @@ SET_DECLARE(gdb_dbgport_set, struct gdb_ struct gdb_dbgport *gdb_cur = NULL; int gdb_listening = 0; +static unsigned char gdb_bindata[64]; + static int gdb_init(void) { @@ -254,6 +256,28 @@ gdb_trap(int type, int code) gdb_tx_begin('l'); gdb_tx_end(); } + } else if (gdb_rx_equal("Search:memory:")) { + size_t patlen; + intmax_t addr, size; + const unsigned char *found; + if (gdb_rx_varhex(&addr) || gdb_rx_char() != ';' || + gdb_rx_varhex(&size) || gdb_rx_char() != ';' || + gdb_rx_bindata(gdb_bindata, sizeof(gdb_bindata), &patlen)) { + gdb_tx_err(EINVAL); + break; + } + if (gdb_search_mem((char *)(uintptr_t)addr, size, gdb_bindata, patlen, &found)) { + if (found == 0ULL) + gdb_tx_begin('0'); + else { + gdb_tx_begin('1'); + gdb_tx_char(','); + gdb_tx_hex((intmax_t)(uintptr_t)found, 8); + } + gdb_tx_end(); + } else + gdb_tx_err(EIO); + break; } else if (!gdb_cpu_query()) gdb_tx_empty(); break; Modified: head/sys/gdb/gdb_packet.c ============================================================================== --- head/sys/gdb/gdb_packet.c Fri Sep 5 15:45:20 2014 (r271172) +++ head/sys/gdb/gdb_packet.c Fri Sep 5 16:40:47 2014 (r271173) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -320,3 +321,46 @@ gdb_tx_reg(int regnum) } else gdb_tx_mem(regp, regsz); } + +/* Read binary data up until the end of the packet or until we have datalen decoded bytes */ +int +gdb_rx_bindata(unsigned char *data, size_t datalen, size_t *amt) +{ + int c; + + *amt = 0; + + while (*amt < datalen) { + c = gdb_rx_char(); + /* End of packet? */ + if (c == -1) + break; + /* Escaped character up next */ + if (c == '}') { + /* Truncated packet? Bail out */ + if ((c = gdb_rx_char()) == -1) + return (1); + c ^= 0x20; + } + *(data++) = c & 0xff; + (*amt)++; + } + + return (0); +} + +int +gdb_search_mem(const unsigned char *addr, size_t size, const unsigned char *pat, size_t patlen, const unsigned char **found) +{ + void *prev; + jmp_buf jb; + int ret; + + prev = kdb_jmpbuf(jb); + ret = setjmp(jb); + if (ret == 0) + *found = memmem(addr, size, pat, patlen); + + (void)kdb_jmpbuf(prev); + return ((ret == 0) ? 1 : 0); +} Added: head/sys/libkern/memmem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/memmem.c Fri Sep 5 16:40:47 2014 (r271173) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2005 Pascal Gloor + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +void * +memmem(const void *l, size_t l_len, const void *s, size_t s_len) +{ + register char *cur, *last; + const char *cl = (const char *)l; + const char *cs = (const char *)s; + + /* we need something to compare */ + if (l_len == 0 || s_len == 0) + return NULL; + + /* "s" must be smaller or equal to "l" */ + if (l_len < s_len) + return NULL; + + /* special case where s_len == 1 */ + if (s_len == 1) + return memchr(l, (int)*cs, l_len); + + /* the last position where its possible to find "s" in "l" */ + last = (char *)cl + l_len - s_len; + + for (cur = (char *)cl; cur <= last; cur++) + if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0) + return cur; + + return NULL; +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Fri Sep 5 15:45:20 2014 (r271172) +++ head/sys/sys/libkern.h Fri Sep 5 16:40:47 2014 (r271173) @@ -103,6 +103,7 @@ int locc(int, char *, u_int); void *memchr(const void *s, int c, size_t n); void *memcchr(const void *s, int c, size_t n); int memcmp(const void *b1, const void *b2, size_t len); +void *memmem(const void *l, size_t l_len, const void *s, size_t s_len); void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 16:46:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9625B835; Fri, 5 Sep 2014 16:46:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A5D1ECA; Fri, 5 Sep 2014 16:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85GkSJ8008981; Fri, 5 Sep 2014 16:46:28 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85GkSm0008980; Fri, 5 Sep 2014 16:46:28 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201409051646.s85GkSm0008980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 5 Sep 2014 16:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271174 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 16:46:28 -0000 Author: rwatson Date: Fri Sep 5 16:46:28 2014 New Revision: 271174 URL: http://svnweb.freebsd.org/changeset/base/271174 Log: Clarify a diagnostic printf() in the mbuf code: M_EXT doesn't necessarily imply a cluster is attached; it could also refer to some other sort of external storage (e.g., an sf_buf). MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Sep 5 16:40:47 2014 (r271173) +++ head/sys/sys/mbuf.h Fri Sep 5 16:46:28 2014 (r271174) @@ -672,7 +672,7 @@ m_clget(struct mbuf *m, int how) { if (m->m_flags & M_EXT) - printf("%s: %p mbuf already has cluster\n", __func__, m); + printf("%s: %p mbuf already has external storage\n", __func__, m); m->m_ext.ext_buf = (char *)NULL; uma_zalloc_arg(zone_clust, m, how); /* @@ -698,7 +698,7 @@ m_cljget(struct mbuf *m, int how, int si uma_zone_t zone; if (m && m->m_flags & M_EXT) - printf("%s: %p mbuf already has cluster\n", __func__, m); + printf("%s: %p mbuf already has external storage\n", __func__, m); if (m != NULL) m->m_ext.ext_buf = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 17:05:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D0072BD; Fri, 5 Sep 2014 17:05:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483791149; Fri, 5 Sep 2014 17:05:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85H5qMp019430; Fri, 5 Sep 2014 17:05:52 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85H5qxx019429; Fri, 5 Sep 2014 17:05:52 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201409051705.s85H5qxx019429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 5 Sep 2014 17:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271175 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 17:05:52 -0000 Author: rwatson Date: Fri Sep 5 17:05:51 2014 New Revision: 271175 URL: http://svnweb.freebsd.org/changeset/base/271175 Log: Garbage collect NFSMINOFF() from the NFS stack; this unused macro replicates mbuf-initialisation logic that is best left to centralised mbuf utility code rather than scattered around the kernel. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/nfs/nfsm_subs.h Modified: head/sys/fs/nfs/nfsm_subs.h ============================================================================== --- head/sys/fs/nfs/nfsm_subs.h Fri Sep 5 16:46:28 2014 (r271174) +++ head/sys/fs/nfs/nfsm_subs.h Fri Sep 5 17:05:51 2014 (r271175) @@ -47,13 +47,6 @@ * First define what the actual subs. return */ #define M_HASCL(m) ((m)->m_flags & M_EXT) -#define NFSMINOFF(m) \ - if (M_HASCL(m)) \ - (m)->m_data = (m)->m_ext.ext_buf; \ - else if ((m)->m_flags & M_PKTHDR) \ - (m)->m_data = (m)->m_pktdat; \ - else \ - (m)->m_data = (m)->m_dat #define NFSMSIZ(m) ((M_HASCL(m))?MCLBYTES: \ (((m)->m_flags & M_PKTHDR)?MHLEN:MLEN)) #define NFSM_DATAP(m, s) (m)->m_data += (s) From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 18:07:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ECC0AF8; Fri, 5 Sep 2014 18:07:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 703CC192D; Fri, 5 Sep 2014 18:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85I7GM5048789; Fri, 5 Sep 2014 18:07:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85I7GFG048788; Fri, 5 Sep 2014 18:07:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409051807.s85I7GFG048788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 5 Sep 2014 18:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271178 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 18:07:16 -0000 Author: emaste Date: Fri Sep 5 18:07:15 2014 New Revision: 271178 URL: http://svnweb.freebsd.org/changeset/base/271178 Log: Correct patch paths (remove contrib/llvm/) The example in contrib/llvm/patches/README.TXT fails otherwise. Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff Modified: head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff ============================================================================== --- head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff Fri Sep 5 17:44:10 2014 (r271177) +++ head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff Fri Sep 5 18:07:15 2014 (r271178) @@ -1,7 +1,7 @@ -Index: contrib/llvm/include/llvm/Support/ELF.h +Index: include/llvm/Support/ELF.h =================================================================== ---- contrib/llvm/include/llvm/Support/ELF.h (revision 270019) -+++ contrib/llvm/include/llvm/Support/ELF.h (working copy) +--- include/llvm/Support/ELF.h (revision 270019) ++++ include/llvm/Support/ELF.h (working copy) @@ -437,6 +437,7 @@ R_PPC_GOT16_LO = 15, R_PPC_GOT16_HI = 16, @@ -10,10 +10,10 @@ Index: contrib/llvm/include/llvm/Support R_PPC_REL32 = 26, R_PPC_TLS = 67, R_PPC_DTPMOD32 = 68, -Index: contrib/llvm/lib/Object/ELF.cpp +Index: lib/Object/ELF.cpp =================================================================== ---- contrib/llvm/lib/Object/ELF.cpp (revision 270019) -+++ contrib/llvm/lib/Object/ELF.cpp (working copy) +--- lib/Object/ELF.cpp (revision 270019) ++++ lib/Object/ELF.cpp (working copy) @@ -507,6 +507,7 @@ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_GOT16_LO); LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_GOT16_HI); @@ -22,10 +22,10 @@ Index: contrib/llvm/lib/Object/ELF.cpp LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_REL32); LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_TLS); LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_PPC_DTPMOD32); -Index: contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +Index: lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp (working copy) +--- lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp (revision 270019) ++++ lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp (working copy) @@ -18,6 +18,7 @@ #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" @@ -52,10 +52,10 @@ Index: contrib/llvm/lib/Target/PowerPC/I } -Index: contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp +Index: lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (working copy) +--- lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (revision 270019) ++++ lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp (working copy) @@ -64,7 +64,15 @@ llvm_unreachable("Unimplemented"); case PPC::fixup_ppc_br24: @@ -123,10 +123,10 @@ Index: contrib/llvm/lib/Target/PowerPC/M break; } break; -Index: contrib/llvm/lib/Target/PowerPC/PPC.h +Index: lib/Target/PowerPC/PPC.h =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPC.h (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPC.h (working copy) +--- lib/Target/PowerPC/PPC.h (revision 270019) ++++ lib/Target/PowerPC/PPC.h (working copy) @@ -53,10 +53,11 @@ // PPC Specific MachineOperand flags. MO_NO_FLAG, @@ -143,10 +143,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to /// the function's picbase, e.g. lo16(symbol-picbase). -Index: contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +Index: lib/Target/PowerPC/PPCAsmPrinter.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp (working copy) +--- lib/Target/PowerPC/PPCAsmPrinter.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCAsmPrinter.cpp (working copy) @@ -19,6 +19,7 @@ #define DEBUG_TYPE "asmprinter" #include "PPC.h" @@ -578,10 +578,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P } } -Index: contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp +Index: lib/Target/PowerPC/PPCFrameLowering.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp (working copy) +--- lib/Target/PowerPC/PPCFrameLowering.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCFrameLowering.cpp (working copy) @@ -299,7 +299,7 @@ const PPCRegisterInfo *RegInfo = static_cast(MF.getTarget().getRegisterInfo()); @@ -664,10 +664,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P // Allocate the frame index for the base pointer save area. BPSI = MFI->CreateFixedObject(isPPC64? 8 : 4, BPOffset, true); // Save the result. -Index: contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h +Index: lib/Target/PowerPC/PPCFrameLowering.h =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h (working copy) +--- lib/Target/PowerPC/PPCFrameLowering.h (revision 270019) ++++ lib/Target/PowerPC/PPCFrameLowering.h (working copy) @@ -96,12 +96,14 @@ /// getBasePointerSaveOffset - Return the previous frame offset to save the @@ -685,10 +685,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P } /// getLinkageSize - Return the size of the PowerPC ABI linkage area. -Index: contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +Index: lib/Target/PowerPC/PPCISelDAGToDAG.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (working copy) +--- lib/Target/PowerPC/PPCISelDAGToDAG.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCISelDAGToDAG.cpp (working copy) @@ -15,6 +15,7 @@ #define DEBUG_TYPE "ppc-codegen" #include "PPC.h" @@ -748,10 +748,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P case PPCISD::VADD_SPLAT: { // This expands into one of three sequences, depending on whether // the first operand is odd or even, positive or negative. -Index: contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +Index: lib/Target/PowerPC/PPCISelLowering.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp (working copy) +--- lib/Target/PowerPC/PPCISelLowering.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCISelLowering.cpp (working copy) @@ -670,6 +670,7 @@ case PPCISD::ADDIS_TOC_HA: return "PPCISD::ADDIS_TOC_HA"; case PPCISD::LD_TOC_L: return "PPCISD::LD_TOC_L"; @@ -972,10 +972,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P MachineInstrBuilder MIB; -Index: contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h +Index: lib/Target/PowerPC/PPCISelLowering.h =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h (working copy) +--- lib/Target/PowerPC/PPCISelLowering.h (revision 270019) ++++ lib/Target/PowerPC/PPCISelLowering.h (working copy) @@ -177,6 +177,12 @@ CR6SET, CR6UNSET, @@ -989,10 +989,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P /// G8RC = ADDIS_GOT_TPREL_HA %X2, Symbol - Used by the initial-exec /// TLS model, produces an ADDIS8 instruction that adds the GOT /// base to sym\@got\@tprel\@ha. -Index: contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td +Index: lib/Target/PowerPC/PPCInstr64Bit.td =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td (working copy) +--- lib/Target/PowerPC/PPCInstr64Bit.td (revision 270019) ++++ lib/Target/PowerPC/PPCInstr64Bit.td (working copy) @@ -36,10 +36,6 @@ def tocentry : Operand { let MIOperandInfo = (ops i64imm:$imm); @@ -1004,10 +1004,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P def tlsreg : Operand { let EncoderMethod = "getTLSRegEncoding"; let ParserMatchClass = PPCTLSRegOperand; -Index: contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td +Index: lib/Target/PowerPC/PPCInstrInfo.td =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td (working copy) +--- lib/Target/PowerPC/PPCInstrInfo.td (revision 270019) ++++ lib/Target/PowerPC/PPCInstrInfo.td (working copy) @@ -57,6 +57,9 @@ SDTCisPtrTy<0>, SDTCisVT<1, i32> ]>; @@ -1130,10 +1130,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P // Standard shifts. These are represented separately from the real shifts above // so that we can distinguish between shifts that allow 5-bit and 6-bit shift // amounts. -Index: contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp +Index: lib/Target/PowerPC/PPCMCInstLower.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp (working copy) +--- lib/Target/PowerPC/PPCMCInstLower.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCMCInstLower.cpp (working copy) @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// @@ -1188,10 +1188,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P const MCExpr *Expr = MCSymbolRefExpr::Create(Symbol, RefKind, Ctx); if (!MO.isJTI() && MO.getOffset()) -Index: contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp +Index: lib/Target/PowerPC/PPCMachineFunctionInfo.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp (working copy) +--- lib/Target/PowerPC/PPCMachineFunctionInfo.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCMachineFunctionInfo.cpp (working copy) @@ -8,8 +8,16 @@ //===----------------------------------------------------------------------===// @@ -1209,10 +1209,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P + return MF.getContext().GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix())+ + Twine(MF.getFunctionNumber())+"$poff"); +} -Index: contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h +Index: lib/Target/PowerPC/PPCMachineFunctionInfo.h =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h (working copy) +--- lib/Target/PowerPC/PPCMachineFunctionInfo.h (revision 270019) ++++ lib/Target/PowerPC/PPCMachineFunctionInfo.h (working copy) @@ -92,6 +92,12 @@ /// 64-bit SVR4 ABI. SmallVector MustSaveCRs; @@ -1249,10 +1249,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P }; } // end of namespace llvm -Index: contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp +Index: lib/Target/PowerPC/PPCRegisterInfo.cpp =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp (working copy) +--- lib/Target/PowerPC/PPCRegisterInfo.cpp (revision 270019) ++++ lib/Target/PowerPC/PPCRegisterInfo.cpp (working copy) @@ -199,7 +199,16 @@ if (PPCFI->needsFP(MF)) Reserved.set(PPC::R31); @@ -1287,10 +1287,10 @@ Index: contrib/llvm/lib/Target/PowerPC/P } bool PPCRegisterInfo::hasBasePointer(const MachineFunction &MF) const { -Index: contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h +Index: lib/Target/PowerPC/PPCSubtarget.h =================================================================== ---- contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h (revision 270019) -+++ contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h (working copy) +--- lib/Target/PowerPC/PPCSubtarget.h (revision 270019) ++++ lib/Target/PowerPC/PPCSubtarget.h (working copy) @@ -189,6 +189,9 @@ /// isBGQ - True if this is a BG/Q platform. bool isBGQ() const { return TargetTriple.getVendor() == Triple::BGQ; } From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 18:08:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95D5DC3F; Fri, 5 Sep 2014 18:08:14 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 56BE11939; Fri, 5 Sep 2014 18:08:13 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 90482783714; Sat, 6 Sep 2014 03:43:06 +1000 (EST) Date: Sat, 6 Sep 2014 03:43:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica In-Reply-To: <201409051044.05853.jhb@freebsd.org> Message-ID: <20140906033051.A1982@besplex.bde.org> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <3070015.668SIdAzOX@ralph.baldwin.cx> <20140905084305.GN2737@kib.kiev.ua> <201409051044.05853.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=6p4dWWagHjQA:10 a=gxbj2yEgeIQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=sZ-NFdfg8zaX1CIR4RwA:9 a=CjuIK1q_8ugA:10 a=Jdm36EHaYjsA:10 a=afaCV70lbk4A:10 Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 18:08:14 -0000 On Fri, 5 Sep 2014, John Baldwin wrote: > We might also consider removing support for 486sx CPUs and requiring an > on-CPU FPU for i386. If we do that we might able to use a common fpu.c > which would be even nicer. You mean a common npx.c. The 'x' part of npx.c is much more descriptive now than it was when the only extension was the floating point one. The 'n' part of npx.c is now too specific, but not as specific as the 'fp' part of fpu.c. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 18:11:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F3E9EBF; Fri, 5 Sep 2014 18:11:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EECE219FF; Fri, 5 Sep 2014 18:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85IBaGA050767; Fri, 5 Sep 2014 18:11:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85IBaoc050765; Fri, 5 Sep 2014 18:11:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409051811.s85IBaoc050765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Sep 2014 18:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271179 - head/lib/libc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 18:11:37 -0000 Author: andrew Date: Fri Sep 5 18:11:36 2014 New Revision: 271179 URL: http://svnweb.freebsd.org/changeset/base/271179 Log: Add the fp{get,set}{mask,round} functions to the public symbols in the map. These are only exported for armv6hf as the soft-float ABIs have these in the softfloat Symbol.map file. Added: head/lib/libc/arm/Symbol_vfp.map (contents, props changed) Modified: head/lib/libc/arm/Makefile.inc Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Fri Sep 5 18:07:15 2014 (r271178) +++ head/lib/libc/arm/Makefile.inc Fri Sep 5 18:11:36 2014 (r271179) @@ -16,3 +16,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" .endif +.if ${MACHINE_ARCH} == "armv6hf" +SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map +.endif + Added: head/lib/libc/arm/Symbol_vfp.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/Symbol_vfp.map Fri Sep 5 18:11:36 2014 (r271179) @@ -0,0 +1,10 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.0 { + fpgetmask; + fpgetround; + fpsetmask; + fpsetround; +}; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 18:11:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B84AFF4; Fri, 5 Sep 2014 18:11:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A114E1A00; Fri, 5 Sep 2014 18:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85IBdBe050812; Fri, 5 Sep 2014 18:11:39 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85IBdoH050811; Fri, 5 Sep 2014 18:11:39 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409051811.s85IBdoH050811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 5 Sep 2014 18:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271180 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 18:11:40 -0000 Author: dumbbell Date: Fri Sep 5 18:11:39 2014 New Revision: 271180 URL: http://svnweb.freebsd.org/changeset/base/271180 Log: vt_vga: vd_setpixel_t and vd_drawrect_t are noop in text mode MFC after: 3 days Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Fri Sep 5 18:11:36 2014 (r271179) +++ head/sys/dev/vt/hw/vga/vt_vga.c Fri Sep 5 18:11:39 2014 (r271180) @@ -352,6 +352,9 @@ static void vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color) { + if (vd->vd_flags & VDF_TEXTMODE) + return; + vga_bitblt_put(vd, (y * VT_VGA_WIDTH / 8) + (x / 8), color, 0x80 >> (x % 8)); } @@ -362,6 +365,9 @@ vga_drawrect(struct vt_device *vd, int x { int x, y; + if (vd->vd_flags & VDF_TEXTMODE) + return; + for (y = y1; y <= y2; y++) { if (fill || (y == y1) || (y == y2)) { for (x = x1; x <= x2; x++) From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:00:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B917791; Fri, 5 Sep 2014 19:00:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8D91E9B; Fri, 5 Sep 2014 19:00:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85J0U1J074756; Fri, 5 Sep 2014 19:00:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85J0UeI074755; Fri, 5 Sep 2014 19:00:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409051900.s85J0UeI074755@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Sep 2014 19:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271181 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 19:00:31 -0000 Author: andrew Date: Fri Sep 5 19:00:30 2014 New Revision: 271181 URL: http://svnweb.freebsd.org/changeset/base/271181 Log: Add the virtual timer irq to the list of interrupts we enable on secondary cores. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Fri Sep 5 18:11:39 2014 (r271180) +++ head/sys/arm/arm/gic.c Fri Sep 5 19:00:30 2014 (r271181) @@ -166,7 +166,10 @@ gic_init_secondary(void) /* Enable interrupt distribution */ gic_d_write_4(GICD_CTLR, 0x01); - /* Activate IRQ 29-30, ie private timer (secure & non-secure) IRQs */ + /* + * Activate the timer interrupts: virtual, secure, and non-secure. + */ + gic_d_write_4(GICD_ISENABLER(27 >> 5), (1UL << (27 & 0x1F))); gic_d_write_4(GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F))); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:50:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F31636D9; Fri, 5 Sep 2014 19:50:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC6414A5; Fri, 5 Sep 2014 19:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85JoIHn000445; Fri, 5 Sep 2014 19:50:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85JoI3r000416; Fri, 5 Sep 2014 19:50:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409051950.s85JoI3r000416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 5 Sep 2014 19:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271182 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 19:50:19 -0000 Author: glebius Date: Fri Sep 5 19:50:18 2014 New Revision: 271182 URL: http://svnweb.freebsd.org/changeset/base/271182 Log: Set vnet context before accessing V_socket_hhh[]. Submitted by: "Hiroo Ono (å°é‡Žå¯›ç”Ÿ)" Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181) +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182) @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) return 1; } + CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) /* This hook returning non-zero indicates an event, not error */ return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + CURVNET_RESTORE(); return (0); } @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint SOCKBUF_LOCK_ASSERT(&so->so_snd); kn->kn_data = sbspace(&so->so_snd); + CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); + CURVNET_RESTORE(); if (so->so_snd.sb_state & SBS_CANTSENDMORE) { kn->kn_flags |= EV_EOF; From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:54:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C26CD868; Fri, 5 Sep 2014 19:54:16 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15F41585; Fri, 5 Sep 2014 19:54:15 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so6260wiv.17 for ; Fri, 05 Sep 2014 12:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hDFR6r9y0rFBk3W1/TNVeiLEgXbpDeej96bmlhRt/sk=; b=LquAuxI1YISnqigX5sM0Bc9+GfVvLjxxYtwsaK9jrkne7MAo584o9X6Qhdjqmf4BHT Jf7fr4z7h/0yUnJfLza/hDMKp/pKDuq4v4c8ttd5w74F6E126ohxWsUZ0wQp5++txtb1 RSJk+S4UAUOr0VSPswa8PorfSjR0a2otNJg9SJHLgjmgv51qUeNs0JxgMPjOc3v9X0EP M3bwxlrYtMnUPdAgCblW+v/nrQjDtRSFSDVcTPx9JPrBp3+F4vGjCdJAjTzAyQ9mbZLx Zg02Qxy0Nm3mC+7tiSToQkOKviKC2iJW7vUu8z94kux6CXHay7iMxRUedEAUA03HzfZi BV3w== X-Received: by 10.194.191.132 with SMTP id gy4mr6992450wjc.35.1409946854211; Fri, 05 Sep 2014 12:54:14 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id g8sm2844675wiy.19.2014.09.05.12.54.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 12:54:13 -0700 (PDT) Date: Fri, 5 Sep 2014 21:54:11 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r271182 - head/sys/kern Message-ID: <20140905195410.GA722@dft-labs.eu> References: <201409051950.s85JoI3r000416@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201409051950.s85JoI3r000416@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 19:54:16 -0000 On Fri, Sep 05, 2014 at 07:50:18PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Sep 5 19:50:18 2014 > New Revision: 271182 > URL: http://svnweb.freebsd.org/changeset/base/271182 > > Log: > Set vnet context before accessing V_socket_hhh[]. > > Submitted by: "Hiroo Ono (å°é‡Žå¯›ç”Ÿ)" > > Modified: > head/sys/kern/uipc_socket.c > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181) > +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182) > @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) > return 1; > } > > + CURVNET_SET(so->so_vnet); > if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) > /* This hook returning non-zero indicates an event, not error */ > return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > + CURVNET_RESTORE(); > should not this be something like: error = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); CURVNET_RESTORE(); return (error); ? > return (0); > } > @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint > SOCKBUF_LOCK_ASSERT(&so->so_snd); > kn->kn_data = sbspace(&so->so_snd); > > + CURVNET_SET(so->so_vnet); > if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) > hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); > + CURVNET_RESTORE(); > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > kn->kn_flags |= EV_EOF; > -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:59:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47012A04; Fri, 5 Sep 2014 19:59:23 +0000 (UTC) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AAEC15B5; Fri, 5 Sep 2014 19:59:23 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id fa1so22922033pad.40 for ; Fri, 05 Sep 2014 12:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=GwxKzu39H+dFh4lPSee3iQMh5EuCjF4Gr+UzHxgtVLI=; b=rgLx/mlQann8E1jKUppt8HeMjN7Xj1qUT829PC/X84DK7+VlJ21Vf3/mqf5i+TsTsB yImOQxbq/S6meNREdpX/w5dREPyw+0uLQ7KEyWihFDT7bX5zI7tbI4LFMeP4TmiESOZO ul6aRYN77W/Twpk0KfdrOOsGsrdNTTKMnLy31T4I4ODg0MJbyBSFnIflenH28lERBo/1 obx9wAc2mG+RSD2noMYhdMrxFIofo7SCDJrGoJfo6oSmQH017D2EZhZto1R8GNhFSAKJ AmHySmRS8poInNgGkQ2Wb34B/b+td+E00uwSK0l/0uICxXCD8eFXk5WuUVEh6+epYk81 foLg== X-Received: by 10.67.23.136 with SMTP id ia8mr1205597pad.125.1409947162569; Fri, 05 Sep 2014 12:59:22 -0700 (PDT) Received: from [10.88.239.179] (mobile-166-137-215-074.mycingular.net. [166.137.215.74]) by mx.google.com with ESMTPSA id nj7sm2487319pdb.10.2014.09.05.12.59.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 12:59:21 -0700 (PDT) References: <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> Mime-Version: 1.0 (1.0) In-Reply-To: <20140905195410.GA722@dft-labs.eu> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: quoted-printable Message-Id: X-Mailer: iPhone Mail (11D257) From: Garrett Cooper Subject: Re: svn commit: r271182 - head/sys/kern Date: Fri, 5 Sep 2014 12:59:12 -0700 To: Mateusz Guzik Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 19:59:23 -0000 > On Sep 5, 2014, at 12:54, Mateusz Guzik wrote: >=20 >> On Fri, Sep 05, 2014 at 07:50:18PM +0000, Gleb Smirnoff wrote: >> Author: glebius >> Date: Fri Sep 5 19:50:18 2014 >> New Revision: 271182 >> URL: http://svnweb.freebsd.org/changeset/base/271182 >>=20 >> Log: >> Set vnet context before accessing V_socket_hhh[]. >>=20 >> Submitted by: "Hiroo Ono (=1B$B>.Ln42@8=1B(B)" >>=20 >> Modified: >> head/sys/kern/uipc_socket.c >>=20 >> Modified: head/sys/kern/uipc_socket.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181) >> +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182) >> @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) >> return 1; >> } >>=20 >> + CURVNET_SET(so->so_vnet); >> if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) >> /* This hook returning non-zero indicates an event, not error */ >> return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); >> + CURVNET_RESTORE(); >=20 > should not this be something like: > error =3D hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); > CURVNET_RESTORE(); > return (error); > ? Probably :/.. >> return (0); >> } >> @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint >> SOCKBUF_LOCK_ASSERT(&so->so_snd); >> kn->kn_data =3D sbspace(&so->so_snd); >>=20 >> + CURVNET_SET(so->so_vnet); >> if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) >> hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); >> + CURVNET_RESTORE(); >>=20 >> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >> kn->kn_flags |=3D EV_EOF; >=20 > --=20 > Mateusz Guzik >=20 From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 21:15:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 299A7E58; Fri, 5 Sep 2014 21:15:17 +0000 (UTC) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA95E1E70; Fri, 5 Sep 2014 21:15:16 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id i50so12647659qgf.14 for ; Fri, 05 Sep 2014 14:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=o5nc5cvIBE5ecWtMnvefIA1DYXOrDJcIVN6PYKMo9nM=; b=cb8uPa2304Hrf//4ycynjwwXb3VWAPEsTjKpkoTsg1y2cFqorzD9shKSMH1IZsFocj 8b4HqHSLXHuOmB7QnaZio/CmFc/qddqJEfruPyoXWkYabfUPBHgt9fz8Bytta7ES2BOb f2ey5K90B90B+FWoP9w6WvfpiTaK2mR0Ijoq0x9m6PAB/pQXfu/u84D9eiNv2CYLyWIz a2ICi5nH1EGUmwNbzQoH1JNdYzPdHbzbQwEH3ijSRn4KRifrrYWPUWAn7DN8ogcp5gE5 JrBLDKHJPbRdWGdekdMsDYp1Twuf9jZFN7EUtstJd4nEQRFTbvGvFzgvY9cTPTi9i6Q1 6YtQ== MIME-Version: 1.0 X-Received: by 10.224.75.73 with SMTP id x9mr22733328qaj.63.1409951715232; Fri, 05 Sep 2014 14:15:15 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Fri, 5 Sep 2014 14:15:15 -0700 (PDT) In-Reply-To: References: <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> Date: Fri, 5 Sep 2014 14:15:15 -0700 X-Google-Sender-Auth: 5toLIEhSFI0HSzA5Rf4ui1Sm93s Message-ID: Subject: Re: svn commit: r271182 - head/sys/kern From: Adrian Chadd To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mateusz Guzik , "src-committers@freebsd.org" , Gleb Smirnoff X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 21:15:17 -0000 I'm building a vimage kernel now to at least compile test a fix. Thanks, -a On 5 September 2014 12:59, Garrett Cooper wrote: > >> On Sep 5, 2014, at 12:54, Mateusz Guzik wrote: >> >>> On Fri, Sep 05, 2014 at 07:50:18PM +0000, Gleb Smirnoff wrote: >>> Author: glebius >>> Date: Fri Sep 5 19:50:18 2014 >>> New Revision: 271182 >>> URL: http://svnweb.freebsd.org/changeset/base/271182 >>> >>> Log: >>> Set vnet context before accessing V_socket_hhh[]. >>> >>> Submitted by: "Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=E7=94=9F)" >>> >>> Modified: >>> head/sys/kern/uipc_socket.c >>> >>> Modified: head/sys/kern/uipc_socket.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181= ) >>> +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182= ) >>> @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) >>> return 1; >>> } >>> >>> + CURVNET_SET(so->so_vnet); >>> if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) >>> /* This hook returning non-zero indicates an event, not error */ >>> return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); >>> + CURVNET_RESTORE(); >> >> should not this be something like: >> error =3D hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); >> CURVNET_RESTORE(); >> return (error); >> ? > > Probably :/.. > > >>> return (0); >>> } >>> @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint >>> SOCKBUF_LOCK_ASSERT(&so->so_snd); >>> kn->kn_data =3D sbspace(&so->so_snd); >>> >>> + CURVNET_SET(so->so_vnet); >>> if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) >>> hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); >>> + CURVNET_RESTORE(); >>> >>> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >>> kn->kn_flags |=3D EV_EOF; >> >> -- >> Mateusz Guzik >> > From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 22:35:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D75C402; Fri, 5 Sep 2014 22:35:37 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B950E1932; Fri, 5 Sep 2014 22:35:36 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id cc10so222636wib.1 for ; Fri, 05 Sep 2014 15:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=yvDxkt9Npkqy4uC3mVwSX5djbYS3LD4X+IHVWhdS49E=; b=ovxiLqCsQoyb61pQOUrdZQbJz7GoDA+3xrDJ3lwLSGiqhnMZ4tY0VT4atYW6Gr5kEn WuGU8RrNvJlxScxyG8GGxQ+yeo9wbpSs+qLhYIIx8fdnXcDCfmBRStdwO4Z951GklHLk M3o003kmI6fPmrvEAPKdC3oOH3OIXT4cMlIfLhW5p+rkPeS00Xj12ZNLD2Mnkci/lX3F IE/RFTNerl3AcHDEizM2rjDDq07nm+vLQQ4ydmYS4Fny8YvZb4mQ/Q1HqzsOeQhApXA0 yBngms1NJM5MlGqJ9AdzpyBXtJkFZyzdYD8fSGWnbm5uTuCCKlbSmflJHO4ahHo0gG7n ulkg== X-Received: by 10.180.212.50 with SMTP id nh18mr6226598wic.81.1409956534775; Fri, 05 Sep 2014 15:35:34 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id hi4sm2742019wjb.46.2014.09.05.15.35.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 15:35:33 -0700 (PDT) Date: Sat, 6 Sep 2014 00:35:26 +0200 From: Mateusz Guzik To: Sean Bruno Subject: Re: svn commit: r271141 - in head/sys: kern sys Message-ID: <20140905223526.GB722@dft-labs.eu> References: <201409042131.s84LVPh3065497@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409042131.s84LVPh3065497@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 22:35:37 -0000 On Thu, Sep 04, 2014 at 09:31:25PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Thu Sep 4 21:31:25 2014 > New Revision: 271141 > URL: http://svnweb.freebsd.org/changeset/base/271141 > > Log: > Allow multiple image activators to run on the same execution by changing > imgp->interpreted to a bitmask instead of, functionally, a bool. Each > imgactivator now requires its own flag in interpreted to indicate whether > or not it has already examined argv[0]. > > Change imgp->interpreted to an unsigned char to add one extra bit for > future use. > > With this change, one can execute a shell script from a 64bit host native > make and still get the binmisc image activator to fire for the script > interpreter. Prior to this, execution would fail. > > Phabric: https://reviews.freebsd.org/D696 > Reviewed by: jhb@ > MFC after: 4 weeks > > Modified: > head/sys/kern/imgact_binmisc.c > head/sys/kern/imgact_shell.c > head/sys/sys/imgact.h > > Modified: head/sys/kern/imgact_binmisc.c > ============================================================================== > --- head/sys/kern/imgact_binmisc.c Thu Sep 4 21:28:25 2014 (r271140) > +++ head/sys/kern/imgact_binmisc.c Thu Sep 4 21:31:25 2014 (r271141) > @@ -600,12 +600,12 @@ imgact_binmisc_exec(struct image_params > } > > /* No interpreter nesting allowed. */ > - if (imgp->interpreted) { > + if (imgp->interpreted & IMGACT_BINMISC) { > mtx_unlock(&interp_list_mtx); > return (ENOEXEC); > } > Unrealated, but I have to ask: can't this be converted to an rmlock? -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 23:30:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A1D5494; Fri, 5 Sep 2014 23:30:26 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DACE01E69; Fri, 5 Sep 2014 23:30:25 +0000 (UTC) Received: by mail-qg0-f54.google.com with SMTP id q108so5202730qgd.41 for ; Fri, 05 Sep 2014 16:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+LBI1b7P+DbOISbCuANyPfyqhgnzrbbAGawtISn9hSg=; b=f7+c3/AeDZrSR81vTBMGfEnXA0vkemX0KvlJNMDHDfHlC6L0/MJcOnb0O2qk4ibDCc z+jkRSjXXOHW35n22hEIyWunJbmYHNxaCKIprU9HPrE+avYmar51bz+VPeoeYZHEmcG1 Cy844BYaUOrH0noK17tB4FcW9nQiZCNahSdcWdoH07WqxB3zxnXWH3N/eHzknQk3IPQt alwrdJpB+iAgRwt1wGYKm2FzrPM9zyeMCvn3okNYQ7i2U95I2t85szOxKYAHak7E1x2/ e8ww0lTq6EpjmNn84q3/fO+6XmwkmbyLf4pOjfHp6cU4RQvjutbIdby9kpJKM3t9vwxF mrxw== MIME-Version: 1.0 X-Received: by 10.224.151.69 with SMTP id b5mr23562606qaw.37.1409959824710; Fri, 05 Sep 2014 16:30:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Fri, 5 Sep 2014 16:30:24 -0700 (PDT) In-Reply-To: References: <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> Date: Fri, 5 Sep 2014 16:30:24 -0700 X-Google-Sender-Auth: 1slcYaK-PkLvHcLHi_e7zdopuyE Message-ID: Subject: Re: svn commit: r271182 - head/sys/kern From: Adrian Chadd To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mateusz Guzik , "src-committers@freebsd.org" , Gleb Smirnoff X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 23:30:26 -0000 How's this look? adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/ Index: sys/kern/uipc_socket.c =================================================================== --- sys/kern/uipc_socket.c (revision 271182) +++ sys/kern/uipc_socket.c (working copy) @@ -448,10 +448,12 @@ mac_socket_destroy(so); #endif CURVNET_SET(so->so_vnet); - if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) + if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) { hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); - CURVNET_RESTORE(); - + CURVNET_RESTORE(); + } else { + CURVNET_RESTORE(); + } crfree(so->so_cred); khelp_destroy_osd(&so->osd); sx_destroy(&so->so_snd.sb_sx); @@ -3245,6 +3247,7 @@ filt_soread(struct knote *kn, long hint) { struct socket *so; + int ret; so = kn->kn_fp->f_data; SOCKBUF_LOCK_ASSERT(&so->so_rcv); @@ -3266,11 +3269,15 @@ } CURVNET_SET(so->so_vnet); - if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) + if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) { /* This hook returning non-zero indicates an event, not error */ - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); - CURVNET_RESTORE(); - + ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + CURVNET_RESTORE(); + return (ret); + } else { + CURVNET_RESTORE(); + } + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 23:36:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44900654; Fri, 5 Sep 2014 23:36:24 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1841F17; Fri, 5 Sep 2014 23:36:23 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id m15so12344865wgh.35 for ; Fri, 05 Sep 2014 16:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5K02UaCExTtY21L0Uq+DAxZq50TmnuyxA2gl4r7VyVg=; b=FNnDgSSmf4a0iWBU9nwhangMT8WjFYBJCth++ftkGtjgnQLNF252YxVwoG53gVex9l afSJtzsv6CyeeNFwaNmU2wQanexMlk/LF1cdDmPzlbiqp/shKBeaVbwEUhduedaVrE9C 35C9oIDiFDvBbMWCEPiis6VdNieFT65YQQ2gud363QXH/mppHg3ol1cmz8XQdjxWGDKm xjj5bIwAUvuTMfQoV5BZVl6//LlFDO7FL1eyot6Y9hR4SLNbAWIekjyiTXU33jcxxoKV UPcgMBDlhbKiwvlln9cpv87IU+WtKzELUA+rqZWZuRovl7SA0uhJCNA31h7wB1FZr6UR QPmw== X-Received: by 10.180.85.136 with SMTP id h8mr6793112wiz.67.1409960181252; Fri, 05 Sep 2014 16:36:21 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id r19sm3451621wik.0.2014.09.05.16.36.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 16:36:20 -0700 (PDT) Date: Sat, 6 Sep 2014 01:36:12 +0200 From: Mateusz Guzik To: Adrian Chadd Subject: Re: svn commit: r271182 - head/sys/kern Message-ID: <20140905233612.GF722@dft-labs.eu> References: <201409051950.s85JoI3r000416@svn.freebsd.org> <20140905195410.GA722@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" , Garrett Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 23:36:24 -0000 On Fri, Sep 05, 2014 at 04:30:24PM -0700, Adrian Chadd wrote: > How's this look? > Malformed. :-P I would prefer: diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c6c3152..de72da5 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3245,6 +3245,7 @@ static int filt_soread(struct knote *kn, long hint) { struct socket *so; + int ret; so = kn->kn_fp->f_data; SOCKBUF_LOCK_ASSERT(&so->so_rcv); @@ -3267,11 +3268,12 @@ filt_soread(struct knote *kn, long hint) CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) - /* This hook returning non-zero indicates an event, not error */ - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + ret = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); + else + ret = 0; CURVNET_RESTORE(); - return (0); + return (ret); } static void But I'm fine either way. > > adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/ > > Index: sys/kern/uipc_socket.c > > =================================================================== > > --- sys/kern/uipc_socket.c (revision 271182) > > +++ sys/kern/uipc_socket.c (working copy) > > @@ -448,10 +448,12 @@ > > mac_socket_destroy(so); > > #endif > > CURVNET_SET(so->so_vnet); > > - if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) > > + if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) { > > hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); > > - CURVNET_RESTORE(); > > - > > + CURVNET_RESTORE(); > > + } else { > > + CURVNET_RESTORE(); > > + } > > crfree(so->so_cred); > > khelp_destroy_osd(&so->osd); > > sx_destroy(&so->so_snd.sb_sx); > > @@ -3245,6 +3247,7 @@ > > filt_soread(struct knote *kn, long hint) > > { > > struct socket *so; > > + int ret; > > > > so = kn->kn_fp->f_data; > > SOCKBUF_LOCK_ASSERT(&so->so_rcv); > > @@ -3266,11 +3269,15 @@ > > } > > > > CURVNET_SET(so->so_vnet); > > - if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) > > + if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) { > > /* This hook returning non-zero indicates an event, not error */ > > - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > > - CURVNET_RESTORE(); > > - > > + ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > > + CURVNET_RESTORE(); > > + return (ret); > > + } else { > > + CURVNET_RESTORE(); > > + } > > + > > return (0); > > } -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 23:56:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B3BDA7B; Fri, 5 Sep 2014 23:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 372FC1147; Fri, 5 Sep 2014 23:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85NuQqX019296; Fri, 5 Sep 2014 23:56:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85NuQIg019295; Fri, 5 Sep 2014 23:56:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409052356.s85NuQIg019295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 5 Sep 2014 23:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271183 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 23:56:26 -0000 Author: mjg Date: Fri Sep 5 23:56:25 2014 New Revision: 271183 URL: http://svnweb.freebsd.org/changeset/base/271183 Log: Plug unnecessary fp assignments in kern_fcntl. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Sep 5 19:50:18 2014 (r271182) +++ head/sys/kern/kern_descrip.c Fri Sep 5 23:56:25 2014 (r271183) @@ -509,7 +509,7 @@ kern_fcntl(struct thread *td, int fd, in case F_GETFD: FILEDESC_SLOCK(fdp); - if ((fp = fget_locked(fdp, fd)) == NULL) { + if (fget_locked(fdp, fd) == NULL) { FILEDESC_SUNLOCK(fdp); error = EBADF; break; @@ -522,7 +522,7 @@ kern_fcntl(struct thread *td, int fd, in case F_SETFD: FILEDESC_XLOCK(fdp); - if ((fp = fget_locked(fdp, fd)) == NULL) { + if (fget_locked(fdp, fd) == NULL) { FILEDESC_XUNLOCK(fdp); error = EBADF; break; From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 08:00:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB56F993; Sat, 6 Sep 2014 08:00:48 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 428061329; Sat, 6 Sep 2014 08:00:48 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8680gPN054878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Sep 2014 11:00:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8680gPN054878 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8680gYW054876; Sat, 6 Sep 2014 11:00:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 6 Sep 2014 11:00:42 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Message-ID: <20140906080042.GT2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <3070015.668SIdAzOX@ralph.baldwin.cx> <20140905084305.GN2737@kib.kiev.ua> <201409051044.05853.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b/WH2/j5QGsRzh1z" Content-Disposition: inline In-Reply-To: <201409051044.05853.jhb@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 08:00:48 -0000 --b/WH2/j5QGsRzh1z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2014 at 10:44:05AM -0400, John Baldwin wrote: > On Friday, September 05, 2014 4:43:05 am Konstantin Belousov wrote: > > On Thu, Sep 04, 2014 at 10:50:25PM -0400, John Baldwin wrote: > > > On Tuesday, September 02, 2014 06:41:27 PM Konstantin Belousov wrote: > > > > On Tue, Sep 02, 2014 at 11:00:57AM -0400, John Baldwin wrote: > > > > > I thought about that. I could easily make a parallel array, or p= erhaps > > > > > use a separate 'susppcb' structure that includes a pcb and the sa= vefpu > > > > > union and change susppcbs to be an array of those. Which do you = prefer?=20 > > > > > If we want to move some state out of the PCB on amd64 into this, = then a > > > > > separate struct for susppcbs might be the sanest. > > > >=20 > > > > Yes, separate structure seems to be a way forward. > > >=20 > > > Please see www.freebsd.org/~jhb/patches/susppcb.patch Note that I mo= ved > > > fpususpend() out into a C function on amd64 so that resumectx() could= still=20 > > > operate on just a pcb. This also makes savectx and resumectx more sy= mmetric > > > and matches what I ended up doing on i386. This is tested for suspen= d and > > > resume on both i386 and amd64. > >=20 > > The implementation of fpuresume() in C is definitely an improvement. > >=20 > > You only moved the fpu context to the susppcb, I think this is good for > > now, we will want to move other bits later. > >=20 > > Do we need to keep pcb layout for KBI compat ? I remember that pcb > > size is asserted to properly fit into pcpu area for percpu zones. > > But why keep the layout ? I.e. moving all padding bits to the end. >=20 > I wasn't sure. I thought the padding was there for ABI reasons. If we d= on't > need KBI compat, I would much rather consolidate all the padding at the e= nd. The padding is due to functional requirements. I do not see KBI requirements that would cause us to keep the layout, at least in HEAD. >=20 > > There is one weird detail, not touched by your patch. Amd64 resume > > path calls initializecpu(), while i386 does not. I do not see any > > use for the call, the reload of CRX registers by trampoline/resumectx > > should already set everything to working state. E.g., enabling XMM > > in CR4 after fpu state is restored looks strange. >=20 > I can test that. >=20 > > Overall, it looks fine. Do you prefer to have alloc_fpusave() on i386 ? >=20 > Well, it might be nice to have XSAVE on i386. I'm not sure if Intel has > any 32-bit only chips planned that will use AVX or MPX, etc. If they are, > then I do think AVX on i386 would be nice to have. Barring XSAVE I think > we can just use a static savefpu on i386 for now. I mean that having alloc_fpusave() would allow to avoid several #ifdefs by using pointer to save area on i386 as well. >=20 > We might also consider removing support for 486sx CPUs and requiring an > on-CPU FPU for i386. If we do that we might able to use a common fpu.c > which would be even nicer. IMO merging fpu.c and npx.c is very non-trivial. First obstacle is the differences between i386 and amd64 fpu context layouts (software-imposed). --b/WH2/j5QGsRzh1z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUCr8qAAoJEJDCuSvBvK1BtI8P/2SMZcJeEbBmY3QWrMtN71Kq PzaG6dccA19dH7zowqtr3ApLCd4L27qmlKZZ7uez4xgb8NxayPLPyW/zXZ+/a3Jc WKpyXZCtiYewwKceBG+XkToAL/XWZR9QnjJBLpqyFcpWY3croM0sEtqn9VWUFuPS R3YQzo3ogw+IblA9HOYfnLYQAXbkHQtTipzes7iZd/xrCLc3HOwdIqnIQW5nq5i1 xsTUTlbS+8+SCfLRRh1AfWJd3GaSc/kcQMJ5BFO8QA1jdm3g8gnEZXoQutaogvnG k539IkudaPXASZG0LD2Y9IFNBa1IkP8AGNj8N5byjU8PfknymBEJx1DBOGb2g5kM hUBtwPkKOUdNSR1izQELmsvQAlKcrF8Z6zjgXlWDyha0LcknKalUiEDBz4dnMtbC OPdsnAl9+nLM6JcSZ5xIKtPQzJItBlp4E88fTGn5DKQ8ZRKtm96+Sfkkjts7X1ix 6jQRaoZL1ipKlXa5arUPKJZq1lFG6k4Arug5MgDoyc4yzFpj1WMY8i5wcizwsjow TYniJOgGMjwjPBBuqD8U5EBG3aHnCK1uj0y7rUC86OcMfcaoRXxSukUkzzkbfsVA h3m5yp4VOSXzby89GMlcJXW/yz+yEX4cLR/8A7il5c8cKU4u/f5yzDHEJm36q9+s QoJb2Nc81IBUTP79q++L =dFVS -----END PGP SIGNATURE----- --b/WH2/j5QGsRzh1z-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 08:48:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B1E206; Sat, 6 Sep 2014 08:48:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC8301984; Sat, 6 Sep 2014 08:48:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s868mwmd066921; Sat, 6 Sep 2014 08:48:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s868mwgm066917; Sat, 6 Sep 2014 08:48:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201409060848.s868mwgm066917@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 6 Sep 2014 08:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271186 - in head/sys: arm/altera/socfpga boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 08:48:59 -0000 Author: br Date: Sat Sep 6 08:48:57 2014 New Revision: 271186 URL: http://svnweb.freebsd.org/changeset/base/271186 Log: Add FPGA Manager driver. This driver allows to program FPGA core from FreeBSD userspace running on ARM core. Sponsored by: DARPA, AFRL Added: head/sys/arm/altera/socfpga/socfpga_common.h (contents, props changed) head/sys/arm/altera/socfpga/socfpga_manager.c (contents, props changed) Modified: head/sys/arm/altera/socfpga/files.socfpga head/sys/boot/fdt/dts/arm/socfpga.dtsi Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Sat Sep 6 04:39:26 2014 (r271185) +++ head/sys/arm/altera/socfpga/files.socfpga Sat Sep 6 08:48:57 2014 (r271186) @@ -15,3 +15,4 @@ arm/arm/mpcore_timer.c standard arm/altera/socfpga/socfpga_common.c standard arm/altera/socfpga/socfpga_machdep.c standard +arm/altera/socfpga/socfpga_manager.c standard Added: head/sys/arm/altera/socfpga/socfpga_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/socfpga_common.h Sat Sep 6 08:48:57 2014 (r271186) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ2(_sc, _reg) \ + bus_space_read_2(_sc->bst, _sc->bsh, _reg) +#define WRITE2(_sc, _reg, _val) \ + bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) +#define READ1(_sc, _reg) \ + bus_space_read_1(_sc->bst, _sc->bsh, _reg) +#define WRITE1(_sc, _reg, _val) \ + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) Added: head/sys/arm/altera/socfpga/socfpga_manager.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/altera/socfpga/socfpga_manager.c Sat Sep 6 08:48:57 2014 (r271186) @@ -0,0 +1,436 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* + * Altera FPGA Manager. + * Chapter 4, Cyclone V Device Handbook (CV-5V2 2014.07.22) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/* FPGA Manager Module Registers */ +#define FPGAMGR_STAT 0x0 /* Status Register */ +#define STAT_MSEL_MASK 0x1f +#define STAT_MSEL_SHIFT 3 +#define STAT_MODE_SHIFT 0 +#define STAT_MODE_MASK 0x7 +#define FPGAMGR_CTRL 0x4 /* Control Register */ +#define CTRL_AXICFGEN (1 << 8) +#define CTRL_CDRATIO_MASK 0x3 +#define CTRL_CDRATIO_SHIFT 6 +#define CTRL_CFGWDTH_MASK 1 +#define CTRL_CFGWDTH_SHIFT 9 +#define CTRL_NCONFIGPULL (1 << 2) +#define CTRL_NCE (1 << 1) +#define CTRL_EN (1 << 0) +#define FPGAMGR_DCLKCNT 0x8 /* DCLK Count Register */ +#define FPGAMGR_DCLKSTAT 0xC /* DCLK Status Register */ +#define FPGAMGR_GPO 0x10 /* General-Purpose Output Register */ +#define FPGAMGR_GPI 0x14 /* General-Purpose Input Register */ +#define FPGAMGR_MISCI 0x18 /* Miscellaneous Input Register */ + +/* Configuration Monitor (MON) Registers */ +#define GPIO_INTEN 0x830 /* Interrupt Enable Register */ +#define GPIO_INTMASK 0x834 /* Interrupt Mask Register */ +#define GPIO_INTTYPE_LEVEL 0x838 /* Interrupt Level Register */ +#define GPIO_INT_POLARITY 0x83C /* Interrupt Polarity Register */ +#define GPIO_INTSTATUS 0x840 /* Interrupt Status Register */ +#define GPIO_RAW_INTSTATUS 0x844 /* Raw Interrupt Status Register */ +#define GPIO_PORTA_EOI 0x84C /* Clear Interrupt Register */ +#define PORTA_EOI_NS (1 << 0) +#define GPIO_EXT_PORTA 0x850 /* External Port A Register */ +#define GPIO_LS_SYNC 0x860 /* Synchronization Level Register */ +#define GPIO_VER_ID_CODE 0x86C /* GPIO Version Register */ +#define GPIO_CONFIG_REG2 0x870 /* Configuration Register 2 */ +#define GPIO_CONFIG_REG1 0x874 /* Configuration Register 1 */ + +#define MSEL_PP16_FAST_NOAES_NODC 0x0 +#define MSEL_PP16_FAST_AES_NODC 0x1 +#define MSEL_PP16_FAST_AESOPT_DC 0x2 +#define MSEL_PP16_SLOW_NOAES_NODC 0x4 +#define MSEL_PP16_SLOW_AES_NODC 0x5 +#define MSEL_PP16_SLOW_AESOPT_DC 0x6 +#define MSEL_PP32_FAST_NOAES_NODC 0x8 +#define MSEL_PP32_FAST_AES_NODC 0x9 +#define MSEL_PP32_FAST_AESOPT_DC 0xa +#define MSEL_PP32_SLOW_NOAES_NODC 0xc +#define MSEL_PP32_SLOW_AES_NODC 0xd +#define MSEL_PP32_SLOW_AESOPT_DC 0xe + +#define CFGWDTH_16 0 +#define CFGWDTH_32 1 + +#define CDRATIO_1 0 +#define CDRATIO_2 1 +#define CDRATIO_4 2 +#define CDRATIO_8 3 + +#define FPGAMGR_MODE_POWEROFF 0x0 +#define FPGAMGR_MODE_RESET 0x1 +#define FPGAMGR_MODE_CONFIG 0x2 +#define FPGAMGR_MODE_INIT 0x3 +#define FPGAMGR_MODE_USER 0x4 + +struct cfgmgr_mode { + int msel; + int cfgwdth; + int cdratio; +}; + +static struct cfgmgr_mode cfgmgr_modes[] = { + { MSEL_PP16_FAST_NOAES_NODC, CFGWDTH_16, CDRATIO_1 }, + { MSEL_PP16_FAST_AES_NODC, CFGWDTH_16, CDRATIO_2 }, + { MSEL_PP16_FAST_AESOPT_DC, CFGWDTH_16, CDRATIO_4 }, + { MSEL_PP16_SLOW_NOAES_NODC, CFGWDTH_16, CDRATIO_1 }, + { MSEL_PP16_SLOW_AES_NODC, CFGWDTH_16, CDRATIO_2 }, + { MSEL_PP16_SLOW_AESOPT_DC, CFGWDTH_16, CDRATIO_4 }, + { MSEL_PP32_FAST_NOAES_NODC, CFGWDTH_32, CDRATIO_1 }, + { MSEL_PP32_FAST_AES_NODC, CFGWDTH_32, CDRATIO_4 }, + { MSEL_PP32_FAST_AESOPT_DC, CFGWDTH_32, CDRATIO_8 }, + { MSEL_PP32_SLOW_NOAES_NODC, CFGWDTH_32, CDRATIO_1 }, + { MSEL_PP32_SLOW_AES_NODC, CFGWDTH_32, CDRATIO_4 }, + { MSEL_PP32_SLOW_AESOPT_DC, CFGWDTH_32, CDRATIO_8 }, + { -1, -1, -1 }, +}; + +struct fpgamgr_softc { + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_data; + bus_space_handle_t bsh_data; + struct cdev *mgr_cdev; + device_t dev; +}; + +static struct resource_spec fpgamgr_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +fpgamgr_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) + return (ENXIO); + + device_set_desc(dev, "FPGA Manager"); + return (BUS_PROBE_DEFAULT); +} + +static int +fpgamgr_state_get(struct fpgamgr_softc *sc) +{ + int reg; + + reg = READ4(sc, FPGAMGR_STAT); + reg >>= STAT_MODE_SHIFT; + reg &= STAT_MODE_MASK; + + return reg; +} + +static int +fpgamgr_state_wait(struct fpgamgr_softc *sc, int state) +{ + int tout; + + tout = 1000; + while (tout > 0) { + if (fpgamgr_state_get(sc) == state) + break; + tout--; + DELAY(10); + } + if (tout == 0) { + return (1); + } + + return (0); +} + +static int +fpga_open(struct cdev *dev __unused, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + struct fpgamgr_softc *sc; + struct cfgmgr_mode *mode; + int msel; + int reg; + int i; + + sc = dev->si_drv1; + + msel = READ4(sc, FPGAMGR_STAT); + msel >>= STAT_MSEL_SHIFT; + msel &= STAT_MSEL_MASK; + + mode = NULL; + for (i = 0; cfgmgr_modes[i].msel != -1; i++) { + if (msel == cfgmgr_modes[i].msel) { + mode = &cfgmgr_modes[i]; + break; + } + } + if (mode == NULL) { + device_printf(sc->dev, "Can't configure: unknown mode\n"); + return (ENXIO); + } + + reg = READ4(sc, FPGAMGR_CTRL); + reg &= ~(CTRL_CDRATIO_MASK << CTRL_CDRATIO_SHIFT); + reg |= (mode->cdratio << CTRL_CDRATIO_SHIFT); + reg &= ~(CTRL_CFGWDTH_MASK << CTRL_CFGWDTH_SHIFT); + reg |= (mode->cfgwdth << CTRL_CFGWDTH_SHIFT); + reg &= ~(CTRL_NCE); + WRITE4(sc, FPGAMGR_CTRL, reg); + + /* Enable configuration */ + reg = READ4(sc, FPGAMGR_CTRL); + reg |= (CTRL_EN); + WRITE4(sc, FPGAMGR_CTRL, reg); + + /* Reset FPGA */ + reg = READ4(sc, FPGAMGR_CTRL); + reg |= (CTRL_NCONFIGPULL); + WRITE4(sc, FPGAMGR_CTRL, reg); + + /* Wait reset state */ + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_RESET)) { + device_printf(sc->dev, "Can't get RESET state\n"); + return (ENXIO); + } + + /* Release from reset */ + reg = READ4(sc, FPGAMGR_CTRL); + reg &= ~(CTRL_NCONFIGPULL); + WRITE4(sc, FPGAMGR_CTRL, reg); + + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_CONFIG)) { + device_printf(sc->dev, "Can't get CONFIG state\n"); + return (ENXIO); + } + + /* Clear nSTATUS edge interrupt */ + WRITE4(sc, GPIO_PORTA_EOI, PORTA_EOI_NS); + + /* Enter configuration state */ + reg = READ4(sc, FPGAMGR_CTRL); + reg |= (CTRL_AXICFGEN); + WRITE4(sc, FPGAMGR_CTRL, reg); + + return (0); +} + +static int +fpga_wait_dclk_pulses(struct fpgamgr_softc *sc, int npulses) +{ + int tout; + + /* Clear done bit, if any */ + if (READ4(sc, FPGAMGR_DCLKSTAT) != 0) + WRITE4(sc, FPGAMGR_DCLKSTAT, 0x1); + + /* Request DCLK pulses */ + WRITE4(sc, FPGAMGR_DCLKCNT, npulses); + + /* Wait finish */ + tout = 1000; + while (tout > 0) { + if (READ4(sc, FPGAMGR_DCLKSTAT) == 1) { + WRITE4(sc, FPGAMGR_DCLKSTAT, 0x1); + break; + } + tout--; + DELAY(10); + } + if (tout == 0) { + return (1); + } + + return (0); +} + +static int +fpga_close(struct cdev *dev __unused, int flags __unused, + int fmt __unused, struct thread *td __unused) +{ + struct fpgamgr_softc *sc; + int reg; + + sc = dev->si_drv1; + + reg = READ4(sc, GPIO_EXT_PORTA); + if ((reg & (1 << 10)) == 0) { + device_printf(sc->dev, "Err: configuration failed\n"); + return (ENXIO); + } + + /* Exit configuration state */ + reg = READ4(sc, FPGAMGR_CTRL); + reg &= ~(CTRL_AXICFGEN); + WRITE4(sc, FPGAMGR_CTRL, reg); + + /* Wait dclk pulses */ + if (fpga_wait_dclk_pulses(sc, 4)) { + device_printf(sc->dev, "Can't proceed 4 dclk pulses\n"); + return (ENXIO); + } + + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_USER)) { + device_printf(sc->dev, "Can't get USER mode\n"); + return (ENXIO); + } + + /* Disable configuration */ + reg = READ4(sc, FPGAMGR_CTRL); + reg &= ~(CTRL_EN); + WRITE4(sc, FPGAMGR_CTRL, reg); + + return (0); +} + +static int +fpga_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct fpgamgr_softc *sc; + int buffer; + + sc = dev->si_drv1; + + /* + * Device supports 4-byte copy only. + * TODO: add padding for <4 bytes. + */ + + while (uio->uio_resid > 0) { + uiomove(&buffer, 4, uio); + bus_space_write_4(sc->bst_data, sc->bsh_data, + 0x0, buffer); + } + + return (0); +} + +static int +fpga_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, + struct thread *td) +{ + + return (0); +} + +static struct cdevsw fpga_cdevsw = { + .d_version = D_VERSION, + .d_open = fpga_open, + .d_close = fpga_close, + .d_write = fpga_write, + .d_ioctl = fpga_ioctl, + .d_name = "FPGA Manager", +}; + +static int +fpgamgr_attach(device_t dev) +{ + struct fpgamgr_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, fpgamgr_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst_data = rman_get_bustag(sc->res[1]); + sc->bsh_data = rman_get_bushandle(sc->res[1]); + + sc->mgr_cdev = make_dev(&fpga_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "fpga%d", device_get_unit(sc->dev)); + + if (sc->mgr_cdev == NULL) { + device_printf(dev, "Failed to create character device.\n"); + return (ENXIO); + } + + sc->mgr_cdev->si_drv1 = sc; + + return (0); +} + +static device_method_t fpgamgr_methods[] = { + DEVMETHOD(device_probe, fpgamgr_probe), + DEVMETHOD(device_attach, fpgamgr_attach), + { 0, 0 } +}; + +static driver_t fpgamgr_driver = { + "fpgamgr", + fpgamgr_methods, + sizeof(struct fpgamgr_softc), +}; + +static devclass_t fpgamgr_devclass; + +DRIVER_MODULE(fpgamgr, simplebus, fpgamgr_driver, fpgamgr_devclass, 0, 0); Modified: head/sys/boot/fdt/dts/arm/socfpga.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/socfpga.dtsi Sat Sep 6 04:39:26 2014 (r271185) +++ head/sys/boot/fdt/dts/arm/socfpga.dtsi Sat Sep 6 08:48:57 2014 (r271186) @@ -69,6 +69,14 @@ interrupt-parent = < &GIC >; }; + fpgamgr: fpgamgr@ff706000 { + compatible = "altr,fpga-mgr"; + reg = <0xff706000 0x1000>, /* FPGAMGRREGS */ + <0xffb90000 0x1000>; /* FPGAMGRDATA */ + interrupts = < 207 >; + interrupt-parent = <&GIC>; + }; + serial0: serial@ffc02000 { compatible = "ns16550"; reg = <0xffc02000 0x1000>; From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 09:03:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EE944DE; Sat, 6 Sep 2014 09:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0391AEB; Sat, 6 Sep 2014 09:03:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8693DiY075544; Sat, 6 Sep 2014 09:03:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8693DFV075543; Sat, 6 Sep 2014 09:03:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409060903.s8693DFV075543@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 6 Sep 2014 09:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271187 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 09:03:14 -0000 Author: trasz Date: Sat Sep 6 09:03:13 2014 New Revision: 271187 URL: http://svnweb.freebsd.org/changeset/base/271187 Log: Avoid ctld(8) crash on getaddrinfo(3) failure. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Sat Sep 6 08:48:57 2014 (r271186) +++ head/usr.sbin/ctld/ctld.c Sat Sep 6 09:03:13 2014 (r271187) @@ -561,8 +561,10 @@ portal_new(struct portal_group *pg) static void portal_delete(struct portal *portal) { + TAILQ_REMOVE(&portal->p_portal_group->pg_portals, portal, p_next); - freeaddrinfo(portal->p_ai); + if (portal->p_ai != NULL) + freeaddrinfo(portal->p_ai); free(portal->p_listen); free(portal); } @@ -633,8 +635,7 @@ portal_group_add_listen(struct portal_gr arg = portal->p_listen; if (arg[0] == '\0') { log_warnx("empty listen address"); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '[') { @@ -646,8 +647,7 @@ portal_group_add_listen(struct portal_gr if (arg == NULL) { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } if (arg[0] == '\0') { @@ -657,8 +657,7 @@ portal_group_add_listen(struct portal_gr } else { log_warnx("invalid listen address %s", portal->p_listen); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } } else { @@ -691,8 +690,7 @@ portal_group_add_listen(struct portal_gr if (error != 0) { log_warnx("getaddrinfo for %s failed: %s", portal->p_listen, gai_strerror(error)); - free(portal->p_listen); - free(portal); + portal_delete(portal); return (1); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 10:45:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6637911B; Sat, 6 Sep 2014 10:45:31 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 22D3914B2; Sat, 6 Sep 2014 10:45:30 +0000 (UTC) Received: from bender.lan (97e07ab1.skybroadband.com [151.224.122.177]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 9B6875CBF4; Sat, 6 Sep 2014 10:45:20 +0000 (UTC) Date: Sat, 6 Sep 2014 11:45:14 +0100 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r271186 - in head/sys: arm/altera/socfpga boot/fdt/dts/arm Message-ID: <20140906114514.5c9f7223@bender.lan> In-Reply-To: <201409060848.s868mwgm066917@svn.freebsd.org> References: <201409060848.s868mwgm066917@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 10:45:31 -0000 On Sat, 6 Sep 2014 08:48:58 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Sat Sep 6 08:48:57 2014 > New Revision: 271186 > URL: http://svnweb.freebsd.org/changeset/base/271186 > > Log: > Add FPGA Manager driver. This driver allows to program FPGA core > from FreeBSD userspace running on ARM core. A few comments below. Andrew ... > Added: head/sys/arm/altera/socfpga/socfpga_common.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) +++ head/sys/arm/altera/socfpga/socfpga_common.h > Sat Sep 6 08:48:57 2014 (r271186) @@ -0,0 +1,44 @@ > +/*- > + * Copyright (c) 2014 Ruslan Bukin > + * All rights reserved. > + * > + * This software was developed by SRI International and the > University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract > (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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$ > + */ > + > +#define READ4(_sc, _reg) \ > + bus_space_read_4(_sc->bst, _sc->bsh, _reg) > +#define WRITE4(_sc, _reg, _val) \ > + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) > +#define READ2(_sc, _reg) \ > + bus_space_read_2(_sc->bst, _sc->bsh, _reg) > +#define WRITE2(_sc, _reg, _val) \ > + bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) > +#define READ1(_sc, _reg) \ > + bus_space_read_1(_sc->bst, _sc->bsh, _reg) > +#define WRITE1(_sc, _reg, _val) \ > + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) Why are these in a header when the softc is in a .c file? Also why not use bus_read_n, e.g. READ4 would become: #define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) > > Added: head/sys/arm/altera/socfpga/socfpga_manager.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) +++ head/sys/arm/altera/socfpga/socfpga_manager.c > Sat Sep 6 08:48:57 2014 (r271186) @@ -0,0 +1,436 @@ > +/*- > + * Copyright (c) 2014 Ruslan Bukin > + * All rights reserved. > + * > + * This software was developed by SRI International and the > University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract > (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > + * 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. > + */ > + > +/* > + * Altera FPGA Manager. > + * Chapter 4, Cyclone V Device Handbook (CV-5V2 2014.07.22) > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > + > +/* FPGA Manager Module Registers */ > +#define FPGAMGR_STAT 0x0 /* Status > Register */ +#define STAT_MSEL_MASK 0x1f > +#define STAT_MSEL_SHIFT 3 > +#define STAT_MODE_SHIFT 0 > +#define STAT_MODE_MASK 0x7 > +#define FPGAMGR_CTRL 0x4 /* Control > Register */ +#define CTRL_AXICFGEN (1 << 8) > +#define CTRL_CDRATIO_MASK 0x3 > +#define CTRL_CDRATIO_SHIFT 6 > +#define CTRL_CFGWDTH_MASK 1 > +#define CTRL_CFGWDTH_SHIFT 9 > +#define CTRL_NCONFIGPULL (1 << 2) > +#define CTRL_NCE (1 << 1) > +#define CTRL_EN (1 << 0) > +#define FPGAMGR_DCLKCNT 0x8 /* DCLK > Count Register */ +#define FPGAMGR_DCLKSTAT > 0xC /* DCLK Status Register */ +#define > FPGAMGR_GPO 0x10 /* General-Purpose Output > Register */ +#define FPGAMGR_GPI 0x14 /* > General-Purpose Input Register */ +#define > FPGAMGR_MISCI 0x18 /* Miscellaneous Input > Register */ + +/* Configuration Monitor (MON) Registers */ > +#define GPIO_INTEN 0x830 /* Interrupt > Enable Register */ +#define GPIO_INTMASK > 0x834 /* Interrupt Mask Register */ +#define > GPIO_INTTYPE_LEVEL 0x838 /* Interrupt Level Register */ > +#define GPIO_INT_POLARITY 0x83C /* Interrupt > Polarity Register */ +#define GPIO_INTSTATUS > 0x840 /* Interrupt Status Register */ +#define > GPIO_RAW_INTSTATUS 0x844 /* Raw Interrupt Status > Register */ +#define GPIO_PORTA_EOI > 0x84C /* Clear Interrupt Register */ +#define > PORTA_EOI_NS (1 << 0) +#define > GPIO_EXT_PORTA 0x850 /* External Port A > Register */ +#define GPIO_LS_SYNC > 0x860 /* Synchronization Level Register */ +#define > GPIO_VER_ID_CODE 0x86C /* GPIO Version Register */ > +#define GPIO_CONFIG_REG2 0x870 /* Configuration > Register 2 */ +#define GPIO_CONFIG_REG1 0x874 /* > Configuration Register 1 */ + +#define > MSEL_PP16_FAST_NOAES_NODC 0x0 +#define > MSEL_PP16_FAST_AES_NODC 0x1 +#define > MSEL_PP16_FAST_AESOPT_DC 0x2 +#define > MSEL_PP16_SLOW_NOAES_NODC 0x4 +#define > MSEL_PP16_SLOW_AES_NODC 0x5 +#define > MSEL_PP16_SLOW_AESOPT_DC 0x6 +#define > MSEL_PP32_FAST_NOAES_NODC 0x8 +#define > MSEL_PP32_FAST_AES_NODC 0x9 +#define > MSEL_PP32_FAST_AESOPT_DC 0xa +#define > MSEL_PP32_SLOW_NOAES_NODC 0xc +#define > MSEL_PP32_SLOW_AES_NODC 0xd +#define > MSEL_PP32_SLOW_AESOPT_DC 0xe + +#define > CFGWDTH_16 0 +#define CFGWDTH_32 1 + > +#define CDRATIO_1 0 +#define CDRATIO_2 1 > +#define CDRATIO_4 2 +#define CDRATIO_8 3 > + > +#define FPGAMGR_MODE_POWEROFF 0x0 > +#define FPGAMGR_MODE_RESET 0x1 > +#define FPGAMGR_MODE_CONFIG 0x2 > +#define FPGAMGR_MODE_INIT 0x3 > +#define FPGAMGR_MODE_USER 0x4 > + > +struct cfgmgr_mode { > + int msel; > + int cfgwdth; > + int cdratio; > +}; > + > +static struct cfgmgr_mode cfgmgr_modes[] = { > + { MSEL_PP16_FAST_NOAES_NODC, CFGWDTH_16, CDRATIO_1 }, > + { MSEL_PP16_FAST_AES_NODC, CFGWDTH_16, CDRATIO_2 }, > + { MSEL_PP16_FAST_AESOPT_DC, CFGWDTH_16, CDRATIO_4 }, > + { MSEL_PP16_SLOW_NOAES_NODC, CFGWDTH_16, CDRATIO_1 }, > + { MSEL_PP16_SLOW_AES_NODC, CFGWDTH_16, CDRATIO_2 }, > + { MSEL_PP16_SLOW_AESOPT_DC, CFGWDTH_16, CDRATIO_4 }, > + { MSEL_PP32_FAST_NOAES_NODC, CFGWDTH_32, CDRATIO_1 }, > + { MSEL_PP32_FAST_AES_NODC, CFGWDTH_32, CDRATIO_4 }, > + { MSEL_PP32_FAST_AESOPT_DC, CFGWDTH_32, CDRATIO_8 }, > + { MSEL_PP32_SLOW_NOAES_NODC, CFGWDTH_32, CDRATIO_1 }, > + { MSEL_PP32_SLOW_AES_NODC, CFGWDTH_32, CDRATIO_4 }, > + { MSEL_PP32_SLOW_AESOPT_DC, CFGWDTH_32, CDRATIO_8 }, > + { -1, -1, -1 }, > +}; > + > +struct fpgamgr_softc { > + struct resource *res[3]; > + bus_space_tag_t bst; > + bus_space_handle_t bsh; > + bus_space_tag_t bst_data; > + bus_space_handle_t bsh_data; > + struct cdev *mgr_cdev; > + device_t dev; > +}; > + > +static struct resource_spec fpgamgr_spec[] = { > + { SYS_RES_MEMORY, 0, RF_ACTIVE }, > + { SYS_RES_MEMORY, 1, RF_ACTIVE }, > + { SYS_RES_IRQ, 0, RF_ACTIVE }, > + { -1, 0 } > +}; > + > +static int > +fpgamgr_probe(device_t dev) You have probe here, but the attach function is a long way below? I normally look for the attach straight after probe as they are somewhat related. > +{ > + > + if (!ofw_bus_status_okay(dev)) > + return (ENXIO); > + > + if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) > + return (ENXIO); > + > + device_set_desc(dev, "FPGA Manager"); > + return (BUS_PROBE_DEFAULT); > +} > + ... > + > +static int > +fpga_open(struct cdev *dev __unused, int flags __unused, dev is used. > + int fmt __unused, struct thread *td __unused) > +{ > + struct fpgamgr_softc *sc; > + struct cfgmgr_mode *mode; > + int msel; > + int reg; > + int i; > + > + sc = dev->si_drv1; Here > + > + msel = READ4(sc, FPGAMGR_STAT); > + msel >>= STAT_MSEL_SHIFT; > + msel &= STAT_MSEL_MASK; > + > + mode = NULL; > + for (i = 0; cfgmgr_modes[i].msel != -1; i++) { > + if (msel == cfgmgr_modes[i].msel) { > + mode = &cfgmgr_modes[i]; > + break; > + } > + } > + if (mode == NULL) { > + device_printf(sc->dev, "Can't configure: unknown > mode\n"); > + return (ENXIO); > + } > + > + reg = READ4(sc, FPGAMGR_CTRL); > + reg &= ~(CTRL_CDRATIO_MASK << CTRL_CDRATIO_SHIFT); > + reg |= (mode->cdratio << CTRL_CDRATIO_SHIFT); > + reg &= ~(CTRL_CFGWDTH_MASK << CTRL_CFGWDTH_SHIFT); > + reg |= (mode->cfgwdth << CTRL_CFGWDTH_SHIFT); > + reg &= ~(CTRL_NCE); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + /* Enable configuration */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg |= (CTRL_EN); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + /* Reset FPGA */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg |= (CTRL_NCONFIGPULL); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + /* Wait reset state */ > + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_RESET)) { > + device_printf(sc->dev, "Can't get RESET state\n"); > + return (ENXIO); > + } > + > + /* Release from reset */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg &= ~(CTRL_NCONFIGPULL); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_CONFIG)) { > + device_printf(sc->dev, "Can't get CONFIG state\n"); > + return (ENXIO); > + } > + > + /* Clear nSTATUS edge interrupt */ > + WRITE4(sc, GPIO_PORTA_EOI, PORTA_EOI_NS); > + > + /* Enter configuration state */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg |= (CTRL_AXICFGEN); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + return (0); > +} > + > +static int > +fpga_wait_dclk_pulses(struct fpgamgr_softc *sc, int npulses) > +{ > + int tout; > + > + /* Clear done bit, if any */ > + if (READ4(sc, FPGAMGR_DCLKSTAT) != 0) > + WRITE4(sc, FPGAMGR_DCLKSTAT, 0x1); > + > + /* Request DCLK pulses */ > + WRITE4(sc, FPGAMGR_DCLKCNT, npulses); > + > + /* Wait finish */ > + tout = 1000; > + while (tout > 0) { > + if (READ4(sc, FPGAMGR_DCLKSTAT) == 1) { > + WRITE4(sc, FPGAMGR_DCLKSTAT, 0x1); > + break; > + } > + tout--; > + DELAY(10); > + } > + if (tout == 0) { > + return (1); > + } > + > + return (0); > +} > + > +static int > +fpga_close(struct cdev *dev __unused, int flags __unused, dev is also used in this function. > + int fmt __unused, struct thread *td __unused) > +{ > + struct fpgamgr_softc *sc; > + int reg; > + > + sc = dev->si_drv1; > + > + reg = READ4(sc, GPIO_EXT_PORTA); > + if ((reg & (1 << 10)) == 0) { What is magic about bit 10? > + device_printf(sc->dev, "Err: configuration > failed\n"); > + return (ENXIO); > + } > + > + /* Exit configuration state */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg &= ~(CTRL_AXICFGEN); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + /* Wait dclk pulses */ > + if (fpga_wait_dclk_pulses(sc, 4)) { > + device_printf(sc->dev, "Can't proceed 4 dclk > pulses\n"); > + return (ENXIO); > + } > + > + if (fpgamgr_state_wait(sc, FPGAMGR_MODE_USER)) { > + device_printf(sc->dev, "Can't get USER mode\n"); > + return (ENXIO); > + } > + > + /* Disable configuration */ > + reg = READ4(sc, FPGAMGR_CTRL); > + reg &= ~(CTRL_EN); > + WRITE4(sc, FPGAMGR_CTRL, reg); > + > + return (0); > +} > + > +static int > +fpga_write(struct cdev *dev, struct uio *uio, int ioflag) > +{ > + struct fpgamgr_softc *sc; > + int buffer; > + > + sc = dev->si_drv1; > + > + /* > + * Device supports 4-byte copy only. > + * TODO: add padding for <4 bytes. > + */ > + > + while (uio->uio_resid > 0) { > + uiomove(&buffer, 4, uio); > + bus_space_write_4(sc->bst_data, sc->bsh_data, > + 0x0, buffer); > + } > + > + return (0); > +} > + > +static int > +fpga_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, > + struct thread *td) > +{ > + > + return (0); > +} > + > +static struct cdevsw fpga_cdevsw = { > + .d_version = D_VERSION, > + .d_open = fpga_open, > + .d_close = fpga_close, > + .d_write = fpga_write, > + .d_ioctl = fpga_ioctl, > + .d_name = "FPGA Manager", > +}; > + > +static int > +fpgamgr_attach(device_t dev) > +{ > + struct fpgamgr_softc *sc; > + > + sc = device_get_softc(dev); > + sc->dev = dev; > + > + if (bus_alloc_resources(dev, fpgamgr_spec, sc->res)) { > + device_printf(dev, "could not allocate resources\n"); > + return (ENXIO); > + } > + > + /* Memory interface */ > + sc->bst = rman_get_bustag(sc->res[0]); > + sc->bsh = rman_get_bushandle(sc->res[0]); These are unneeded if you use bus_read_n/bus_write_n. > + sc->bst_data = rman_get_bustag(sc->res[1]); > + sc->bsh_data = rman_get_bushandle(sc->res[1]); > + > + sc->mgr_cdev = make_dev(&fpga_cdevsw, 0, UID_ROOT, GID_WHEEL, > + 0600, "fpga%d", device_get_unit(sc->dev)); > + > + if (sc->mgr_cdev == NULL) { > + device_printf(dev, "Failed to create character > device.\n"); > + return (ENXIO); > + } > + > + sc->mgr_cdev->si_drv1 = sc; > + > + return (0); > +} > + ... From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 11:19:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D093AE16; Sat, 6 Sep 2014 11:19:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC0091960; Sat, 6 Sep 2014 11:19:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86BJCE6037950; Sat, 6 Sep 2014 11:19:12 GMT (envelope-from joel@FreeBSD.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86BJCe6037949; Sat, 6 Sep 2014 11:19:12 GMT (envelope-from joel@FreeBSD.org) Message-Id: <201409061119.s86BJCe6037949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: joel set sender to joel@FreeBSD.org using -f From: Joel Dahl Date: Sat, 6 Sep 2014 11:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271188 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 11:19:12 -0000 Author: joel (doc committer) Date: Sat Sep 6 11:19:12 2014 New Revision: 271188 URL: http://svnweb.freebsd.org/changeset/base/271188 Log: mdoc: remove superfluous paragraph macro. Modified: head/share/man/man4/uled.4 Modified: head/share/man/man4/uled.4 ============================================================================== --- head/share/man/man4/uled.4 Sat Sep 6 09:03:13 2014 (r271187) +++ head/share/man/man4/uled.4 Sat Sep 6 11:19:12 2014 (r271188) @@ -73,7 +73,6 @@ struct uled_color { uint8_t blue; }; .Ed -.Pp .It Dv ULED_SET_COLOR The command sets LED colors with values for RGB. It uses the same structure as above. From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 12:01:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93209C0B; Sat, 6 Sep 2014 12:01:37 +0000 (UTC) Received: from bsdpad.com (xc1.bsdpad.com [195.154.136.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 535EE1DD3; Sat, 6 Sep 2014 12:01:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bsdpad.com) by bsdpad.com with smtp (Exim 4.83 (FreeBSD)) (envelope-from ) id 1XQEfU-000GS5-1G; Sat, 06 Sep 2014 13:00:36 +0100 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Sat, 6 Sep 2014 13:00:36 +0100 (BST) Date: Sat, 6 Sep 2014 13:00:35 +0100 From: Ruslan Bukin To: Andrew Turner Subject: Re: svn commit: r271186 - in head/sys: arm/altera/socfpga boot/fdt/dts/arm Message-ID: <20140906120035.GA62565@bsdpad.com> References: <201409060848.s868mwgm066917@svn.freebsd.org> <20140906114514.5c9f7223@bender.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <20140906114514.5c9f7223@bender.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 12:01:37 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Sat, Sep 06, 2014 at 11:45:14AM +0100, Andrew Turner wrote: > > +#define WRITE1(_sc, _reg, _val) \ > > + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) > > Why are these in a header when the softc is in a .c file? Also why not > use bus_read_n, e.g. READ4 would become: > > #define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) > > I want to use these defines in other socfpga drivers, so I leaved it in header file. Is that fine ? Excellent review, thanks. I've prepared the patch Ruslan --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="patch.socfpga.0" Index: sys/arm/altera/socfpga/socfpga_common.h =================================================================== --- sys/arm/altera/socfpga/socfpga_common.h (revision 271188) +++ sys/arm/altera/socfpga/socfpga_common.h (working copy) @@ -30,15 +30,9 @@ * $FreeBSD$ */ -#define READ4(_sc, _reg) \ - bus_space_read_4(_sc->bst, _sc->bsh, _reg) -#define WRITE4(_sc, _reg, _val) \ - bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) -#define READ2(_sc, _reg) \ - bus_space_read_2(_sc->bst, _sc->bsh, _reg) -#define WRITE2(_sc, _reg, _val) \ - bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) -#define READ1(_sc, _reg) \ - bus_space_read_1(_sc->bst, _sc->bsh, _reg) -#define WRITE1(_sc, _reg, _val) \ - bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) +#define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) +#define READ2(_sc, _reg) bus_read_2((_sc)->res[0], _reg) +#define READ1(_sc, _reg) bus_read_1((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) bus_write_4((_sc)->res[0], _reg, _val) +#define WRITE2(_sc, _reg, _val) bus_write_2((_sc)->res[0], _reg, _val) +#define WRITE1(_sc, _reg, _val) bus_write_1((_sc)->res[0], _reg, _val) Index: sys/arm/altera/socfpga/socfpga_manager.c =================================================================== --- sys/arm/altera/socfpga/socfpga_manager.c (revision 271188) +++ sys/arm/altera/socfpga/socfpga_manager.c (working copy) @@ -91,6 +91,7 @@ #define GPIO_PORTA_EOI 0x84C /* Clear Interrupt Register */ #define PORTA_EOI_NS (1 << 0) #define GPIO_EXT_PORTA 0x850 /* External Port A Register */ +#define EXT_PORTA_CDP (1 << 10) /* Configuration done */ #define GPIO_LS_SYNC 0x860 /* Synchronization Level Register */ #define GPIO_VER_ID_CODE 0x86C /* GPIO Version Register */ #define GPIO_CONFIG_REG2 0x870 /* Configuration Register 2 */ @@ -147,8 +148,6 @@ struct fpgamgr_softc { struct resource *res[3]; - bus_space_tag_t bst; - bus_space_handle_t bsh; bus_space_tag_t bst_data; bus_space_handle_t bsh_data; struct cdev *mgr_cdev; @@ -163,20 +162,6 @@ }; static int -fpgamgr_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) - return (ENXIO); - - device_set_desc(dev, "FPGA Manager"); - return (BUS_PROBE_DEFAULT); -} - -static int fpgamgr_state_get(struct fpgamgr_softc *sc) { int reg; @@ -208,7 +193,7 @@ } static int -fpga_open(struct cdev *dev __unused, int flags __unused, +fpga_open(struct cdev *dev, int flags __unused, int fmt __unused, struct thread *td __unused) { struct fpgamgr_softc *sc; @@ -310,7 +295,7 @@ } static int -fpga_close(struct cdev *dev __unused, int flags __unused, +fpga_close(struct cdev *dev, int flags __unused, int fmt __unused, struct thread *td __unused) { struct fpgamgr_softc *sc; @@ -319,7 +304,7 @@ sc = dev->si_drv1; reg = READ4(sc, GPIO_EXT_PORTA); - if ((reg & (1 << 10)) == 0) { + if ((reg & EXT_PORTA_CDP) == 0) { device_printf(sc->dev, "Err: configuration failed\n"); return (ENXIO); } @@ -388,6 +373,20 @@ }; static int +fpgamgr_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) + return (ENXIO); + + device_set_desc(dev, "FPGA Manager"); + return (BUS_PROBE_DEFAULT); +} + +static int fpgamgr_attach(device_t dev) { struct fpgamgr_softc *sc; @@ -401,8 +400,6 @@ } /* Memory interface */ - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); sc->bst_data = rman_get_bustag(sc->res[1]); sc->bsh_data = rman_get_bushandle(sc->res[1]); --MGYHOYXEY6WxJCY8-- From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 13:21:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C32E6EE; Sat, 6 Sep 2014 13:21:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2C2B179C; Sat, 6 Sep 2014 13:21:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86DL7SJ095887; Sat, 6 Sep 2014 13:21:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86DL7BA095886; Sat, 6 Sep 2014 13:21:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409061321.s86DL7BA095886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Sep 2014 13:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271189 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 13:21:08 -0000 Author: andrew Date: Sat Sep 6 13:21:07 2014 New Revision: 271189 URL: http://svnweb.freebsd.org/changeset/base/271189 Log: Allow us to use the virtual timer. It is currently disabled, but should be usable as the default timer in place of the physical timer. We are guaranteed to have access to the virtual timer, but when running under a hypervisor may not have access to the physical. Differential Revision: https://reviews.freebsd.org/D588 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sat Sep 6 11:19:12 2014 (r271188) +++ head/sys/arm/arm/generic_timer.c Sat Sep 6 13:21:07 2014 (r271189) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); #define GT_CNTKCTL_PL0PTEN (1 << 9) /* PL0 Physical timer reg access */ #define GT_CNTKCTL_PL0VTEN (1 << 8) /* PL0 Virtual timer reg access */ -#define GT_CNTKCTL_EVNTI (1 << 4) /* Virtual counter event bits */ +#define GT_CNTKCTL_EVNTI (0xf << 4) /* Virtual counter event bits */ #define GT_CNTKCTL_EVNTDIR (1 << 3) /* Virtual counter event transition */ #define GT_CNTKCTL_EVNTEN (1 << 2) /* Enables virtual counter events */ #define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ @@ -78,6 +78,7 @@ struct arm_tmr_softc { void *ihl[4]; uint32_t clkfreq; struct eventtimer et; + bool physical; }; static struct arm_tmr_softc *arm_tmr_sc = NULL; @@ -101,81 +102,83 @@ static struct timecounter arm_tmr_timeco .tc_quality = 1000, }; -static inline int +static int get_freq(void) { uint32_t val; + /* cntfrq */ __asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); return (val); } -static inline int -set_freq(uint32_t val) -{ - - __asm volatile("mcr p15, 0, %[val], c14, c0, 0" : : - [val] "r" (val)); - isb(); - - return (val); -} - - -static inline long -get_cntpct(void) +static long +get_cntxct(bool physical) { uint64_t val; - __asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (val)); + isb(); + if (physical) + /* cntpct */ + __asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (val)); + else + /* cntvct */ + __asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (val)); return (val); } -static inline int -set_ctrl(uint32_t val) +static int +set_ctrl(uint32_t val, bool physical) { - __asm volatile("mcr p15, 0, %[val], c14, c2, 1" : : - [val] "r" (val)); + if (physical) + /* cntp_ctl */ + __asm volatile("mcr p15, 0, %[val], c14, c2, 1" : : + [val] "r" (val)); + else + /* cntv_ctl */ + __asm volatile("mcr p15, 0, %[val], c14, c3, 1" : : + [val] "r" (val)); isb(); return (0); } -static inline int -set_tval(uint32_t val) +static int +set_tval(uint32_t val, bool physical) { - __asm volatile("mcr p15, 0, %[val], c14, c2, 0" : : - [val] "r" (val)); + if (physical) + /* cntp_tval */ + __asm volatile("mcr p15, 0, %[val], c14, c2, 0" : : + [val] "r" (val)); + else + /* cntv_tval */ + __asm volatile("mcr p15, 0, %[val], c14, c3, 0" : : + [val] "r" (val)); isb(); return (0); } -static inline int -get_ctrl(void) -{ - uint32_t val; - - __asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); - - return (val); -} - -static inline int -get_tval(void) +static int +get_ctrl(bool physical) { uint32_t val; - __asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); + if (physical) + /* cntp_ctl */ + __asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); + else + /* cntv_ctl */ + __asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); return (val); } -static inline void +static void disable_user_access(void) { uint32_t cntkctl; @@ -191,7 +194,7 @@ static unsigned arm_tmr_get_timecount(struct timecounter *tc) { - return (get_cntpct()); + return (get_cntxct(arm_tmr_sc->physical)); } static int @@ -204,11 +207,11 @@ arm_tmr_start(struct eventtimer *et, sbi if (first != 0) { counts = ((uint32_t)et->et_frequency * first) >> 32; - ctrl = get_ctrl(); + ctrl = get_ctrl(sc->physical); ctrl &= ~GT_CTRL_INT_MASK; ctrl |= GT_CTRL_ENABLE; - set_tval(counts); - set_ctrl(ctrl); + set_tval(counts, sc->physical); + set_ctrl(ctrl, sc->physical); return (0); } @@ -219,11 +222,14 @@ arm_tmr_start(struct eventtimer *et, sbi static int arm_tmr_stop(struct eventtimer *et) { + struct arm_tmr_softc *sc; int ctrl; - ctrl = get_ctrl(); + sc = (struct arm_tmr_softc *)et->et_priv; + + ctrl = get_ctrl(sc->physical); ctrl &= GT_CTRL_ENABLE; - set_ctrl(ctrl); + set_ctrl(ctrl, sc->physical); return (0); } @@ -235,10 +241,10 @@ arm_tmr_intr(void *arg) int ctrl; sc = (struct arm_tmr_softc *)arg; - ctrl = get_ctrl(); + ctrl = get_ctrl(sc->physical); if (ctrl & GT_CTRL_INT_STAT) { ctrl |= GT_CTRL_INT_MASK; - set_ctrl(ctrl); + set_ctrl(ctrl, sc->physical); } if (sc->et.et_active) @@ -295,12 +301,14 @@ arm_tmr_attach(device_t dev) if (bus_alloc_resources(dev, timer_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); - }; + } + + sc->physical = true; arm_tmr_sc = sc; - /* Setup secure and non-secure IRQs handler */ - for (i = 0; i < 2; i++) { + /* Setup secure, non-secure and virtual IRQs handler */ + for (i = 0; i < 3; i++) { error = bus_setup_intr(dev, sc->res[i], INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, &sc->ihl[i]); if (error) { @@ -381,10 +389,10 @@ DELAY(int usec) else counts = usec * counts_per_usec; - first = get_cntpct(); + first = get_cntxct(arm_tmr_sc->physical); while (counts > 0) { - last = get_cntpct(); + last = get_cntxct(arm_tmr_sc->physical); counts -= (int32_t)(last - first); first = last; } From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:11:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AC6BB0B; Sat, 6 Sep 2014 15:11:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F07241139; Sat, 6 Sep 2014 15:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86FBZP8050027; Sat, 6 Sep 2014 15:11:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86FBZAB050025; Sat, 6 Sep 2014 15:11:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409061511.s86FBZAB050025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 6 Sep 2014 15:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271190 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:11:36 -0000 Author: ian Date: Sat Sep 6 15:11:35 2014 New Revision: 271190 URL: http://svnweb.freebsd.org/changeset/base/271190 Log: Add OF_xref_from_node_strict() which returns -1 if there is no xref handle for the node. The default routine returns the untranslated handle, which is sometimes useful, but sometimes you really need to know there's no entry in the xref<->node<->device translation table. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sat Sep 6 13:21:07 2014 (r271189) +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 15:11:35 2014 (r271190) @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) return (node); } -phandle_t -OF_xref_from_node(phandle_t node) +static phandle_t +xref_from_node(phandle_t node, phandle_t notfoundvalue) { struct xrefinfo *xi; phandle_t xref; if (xref_init_done) { if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) - return (node); + return (notfoundvalue); return (xi->xref); } @@ -570,10 +570,24 @@ OF_xref_from_node(phandle_t node) -1 && OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) - return (node); + return (notfoundvalue); return (xref); } +phandle_t +OF_xref_from_node(phandle_t node) +{ + + return (xref_from_node(node, node)); +} + +phandle_t +OF_xref_from_node_strict(phandle_t node) +{ + + return (xref_from_node(node, -1)); +} + device_t OF_device_from_xref(phandle_t xref) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Sat Sep 6 13:21:07 2014 (r271189) +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 15:11:35 2014 (r271190) @@ -128,10 +128,12 @@ ssize_t OF_package_to_path(phandle_t no * Some OF implementations (IBM, FDT) have a concept of effective phandles * used for device-tree cross-references. Given one of these, returns the * real phandle. If one can't be found (or running on OF implementations - * without this property), returns its input. + * without this property), OF_xref_from_node() returns its input, while the + * strict version returns -1. */ phandle_t OF_node_from_xref(phandle_t xref); phandle_t OF_xref_from_node(phandle_t node); +phandle_t OF_xref_from_node_strict(phandle_t node); /* * When properties contain references to other nodes using xref handles it is From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:23:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1352DFDC; Sat, 6 Sep 2014 15:23:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1661127D; Sat, 6 Sep 2014 15:23:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86FNUK5055962; Sat, 6 Sep 2014 15:23:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86FNSbY055950; Sat, 6 Sep 2014 15:23:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409061523.s86FNSbY055950@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 6 Sep 2014 15:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271192 - in head/sys: amd64/amd64 amd64/include dev/acpica i386/i386 i386/include sparc64/pci x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:23:31 -0000 Author: jhb Date: Sat Sep 6 15:23:28 2014 New Revision: 271192 URL: http://svnweb.freebsd.org/changeset/base/271192 Log: Create a separate structure for per-CPU state saved across suspend and resume that is a superset of a pcb. Move the FPU state out of the pcb and into this new structure. As part of this, move the FPU resume code on amd64 into a C function. This allows resumectx() to still operate only on a pcb and more closely mirrors the i386 code. Reviewed by: kib (earlier version) Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/fpu.h head/sys/amd64/include/pcb.h head/sys/dev/acpica/acpi.c head/sys/i386/i386/mp_machdep.c head/sys/i386/include/pcb.h head/sys/sparc64/pci/psycho.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/amd64/cpu_switch.S Sat Sep 6 15:23:28 2014 (r271192) @@ -399,10 +399,6 @@ ENTRY(savectx) rdmsr movl %eax,PCB_SFMASK(%rdi) movl %edx,PCB_SFMASK+4(%rdi) - movl xsave_mask,%eax - movl %eax,PCB_XSMASK(%rdi) - movl xsave_mask+4,%eax - movl %eax,PCB_XSMASK+4(%rdi) sgdt PCB_GDT(%rdi) sidt PCB_IDT(%rdi) @@ -467,12 +463,9 @@ ENTRY(resumectx) movl PCB_SFMASK(%rdi),%eax wrmsr - /* Restore CR0 except for FPU mode. */ + /* Restore CR0, CR2, CR4 and CR3. */ movq PCB_CR0(%rdi),%rax - andq $~(CR0_EM | CR0_TS),%rax movq %rax,%cr0 - - /* Restore CR2, CR4 and CR3. */ movq PCB_CR2(%rdi),%rax movq %rax,%cr2 movq PCB_CR4(%rdi),%rax @@ -510,26 +503,6 @@ ENTRY(resumectx) movq PCB_DR7(%rdi),%rax movq %rax,%dr7 - /* Restore FPU state. */ - fninit - movq PCB_FPUSUSPEND(%rdi),%rbx - movq PCB_XSMASK(%rdi),%rax - testq %rax,%rax - jz 1f - movq %rax,%rdx - shrq $32,%rdx - movl $XCR0,%ecx - xsetbv - xrstor (%rbx) - jmp 2f -1: - fxrstor (%rbx) -2: - - /* Reload CR0. */ - movq PCB_CR0(%rdi),%rax - movq %rax,%cr0 - /* Restore other callee saved registers. */ movq PCB_R15(%rdi),%r15 movq PCB_R14(%rdi),%r14 Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/amd64/fpu.c Sat Sep 6 15:23:28 2014 (r271192) @@ -173,6 +173,20 @@ fpususpend(void *addr) load_cr0(cr0); } +void +fpuresume(void *addr) +{ + u_long cr0; + + cr0 = rcr0(); + stop_emulating(); + fninit(); + if (use_xsave) + load_xcr(XCR0, xsave_mask); + fpurestore(addr); + load_cr0(cr0); +} + /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/amd64/genassym.c Sat Sep 6 15:23:28 2014 (r271192) @@ -163,8 +163,6 @@ ASSYM(PCB_STAR, offsetof(struct pcb, pcb ASSYM(PCB_LSTAR, offsetof(struct pcb, pcb_lstar)); ASSYM(PCB_CSTAR, offsetof(struct pcb, pcb_cstar)); ASSYM(PCB_SFMASK, offsetof(struct pcb, pcb_sfmask)); -ASSYM(PCB_XSMASK, offsetof(struct pcb, pcb_xsmask)); -ASSYM(PCB_FPUSUSPEND, offsetof(struct pcb, pcb_fpususpend)); ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/amd64/mp_machdep.c Sat Sep 6 15:23:28 2014 (r271192) @@ -102,7 +102,7 @@ char *nmi_stack; void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs; +struct susppcb **susppcbs; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr2; @@ -1461,11 +1461,12 @@ cpususpend_handler(void) mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); cpu = PCPU_GET(cpuid); - if (savectx(susppcbs[cpu])) { - fpususpend(susppcbs[cpu]->pcb_fpususpend); + if (savectx(&susppcbs[cpu]->sp_pcb)) { + fpususpend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { + fpuresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); initializecpu(); PCPU_SET(switchtime, 0); Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/include/fpu.h Sat Sep 6 15:23:28 2014 (r271192) @@ -58,6 +58,7 @@ int fpuformat(void); int fpugetregs(struct thread *td); void fpuinit(void); void fpurestore(void *addr); +void fpuresume(void *addr); void fpusave(void *addr); int fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate, size_t xfpustate_size); Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/amd64/include/pcb.h Sat Sep 6 15:23:28 2014 (r271192) @@ -97,14 +97,18 @@ struct pcb { register_t pcb_lstar; register_t pcb_cstar; register_t pcb_sfmask; - register_t pcb_xsmask; - - /* fpu context for suspend/resume */ - void *pcb_fpususpend; struct savefpu *pcb_save; - uint64_t pcb_pad[3]; + uint64_t pcb_pad[5]; +}; + +/* Per-CPU state saved during suspend and resume. */ +struct susppcb { + struct pcb sp_pcb; + + /* fpu context for suspend/resume */ + void *sp_fpususpend; }; #endif Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/dev/acpica/acpi.c Sat Sep 6 15:23:28 2014 (r271192) @@ -1211,6 +1211,11 @@ acpi_set_resource(device_t dev, device_t if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT)) #endif { + if (bootverbose) + device_printf(dev, + "Ignoring %s range %#lx-%#lx for %s\n", + type == SYS_RES_MEMORY ? "memory" : "I/O", + start, start + count - 1, acpi_name(ad->ad_handle)); AcpiOsFree(devinfo); return (0); } Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/i386/i386/mp_machdep.c Sat Sep 6 15:23:28 2014 (r271192) @@ -147,7 +147,7 @@ void *bootstacks[MAXCPU]; static void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs = NULL; +struct susppcb **susppcbs; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr1; @@ -1521,12 +1521,12 @@ cpususpend_handler(void) mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); cpu = PCPU_GET(cpuid); - if (savectx(susppcbs[cpu])) { - npxsuspend(&susppcbs[cpu]->pcb_fpususpend); + if (savectx(&susppcbs[cpu]->sp_pcb)) { + npxsuspend(&susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { - npxresume(&susppcbs[cpu]->pcb_fpususpend); + npxresume(&susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/i386/include/pcb.h Sat Sep 6 15:23:28 2014 (r271192) @@ -90,8 +90,11 @@ struct pcb { struct region_descriptor pcb_idt; uint16_t pcb_ldt; uint16_t pcb_tr; +}; - union savefpu pcb_fpususpend; +struct susppcb { + struct pcb sp_pcb; + union savefpu sp_fpususpend; }; #ifdef _KERNEL Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/sparc64/pci/psycho.c Sat Sep 6 15:23:28 2014 (r271192) @@ -448,24 +448,30 @@ psycho_attach(device_t dev) i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range); /* - * Make sure that the expected ranges are present. The - * OFW_PCI_CS_MEM64 one is not currently used though. - */ - if (i != PSYCHO_NRANGE) - panic("%s: unsupported number of ranges", __func__); - /* * Find the addresses of the various bus spaces. * There should not be multiple ones of one kind. * The physical start addresses of the ranges are the configuration, * memory and I/O handles. */ - for (i = 0; i < PSYCHO_NRANGE; i++) { + for (; i >= 0; i--) { j = OFW_PCI_RANGE_CS(&range[i]); if (sc->sc_pci_bh[j] != 0) panic("%s: duplicate range for space %d", __func__, j); sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]); } + + /* + * Make sure that the expected ranges are present. The + * OFW_PCI_CS_MEM64 one is not currently used. + */ + if (sc->sc_pci_bh[OFW_PCI_CS_CONFIG] == 0) + panic("%s: missing CONFIG range", __func__); + if (sc->sc_pci_bh[OFW_PCI_CS_IO] == 0) + panic("%s: missing IO range", __func__); + if (sc->sc_pci_bh[OFW_PCI_CS_MEM32] == 0) + panic("%s: missing MEM32 range", __func__); + free(range, M_OFWPROP); /* Register the softc, this is needed for paired Psychos. */ Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Sat Sep 6 15:15:06 2014 (r271191) +++ head/sys/x86/acpica/acpi_wakeup.c Sat Sep 6 15:23:28 2014 (r271192) @@ -75,10 +75,10 @@ extern int acpi_resume_beep; extern int acpi_reset_video; #ifdef SMP -extern struct pcb **susppcbs; +extern struct susppcb **susppcbs; static cpuset_t suspcpus; #else -static struct pcb **susppcbs; +static struct susppcb **susppcbs; #endif static void *acpi_alloc_wakeup_handler(void); @@ -117,14 +117,15 @@ acpi_stop_beep(void *arg) static int acpi_wakeup_ap(struct acpi_softc *sc, int cpu) { + struct pcb *pcb; int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; int apic_id = cpu_apic_ids[cpu]; int ms; - WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); - WAKECODE_FIXUP(wakeup_gdt, uint16_t, susppcbs[cpu]->pcb_gdt.rd_limit); - WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, - susppcbs[cpu]->pcb_gdt.rd_base); + pcb = &susppcbs[cpu]->sp_pcb; + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); ipi_startup(apic_id, vector); @@ -188,6 +189,7 @@ int acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; + struct pcb *pcb; if (sc->acpi_wakeaddr == 0ul) return (-1); /* couldn't alloc wake memory */ @@ -204,11 +206,12 @@ acpi_sleep_machdep(struct acpi_softc *sc intr_suspend(); - if (savectx(susppcbs[0])) { + pcb = &susppcbs[0]->sp_pcb; + if (savectx(pcb)) { #ifdef __amd64__ - fpususpend(susppcbs[0]->pcb_fpususpend); + fpususpend(susppcbs[0]->sp_fpususpend); #elif defined(DEV_NPX) - npxsuspend(&susppcbs[0]->pcb_fpususpend); + npxsuspend(&susppcbs[0]->sp_fpususpend); #endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { @@ -221,13 +224,11 @@ acpi_sleep_machdep(struct acpi_softc *sc WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifndef __amd64__ - WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); + WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif - WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); - WAKECODE_FIXUP(wakeup_gdt, uint16_t, - susppcbs[0]->pcb_gdt.rd_limit); - WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, - susppcbs[0]->pcb_gdt.rd_base); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) @@ -244,8 +245,10 @@ acpi_sleep_machdep(struct acpi_softc *sc for (;;) ia32_pause(); } else { -#ifdef DEV_NPX - npxresume(&susppcbs[0]->pcb_fpususpend); +#ifdef __amd64__ + fpuresume(susppcbs[0]->sp_fpususpend); +#elif defined(DEV_NPX) + npxresume(&susppcbs[0]->sp_fpususpend); #endif } @@ -325,7 +328,7 @@ acpi_alloc_wakeup_handler(void) for (i = 0; i < mp_ncpus; i++) { susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); #ifdef __amd64__ - susppcbs[i]->pcb_fpususpend = alloc_fpusave(M_WAITOK); + susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); #endif } From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:26:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0582D30E; Sat, 6 Sep 2014 15:26:04 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF6BC1294; Sat, 6 Sep 2014 15:26:03 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s86FPtll018241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 6 Sep 2014 08:25:56 -0700 Message-ID: <540B2783.9020808@freebsd.org> Date: Sat, 06 Sep 2014 08:25:55 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271190 - head/sys/dev/ofw References: <201409061511.s86FBZAB050025@svn.freebsd.org> In-Reply-To: <201409061511.s86FBZAB050025@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZmO0r8jtSlUxk5DAZ5bcqgG2qZUG3YrdEg67GsWoEd2oizSIzS2d/Lbz+8EJ8dSMMvkneYTGJMY2+pl489d/ACxBt/+x0Ez7c= X-Sonic-ID: C;6GhBGNo15BGh9EpcoK8kYw== M;MuC7GNo15BGh9EpcoK8kYw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:26:04 -0000 What is this for? The way the specification works here explicitly requires this fallback. -Nathan On 09/06/14 08:11, Ian Lepore wrote: > Author: ian > Date: Sat Sep 6 15:11:35 2014 > New Revision: 271190 > URL: http://svnweb.freebsd.org/changeset/base/271190 > > Log: > Add OF_xref_from_node_strict() which returns -1 if there is no xref handle > for the node. The default routine returns the untranslated handle, which > is sometimes useful, but sometimes you really need to know there's no > entry in the xref<->node<->device translation table. > > Modified: > head/sys/dev/ofw/openfirm.c > head/sys/dev/ofw/openfirm.h > > Modified: head/sys/dev/ofw/openfirm.c > ============================================================================== > --- head/sys/dev/ofw/openfirm.c Sat Sep 6 13:21:07 2014 (r271189) > +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 15:11:35 2014 (r271190) > @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) > return (node); > } > > -phandle_t > -OF_xref_from_node(phandle_t node) > +static phandle_t > +xref_from_node(phandle_t node, phandle_t notfoundvalue) > { > struct xrefinfo *xi; > phandle_t xref; > > if (xref_init_done) { > if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) > - return (node); > + return (notfoundvalue); > return (xi->xref); > } > > @@ -570,10 +570,24 @@ OF_xref_from_node(phandle_t node) > -1 && OF_getencprop(node, "ibm,phandle", &xref, > sizeof(xref)) == -1 && OF_getencprop(node, > "linux,phandle", &xref, sizeof(xref)) == -1) > - return (node); > + return (notfoundvalue); > return (xref); > } > > +phandle_t > +OF_xref_from_node(phandle_t node) > +{ > + > + return (xref_from_node(node, node)); > +} > + > +phandle_t > +OF_xref_from_node_strict(phandle_t node) > +{ > + > + return (xref_from_node(node, -1)); > +} > + > device_t > OF_device_from_xref(phandle_t xref) > { > > Modified: head/sys/dev/ofw/openfirm.h > ============================================================================== > --- head/sys/dev/ofw/openfirm.h Sat Sep 6 13:21:07 2014 (r271189) > +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 15:11:35 2014 (r271190) > @@ -128,10 +128,12 @@ ssize_t OF_package_to_path(phandle_t no > * Some OF implementations (IBM, FDT) have a concept of effective phandles > * used for device-tree cross-references. Given one of these, returns the > * real phandle. If one can't be found (or running on OF implementations > - * without this property), returns its input. > + * without this property), OF_xref_from_node() returns its input, while the > + * strict version returns -1. > */ > phandle_t OF_node_from_xref(phandle_t xref); > phandle_t OF_xref_from_node(phandle_t node); > +phandle_t OF_xref_from_node_strict(phandle_t node); > > /* > * When properties contain references to other nodes using xref handles it is > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:34:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50CA0833; Sat, 6 Sep 2014 15:34:40 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1168B137B; Sat, 6 Sep 2014 15:34:39 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XQI0b-000G6L-QN; Sat, 06 Sep 2014 15:34:37 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s86FYae5015588; Sat, 6 Sep 2014 09:34:36 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX180S/J7hPptC1+ffOizrxtM X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r271190 - head/sys/dev/ofw From: Ian Lepore To: Nathan Whitehorn In-Reply-To: <540B2783.9020808@freebsd.org> References: <201409061511.s86FBZAB050025@svn.freebsd.org> <540B2783.9020808@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 06 Sep 2014 09:34:36 -0600 Message-ID: <1410017676.1150.356.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:34:40 -0000 On Sat, 2014-09-06 at 08:25 -0700, Nathan Whitehorn wrote: > What is this for? The way the specification works here explicitly > requires this fallback. > -Nathan > It's for determining whether there is an entry in the device<->xref list. If a node has no xref phandle property there will be no entry for it in the list and thus no way to record or retrieve a device association. I found myself coding the "if it has a phandle, or an ibm,phandle, or a linux,phandle" incantation, then realized that all that figuring-out work was done at init time when the xref list is built, I just needed a way to get the result. -- Ian > On 09/06/14 08:11, Ian Lepore wrote: > > Author: ian > > Date: Sat Sep 6 15:11:35 2014 > > New Revision: 271190 > > URL: http://svnweb.freebsd.org/changeset/base/271190 > > > > Log: > > Add OF_xref_from_node_strict() which returns -1 if there is no xref handle > > for the node. The default routine returns the untranslated handle, which > > is sometimes useful, but sometimes you really need to know there's no > > entry in the xref<->node<->device translation table. > > > > Modified: > > head/sys/dev/ofw/openfirm.c > > head/sys/dev/ofw/openfirm.h > > > > Modified: head/sys/dev/ofw/openfirm.c > > ============================================================================== > > --- head/sys/dev/ofw/openfirm.c Sat Sep 6 13:21:07 2014 (r271189) > > +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 15:11:35 2014 (r271190) > > @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) > > return (node); > > } > > > > -phandle_t > > -OF_xref_from_node(phandle_t node) > > +static phandle_t > > +xref_from_node(phandle_t node, phandle_t notfoundvalue) > > { > > struct xrefinfo *xi; > > phandle_t xref; > > > > if (xref_init_done) { > > if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) > > - return (node); > > + return (notfoundvalue); > > return (xi->xref); > > } > > > > @@ -570,10 +570,24 @@ OF_xref_from_node(phandle_t node) > > -1 && OF_getencprop(node, "ibm,phandle", &xref, > > sizeof(xref)) == -1 && OF_getencprop(node, > > "linux,phandle", &xref, sizeof(xref)) == -1) > > - return (node); > > + return (notfoundvalue); > > return (xref); > > } > > > > +phandle_t > > +OF_xref_from_node(phandle_t node) > > +{ > > + > > + return (xref_from_node(node, node)); > > +} > > + > > +phandle_t > > +OF_xref_from_node_strict(phandle_t node) > > +{ > > + > > + return (xref_from_node(node, -1)); > > +} > > + > > device_t > > OF_device_from_xref(phandle_t xref) > > { > > > > Modified: head/sys/dev/ofw/openfirm.h > > ============================================================================== > > --- head/sys/dev/ofw/openfirm.h Sat Sep 6 13:21:07 2014 (r271189) > > +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 15:11:35 2014 (r271190) > > @@ -128,10 +128,12 @@ ssize_t OF_package_to_path(phandle_t no > > * Some OF implementations (IBM, FDT) have a concept of effective phandles > > * used for device-tree cross-references. Given one of these, returns the > > * real phandle. If one can't be found (or running on OF implementations > > - * without this property), returns its input. > > + * without this property), OF_xref_from_node() returns its input, while the > > + * strict version returns -1. > > */ > > phandle_t OF_node_from_xref(phandle_t xref); > > phandle_t OF_xref_from_node(phandle_t node); > > +phandle_t OF_xref_from_node_strict(phandle_t node); > > > > /* > > * When properties contain references to other nodes using xref handles it is > > > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:37:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3E07990; Sat, 6 Sep 2014 15:37:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF5BF139B; Sat, 6 Sep 2014 15:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Fbtvl061424; Sat, 6 Sep 2014 15:37:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86FbtLY061423; Sat, 6 Sep 2014 15:37:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409061537.s86FbtLY061423@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 6 Sep 2014 15:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271196 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:37:55 -0000 Author: mav Date: Sat Sep 6 15:37:55 2014 New Revision: 271196 URL: http://svnweb.freebsd.org/changeset/base/271196 Log: Fix typo in comments. Submitted by: Benedict Reuschling MFC after: 6 days Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Sep 6 15:30:57 2014 (r271195) +++ head/sys/dev/ahci/ahci.c Sat Sep 6 15:37:55 2014 (r271196) @@ -1535,8 +1535,9 @@ ahci_execute_transaction(struct ahci_slo /* * Marvell HBAs with non-RAID firmware do not wait for * readiness after soft reset, so we have to wait here. - * Marvell RAIDs have no this problem, but instead sometimes - * forget to update FIS receive area, breaking this wait. + * Marvell RAIDs do not have this problem, but instead + * sometimes forget to update FIS receive area, breaking + * this wait. */ if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 && (ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 && From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:39:03 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE86BAD1; Sat, 6 Sep 2014 15:39:02 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D358C13A3; Sat, 6 Sep 2014 15:39:02 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s86Fd0oh031419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 6 Sep 2014 08:39:01 -0700 Message-ID: <540B2A94.4090201@freebsd.org> Date: Sat, 06 Sep 2014 08:39:00 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r271190 - head/sys/dev/ofw References: <201409061511.s86FBZAB050025@svn.freebsd.org> <540B2783.9020808@freebsd.org> <1410017676.1150.356.camel@revolution.hippie.lan> In-Reply-To: <1410017676.1150.356.camel@revolution.hippie.lan> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbjB3dvfc4QCRL4bZYXSiQzVA2HFeqU1occLgeIycaeo9nfX+hcuHBAInSJTKJ2NUcfyCin65Xe3F6Qg6nJSObGmNRtyp30KD4= X-Sonic-ID: C;AvJZ7Ns15BGCX0pcoK8kYw== M;UkSe7Ns15BGCX0pcoK8kYw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:39:03 -0000 On 09/06/14 08:34, Ian Lepore wrote: > On Sat, 2014-09-06 at 08:25 -0700, Nathan Whitehorn wrote: >> What is this for? The way the specification works here explicitly >> requires this fallback. >> -Nathan >> > It's for determining whether there is an entry in the device<->xref > list. If a node has no xref phandle property there will be no entry for > it in the list and thus no way to record or retrieve a device > association. I found myself coding the "if it has a phandle, or an > ibm,phandle, or a linux,phandle" incantation, then realized that all > that figuring-out work was done at init time when the xref list is > built, I just needed a way to get the result. This isn't true. On most but not all real OF systems, which use, or will use, the same mechanism, there is no distinction between "regular" and "cross-reference" phandles and device tree cross-references still exist with no explicit phandle property. So registering a device without a phandle property has to to work, and has to fall back to the regular phandle 100% of the time. What may be true is that no single device tree has a mixture of implicit and explicit cross-reference handles, so you could set a flag or something. But it's probably not worth it. Do you have a concrete example where you cared about this? -Nathan > -- Ian > >> On 09/06/14 08:11, Ian Lepore wrote: >>> Author: ian >>> Date: Sat Sep 6 15:11:35 2014 >>> New Revision: 271190 >>> URL: http://svnweb.freebsd.org/changeset/base/271190 >>> >>> Log: >>> Add OF_xref_from_node_strict() which returns -1 if there is no xref handle >>> for the node. The default routine returns the untranslated handle, which >>> is sometimes useful, but sometimes you really need to know there's no >>> entry in the xref<->node<->device translation table. >>> >>> Modified: >>> head/sys/dev/ofw/openfirm.c >>> head/sys/dev/ofw/openfirm.h >>> >>> Modified: head/sys/dev/ofw/openfirm.c >>> ============================================================================== >>> --- head/sys/dev/ofw/openfirm.c Sat Sep 6 13:21:07 2014 (r271189) >>> +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 15:11:35 2014 (r271190) >>> @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) >>> return (node); >>> } >>> >>> -phandle_t >>> -OF_xref_from_node(phandle_t node) >>> +static phandle_t >>> +xref_from_node(phandle_t node, phandle_t notfoundvalue) >>> { >>> struct xrefinfo *xi; >>> phandle_t xref; >>> >>> if (xref_init_done) { >>> if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) >>> - return (node); >>> + return (notfoundvalue); >>> return (xi->xref); >>> } >>> >>> @@ -570,10 +570,24 @@ OF_xref_from_node(phandle_t node) >>> -1 && OF_getencprop(node, "ibm,phandle", &xref, >>> sizeof(xref)) == -1 && OF_getencprop(node, >>> "linux,phandle", &xref, sizeof(xref)) == -1) >>> - return (node); >>> + return (notfoundvalue); >>> return (xref); >>> } >>> >>> +phandle_t >>> +OF_xref_from_node(phandle_t node) >>> +{ >>> + >>> + return (xref_from_node(node, node)); >>> +} >>> + >>> +phandle_t >>> +OF_xref_from_node_strict(phandle_t node) >>> +{ >>> + >>> + return (xref_from_node(node, -1)); >>> +} >>> + >>> device_t >>> OF_device_from_xref(phandle_t xref) >>> { >>> >>> Modified: head/sys/dev/ofw/openfirm.h >>> ============================================================================== >>> --- head/sys/dev/ofw/openfirm.h Sat Sep 6 13:21:07 2014 (r271189) >>> +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 15:11:35 2014 (r271190) >>> @@ -128,10 +128,12 @@ ssize_t OF_package_to_path(phandle_t no >>> * Some OF implementations (IBM, FDT) have a concept of effective phandles >>> * used for device-tree cross-references. Given one of these, returns the >>> * real phandle. If one can't be found (or running on OF implementations >>> - * without this property), returns its input. >>> + * without this property), OF_xref_from_node() returns its input, while the >>> + * strict version returns -1. >>> */ >>> phandle_t OF_node_from_xref(phandle_t xref); >>> phandle_t OF_xref_from_node(phandle_t node); >>> +phandle_t OF_xref_from_node_strict(phandle_t node); >>> >>> /* >>> * When properties contain references to other nodes using xref handles it is >>> > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:45:10 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC145E2B; Sat, 6 Sep 2014 15:45:10 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B35214C2; Sat, 6 Sep 2014 15:45:09 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XQIAn-000G58-2S; Sat, 06 Sep 2014 15:45:09 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s86Fj8pe015621; Sat, 6 Sep 2014 09:45:08 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+qymkkWQ6IPjrKnljNoaYQ X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r271190 - head/sys/dev/ofw From: Ian Lepore To: Nathan Whitehorn In-Reply-To: <540B2A94.4090201@freebsd.org> References: <201409061511.s86FBZAB050025@svn.freebsd.org> <540B2783.9020808@freebsd.org> <1410017676.1150.356.camel@revolution.hippie.lan> <540B2A94.4090201@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 06 Sep 2014 09:45:07 -0600 Message-ID: <1410018307.1150.358.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:45:11 -0000 On Sat, 2014-09-06 at 08:39 -0700, Nathan Whitehorn wrote: > On 09/06/14 08:34, Ian Lepore wrote: > > On Sat, 2014-09-06 at 08:25 -0700, Nathan Whitehorn wrote: > >> What is this for? The way the specification works here explicitly > >> requires this fallback. > >> -Nathan > >> > > It's for determining whether there is an entry in the device<->xref > > list. If a node has no xref phandle property there will be no entry for > > it in the list and thus no way to record or retrieve a device > > association. I found myself coding the "if it has a phandle, or an > > ibm,phandle, or a linux,phandle" incantation, then realized that all > > that figuring-out work was done at init time when the xref list is > > built, I just needed a way to get the result. > > This isn't true. On most but not all real OF systems, which use, or will > use, the same mechanism, there is no distinction between "regular" and > "cross-reference" phandles and device tree cross-references still exist > with no explicit phandle property. So registering a device without a > phandle property has to to work, and has to fall back to the regular > phandle 100% of the time. > Oh. That wasn't clear when you helped me last week with the xref list stuff. I'll have to rework that a bit to meet the requirements you list above. -- Ian > What may be true is that no single device tree has a mixture of implicit > and explicit cross-reference handles, so you could set a flag or > something. But it's probably not worth it. Do you have a concrete > example where you cared about this? > -Nathan > > > -- Ian > > > >> On 09/06/14 08:11, Ian Lepore wrote: > >>> Author: ian > >>> Date: Sat Sep 6 15:11:35 2014 > >>> New Revision: 271190 > >>> URL: http://svnweb.freebsd.org/changeset/base/271190 > >>> > >>> Log: > >>> Add OF_xref_from_node_strict() which returns -1 if there is no xref handle > >>> for the node. The default routine returns the untranslated handle, which > >>> is sometimes useful, but sometimes you really need to know there's no > >>> entry in the xref<->node<->device translation table. > >>> > >>> Modified: > >>> head/sys/dev/ofw/openfirm.c > >>> head/sys/dev/ofw/openfirm.h > >>> > >>> Modified: head/sys/dev/ofw/openfirm.c > >>> ============================================================================== > >>> --- head/sys/dev/ofw/openfirm.c Sat Sep 6 13:21:07 2014 (r271189) > >>> +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 15:11:35 2014 (r271190) > >>> @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) > >>> return (node); > >>> } > >>> > >>> -phandle_t > >>> -OF_xref_from_node(phandle_t node) > >>> +static phandle_t > >>> +xref_from_node(phandle_t node, phandle_t notfoundvalue) > >>> { > >>> struct xrefinfo *xi; > >>> phandle_t xref; > >>> > >>> if (xref_init_done) { > >>> if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) > >>> - return (node); > >>> + return (notfoundvalue); > >>> return (xi->xref); > >>> } > >>> > >>> @@ -570,10 +570,24 @@ OF_xref_from_node(phandle_t node) > >>> -1 && OF_getencprop(node, "ibm,phandle", &xref, > >>> sizeof(xref)) == -1 && OF_getencprop(node, > >>> "linux,phandle", &xref, sizeof(xref)) == -1) > >>> - return (node); > >>> + return (notfoundvalue); > >>> return (xref); > >>> } > >>> > >>> +phandle_t > >>> +OF_xref_from_node(phandle_t node) > >>> +{ > >>> + > >>> + return (xref_from_node(node, node)); > >>> +} > >>> + > >>> +phandle_t > >>> +OF_xref_from_node_strict(phandle_t node) > >>> +{ > >>> + > >>> + return (xref_from_node(node, -1)); > >>> +} > >>> + > >>> device_t > >>> OF_device_from_xref(phandle_t xref) > >>> { > >>> > >>> Modified: head/sys/dev/ofw/openfirm.h > >>> ============================================================================== > >>> --- head/sys/dev/ofw/openfirm.h Sat Sep 6 13:21:07 2014 (r271189) > >>> +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 15:11:35 2014 (r271190) > >>> @@ -128,10 +128,12 @@ ssize_t OF_package_to_path(phandle_t no > >>> * Some OF implementations (IBM, FDT) have a concept of effective phandles > >>> * used for device-tree cross-references. Given one of these, returns the > >>> * real phandle. If one can't be found (or running on OF implementations > >>> - * without this property), returns its input. > >>> + * without this property), OF_xref_from_node() returns its input, while the > >>> + * strict version returns -1. > >>> */ > >>> phandle_t OF_node_from_xref(phandle_t xref); > >>> phandle_t OF_xref_from_node(phandle_t node); > >>> +phandle_t OF_xref_from_node_strict(phandle_t node); > >>> > >>> /* > >>> * When properties contain references to other nodes using xref handles it is > >>> > > > > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 15:45:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEAA0F67; Sat, 6 Sep 2014 15:45:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8041114C6; Sat, 6 Sep 2014 15:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Fjkgw065961; Sat, 6 Sep 2014 15:45:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86FjknW065959; Sat, 6 Sep 2014 15:45:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409061545.s86FjknW065959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 6 Sep 2014 15:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271197 - in head/sys/x86: include x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 15:45:46 -0000 Author: kib Date: Sat Sep 6 15:45:45 2014 New Revision: 271197 URL: http://svnweb.freebsd.org/changeset/base/271197 Log: Add more bits for the XSAVE features from CPUID 0xd, sub-function 1 %eax report. Print the XSAVE features 0xd/1 in the boot banner. The printcpuinfo() is executed late enough so that XSAVE is already enabled. There is no known to me off the shelf hardware that implements any feature bits except XSAVEOPT, the list is taken from SDM rev. 50. The banner printing will allow us to note the hardware arrival. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Sep 6 15:37:55 2014 (r271196) +++ head/sys/x86/include/specialreg.h Sat Sep 6 15:45:45 2014 (r271197) @@ -296,6 +296,9 @@ * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1 */ #define CPUID_EXTSTATE_XSAVEOPT 0x00000001 +#define CPUID_EXTSTATE_XSAVEC 0x00000002 +#define CPUID_EXTSTATE_XINUSE 0x00000004 +#define CPUID_EXTSTATE_XSAVES 0x00000008 /* * AMD extended function 8000_0007h edx info Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Sep 6 15:37:55 2014 (r271196) +++ head/sys/x86/x86/identcpu.c Sat Sep 6 15:45:45 2014 (r271197) @@ -932,6 +932,19 @@ printcpuinfo(void) ); } + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { + cpuid_count(0xd, 0x1, regs); + if (regs[0] != 0) { + printf("\n XSAVE Features=0x%b", + regs[0], + "\020" + "\001XSAVEOPT" + "\002XSAVEC" + "\003XINUSE" + "\004XSAVES"); + } + } + if (via_feature_rng != 0 || via_feature_xcrypt != 0) print_via_padlock_info(); From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 17:33:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30B476C8; Sat, 6 Sep 2014 17:33:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C25E1F57; Sat, 6 Sep 2014 17:33:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86HXfkI020975; Sat, 6 Sep 2014 17:33:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86HXfTK020974; Sat, 6 Sep 2014 17:33:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409061733.s86HXfTK020974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Sep 2014 17:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271198 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 17:33:42 -0000 Author: andrew Date: Sat Sep 6 17:33:41 2014 New Revision: 271198 URL: http://svnweb.freebsd.org/changeset/base/271198 Log: Fixthe spelling of ehci Modified: head/sys/arm/freescale/imx/files.imx51 Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Sat Sep 6 15:45:45 2014 (r271197) +++ head/sys/arm/freescale/imx/files.imx51 Sat Sep 6 17:33:41 2014 (r271198) @@ -37,7 +37,7 @@ dev/ata/chipsets/ata-fsl.c optional imx dev/uart/uart_dev_imx.c optional uart # USB OH3 controller (1 OTG, 3 EHCI) -arm/freescale/imx/imx_nop_usbphy.c optional echi +arm/freescale/imx/imx_nop_usbphy.c optional ehci dev/usb/controller/ehci_imx.c optional ehci # Watchdog From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 17:51:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5557B4F; Sat, 6 Sep 2014 17:51:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73C210BC; Sat, 6 Sep 2014 17:51:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Hp0l4030057; Sat, 6 Sep 2014 17:51:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86Hp0Vc030052; Sat, 6 Sep 2014 17:51:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409061751.s86Hp0Vc030052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 6 Sep 2014 17:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271199 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 17:51:01 -0000 Author: ian Date: Sat Sep 6 17:50:59 2014 New Revision: 271199 URL: http://svnweb.freebsd.org/changeset/base/271199 Log: Revert rr271190, it was based on a misunderstanding. The problem of non-existant device<->xref info needs to be handled by creating the info, which will come in a subsequent commit. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sat Sep 6 17:33:41 2014 (r271198) +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 17:50:59 2014 (r271199) @@ -554,15 +554,15 @@ OF_node_from_xref(phandle_t xref) return (node); } -static phandle_t -xref_from_node(phandle_t node, phandle_t notfoundvalue) +phandle_t +OF_xref_from_node(phandle_t node) { struct xrefinfo *xi; phandle_t xref; if (xref_init_done) { if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL) - return (notfoundvalue); + return (node); return (xi->xref); } @@ -570,24 +570,10 @@ xref_from_node(phandle_t node, phandle_t -1 && OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 && OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) - return (notfoundvalue); + return (node); return (xref); } -phandle_t -OF_xref_from_node(phandle_t node) -{ - - return (xref_from_node(node, node)); -} - -phandle_t -OF_xref_from_node_strict(phandle_t node) -{ - - return (xref_from_node(node, -1)); -} - device_t OF_device_from_xref(phandle_t xref) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Sat Sep 6 17:33:41 2014 (r271198) +++ head/sys/dev/ofw/openfirm.h Sat Sep 6 17:50:59 2014 (r271199) @@ -128,12 +128,10 @@ ssize_t OF_package_to_path(phandle_t no * Some OF implementations (IBM, FDT) have a concept of effective phandles * used for device-tree cross-references. Given one of these, returns the * real phandle. If one can't be found (or running on OF implementations - * without this property), OF_xref_from_node() returns its input, while the - * strict version returns -1. + * without this property), returns its input. */ phandle_t OF_node_from_xref(phandle_t xref); phandle_t OF_xref_from_node(phandle_t node); -phandle_t OF_xref_from_node_strict(phandle_t node); /* * When properties contain references to other nodes using xref handles it is From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 18:08:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63DD5F7F; Sat, 6 Sep 2014 18:08:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F60612C8; Sat, 6 Sep 2014 18:08:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86I8MaL036009; Sat, 6 Sep 2014 18:08:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86I8LvX036006; Sat, 6 Sep 2014 18:08:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <201409061808.s86I8LvX036006@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sat, 6 Sep 2014 18:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271200 - head/sys/arm/altera/socfpga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 18:08:22 -0000 Author: br Date: Sat Sep 6 18:08:21 2014 New Revision: 271200 URL: http://svnweb.freebsd.org/changeset/base/271200 Log: o Remove __unused attribute on variables which actually used o Unmagic 'configuration done' bit o Move probe() to place before attach() for better navigation o Use bus_read_n instead of bus_space_read_n functions Pointed out by: andrew Sponsored by: DARPA, AFRL Modified: head/sys/arm/altera/socfpga/socfpga_common.h head/sys/arm/altera/socfpga/socfpga_manager.c Modified: head/sys/arm/altera/socfpga/socfpga_common.h ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_common.h Sat Sep 6 17:50:59 2014 (r271199) +++ head/sys/arm/altera/socfpga/socfpga_common.h Sat Sep 6 18:08:21 2014 (r271200) @@ -30,15 +30,9 @@ * $FreeBSD$ */ -#define READ4(_sc, _reg) \ - bus_space_read_4(_sc->bst, _sc->bsh, _reg) -#define WRITE4(_sc, _reg, _val) \ - bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) -#define READ2(_sc, _reg) \ - bus_space_read_2(_sc->bst, _sc->bsh, _reg) -#define WRITE2(_sc, _reg, _val) \ - bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) -#define READ1(_sc, _reg) \ - bus_space_read_1(_sc->bst, _sc->bsh, _reg) -#define WRITE1(_sc, _reg, _val) \ - bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) +#define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) +#define READ2(_sc, _reg) bus_read_2((_sc)->res[0], _reg) +#define READ1(_sc, _reg) bus_read_1((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) bus_write_4((_sc)->res[0], _reg, _val) +#define WRITE2(_sc, _reg, _val) bus_write_2((_sc)->res[0], _reg, _val) +#define WRITE1(_sc, _reg, _val) bus_write_1((_sc)->res[0], _reg, _val) Modified: head/sys/arm/altera/socfpga/socfpga_manager.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_manager.c Sat Sep 6 17:50:59 2014 (r271199) +++ head/sys/arm/altera/socfpga/socfpga_manager.c Sat Sep 6 18:08:21 2014 (r271200) @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #define GPIO_PORTA_EOI 0x84C /* Clear Interrupt Register */ #define PORTA_EOI_NS (1 << 0) #define GPIO_EXT_PORTA 0x850 /* External Port A Register */ +#define EXT_PORTA_CDP (1 << 10) /* Configuration done */ #define GPIO_LS_SYNC 0x860 /* Synchronization Level Register */ #define GPIO_VER_ID_CODE 0x86C /* GPIO Version Register */ #define GPIO_CONFIG_REG2 0x870 /* Configuration Register 2 */ @@ -147,8 +148,6 @@ static struct cfgmgr_mode cfgmgr_modes[] struct fpgamgr_softc { struct resource *res[3]; - bus_space_tag_t bst; - bus_space_handle_t bsh; bus_space_tag_t bst_data; bus_space_handle_t bsh_data; struct cdev *mgr_cdev; @@ -163,20 +162,6 @@ static struct resource_spec fpgamgr_spec }; static int -fpgamgr_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) - return (ENXIO); - - device_set_desc(dev, "FPGA Manager"); - return (BUS_PROBE_DEFAULT); -} - -static int fpgamgr_state_get(struct fpgamgr_softc *sc) { int reg; @@ -208,7 +193,7 @@ fpgamgr_state_wait(struct fpgamgr_softc } static int -fpga_open(struct cdev *dev __unused, int flags __unused, +fpga_open(struct cdev *dev, int flags __unused, int fmt __unused, struct thread *td __unused) { struct fpgamgr_softc *sc; @@ -310,7 +295,7 @@ fpga_wait_dclk_pulses(struct fpgamgr_sof } static int -fpga_close(struct cdev *dev __unused, int flags __unused, +fpga_close(struct cdev *dev, int flags __unused, int fmt __unused, struct thread *td __unused) { struct fpgamgr_softc *sc; @@ -319,7 +304,7 @@ fpga_close(struct cdev *dev __unused, in sc = dev->si_drv1; reg = READ4(sc, GPIO_EXT_PORTA); - if ((reg & (1 << 10)) == 0) { + if ((reg & EXT_PORTA_CDP) == 0) { device_printf(sc->dev, "Err: configuration failed\n"); return (ENXIO); } @@ -388,6 +373,20 @@ static struct cdevsw fpga_cdevsw = { }; static int +fpgamgr_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "altr,fpga-mgr")) + return (ENXIO); + + device_set_desc(dev, "FPGA Manager"); + return (BUS_PROBE_DEFAULT); +} + +static int fpgamgr_attach(device_t dev) { struct fpgamgr_softc *sc; @@ -401,8 +400,6 @@ fpgamgr_attach(device_t dev) } /* Memory interface */ - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); sc->bst_data = rman_get_bustag(sc->res[1]); sc->bsh_data = rman_get_bushandle(sc->res[1]); From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 18:20:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E711557; Sat, 6 Sep 2014 18:20:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4AB13CF; Sat, 6 Sep 2014 18:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86IKpfM042261; Sat, 6 Sep 2014 18:20:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86IKpnw042259; Sat, 6 Sep 2014 18:20:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201409061820.s86IKpnw042259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 6 Sep 2014 18:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271201 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 18:20:51 -0000 Author: imp Date: Sat Sep 6 18:20:50 2014 New Revision: 271201 URL: http://svnweb.freebsd.org/changeset/base/271201 Log: Restore order of interrupt setup. Minor problems can result by setting up the interrupts too early: Reviewed by: mav@ Sponsored by: Netflix Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Sep 6 18:08:21 2014 (r271200) +++ head/sys/dev/ahci/ahci.c Sat Sep 6 18:20:50 2014 (r271201) @@ -229,6 +229,15 @@ ahci_attach(device_t dev) ahci_ctlr_setup(dev); + /* Setup interrupts. */ + if (ahci_setup_interrupt(dev)) { + bus_dma_tag_destroy(ctlr->dma_tag); + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, + ctlr->r_mem); + rman_fini(&ctlr->sc_iomem); + return ENXIO; + } + i = 0; for (u = ctlr->ichannels; u != 0; u >>= 1) i += (u & 1); Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sat Sep 6 18:08:21 2014 (r271200) +++ head/sys/dev/ahci/ahci_pci.c Sat Sep 6 18:20:50 2014 (r271201) @@ -417,13 +417,6 @@ ahci_pci_attach(device_t dev) ctlr->numirqs = 1; } - if (ahci_setup_interrupt(dev)) { - if (ctlr->msi) - pci_release_msi(dev); - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - return ENXIO; - } - error = ahci_attach(dev); if (error != 0) if (ctlr->msi) From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 18:43:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A7CE966; Sat, 6 Sep 2014 18:43:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA02017B8; Sat, 6 Sep 2014 18:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86IhHW2054857; Sat, 6 Sep 2014 18:43:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86IhHMJ054856; Sat, 6 Sep 2014 18:43:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409061843.s86IhHMJ054856@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 6 Sep 2014 18:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271202 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 18:43:18 -0000 Author: ian Date: Sat Sep 6 18:43:17 2014 New Revision: 271202 URL: http://svnweb.freebsd.org/changeset/base/271202 Log: When registering an association between a device and an xref phandle, create an entry in the xref list if one doesn't already exist for the given handle. On a system that uses phandle properties, the init-time scan of the tree which builds the xref list will pre-create entries for every xref handle that exists in the data. On systems where the xref and node handles are synonymous there is no phandle property in referenced nodes, and the xref list will initialize to an empty state. In the latter case, we still need to be able to associate a device_t with an xref handle, so we create list entries on the fly as needed. Since the node and xref handles are synonymous, we have all the info needed to create a list entry at device registration time. The downside to this change is that it basically allows on the fly creation of xref handles as synonyms of node handles, and the association of a device_t with them. Whether this is a bug or a feature is in the eye of the beholder, I guess. Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sat Sep 6 18:20:50 2014 (r271201) +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 18:43:17 2014 (r271202) @@ -62,7 +62,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include @@ -92,6 +95,7 @@ struct xrefinfo { }; static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); +static struct mtx xreflist_lock; static boolean_t xref_init_done; #define FIND_BY_XREF 0 @@ -138,6 +142,12 @@ static void xrefinfo_init(void *unsed) { + /* + * There is no locking during this init because it runs much earlier + * than any of the clients/consumers of the xref list data, but we do + * initialize the mutex that will be used for access later. + */ + mtx_init(&xreflist_lock, "OF xreflist lock", NULL, MTX_DEF); xrefinfo_create(OF_peer(0)); xref_init_done = true; } @@ -146,17 +156,35 @@ SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ static struct xrefinfo * xrefinfo_find(phandle_t phandle, int find_by) { - struct xrefinfo * xi; + struct xrefinfo *rv, *xi; + rv = NULL; + mtx_lock(&xreflist_lock); SLIST_FOREACH(xi, &xreflist, next_entry) { - if (find_by == FIND_BY_XREF && phandle == xi->xref) - return (xi); - else if (find_by == FIND_BY_NODE && phandle == xi->node) - return (xi); - else if (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev) - return (xi); + if ((find_by == FIND_BY_XREF && phandle == xi->xref) || + (find_by == FIND_BY_NODE && phandle == xi->node) || + (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { + rv = xi; + break; + } } - return (NULL); + mtx_unlock(&xreflist_lock); + return (rv); +} + +static struct xrefinfo * +xrefinfo_add(phandle_t node, phandle_t xref, device_t dev) +{ + struct xrefinfo *xi; + + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK); + xi->node = node; + xi->xref = xref; + xi->dev = dev; + mtx_lock(&xreflist_lock); + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); + mtx_unlock(&xreflist_lock); + return (xi); } /* @@ -605,10 +633,17 @@ OF_device_register_xref(phandle_t xref, { struct xrefinfo *xi; + /* + * If the given xref handle doesn't already exist in the list then we + * add a list entry. In theory this can only happen on a system where + * nodes don't contain phandle properties and xref and node handles are + * synonymous, so the xref handle is added as the node handle as well. + */ if (xref_init_done) { if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) - return (ENXIO); - xi->dev = dev; + xrefinfo_add(xref, xref, dev); + else + xi->dev = dev; return (0); } panic("Attempt to register device before xreflist_init"); From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:12:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D68422F1; Sat, 6 Sep 2014 19:12:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0FCA1A96; Sat, 6 Sep 2014 19:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86JCFWR069522; Sat, 6 Sep 2014 19:12:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86JCF13069516; Sat, 6 Sep 2014 19:12:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409061912.s86JCF13069516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 6 Sep 2014 19:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271204 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:12:16 -0000 Author: tuexen Date: Sat Sep 6 19:12:14 2014 New Revision: 271204 URL: http://svnweb.freebsd.org/changeset/base/271204 Log: Fix the handling of sysctl variables when used with VIMAGE. While there do some cleanup of the code. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Sep 6 19:02:52 2014 (r271203) +++ head/sys/netinet/sctp_constants.h Sat Sep 6 19:12:14 2014 (r271204) @@ -267,18 +267,9 @@ __FBSDID("$FreeBSD$"); /* how many addresses per assoc remote and local */ #define SCTP_SCALE_FOR_ADDR 2 -/* default AUTO_ASCONF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_AUTO_ASCONF 1 - /* default MULTIPLE_ASCONF mode enable(1)/disable(0) value (sysctl) */ #define SCTP_DEFAULT_MULTIPLE_ASCONFS 0 -/* default MOBILITY_BASE mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_BASE 0 - -/* default MOBILITY_FASTHANDOFF mode enable(1)/disable(0) value (sysctl) */ -#define SCTP_DEFAULT_MOBILITY_FASTHANDOFF 0 - /* * Theshold for rwnd updates, we have to read (sb_hiwat >> * SCTP_RWND_HIWAT_SHIFT) before we will look to see if we need to send a Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sat Sep 6 19:02:52 2014 (r271203) +++ head/sys/netinet/sctp_os_bsd.h Sat Sep 6 19:12:14 2014 (r271204) @@ -152,16 +152,10 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define V_system_base_info VNET(system_base_info) #define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m #define SCTP_BASE_STATS V_system_base_info.sctpstat -#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat) -#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m) +#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m +#define SCTP_BASE_SYSCTL(__m) V_system_base_info.sctpsysctl.__m #define SCTP_BASE_VAR(__m) V_system_base_info.__m -/* - * - */ -#define USER_ADDR_NULL (NULL) /* FIX ME: temp */ - #define SCTP_PRINTF(params...) printf(params) #if defined(SCTP_DEBUG) #define SCTPDBG(level, params...) \ @@ -175,9 +169,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); #define SCTPDBG_ADDR(level, addr) \ { \ do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ - sctp_print_address(addr); \ - } \ + if (SCTP_BASE_SYSCTL(sctp_debug_on) & level ) { \ + sctp_print_address(addr); \ + } \ } while (0); \ } #else Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat Sep 6 19:02:52 2014 (r271203) +++ head/sys/netinet/sctp_sysctl.c Sat Sep 6 19:12:14 2014 (r271204) @@ -105,9 +105,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; - /* JRS - Variable for default congestion control module */ SCTP_BASE_SYSCTL(sctp_default_cc_module) = SCTPCTL_DEFAULT_CC_MODULE_DEFAULT; - /* RS - Variable for default stream scheduling module */ SCTP_BASE_SYSCTL(sctp_default_ss_module) = SCTPCTL_DEFAULT_SS_MODULE_DEFAULT; SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; @@ -139,7 +137,7 @@ sctp_init_sysctls() /* It returns an upper limit. No filtering is done here */ static unsigned int -number_of_addresses(struct sctp_inpcb *inp) +sctp_sysctl_number_of_addresses(struct sctp_inpcb *inp) { unsigned int cnt; struct sctp_vrf *vrf; @@ -189,7 +187,7 @@ number_of_addresses(struct sctp_inpcb *i } static int -copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) +sctp_sysctl_copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) { struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; @@ -355,7 +353,7 @@ copy_out_local_addresses(struct sctp_inp * sysctl functions */ static int -sctp_assoclist(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) { unsigned int number_of_endpoints; unsigned int number_of_local_addresses; @@ -377,14 +375,14 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) number_of_remote_addresses = 0; SCTP_INP_INFO_RLOCK(); - if (req->oldptr == USER_ADDR_NULL) { + if (req->oldptr == NULL) { LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); number_of_endpoints++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { number_of_associations++; - number_of_local_addresses += number_of_addresses(inp); + number_of_local_addresses += sctp_sysctl_number_of_addresses(inp); TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { number_of_remote_addresses++; } @@ -401,7 +399,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) req->oldidx = (n + n / 8); return (0); } - if (req->newptr != USER_ADDR_NULL) { + if (req->newptr != NULL) { SCTP_INP_INFO_RUNLOCK(); SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); @@ -439,7 +437,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, NULL, req); + error = sctp_sysctl_copy_out_local_addresses(inp, NULL, req); if (error) { SCTP_INP_DECR_REF(inp); return (error); @@ -490,7 +488,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) } SCTP_INP_INFO_RLOCK(); SCTP_INP_RLOCK(inp); - error = copy_out_local_addresses(inp, stcb, req); + error = sctp_sysctl_copy_out_local_addresses(inp, stcb, req); if (error) { SCTP_INP_DECR_REF(inp); atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -558,196 +556,97 @@ skip: return (error); } - -#define RANGECHK(var, min, max) \ - if ((var) < (min)) { (var) = (min); } \ - else if ((var) > (max)) { (var) = (max); } - static int -sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_udp_tunneling(SYSCTL_HANDLER_ARGS) { int error; - uint32_t old_sctp_udp_tunneling_port; + uint32_t old, new; SCTP_INP_INFO_RLOCK(); - old_sctp_udp_tunneling_port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); + old = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); SCTP_INP_INFO_RUNLOCK(); - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), SCTPCTL_UDP_TUNNELING_PORT_MIN, SCTPCTL_UDP_TUNNELING_PORT_MAX); - if (old_sctp_udp_tunneling_port == SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - error = 0; - goto out; - } - SCTP_INP_INFO_WLOCK(); - if (old_sctp_udp_tunneling_port) { - sctp_over_udp_stop(); - } - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { - if (sctp_over_udp_start()) { - SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = 0; + new = old; + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_UDP_TUNNELING_PORT_MIN) || + (new > SCTPCTL_UDP_TUNNELING_PORT_MAX)) { + error = EINVAL; + } else { + SCTP_INP_INFO_WLOCK(); + SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = new; + if (old != 0) { + sctp_over_udp_stop(); + } + if (new != 0) { + error = sctp_over_udp_start(); } + SCTP_INP_INFO_WUNLOCK(); } - SCTP_INP_INFO_WUNLOCK(); } -out: return (error); } static int -sysctl_sctp_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_auth(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pr_enable), SCTPCTL_PR_ENABLE_MIN, SCTPCTL_PR_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_split_point), SCTPCTL_MIN_SPLIT_POINT_MIN, SCTPCTL_MIN_SPLIT_POINT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_chunkscale), SCTPCTL_CHUNKSCALE_MIN, SCTPCTL_CHUNKSCALE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), SCTPCTL_DELAYED_SACK_TIME_MIN, SCTPCTL_DELAYED_SACK_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_sack_freq_default), SCTPCTL_SACK_FREQ_MIN, SCTPCTL_SACK_FREQ_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), SCTPCTL_SYS_RESOURCE_MIN, SCTPCTL_SYS_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), SCTPCTL_ASOC_RESOURCE_MIN, SCTPCTL_ASOC_RESOURCE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), SCTPCTL_HEARTBEAT_INTERVAL_MIN, SCTPCTL_HEARTBEAT_INTERVAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), SCTPCTL_PMTU_RAISE_TIME_MIN, SCTPCTL_PMTU_RAISE_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), SCTPCTL_SHUTDOWN_GUARD_TIME_MIN, SCTPCTL_SHUTDOWN_GUARD_TIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), SCTPCTL_SECRET_LIFETIME_MIN, SCTPCTL_SECRET_LIFETIME_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_max_default), SCTPCTL_RTO_MAX_MIN, SCTPCTL_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_min_default), SCTPCTL_RTO_MIN_MIN, SCTPCTL_RTO_MIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_initial_default), SCTPCTL_RTO_INITIAL_MIN, SCTPCTL_RTO_INITIAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rto_max_default), SCTPCTL_INIT_RTO_MAX_MIN, SCTPCTL_INIT_RTO_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), SCTPCTL_VALID_COOKIE_LIFE_MIN, SCTPCTL_VALID_COOKIE_LIFE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), SCTPCTL_INIT_RTX_MAX_MIN, SCTPCTL_INIT_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), SCTPCTL_ASSOC_RTX_MAX_MIN, SCTPCTL_ASSOC_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_do_drain), SCTPCTL_DO_SCTP_DRAIN_MIN, SCTPCTL_DO_SCTP_DRAIN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_hb_maxburst), SCTPCTL_HB_MAX_BURST_MIN, SCTPCTL_HB_MAX_BURST_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), SCTPCTL_ABORT_AT_LIMIT_MIN, SCTPCTL_ABORT_AT_LIMIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_data_order), SCTPCTL_STRICT_DATA_ORDER_MIN, SCTPCTL_STRICT_DATA_ORDER_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_min_residual), SCTPCTL_MIN_RESIDUAL_MIN, SCTPCTL_MIN_RESIDUAL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_max_retran_chunk), SCTPCTL_MAX_RETRAN_CHUNK_MIN, SCTPCTL_MAX_RETRAN_CHUNK_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_ss_module), SCTPCTL_DEFAULT_SS_MODULE_MIN, SCTPCTL_DEFAULT_SS_MODULE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_steady_step), SCTPCTL_RTTVAR_STEADYS_MIN, SCTPCTL_RTTVAR_STEADYS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_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_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); - RANGECHK(SCTP_BASE_SYSCTL(sctp_diag_info_code), SCTPCTL_DIAG_INFO_CODE_MIN, SCTPCTL_DIAG_INFO_CODE_MAX); - -#ifdef SCTP_DEBUG - RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); -#endif -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); -#endif + new = SCTP_BASE_SYSCTL(sctp_auth_enable); + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_AUTH_ENABLE_MIN) || + (new > SCTPCTL_AUTH_ENABLE_MAX) || + ((new == 0) && (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1))) { + error = EINVAL; + } else { + SCTP_BASE_SYSCTL(sctp_auth_enable) = new; + } } return (error); } static int -sysctl_sctp_auth_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_asconf(SYSCTL_HANDLER_ARGS) { int error; + uint32_t new; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - if (SCTP_BASE_SYSCTL(sctp_auth_enable) < SCTPCTL_AUTH_ENABLE_MIN) { - SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MIN; - } - if (SCTP_BASE_SYSCTL(sctp_auth_enable) > SCTPCTL_AUTH_ENABLE_MAX) { - SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MAX; - } - if ((SCTP_BASE_SYSCTL(sctp_auth_enable) == 0) && - (SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) { - /* - * You can't disable AUTH with disabling ASCONF - * first - */ - SCTP_BASE_SYSCTL(sctp_auth_enable) = 1; + new = SCTP_BASE_SYSCTL(sctp_asconf_enable); + error = sysctl_handle_int(oidp, &new, 0, req); + if ((error == 0) && + (req->newptr != NULL)) { + if ((new < SCTPCTL_ASCONF_ENABLE_MIN) || + (new > SCTPCTL_ASCONF_ENABLE_MAX) || + ((new == 1) && (SCTP_BASE_SYSCTL(sctp_auth_enable) == 0))) { + error = EINVAL; + } else { + SCTP_BASE_SYSCTL(sctp_asconf_enable) = new; } } return (error); } static int -sysctl_sctp_asconf_check(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS) { int error; - error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if (error == 0) { - if (SCTP_BASE_SYSCTL(sctp_asconf_enable) < SCTPCTL_ASCONF_ENABLE_MIN) { - SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MIN; - } - if (SCTP_BASE_SYSCTL(sctp_asconf_enable) > SCTPCTL_ASCONF_ENABLE_MAX) { - SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MAX; - } - if ((SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1) && - (SCTP_BASE_SYSCTL(sctp_auth_enable) == 0)) { - /* - * You can't enable ASCONF without enabling AUTH - * first - */ - SCTP_BASE_SYSCTL(sctp_asconf_enable) = 0; - } - } - return (error); -} +#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + int cpu; + struct sctpstat sb, *sarry; -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) -static int -sysctl_stat_get(SYSCTL_HANDLER_ARGS) -{ - int cpu, error; - struct sctpstat sb, *sarry, *cpin = NULL; +#endif - if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { - /* - * User wants us to clear or at least reset the counters to - * the specified values. - */ - cpin = (struct sctpstat *)req->newptr; - } else if (req->newptr) { - /* Must be a stat structure */ + if ((req->newptr != NULL) && + (req->newlen != sizeof(struct sctpstat))) { return (EINVAL); } - memset(&sb, 0, sizeof(sb)); +#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + memset(&sb, 0, sizeof(struct sctpstat)); for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { @@ -875,19 +774,29 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS) sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; - if (cpin) { - memcpy(sarry, cpin, sizeof(struct sctpstat)); + if (req->newptr != NULL) { + memcpy(sarry, req->newptr, sizeof(struct sctpstat)); } } - error = SYSCTL_OUT(req, &sb, sizeof(sb)); + error = SYSCTL_OUT(req, &sb, sizeof(struct sctpstat)); +#else + error = SYSCTL_OUT(req, &SCTP_BASE_STATS, sizeof(struct sctpstat)); +#endif return (error); } -#endif - #if defined(SCTP_LOCAL_TRACE_BUF) static int -sysctl_sctp_cleartrace(SYSCTL_HANDLER_ARGS) +sctp_sysctl_handle_trace_log(SYSCTL_HANDLER_ARGS) +{ + int error; + + error = SYSCTL_OUT(req, &SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log)); + return (error); +} + +static int +sctp_sysctl_handle_trace_log_clear(SYSCTL_HANDLER_ARGS) { int error = 0; @@ -897,326 +806,119 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR #endif +#define SCTP_UINT_SYSCTL(mib_name, var_name, prefix) \ + static int \ + sctp_sysctl_handle_##mib_name(SYSCTL_HANDLER_ARGS) \ + { \ + int error; \ + uint32_t new; \ + \ + new = SCTP_BASE_SYSCTL(var_name); \ + error = sysctl_handle_int(oidp, &new, 0, req); \ + if ((error == 0) && (req->newptr != NULL)) { \ + if ((new < prefix##_MIN) || \ + (new > prefix##_MAX)) { \ + error = EINVAL; \ + } else { \ + SCTP_BASE_SYSCTL(var_name) = new; \ + } \ + } \ + return (error); \ + } \ + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mib_name, \ + CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, \ + sctp_sysctl_handle_##mib_name, "UI", prefix##_DESC); /* * sysctl definitions */ -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", - SCTPCTL_MAXDGRAM_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", - SCTPCTL_RECVSPACE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", - SCTPCTL_AUTOASCONF_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_ECN_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pr_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_PR_ENABLE_DESC); - +SCTP_UINT_SYSCTL(sendspace, sctp_sendspace, SCTPCTL_MAXDGRAM) +SCTP_UINT_SYSCTL(recvspace, sctp_recvspace, SCTPCTL_RECVSPACE) +SCTP_UINT_SYSCTL(auto_asconf, sctp_auto_asconf, SCTPCTL_AUTOASCONF) +SCTP_UINT_SYSCTL(ecn_enable, sctp_ecn_enable, SCTPCTL_ECN_ENABLE) +SCTP_UINT_SYSCTL(pr_enable, sctp_pr_enable, SCTPCTL_PR_ENABLE) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_auth_enable), 0, sysctl_sctp_auth_check, "IU", - SCTPCTL_AUTH_ENABLE_DESC); - + NULL, 0, sctp_sysctl_handle_auth, "IU", SCTPCTL_AUTH_ENABLE_DESC); SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_asconf_enable), 0, sysctl_sctp_asconf_check, "IU", - SCTPCTL_ASCONF_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, reconfig_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_reconfig_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_RECONFIG_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nrsack_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_nrsack_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_NRSACK_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pktdrop_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_pktdrop_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_PKTDROP_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_SACKS_DESC); - - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", - SCTPCTL_PEER_CHKOH_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_MAXBURST_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_FRMAXBURST_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", - SCTPCTL_MAXCHUNKS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", - SCTPCTL_TCBHASHSIZE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", - SCTPCTL_PCBHASHSIZE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", - SCTPCTL_MIN_SPLIT_POINT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", - SCTPCTL_CHUNKSCALE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_DELAYED_SACK_TIME_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_SACK_FREQ_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", - SCTPCTL_SYS_RESOURCE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", - SCTPCTL_ASOC_RESOURCE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_HEARTBEAT_INTERVAL_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_PMTU_RAISE_TIME_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_SECRET_LIFETIME_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTO_MAX_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTO_MIN_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTO_INITIAL_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_INIT_RTO_MAX_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_VALID_COOKIE_LIFE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_INIT_RTX_MAX_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_ASSOC_RTX_MAX_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_PATH_RTX_MAX_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_pf_threshold, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_path_pf_threshold), 0, sysctl_sctp_check, "IU", - SCTPCTL_PATH_PF_THRESHOLD_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", - SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_INCOMING_STREAMS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", - SCTPCTL_OUTGOING_STREAMS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", - SCTPCTL_CMT_ON_OFF_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", - SCTPCTL_CMT_USE_DAC_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", - SCTPCTL_CWND_MAXBURST_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", - SCTPCTL_NAT_FRIENDLY_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", - SCTPCTL_ABC_L_VAR_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", - SCTPCTL_MAX_CHAINED_MBUFS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", - SCTPCTL_DO_SCTP_DRAIN_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", - SCTPCTL_HB_MAX_BURST_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", - SCTPCTL_ABORT_AT_LIMIT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_DATA_ORDER_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", - SCTPCTL_MIN_RESIDUAL_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", - SCTPCTL_MAX_RETRAN_CHUNK_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOGGING_LEVEL_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", - SCTPCTL_DEFAULT_CC_MODULE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", - SCTPCTL_DEFAULT_SS_MODULE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", - SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", - SCTPCTL_MOBILITY_BASE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", - SCTPCTL_MOBILITY_FASTHANDOFF_DESC); - + NULL, 0, sctp_sysctl_handle_asconf, "IU", SCTPCTL_ASCONF_ENABLE_DESC); +SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE) +SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE) +SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE) +SCTP_UINT_SYSCTL(strict_sacks, sctp_strict_sacks, SCTPCTL_STRICT_SACKS) +SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) +SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) +SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) +SCTP_UINT_SYSCTL(maxchunks, sctp_max_chunks_on_queue, SCTPCTL_MAXCHUNKS) +SCTP_UINT_SYSCTL(tcbhashsize, sctp_hashtblsize, SCTPCTL_TCBHASHSIZE) +SCTP_UINT_SYSCTL(pcbhashsize, sctp_pcbtblsize, SCTPCTL_PCBHASHSIZE) +SCTP_UINT_SYSCTL(min_split_point, sctp_min_split_point, SCTPCTL_MIN_SPLIT_POINT) +SCTP_UINT_SYSCTL(chunkscale, sctp_chunkscale, SCTPCTL_CHUNKSCALE) +SCTP_UINT_SYSCTL(delayed_sack_time, sctp_delayed_sack_time_default, SCTPCTL_DELAYED_SACK_TIME) +SCTP_UINT_SYSCTL(sack_freq, sctp_sack_freq_default, SCTPCTL_SACK_FREQ) +SCTP_UINT_SYSCTL(sys_resource, sctp_system_free_resc_limit, SCTPCTL_SYS_RESOURCE) +SCTP_UINT_SYSCTL(asoc_resource, sctp_asoc_free_resc_limit, SCTPCTL_ASOC_RESOURCE) +SCTP_UINT_SYSCTL(heartbeat_interval, sctp_heartbeat_interval_default, SCTPCTL_HEARTBEAT_INTERVAL) +SCTP_UINT_SYSCTL(pmtu_raise_time, sctp_pmtu_raise_time_default, SCTPCTL_PMTU_RAISE_TIME) +SCTP_UINT_SYSCTL(shutdown_guard_time, sctp_shutdown_guard_time_default, SCTPCTL_SHUTDOWN_GUARD_TIME) +SCTP_UINT_SYSCTL(secret_lifetime, sctp_secret_lifetime_default, SCTPCTL_SECRET_LIFETIME) +SCTP_UINT_SYSCTL(rto_max, sctp_rto_max_default, SCTPCTL_RTO_MAX) +SCTP_UINT_SYSCTL(rto_min, sctp_rto_min_default, SCTPCTL_RTO_MIN) +SCTP_UINT_SYSCTL(rto_initial, sctp_rto_initial_default, SCTPCTL_RTO_INITIAL) +SCTP_UINT_SYSCTL(init_rto_max, sctp_init_rto_max_default, SCTPCTL_INIT_RTO_MAX) +SCTP_UINT_SYSCTL(valid_cookie_life, sctp_valid_cookie_life_default, SCTPCTL_VALID_COOKIE_LIFE) +SCTP_UINT_SYSCTL(init_rtx_max, sctp_init_rtx_max_default, SCTPCTL_INIT_RTX_MAX) +SCTP_UINT_SYSCTL(assoc_rtx_max, sctp_assoc_rtx_max_default, SCTPCTL_ASSOC_RTX_MAX) +SCTP_UINT_SYSCTL(path_rtx_max, sctp_path_rtx_max_default, SCTPCTL_PATH_RTX_MAX) +SCTP_UINT_SYSCTL(path_pf_threshold, sctp_path_pf_threshold, SCTPCTL_PATH_PF_THRESHOLD) +SCTP_UINT_SYSCTL(add_more_on_output, sctp_add_more_threshold, SCTPCTL_ADD_MORE_ON_OUTPUT) +SCTP_UINT_SYSCTL(incoming_streams, sctp_nr_incoming_streams_default, SCTPCTL_INCOMING_STREAMS) +SCTP_UINT_SYSCTL(outgoing_streams, sctp_nr_outgoing_streams_default, SCTPCTL_OUTGOING_STREAMS) +SCTP_UINT_SYSCTL(cmt_on_off, sctp_cmt_on_off, SCTPCTL_CMT_ON_OFF) +SCTP_UINT_SYSCTL(cmt_use_dac, sctp_cmt_use_dac, SCTPCTL_CMT_USE_DAC) +SCTP_UINT_SYSCTL(cwnd_maxburst, sctp_use_cwnd_based_maxburst, SCTPCTL_CWND_MAXBURST) +SCTP_UINT_SYSCTL(nat_friendly, sctp_nat_friendly, SCTPCTL_NAT_FRIENDLY) +SCTP_UINT_SYSCTL(abc_l_var, sctp_L2_abc_variable, SCTPCTL_ABC_L_VAR) +SCTP_UINT_SYSCTL(max_chained_mbufs, sctp_mbuf_threshold_count, SCTPCTL_MAX_CHAINED_MBUFS) +SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN) +SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST) +SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT) +SCTP_UINT_SYSCTL(strict_data_order, sctp_strict_data_order, SCTPCTL_STRICT_DATA_ORDER) +SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL) +SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK) +SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL) +SCTP_UINT_SYSCTL(default_cc_module, sctp_default_cc_module, SCTPCTL_DEFAULT_CC_MODULE) +SCTP_UINT_SYSCTL(default_ss_module, sctp_default_ss_module, SCTPCTL_DEFAULT_SS_MODULE) +SCTP_UINT_SYSCTL(default_frag_interleave, sctp_default_frag_interleave, SCTPCTL_DEFAULT_FRAG_INTERLEAVE) +SCTP_UINT_SYSCTL(mobility_base, sctp_mobility_base, SCTPCTL_MOBILITY_BASE) +SCTP_UINT_SYSCTL(mobility_fasthandoff, sctp_mobility_fasthandoff, SCTPCTL_MOBILITY_FASTHANDOFF) #if defined(SCTP_LOCAL_TRACE_BUF) -SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, - &SCTP_BASE_SYSCTL(sctp_log), sctp_log, - "SCTP logging (struct sctp_log)"); - +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log, CTLTYPE_STRUCT | CTLFLAG_RD, + NULL, 0, sctp_sysctl_handle_trace_log, "S,sctplog", "SCTP logging (struct sctp_log)"); SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", - "Clear SCTP Logging buffer"); + NULL, 0, sctp_sysctl_handle_trace_log_clear, "IU", "Clear SCTP Logging buffer"); #endif - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", - SCTPCTL_UDP_TUNNELING_PORT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", - SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", - SCTPCTL_NAT_FRIENDLY_INITS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", - SCTPCTL_TIME_WAIT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", - SCTPCTL_BUFFER_SPLITTING_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", - SCTPCTL_INITIAL_CWND_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_bw, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTTVAR_BW_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_rtt, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rttvar_rtt), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTTVAR_RTT_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_eqret, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTTVAR_EQRET_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_steady_step, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_steady_step), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTTVAR_STEADYS_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, use_dcccecn, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", - SCTPCTL_RTTVAR_DCCCECN_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", - SCTPCTL_BLACKHOLE_DESC); - -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, diag_info_code, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_diag_info_code), 0, sysctl_sctp_check, "IU", - SCTPCTL_DIAG_INFO_CODE_DESC); - + NULL, 0, sctp_sysctl_handle_udp_tunneling, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); +SCTP_UINT_SYSCTL(enable_sack_immediately, sctp_enable_sack_immediately, SCTPCTL_SACK_IMMEDIATELY_ENABLE) +SCTP_UINT_SYSCTL(nat_friendly_init, sctp_inits_include_nat_friendly, SCTPCTL_NAT_FRIENDLY_INITS) +SCTP_UINT_SYSCTL(vtag_time_wait, sctp_vtag_time_wait, SCTPCTL_TIME_WAIT) +SCTP_UINT_SYSCTL(buffer_splitting, sctp_buffer_splitting, SCTPCTL_BUFFER_SPLITTING) +SCTP_UINT_SYSCTL(initial_cwnd, sctp_initial_cwnd, SCTPCTL_INITIAL_CWND) +SCTP_UINT_SYSCTL(rttvar_bw, sctp_rttvar_bw, SCTPCTL_RTTVAR_BW) +SCTP_UINT_SYSCTL(rttvar_rtt, sctp_rttvar_rtt, SCTPCTL_RTTVAR_RTT) +SCTP_UINT_SYSCTL(rttvar_eqret, sctp_rttvar_eqret, SCTPCTL_RTTVAR_EQRET) +SCTP_UINT_SYSCTL(rttvar_steady_step, sctp_steady_step, SCTPCTL_RTTVAR_STEADYS) +SCTP_UINT_SYSCTL(use_dcccecn, sctp_use_dccc_ecn, SCTPCTL_RTTVAR_DCCCECN) +SCTP_UINT_SYSCTL(blackhole, sctp_blackhole, SCTPCTL_BLACKHOLE) +SCTP_UINT_SYSCTL(diag_info_code, sctp_diag_info_code, SCTPCTL_DIAG_INFO_CODE) #ifdef SCTP_DEBUG -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", - SCTPCTL_DEBUG_DESC); +SCTP_UINT_SYSCTL(debug, sctp_debug_on, SCTPCTL_DEBUG) #endif - - #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", - SCTPCTL_OUTPUT_UNLOCKED_DESC); -#endif - -#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, - CTLTYPE_STRUCT | CTLFLAG_RW, - 0, 0, sysctl_stat_get, "S,sctpstat", - "SCTP statistics (struct sctp_stat)"); -#else -SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, - &SCTP_BASE_STATS_SYSCTL, sctpstat, - "SCTP statistics (struct sctp_stat)"); +SCTP_UINT_SYSCTL(output_unlocked, sctp_output_unlocked, SCTPCTL_OUTPUT_UNLOCKED) #endif - +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, CTLTYPE_STRUCT | CTLFLAG_RW, + NULL, 0, sctp_sysctl_handle_stats, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, - 0, 0, sctp_assoclist, - "S,xassoc", "List of active SCTP associations"); + NULL, 0, sctp_sysctl_handle_assoclist, "S,xassoc", "List of active SCTP associations"); Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat Sep 6 19:02:52 2014 (r271203) +++ head/sys/netinet/sctp_sysctl.h Sat Sep 6 19:12:14 2014 (r271204) @@ -143,7 +143,7 @@ struct sctp_sysctl { #define SCTPCTL_AUTOASCONF_DESC "Enable SCTP Auto-ASCONF" #define SCTPCTL_AUTOASCONF_MIN 0 #define SCTPCTL_AUTOASCONF_MAX 1 -#define SCTPCTL_AUTOASCONF_DEFAULT SCTP_DEFAULT_AUTO_ASCONF +#define SCTPCTL_AUTOASCONF_DEFAULT 1 /* autoasconf: Enable SCTP Auto-ASCONF */ #define SCTPCTL_MULTIPLEASCONFS_DESC "Enable SCTP Muliple-ASCONFs" @@ -474,13 +474,13 @@ struct sctp_sysctl { #define SCTPCTL_MOBILITY_BASE_DESC "Enable SCTP base mobility" #define SCTPCTL_MOBILITY_BASE_MIN 0 #define SCTPCTL_MOBILITY_BASE_MAX 1 -#define SCTPCTL_MOBILITY_BASE_DEFAULT SCTP_DEFAULT_MOBILITY_BASE +#define SCTPCTL_MOBILITY_BASE_DEFAULT 0 /* mobility_fasthandoff: Enable SCTP fast handoff support */ #define SCTPCTL_MOBILITY_FASTHANDOFF_DESC "Enable SCTP fast handoff" #define SCTPCTL_MOBILITY_FASTHANDOFF_MIN 0 #define SCTPCTL_MOBILITY_FASTHANDOFF_MAX 1 -#define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT SCTP_DEFAULT_MOBILITY_FASTHANDOFF +#define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT 0 /* Enable SCTP/UDP tunneling port */ #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:17:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67EA0612; Sat, 6 Sep 2014 19:17:00 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E5331AD1; Sat, 6 Sep 2014 19:16:59 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s86JGu0C022796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 6 Sep 2014 12:16:57 -0700 Message-ID: <540B5DA8.3080601@freebsd.org> Date: Sat, 06 Sep 2014 12:16:56 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271202 - head/sys/dev/ofw References: <201409061843.s86IhHMJ054856@svn.freebsd.org> In-Reply-To: <201409061843.s86IhHMJ054856@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbSeCFrWlii72fyLpzyJ4Za+ZgKmzM/AodZHrEzSCQ8eRq3es6tTMuuUeLfO4khe+KdpuItFem6kSyJFRKZ2WFoskKDM/xKkuI= X-Sonic-ID: C;+P84Xvo15BGjnEpcoK8kYw== M;+KiUXvo15BGjnEpcoK8kYw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:17:00 -0000 Not looking at the code: what happens if you ask for the node corresponding to a phandle but the device corresponding to that phandle has not registered yet and it has an implicit crossreference mapping? -Nathan On 09/06/14 11:43, Ian Lepore wrote: > Author: ian > Date: Sat Sep 6 18:43:17 2014 > New Revision: 271202 > URL: http://svnweb.freebsd.org/changeset/base/271202 > > Log: > When registering an association between a device and an xref phandle, create > an entry in the xref list if one doesn't already exist for the given handle. > > On a system that uses phandle properties, the init-time scan of the tree > which builds the xref list will pre-create entries for every xref handle > that exists in the data. On systems where the xref and node handles are > synonymous there is no phandle property in referenced nodes, and the xref > list will initialize to an empty state. In the latter case, we still need > to be able to associate a device_t with an xref handle, so we create list > entries on the fly as needed. Since the node and xref handles are > synonymous, we have all the info needed to create a list entry at device > registration time. > > The downside to this change is that it basically allows on the fly creation > of xref handles as synonyms of node handles, and the association of a > device_t with them. Whether this is a bug or a feature is in the eye of > the beholder, I guess. > > Modified: > head/sys/dev/ofw/openfirm.c > > Modified: head/sys/dev/ofw/openfirm.c > ============================================================================== > --- head/sys/dev/ofw/openfirm.c Sat Sep 6 18:20:50 2014 (r271201) > +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 18:43:17 2014 (r271202) > @@ -62,7 +62,10 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > +#include > +#include > #include > #include > > @@ -92,6 +95,7 @@ struct xrefinfo { > }; > > static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); > +static struct mtx xreflist_lock; > static boolean_t xref_init_done; > > #define FIND_BY_XREF 0 > @@ -138,6 +142,12 @@ static void > xrefinfo_init(void *unsed) > { > > + /* > + * There is no locking during this init because it runs much earlier > + * than any of the clients/consumers of the xref list data, but we do > + * initialize the mutex that will be used for access later. > + */ > + mtx_init(&xreflist_lock, "OF xreflist lock", NULL, MTX_DEF); > xrefinfo_create(OF_peer(0)); > xref_init_done = true; > } > @@ -146,17 +156,35 @@ SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ > static struct xrefinfo * > xrefinfo_find(phandle_t phandle, int find_by) > { > - struct xrefinfo * xi; > + struct xrefinfo *rv, *xi; > > + rv = NULL; > + mtx_lock(&xreflist_lock); > SLIST_FOREACH(xi, &xreflist, next_entry) { > - if (find_by == FIND_BY_XREF && phandle == xi->xref) > - return (xi); > - else if (find_by == FIND_BY_NODE && phandle == xi->node) > - return (xi); > - else if (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev) > - return (xi); > + if ((find_by == FIND_BY_XREF && phandle == xi->xref) || > + (find_by == FIND_BY_NODE && phandle == xi->node) || > + (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { > + rv = xi; > + break; > + } > } > - return (NULL); > + mtx_unlock(&xreflist_lock); > + return (rv); > +} > + > +static struct xrefinfo * > +xrefinfo_add(phandle_t node, phandle_t xref, device_t dev) > +{ > + struct xrefinfo *xi; > + > + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK); > + xi->node = node; > + xi->xref = xref; > + xi->dev = dev; > + mtx_lock(&xreflist_lock); > + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); > + mtx_unlock(&xreflist_lock); > + return (xi); > } > > /* > @@ -605,10 +633,17 @@ OF_device_register_xref(phandle_t xref, > { > struct xrefinfo *xi; > > + /* > + * If the given xref handle doesn't already exist in the list then we > + * add a list entry. In theory this can only happen on a system where > + * nodes don't contain phandle properties and xref and node handles are > + * synonymous, so the xref handle is added as the node handle as well. > + */ > if (xref_init_done) { > if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) > - return (ENXIO); > - xi->dev = dev; > + xrefinfo_add(xref, xref, dev); > + else > + xi->dev = dev; > return (0); > } > panic("Attempt to register device before xreflist_init"); > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:39:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E64E9B58; Sat, 6 Sep 2014 19:39:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1F941C98; Sat, 6 Sep 2014 19:39:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86JdCVV080410; Sat, 6 Sep 2014 19:39:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86JdCWf080409; Sat, 6 Sep 2014 19:39:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409061939.s86JdCWf080409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 6 Sep 2014 19:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271206 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:39:13 -0000 Author: kib Date: Sat Sep 6 19:39:12 2014 New Revision: 271206 URL: http://svnweb.freebsd.org/changeset/base/271206 Log: SDM rev. 50 defines the use of the next 8 bytes in the xstate header. It is the compaction bitmask, with the highest bit defining if compact format of the xsave area is used at all. Adjust the definition of struct xstate_hdr, provide define for bit 63. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/fpu.h Modified: head/sys/x86/include/fpu.h ============================================================================== --- head/sys/x86/include/fpu.h Sat Sep 6 19:38:40 2014 (r271205) +++ head/sys/x86/include/fpu.h Sat Sep 6 19:39:12 2014 (r271206) @@ -150,9 +150,11 @@ struct savefpu { struct xstate_hdr { uint64_t xstate_bv; - uint8_t xstate_rsrv0[16]; + uint64_t xstate_xcomp_bv; + uint8_t xstate_rsrv0[8]; uint8_t xstate_rsrv[40]; }; +#define XSTATE_XCOMP_BV_COMPACT (1ULL << 63) struct savexmm_xstate { struct xstate_hdr sx_hd; From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:40:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94612CA8; Sat, 6 Sep 2014 19:40:09 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54B991CA6; Sat, 6 Sep 2014 19:40:09 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XQLqB-0005BA-T0; Sat, 06 Sep 2014 19:40:08 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s86Je6nK015936; Sat, 6 Sep 2014 13:40:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/zprqVhuVIyJNbWbgKHqj7 X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r271202 - head/sys/dev/ofw From: Ian Lepore To: Nathan Whitehorn In-Reply-To: <540B5DA8.3080601@freebsd.org> References: <201409061843.s86IhHMJ054856@svn.freebsd.org> <540B5DA8.3080601@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 06 Sep 2014 13:40:06 -0600 Message-ID: <1410032406.1150.370.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:40:09 -0000 On Sat, 2014-09-06 at 12:16 -0700, Nathan Whitehorn wrote: > Not looking at the code: what happens if you ask for the node > corresponding to a phandle but the device corresponding to that phandle > has not registered yet and it has an implicit crossreference mapping? > -Nathan > The node<->xref behavior is the same as it has always been: if there isn't a phandle property in a node to supply an xref handle then the node and xref handles are the synonyms. The only thing that has changed is that with my first implementation an xref handle had exist (meaning it had to have been discovered as a phandle property during the init-time scan of the tree) before you could associate a device_t with it. Now you can make associations on the fly whether the data author intended for such associations to exist or not. I can't decide whether that's a good or a bad thing. -- Ian > On 09/06/14 11:43, Ian Lepore wrote: > > Author: ian > > Date: Sat Sep 6 18:43:17 2014 > > New Revision: 271202 > > URL: http://svnweb.freebsd.org/changeset/base/271202 > > > > Log: > > When registering an association between a device and an xref phandle, create > > an entry in the xref list if one doesn't already exist for the given handle. > > > > On a system that uses phandle properties, the init-time scan of the tree > > which builds the xref list will pre-create entries for every xref handle > > that exists in the data. On systems where the xref and node handles are > > synonymous there is no phandle property in referenced nodes, and the xref > > list will initialize to an empty state. In the latter case, we still need > > to be able to associate a device_t with an xref handle, so we create list > > entries on the fly as needed. Since the node and xref handles are > > synonymous, we have all the info needed to create a list entry at device > > registration time. > > > > The downside to this change is that it basically allows on the fly creation > > of xref handles as synonyms of node handles, and the association of a > > device_t with them. Whether this is a bug or a feature is in the eye of > > the beholder, I guess. > > > > Modified: > > head/sys/dev/ofw/openfirm.c > > > > Modified: head/sys/dev/ofw/openfirm.c > > ============================================================================== > > --- head/sys/dev/ofw/openfirm.c Sat Sep 6 18:20:50 2014 (r271201) > > +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 18:43:17 2014 (r271202) > > @@ -62,7 +62,10 @@ __FBSDID("$FreeBSD$"); > > > > #include > > #include > > +#include > > #include > > +#include > > +#include > > #include > > #include > > > > @@ -92,6 +95,7 @@ struct xrefinfo { > > }; > > > > static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); > > +static struct mtx xreflist_lock; > > static boolean_t xref_init_done; > > > > #define FIND_BY_XREF 0 > > @@ -138,6 +142,12 @@ static void > > xrefinfo_init(void *unsed) > > { > > > > + /* > > + * There is no locking during this init because it runs much earlier > > + * than any of the clients/consumers of the xref list data, but we do > > + * initialize the mutex that will be used for access later. > > + */ > > + mtx_init(&xreflist_lock, "OF xreflist lock", NULL, MTX_DEF); > > xrefinfo_create(OF_peer(0)); > > xref_init_done = true; > > } > > @@ -146,17 +156,35 @@ SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ > > static struct xrefinfo * > > xrefinfo_find(phandle_t phandle, int find_by) > > { > > - struct xrefinfo * xi; > > + struct xrefinfo *rv, *xi; > > > > + rv = NULL; > > + mtx_lock(&xreflist_lock); > > SLIST_FOREACH(xi, &xreflist, next_entry) { > > - if (find_by == FIND_BY_XREF && phandle == xi->xref) > > - return (xi); > > - else if (find_by == FIND_BY_NODE && phandle == xi->node) > > - return (xi); > > - else if (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev) > > - return (xi); > > + if ((find_by == FIND_BY_XREF && phandle == xi->xref) || > > + (find_by == FIND_BY_NODE && phandle == xi->node) || > > + (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { > > + rv = xi; > > + break; > > + } > > } > > - return (NULL); > > + mtx_unlock(&xreflist_lock); > > + return (rv); > > +} > > + > > +static struct xrefinfo * > > +xrefinfo_add(phandle_t node, phandle_t xref, device_t dev) > > +{ > > + struct xrefinfo *xi; > > + > > + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK); > > + xi->node = node; > > + xi->xref = xref; > > + xi->dev = dev; > > + mtx_lock(&xreflist_lock); > > + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); > > + mtx_unlock(&xreflist_lock); > > + return (xi); > > } > > > > /* > > @@ -605,10 +633,17 @@ OF_device_register_xref(phandle_t xref, > > { > > struct xrefinfo *xi; > > > > + /* > > + * If the given xref handle doesn't already exist in the list then we > > + * add a list entry. In theory this can only happen on a system where > > + * nodes don't contain phandle properties and xref and node handles are > > + * synonymous, so the xref handle is added as the node handle as well. > > + */ > > if (xref_init_done) { > > if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) > > - return (ENXIO); > > - xi->dev = dev; > > + xrefinfo_add(xref, xref, dev); > > + else > > + xi->dev = dev; > > return (0); > > } > > panic("Attempt to register device before xreflist_init"); > > > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:43:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08623E3E; Sat, 6 Sep 2014 19:43:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E839F1D3F; Sat, 6 Sep 2014 19:43:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86JhmTM084403; Sat, 6 Sep 2014 19:43:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86JhmK4084402; Sat, 6 Sep 2014 19:43:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409061943.s86JhmK4084402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 6 Sep 2014 19:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271207 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:43:49 -0000 Author: mav Date: Sat Sep 6 19:43:48 2014 New Revision: 271207 URL: http://svnweb.freebsd.org/changeset/base/271207 Log: Save one register read (AHCI_IS) for AHCI controllers with only one port. For controllers with only one port (like PCIe or M.2 SSDs) interrupt can come from only one source, and skipping read saves few percents of CPU time. MFC after: 1 month H/W donated by: I/O Switch Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Sep 6 19:39:12 2014 (r271206) +++ head/sys/dev/ahci/ahci.c Sat Sep 6 19:43:48 2014 (r271207) @@ -359,7 +359,9 @@ ahci_setup_interrupt(device_t dev) for (i = 0; i < ctlr->numirqs; i++) { ctlr->irqs[i].ctlr = ctlr; ctlr->irqs[i].r_irq_rid = i + (ctlr->msi ? 1 : 0); - if (ctlr->numirqs == 1 || i >= ctlr->channels || + if (ctlr->channels == 1 && !ctlr->ccc) + ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE; + else if (ctlr->numirqs == 1 || i >= ctlr->channels || (ctlr->ccc && i == ctlr->cccv)) ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL; else if (i == ctlr->numirqs - 1) From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 19:47:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F776FF2; Sat, 6 Sep 2014 19:47:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B30B1D55; Sat, 6 Sep 2014 19:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Jlb2t085059; Sat, 6 Sep 2014 19:47:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86JlbQL085058; Sat, 6 Sep 2014 19:47:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409061947.s86JlbQL085058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 6 Sep 2014 19:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271208 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 19:47:38 -0000 Author: kib Date: Sat Sep 6 19:47:37 2014 New Revision: 271208 URL: http://svnweb.freebsd.org/changeset/base/271208 Log: Add a define for index of IA32_XSS MSR, which is, per SDM rev. 50, an analog of XCR0 for ring 0 FPU state, used by XSAVES and XRSTORS. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Sep 6 19:43:48 2014 (r271207) +++ head/sys/x86/include/specialreg.h Sat Sep 6 19:47:37 2014 (r271208) @@ -490,6 +490,8 @@ #define MSR_APIC_DCR_TIMER 0x83e #define MSR_APIC_SELF_IPI 0x83f +#define MSR_IA32_XSS 0xda0 + /* * Constants related to MSR's. */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 20:03:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 789EF45A; Sat, 6 Sep 2014 20:03:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63E5F1ED7; Sat, 6 Sep 2014 20:03:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86K3Pck094144; Sat, 6 Sep 2014 20:03:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86K3PAG094143; Sat, 6 Sep 2014 20:03:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201409062003.s86K3PAG094143@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 6 Sep 2014 20:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271209 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 20:03:25 -0000 Author: tuexen Date: Sat Sep 6 20:03:24 2014 New Revision: 271209 URL: http://svnweb.freebsd.org/changeset/base/271209 Log: Fix a leak of an address, if the address is scheduled for removal and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC after: 1 week Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Sep 6 19:47:37 2014 (r271208) +++ head/sys/netinet/sctp_pcb.c Sat Sep 6 20:03:24 2014 (r271209) @@ -5976,6 +5976,9 @@ sctp_pcb_finish(void) LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); SCTP_DECR_LADDR_COUNT(); + if (wi->action == SCTP_DEL_IP_ADDRESS) { + SCTP_FREE(wi->ifa, SCTP_M_IFA); + } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); } SCTP_WQ_ADDR_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 20:09:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBC035C8; Sat, 6 Sep 2014 20:08:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 824481EF8; Sat, 6 Sep 2014 20:08:59 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 84359B95E; Sat, 6 Sep 2014 16:08:57 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Sat, 06 Sep 2014 16:04:49 -0400 Message-ID: <1432043.pIBGVXe1sj@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409051044.05853.jhb@freebsd.org> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <20140905084305.GN2737@kib.kiev.ua> <201409051044.05853.jhb@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 06 Sep 2014 16:08:57 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 20:09:00 -0000 On Friday, September 05, 2014 10:44:05 AM John Baldwin wrote: > On Friday, September 05, 2014 4:43:05 am Konstantin Belousov wrote: > > There is one weird detail, not touched by your patch. Amd64 resume > > path calls initializecpu(), while i386 does not. I do not see any > > use for the call, the reload of CRX registers by trampoline/resumectx > > should already set everything to working state. E.g., enabling XMM > > in CR4 after fpu state is restored looks strange. > > I can test that. I looked at this, and I actually think calling initializecpu() is correct. It is true that it will set bits in CR4 that are already set, but it also does vendor-specific initialization (e.g. init_amd() and init_via() on amd64 set MSRs, and on i386 there is a lot more of those, though most of the CPUs with extra settings probably do not support SMP or run in ACPI systems). We could either save and restore those various vendor-specific MSRs and registers in suspend/resume, or just call initializecpu() to set their values. The latter approach seems simpler, so I chose that route. In immediate terms, it should fix enabling PG_NX in MSR_EFER on i386 + PAE resume, but it also makes the AP startup case simpler and closer to the amd64 code. I also moved some code that set MSRs out of printcpuinfo() in identcpu.c and into initializecpu() instead. Finally, I split initializecpucache() out similar to how it is split on amd64. Ah, I see one bug I will fix in my tree, pc98's machdep.c needs the change to call initializecpucache(). --- //depot/vendor/freebsd/src/sys/i386/i386/initcpu.c +++ //depot/user/jhb/acpipci/i386/i386/initcpu.c @@ -59,6 +59,12 @@ static void init_6x86(void); #endif /* I486_CPU */ +#if defined(I586_CPU) && defined(CPU_WT_ALLOC) +static void enable_K5_wt_alloc(void); +static void enable_K6_wt_alloc(void); +static void enable_K6_2_wt_alloc(void); +#endif + #ifdef I686_CPU static void init_6x86MX(void); static void init_ppro(void); @@ -527,6 +533,8 @@ intr_restore(saveintr); } +static int ppro_apic_used = -1; + static void init_ppro(void) { @@ -535,9 +543,29 @@ /* * Local APIC should be disabled if it is not going to be used. */ - apicbase = rdmsr(MSR_APICBASE); - apicbase &= ~APICBASE_ENABLED; - wrmsr(MSR_APICBASE, apicbase); + if (ppro_apic_used != 1) { + apicbase = rdmsr(MSR_APICBASE); + apicbase &= ~APICBASE_ENABLED; + wrmsr(MSR_APICBASE, apicbase); + ppro_apic_used = 0; + } +} + +/* + * If the local APIC is going to be used after being disabled above, + * re-enable it and don't disable it in the future. + */ +void +ppro_reenable_apic(void) +{ + u_int64_t apicbase; + + if (ppro_apic_used == 0) { + apicbase = rdmsr(MSR_APICBASE); + apicbase |= APICBASE_ENABLED; + wrmsr(MSR_APICBASE, apicbase); + ppro_apic_used = 1; + } } /* @@ -646,20 +674,6 @@ } #endif -/* - * Initialize CR4 (Control register 4) to enable SSE instructions. - */ -void -enable_sse(void) -{ -#if defined(CPU_ENABLE_SSE) - if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { - load_cr4(rcr4() | CR4_FXSR | CR4_XMM); - cpu_fxsr = hw_instruction_sse = 1; - } -#endif -} - extern int elf32_nxstack; void @@ -692,6 +706,27 @@ #ifdef I586_CPU case CPU_586: switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: +#ifdef CPU_WT_ALLOC + if (((cpu_id & 0x0f0) > 0) && + ((cpu_id & 0x0f0) < 0x60) && + ((cpu_id & 0x00f) > 3)) + enable_K5_wt_alloc(); + else if (((cpu_id & 0x0f0) > 0x80) || + (((cpu_id & 0x0f0) == 0x80) && + (cpu_id & 0x00f) > 0x07)) + enable_K6_2_wt_alloc(); + else if ((cpu_id & 0x0f0) > 0x50) + enable_K6_wt_alloc(); +#endif + if ((cpu_id & 0xf0) == 0xa0) + /* + * Make sure the TSC runs through + * suspension, otherwise we can't use + * it as timecounter + */ + wrmsr(0x1900, rdmsr(0x1900) | 0x20ULL); + break; case CPU_VENDOR_CENTAUR: init_winchip(); break; @@ -762,7 +797,17 @@ default: break; } - enable_sse(); +#if defined(CPU_ENABLE_SSE) + if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { + load_cr4(rcr4() | CR4_FXSR | CR4_XMM); + cpu_fxsr = hw_instruction_sse = 1; + } +#endif +} + +void +initializecpucache(void) +{ /* * CPUID with %eax = 1, %ebx returns @@ -839,7 +884,7 @@ * Enable write allocate feature of AMD processors. * Following two functions require the Maxmem variable being set. */ -void +static void enable_K5_wt_alloc(void) { u_int64_t msr; @@ -885,7 +930,7 @@ } } -void +static void enable_K6_wt_alloc(void) { quad_t size; @@ -945,7 +990,7 @@ intr_restore(saveintr); } -void +static void enable_K6_2_wt_alloc(void) { quad_t size; --- //depot/vendor/freebsd/src/sys/i386/i386/machdep.c +++ //depot/user/jhb/acpipci/i386/i386/machdep.c @@ -2753,6 +2753,7 @@ setidt(IDT_GP, &IDTVEC(prot), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); initializecpu(); /* Initialize CPU registers */ + initializecpucache(); /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ --- //depot/vendor/freebsd/src/sys/i386/i386/mp_machdep.c +++ //depot/user/jhb/acpipci/i386/i386/mp_machdep.c @@ -745,25 +745,15 @@ /* set up CPU registers and state */ cpu_setregs(); + /* set up SSE/NX registers */ + initializecpu(); + /* set up FPU state on the AP */ npxinit(); - /* set up SSE registers */ - enable_sse(); - if (cpu_ops.cpu_init) cpu_ops.cpu_init(); -#ifdef PAE - /* Enable the PTE no-execute bit. */ - if ((amd_feature & AMDID_NX) != 0) { - uint64_t msr; - - msr = rdmsr(MSR_EFER) | EFER_NXE; - wrmsr(MSR_EFER, msr); - } -#endif - /* A quick check from sanity claus */ cpuid = PCPU_GET(cpuid); if (PCPU_GET(apic_id) != lapic_id()) { @@ -1528,6 +1518,7 @@ } else { npxresume(&susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); + initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); --- //depot/vendor/freebsd/src/sys/i386/include/md_var.h +++ //depot/user/jhb/acpipci/i386/include/md_var.h @@ -99,14 +99,9 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void finishidentcpu(void); -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) -void enable_K5_wt_alloc(void); -void enable_K6_wt_alloc(void); -void enable_K6_2_wt_alloc(void); -#endif -void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void initializecpu(void); +void initializecpucache(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); @@ -114,6 +109,7 @@ int isa_nmi(int cd); vm_paddr_t kvtop(void *addr); void panicifcpuunsupported(void); +void ppro_reenable_apic(void); void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); int user_dbreg_trap(void); --- //depot/vendor/freebsd/src/sys/i386/xen/mp_machdep.c +++ //depot/user/jhb/acpipci/i386/xen/mp_machdep.c @@ -602,17 +602,8 @@ npxinit(); #if 0 - /* set up SSE registers */ - enable_sse(); -#endif -#if 0 && defined(PAE) - /* Enable the PTE no-execute bit. */ - if ((amd_feature & AMDID_NX) != 0) { - uint64_t msr; - - msr = rdmsr(MSR_EFER) | EFER_NXE; - wrmsr(MSR_EFER, msr); - } + /* set up SSE/NX registers */ + initializecpu(); #endif #if 0 /* A quick check from sanity claus */ --- //depot/vendor/freebsd/src/sys/x86/x86/identcpu.c +++ //depot/user/jhb/acpipci/x86/x86/identcpu.c @@ -405,30 +405,11 @@ break; case 0x5a0: strcat(cpu_model, "Geode LX"); - /* - * Make sure the TSC runs through suspension, - * otherwise we can't use it as timecounter - */ - wrmsr(0x1900, rdmsr(0x1900) | 0x20ULL); break; default: strcat(cpu_model, "Unknown"); break; } -#if defined(I586_CPU) && defined(CPU_WT_ALLOC) - if ((cpu_id & 0xf00) == 0x500) { - if (((cpu_id & 0x0f0) > 0) - && ((cpu_id & 0x0f0) < 0x60) - && ((cpu_id & 0x00f) > 3)) - enable_K5_wt_alloc(); - else if (((cpu_id & 0x0f0) > 0x80) - || (((cpu_id & 0x0f0) == 0x80) - && (cpu_id & 0x00f) > 0x07)) - enable_K6_2_wt_alloc(); - else if ((cpu_id & 0x0f0) > 0x50) - enable_K6_wt_alloc(); - } -#endif #else if ((cpu_id & 0xf00) == 0xf00) strcat(cpu_model, "AMD64 Processor"); --- //depot/vendor/freebsd/src/sys/x86/x86/local_apic.c +++ //depot/user/jhb/acpipci/x86/x86/local_apic.c @@ -55,7 +55,6 @@ #include #include -#include #include #include #include @@ -1331,9 +1330,6 @@ apic_init(void *dummy __unused) { struct apic_enumerator *enumerator; -#ifndef __amd64__ - uint64_t apic_base; -#endif int retval, best; /* We only support built in local APICs. */ @@ -1375,12 +1371,7 @@ * CPUs during early startup. We need to turn the local APIC back * on on such CPUs now. */ - if (cpu == CPU_686 && cpu_vendor_id == CPU_VENDOR_INTEL && - (cpu_id & 0xff0) == 0x610) { - apic_base = rdmsr(MSR_APICBASE); - apic_base |= APICBASE_ENABLED; - wrmsr(MSR_APICBASE, apic_base); - } + ppro_reenable_apic(); #endif /* Probe the CPU's in the system. */ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 20:41:59 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F24898D7; Sat, 6 Sep 2014 20:41:58 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D6F1379; Sat, 6 Sep 2014 20:41:58 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s86KftEI014037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 6 Sep 2014 13:41:56 -0700 Message-ID: <540B7193.8060601@freebsd.org> Date: Sat, 06 Sep 2014 13:41:55 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r271202 - head/sys/dev/ofw References: <201409061843.s86IhHMJ054856@svn.freebsd.org> <540B5DA8.3080601@freebsd.org> <1410032406.1150.370.camel@revolution.hippie.lan> In-Reply-To: <1410032406.1150.370.camel@revolution.hippie.lan> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZ5sIj8gt8EWHdlNQIJQfF7g8qmtuQFDYZGzMVimm99B9FZdCDiFIizs5/Su+gZ2vSgqxjtFqppuPv7Xy5kRkH79wjNxogP/H8= X-Sonic-ID: C;5hktPQY25BGELUpcoK8kYw== M;BI+ePQY25BGELUpcoK8kYw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 20:41:59 -0000 On 09/06/14 12:40, Ian Lepore wrote: > On Sat, 2014-09-06 at 12:16 -0700, Nathan Whitehorn wrote: >> Not looking at the code: what happens if you ask for the node >> corresponding to a phandle but the device corresponding to that phandle >> has not registered yet and it has an implicit crossreference mapping? >> -Nathan >> > The node<->xref behavior is the same as it has always been: if there > isn't a phandle property in a node to supply an xref handle then the > node and xref handles are the synonyms. > > The only thing that has changed is that with my first implementation an > xref handle had exist (meaning it had to have been discovered as a > phandle property during the init-time scan of the tree) before you could > associate a device_t with it. Now you can make associations on the fly > whether the data author intended for such associations to exist or not. > I can't decide whether that's a good or a bad thing. > > -- Ian Thanks for the explanation! That seems like the most reasonable approach. -Nathan >> On 09/06/14 11:43, Ian Lepore wrote: >>> Author: ian >>> Date: Sat Sep 6 18:43:17 2014 >>> New Revision: 271202 >>> URL: http://svnweb.freebsd.org/changeset/base/271202 >>> >>> Log: >>> When registering an association between a device and an xref phandle, create >>> an entry in the xref list if one doesn't already exist for the given handle. >>> >>> On a system that uses phandle properties, the init-time scan of the tree >>> which builds the xref list will pre-create entries for every xref handle >>> that exists in the data. On systems where the xref and node handles are >>> synonymous there is no phandle property in referenced nodes, and the xref >>> list will initialize to an empty state. In the latter case, we still need >>> to be able to associate a device_t with an xref handle, so we create list >>> entries on the fly as needed. Since the node and xref handles are >>> synonymous, we have all the info needed to create a list entry at device >>> registration time. >>> >>> The downside to this change is that it basically allows on the fly creation >>> of xref handles as synonyms of node handles, and the association of a >>> device_t with them. Whether this is a bug or a feature is in the eye of >>> the beholder, I guess. >>> >>> Modified: >>> head/sys/dev/ofw/openfirm.c >>> >>> Modified: head/sys/dev/ofw/openfirm.c >>> ============================================================================== >>> --- head/sys/dev/ofw/openfirm.c Sat Sep 6 18:20:50 2014 (r271201) >>> +++ head/sys/dev/ofw/openfirm.c Sat Sep 6 18:43:17 2014 (r271202) >>> @@ -62,7 +62,10 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> #include >>> +#include >>> #include >>> +#include >>> +#include >>> #include >>> #include >>> >>> @@ -92,6 +95,7 @@ struct xrefinfo { >>> }; >>> >>> static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist); >>> +static struct mtx xreflist_lock; >>> static boolean_t xref_init_done; >>> >>> #define FIND_BY_XREF 0 >>> @@ -138,6 +142,12 @@ static void >>> xrefinfo_init(void *unsed) >>> { >>> >>> + /* >>> + * There is no locking during this init because it runs much earlier >>> + * than any of the clients/consumers of the xref list data, but we do >>> + * initialize the mutex that will be used for access later. >>> + */ >>> + mtx_init(&xreflist_lock, "OF xreflist lock", NULL, MTX_DEF); >>> xrefinfo_create(OF_peer(0)); >>> xref_init_done = true; >>> } >>> @@ -146,17 +156,35 @@ SYSINIT(xrefinfo, SI_SUB_KMEM, SI_ORDER_ >>> static struct xrefinfo * >>> xrefinfo_find(phandle_t phandle, int find_by) >>> { >>> - struct xrefinfo * xi; >>> + struct xrefinfo *rv, *xi; >>> >>> + rv = NULL; >>> + mtx_lock(&xreflist_lock); >>> SLIST_FOREACH(xi, &xreflist, next_entry) { >>> - if (find_by == FIND_BY_XREF && phandle == xi->xref) >>> - return (xi); >>> - else if (find_by == FIND_BY_NODE && phandle == xi->node) >>> - return (xi); >>> - else if (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev) >>> - return (xi); >>> + if ((find_by == FIND_BY_XREF && phandle == xi->xref) || >>> + (find_by == FIND_BY_NODE && phandle == xi->node) || >>> + (find_by == FIND_BY_DEV && phandle == (uintptr_t)xi->dev)) { >>> + rv = xi; >>> + break; >>> + } >>> } >>> - return (NULL); >>> + mtx_unlock(&xreflist_lock); >>> + return (rv); >>> +} >>> + >>> +static struct xrefinfo * >>> +xrefinfo_add(phandle_t node, phandle_t xref, device_t dev) >>> +{ >>> + struct xrefinfo *xi; >>> + >>> + xi = malloc(sizeof(*xi), M_OFWPROP, M_WAITOK); >>> + xi->node = node; >>> + xi->xref = xref; >>> + xi->dev = dev; >>> + mtx_lock(&xreflist_lock); >>> + SLIST_INSERT_HEAD(&xreflist, xi, next_entry); >>> + mtx_unlock(&xreflist_lock); >>> + return (xi); >>> } >>> >>> /* >>> @@ -605,10 +633,17 @@ OF_device_register_xref(phandle_t xref, >>> { >>> struct xrefinfo *xi; >>> >>> + /* >>> + * If the given xref handle doesn't already exist in the list then we >>> + * add a list entry. In theory this can only happen on a system where >>> + * nodes don't contain phandle properties and xref and node handles are >>> + * synonymous, so the xref handle is added as the node handle as well. >>> + */ >>> if (xref_init_done) { >>> if ((xi = xrefinfo_find(xref, FIND_BY_XREF)) == NULL) >>> - return (ENXIO); >>> - xi->dev = dev; >>> + xrefinfo_add(xref, xref, dev); >>> + else >>> + xi->dev = dev; >>> return (0); >>> } >>> panic("Attempt to register device before xreflist_init"); >>> > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 21:15:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A653114C; Sat, 6 Sep 2014 21:15:38 +0000 (UTC) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0BF17A3; Sat, 6 Sep 2014 21:15:38 +0000 (UTC) Received: by mail-qg0-f52.google.com with SMTP id z60so13197737qgd.25 for ; Sat, 06 Sep 2014 14:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=R+eRqtsFVXAdVAesgLzEP6zQ+jYw9fprdA6Y0o0ZmVs=; b=C+/33rQBXm6PSYQ+aiaW2iHgAkudSlLSGuUehZYnSZ645m1x22cV4CR0fNrutV76RF mTbRQ6OPUXw32V7x6QznE3/CDwNM3rBkQd2DUJ8LziTuk8OuMRJmnCDpDF4vmfDJyr6z QzV5ZBG6PD71XiITzRJpBjCRCTqCeCbCZM9GZ2d9zzSVc2c2Mis+GicBK749pjTNIhqH dTHCI+RT1mMlXGYN53gDRY0qPGjyzBt22FsJHhyayVrqtTs5ezwal4yZPuxTbd4m5xX/ SoUmWcHy48Er5HX3TqrZdRm30fM2kIfOD4KkYpFsImtvDECzEO5lHt5qLI0P/w7X14Mx hbCA== MIME-Version: 1.0 X-Received: by 10.229.136.133 with SMTP id r5mr4240280qct.31.1410038137338; Sat, 06 Sep 2014 14:15:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Sat, 6 Sep 2014 14:15:37 -0700 (PDT) In-Reply-To: <53e0a76b.5936.428818a9@svn.freebsd.org> References: <53e0a76b.5936.428818a9@svn.freebsd.org> Date: Sat, 6 Sep 2014 14:15:37 -0700 X-Google-Sender-Auth: pMMc_ByL1TfuomHd2Qy5sqWcc7g Message-ID: Subject: Re: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 21:15:38 -0000 Hi Gleb! This commit has broken mips32 on my 128MB RAM routerstation pro board. I've tested the commit before this one (and it works). I've also tested today's -HEAD as there was some subsequent fixes to the sfbuf code. It hasn't completely fixed things - I still see processes throwing VM errors: umass0:0:0: Attached to scbus0 Trying to mount root from ufs:redboot/rootfs.uzip []... warning: no time-of-day clock registered, system time will not be set accurately da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: Serial Number 000000009451 da0: 40.000MB/s transfers da0: 3902MB (7991296 512 byte sectors: 255H 63S/T 497C) da0: quirks=0x3 Aug 28 08:07:57 init: login_getclass: unknown class 'daemon' BAD_PAGE_FAULT: pid 27 tid 100045 (mount), uid 0: pc 0x40514dd0 got a read fault (type 0x2) at 0x4040011c Trapframe Register Dump: zero: 0 at: 0x7fffffff v0: 0 v1: 0x404000fc a0: 0x54 a1: 0x40400000 a2: 0 a3: 0x1 t0: 0 t1: 0x40c0300c t2: 0x40800168 t3: 0x2f t4: 0x40c00030 t5: 0 t6: 0x748 t7: 0x402c70 t8: 0x13 t9: 0x40514d58 s0: 0x3 s1: 0x40418798 s2: 0 s3: 0x404ec4 s4: 0x40418798 s5: 0x40418798 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x405ec910 sp: 0x7ffee348 s8: 0 ra: 0x4051534c sr: 0xfc13 mullo: 0x6719 mulhi: 0xc badvaddr: 0x4040011c cause: 0x8 pc: 0x40514dd0 Page table info for pc address 0x40514dd0: pde = 0x813da000, pte = 0xa00569da Dumping 4 words starting at pc address 0x40514dd0: 8c700020 32030ff0 00032102 240300ff Page table info for bad address 0x4040011c: pde = 0x813da000, pte = 0 pid 27 (mount), uid 0: exited on signal 11 *** Populating /var .. .. so how can we debug what's going on? -a On 5 August 2014 02:44, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Aug 5 09:44:10 2014 > New Revision: 269577 > URL: http://svnweb.freebsd.org/changeset/base/269577 > > Log: > Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c > The MD allocators were very common, however there were some minor > differencies. These differencies were all consolidated in the MI allocator, > under ifdefs. The defines from machine/vmparam.h turn on features required > for a particular machine. For details look in the comment in sys/sf_buf.h. > > As result no MD code left in sys/*/*/vm_machdep.c. Some arches still have > machine/sf_buf.h, which is usually quite small. > > Tested by: glebius (i386), tuexen (arm32), kevlo (arm32) > Reviewed by: kib > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Added: > head/sys/kern/subr_sfbuf.c (contents, props changed) > Deleted: > head/sys/powerpc/include/sf_buf.h > head/sys/sparc64/include/sf_buf.h > Modified: > head/sys/amd64/include/sf_buf.h > head/sys/arm/arm/vm_machdep.c > head/sys/arm/include/sf_buf.h > head/sys/arm/include/vmparam.h > head/sys/conf/files.arm > head/sys/conf/files.i386 > head/sys/conf/files.mips > head/sys/conf/files.pc98 > head/sys/conf/files.powerpc > head/sys/conf/files.sparc64 > head/sys/i386/i386/vm_machdep.c > head/sys/i386/include/sf_buf.h > head/sys/i386/include/vmparam.h > head/sys/mips/include/sf_buf.h > head/sys/mips/include/vmparam.h > head/sys/mips/mips/vm_machdep.c > head/sys/powerpc/include/vmparam.h > head/sys/powerpc/powerpc/vm_machdep.c > head/sys/sparc64/include/vmparam.h > head/sys/sparc64/sparc64/vm_machdep.c > head/sys/sys/sf_buf.h > > Modified: head/sys/amd64/include/sf_buf.h > ============================================================================== > --- head/sys/amd64/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/amd64/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -29,42 +29,23 @@ > #ifndef _MACHINE_SF_BUF_H_ > #define _MACHINE_SF_BUF_H_ > > -#include > -#include > -#include > - > /* > * On this machine, the only purpose for which sf_buf is used is to implement > * an opaque pointer required by the machine-independent parts of the kernel. > * That pointer references the vm_page that is "mapped" by the sf_buf. The > * actual mapping is provided by the direct virtual-to-physical mapping. > */ > -struct sf_buf; > - > -static inline struct sf_buf * > -sf_buf_alloc(struct vm_page *m, int pri) > -{ > - > - return ((struct sf_buf *)m); > -} > - > -static inline void > -sf_buf_free(struct sf_buf *sf) > -{ > -} > - > -static __inline vm_offset_t > +static inline vm_offset_t > sf_buf_kva(struct sf_buf *sf) > { > > return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); > } > > -static __inline vm_page_t > +static inline vm_page_t > sf_buf_page(struct sf_buf *sf) > { > > return ((vm_page_t)sf); > } > - > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/arm/arm/vm_machdep.c > ============================================================================== > --- head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) > @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > @@ -83,42 +82,6 @@ __FBSDID("$FreeBSD$"); > CTASSERT(sizeof(struct switchframe) == 24); > CTASSERT(sizeof(struct trapframe) == 80); > > -#ifndef NSFBUFS > -#define NSFBUFS (512 + maxusers * 16) > -#endif > - > -static int nsfbufs; > -static int nsfbufspeak; > -static int nsfbufsused; > - > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, > - "Maximum number of sendfile(2) sf_bufs available"); > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, > - "Number of sendfile(2) sf_bufs at peak usage"); > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, > - "Number of sendfile(2) sf_bufs in use"); > - > -static void sf_buf_init(void *arg); > -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); > - > -LIST_HEAD(sf_head, sf_buf); > - > -/* > - * A hash table of active sendfile(2) buffers > - */ > -static struct sf_head *sf_buf_active; > -static u_long sf_buf_hashmask; > - > -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) > - > -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; > -static u_int sf_buf_alloc_want; > - > -/* > - * A lock used to synchronize access to the hash table and free list > - */ > -static struct mtx sf_buf_lock; > - > /* > * Finish a fork operation, with process p2 nearly set up. > * Copy and update the pcb, set up the stack so that the child > @@ -184,106 +147,6 @@ cpu_thread_swapout(struct thread *td) > { > } > > -/* > - * Detatch mapped page and release resources back to the system. > - */ > -void > -sf_buf_free(struct sf_buf *sf) > -{ > - > - mtx_lock(&sf_buf_lock); > - sf->ref_count--; > - if (sf->ref_count == 0) { > - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); > - nsfbufsused--; > - pmap_kremove(sf->kva); > - sf->m = NULL; > - LIST_REMOVE(sf, list_entry); > - if (sf_buf_alloc_want > 0) > - wakeup(&sf_buf_freelist); > - } > - mtx_unlock(&sf_buf_lock); > -} > - > -/* > - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) > - */ > -static void > -sf_buf_init(void *arg) > -{ > - struct sf_buf *sf_bufs; > - vm_offset_t sf_base; > - int i; > - > - nsfbufs = NSFBUFS; > - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); > - > - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); > - TAILQ_INIT(&sf_buf_freelist); > - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); > - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, > - M_NOWAIT | M_ZERO); > - for (i = 0; i < nsfbufs; i++) { > - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; > - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); > - } > - sf_buf_alloc_want = 0; > - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); > -} > - > -/* > - * Get an sf_buf from the freelist. Will block if none are available. > - */ > -struct sf_buf * > -sf_buf_alloc(struct vm_page *m, int flags) > -{ > - struct sf_head *hash_list; > - struct sf_buf *sf; > - int error; > - > - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; > - mtx_lock(&sf_buf_lock); > - LIST_FOREACH(sf, hash_list, list_entry) { > - if (sf->m == m) { > - sf->ref_count++; > - if (sf->ref_count == 1) { > - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > - nsfbufsused++; > - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > - } > - goto done; > - } > - } > - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { > - if (flags & SFB_NOWAIT) > - goto done; > - sf_buf_alloc_want++; > - SFSTAT_INC(sf_allocwait); > - error = msleep(&sf_buf_freelist, &sf_buf_lock, > - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); > - sf_buf_alloc_want--; > - > - > - /* > - * If we got a signal, don't risk going back to sleep. > - */ > - if (error) > - goto done; > - } > - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > - if (sf->m != NULL) > - LIST_REMOVE(sf, list_entry); > - LIST_INSERT_HEAD(hash_list, sf, list_entry); > - sf->ref_count = 1; > - sf->m = m; > - nsfbufsused++; > - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > - pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); > -done: > - mtx_unlock(&sf_buf_lock); > - return (sf); > -} > - > void > cpu_set_syscall_retval(struct thread *td, int error) > { > > Modified: head/sys/arm/include/sf_buf.h > ============================================================================== > --- head/sys/arm/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/arm/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -29,33 +29,18 @@ > #ifndef _MACHINE_SF_BUF_H_ > #define _MACHINE_SF_BUF_H_ > > -#include > - > -struct vm_page; > - > -struct sf_buf { > - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ > - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ > - struct vm_page *m; /* currently mapped page */ > - vm_offset_t kva; /* va of mapping */ > - int ref_count; /* usage of this mapping */ > -}; > - > -static __inline vm_offset_t > -sf_buf_kva(struct sf_buf *sf) > +static inline void > +sf_buf_map(struct sf_buf *sf, int flags) > { > > - return (sf->kva); > + pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); > } > > -static __inline struct vm_page * > -sf_buf_page(struct sf_buf *sf) > +static inline int > +sf_buf_unmap(struct sf_buf *sf) > { > > - return (sf->m); > + pmap_kremove(sf->kva); > + return (1); > } > - > -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); > -void sf_buf_free(struct sf_buf *sf); > - > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/arm/include/vmparam.h > ============================================================================== > --- head/sys/arm/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/arm/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -170,4 +170,7 @@ extern vm_offset_t vm_max_kernel_address > #define VM_MAX_AUTOTUNE_MAXUSERS 384 > #endif > > +#define SFBUF > +#define SFBUF_MAP > + > #endif /* _MACHINE_VMPARAM_H_ */ > > Modified: head/sys/conf/files.arm > ============================================================================== > --- head/sys/conf/files.arm Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.arm Tue Aug 5 09:44:10 2014 (r269577) > @@ -77,6 +77,7 @@ font.h optional sc \ > clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" > kern/subr_busdma_bufalloc.c standard > kern/subr_dummy_vdso_tc.c standard > +kern/subr_sfbuf.c standard > libkern/arm/aeabi_unwind.c standard > libkern/arm/divsi3.S standard > libkern/arm/ffs.S standard > > Modified: head/sys/conf/files.i386 > ============================================================================== > --- head/sys/conf/files.i386 Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.i386 Tue Aug 5 09:44:10 2014 (r269577) > @@ -520,6 +520,7 @@ isa/vga_isa.c optional vga > kern/kern_clocksource.c standard > kern/imgact_aout.c optional compat_aout > kern/imgact_gzip.c optional gzip > +kern/subr_sfbuf.c standard > libkern/divdi3.c standard > libkern/flsll.c standard > libkern/memmove.c standard > > Modified: head/sys/conf/files.mips > ============================================================================== > --- head/sys/conf/files.mips Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.mips Tue Aug 5 09:44:10 2014 (r269577) > @@ -51,6 +51,7 @@ mips/mips/vm_machdep.c standard > kern/kern_clocksource.c standard > kern/link_elf_obj.c standard > kern/subr_dummy_vdso_tc.c standard > +kern/subr_sfbuf.c optional mips | mipsel | mipsn32 > > # gcc/clang runtime > libkern/ffsl.c standard > > Modified: head/sys/conf/files.pc98 > ============================================================================== > --- head/sys/conf/files.pc98 Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.pc98 Tue Aug 5 09:44:10 2014 (r269577) > @@ -205,6 +205,7 @@ i386/svr4/svr4_machdep.c optional compat > kern/kern_clocksource.c standard > kern/imgact_aout.c optional compat_aout > kern/imgact_gzip.c optional gzip > +kern/subr_sfbuf.c standard > libkern/divdi3.c standard > libkern/flsll.c standard > libkern/memmove.c standard > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.powerpc Tue Aug 5 09:44:10 2014 (r269577) > @@ -71,6 +71,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt aim > kern/kern_clocksource.c standard > kern/subr_dummy_vdso_tc.c standard > kern/syscalls.c optional ktr > +kern/subr_sfbuf.c standard > libkern/ashldi3.c optional powerpc > libkern/ashrdi3.c optional powerpc > libkern/bcmp.c standard > > Modified: head/sys/conf/files.sparc64 > ============================================================================== > --- head/sys/conf/files.sparc64 Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/conf/files.sparc64 Tue Aug 5 09:44:10 2014 (r269577) > @@ -64,6 +64,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt > kern/kern_clocksource.c standard > kern/subr_dummy_vdso_tc.c standard > kern/syscalls.c optional ktr > +kern/subr_sfbuf.c standard > libkern/ffs.c standard > libkern/ffsl.c standard > libkern/fls.c standard > > Modified: head/sys/i386/i386/vm_machdep.c > ============================================================================== > --- head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) > @@ -118,38 +118,6 @@ static u_int cpu_reset_proxyid; > static volatile u_int cpu_reset_proxy_active; > #endif > > -static int nsfbufs; > -static int nsfbufspeak; > -static int nsfbufsused; > - > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, > - "Maximum number of sendfile(2) sf_bufs available"); > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, > - "Number of sendfile(2) sf_bufs at peak usage"); > -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, > - "Number of sendfile(2) sf_bufs in use"); > - > -static void sf_buf_init(void *arg); > -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); > - > -LIST_HEAD(sf_head, sf_buf); > - > -/* > - * A hash table of active sendfile(2) buffers > - */ > -static struct sf_head *sf_buf_active; > -static u_long sf_buf_hashmask; > - > -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) > - > -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; > -static u_int sf_buf_alloc_want; > - > -/* > - * A lock used to synchronize access to the hash table and free list > - */ > -static struct mtx sf_buf_lock; > - > extern int _ucodesel, _udatasel; > > /* > @@ -750,121 +718,12 @@ cpu_reset_real() > } > > /* > - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) > - */ > -static void > -sf_buf_init(void *arg) > -{ > - struct sf_buf *sf_bufs; > - vm_offset_t sf_base; > - int i; > - > - nsfbufs = NSFBUFS; > - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); > - > - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); > - TAILQ_INIT(&sf_buf_freelist); > - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); > - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, > - M_NOWAIT | M_ZERO); > - for (i = 0; i < nsfbufs; i++) { > - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; > - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); > - } > - sf_buf_alloc_want = 0; > - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); > -} > - > -/* > - * Invalidate the cache lines that may belong to the page, if > - * (possibly old) mapping of the page by sf buffer exists. Returns > - * TRUE when mapping was found and cache invalidated. > - */ > -boolean_t > -sf_buf_invalidate_cache(vm_page_t m) > -{ > - struct sf_head *hash_list; > - struct sf_buf *sf; > - boolean_t ret; > - > - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; > - ret = FALSE; > - mtx_lock(&sf_buf_lock); > - LIST_FOREACH(sf, hash_list, list_entry) { > - if (sf->m == m) { > - /* > - * Use pmap_qenter to update the pte for > - * existing mapping, in particular, the PAT > - * settings are recalculated. > - */ > - pmap_qenter(sf->kva, &m, 1); > - pmap_invalidate_cache_range(sf->kva, sf->kva + > - PAGE_SIZE); > - ret = TRUE; > - break; > - } > - } > - mtx_unlock(&sf_buf_lock); > - return (ret); > -} > - > -/* > * Get an sf_buf from the freelist. May block if none are available. > */ > -struct sf_buf * > -sf_buf_alloc(struct vm_page *m, int flags) > +void > +sf_buf_map(struct sf_buf *sf, int flags) > { > pt_entry_t opte, *ptep; > - struct sf_head *hash_list; > - struct sf_buf *sf; > -#ifdef SMP > - cpuset_t other_cpus; > - u_int cpuid; > -#endif > - int error; > - > - KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, > - ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); > - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; > - mtx_lock(&sf_buf_lock); > - LIST_FOREACH(sf, hash_list, list_entry) { > - if (sf->m == m) { > - sf->ref_count++; > - if (sf->ref_count == 1) { > - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > - nsfbufsused++; > - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > - } > -#ifdef SMP > - goto shootdown; > -#else > - goto done; > -#endif > - } > - } > - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { > - if (flags & SFB_NOWAIT) > - goto done; > - sf_buf_alloc_want++; > - SFSTAT_INC(sf_allocwait); > - error = msleep(&sf_buf_freelist, &sf_buf_lock, > - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); > - sf_buf_alloc_want--; > - > - /* > - * If we got a signal, don't risk going back to sleep. > - */ > - if (error) > - goto done; > - } > - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > - if (sf->m != NULL) > - LIST_REMOVE(sf, list_entry); > - LIST_INSERT_HEAD(hash_list, sf, list_entry); > - sf->ref_count = 1; > - sf->m = m; > - nsfbufsused++; > - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > > /* > * Update the sf_buf's virtual-to-physical mapping, flushing the > @@ -876,11 +735,11 @@ sf_buf_alloc(struct vm_page *m, int flag > ptep = vtopte(sf->kva); > opte = *ptep; > #ifdef XEN > - PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag > - | PG_RW | PG_V | pmap_cache_bits(m->md.pat_mode, 0)); > + PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(sf->m)) | pgeflag > + | PG_RW | PG_V | pmap_cache_bits(sf->m->md.pat_mode, 0)); > #else > - *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V | > - pmap_cache_bits(m->md.pat_mode, 0); > + *ptep = VM_PAGE_TO_PHYS(sf->m) | pgeflag | PG_RW | PG_V | > + pmap_cache_bits(sf->m->md.pat_mode, 0); > #endif > > /* > @@ -892,7 +751,21 @@ sf_buf_alloc(struct vm_page *m, int flag > #ifdef SMP > if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) > CPU_ZERO(&sf->cpumask); > -shootdown: > + > + sf_buf_shootdown(sf, flags); > +#else > + if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) > + pmap_invalidate_page(kernel_pmap, sf->kva); > +#endif > +} > + > +#ifdef SMP > +void > +sf_buf_shootdown(struct sf_buf *sf, int flags) > +{ > + cpuset_t other_cpus; > + u_int cpuid; > + > sched_pin(); > cpuid = PCPU_GET(cpuid); > if (!CPU_ISSET(cpuid, &sf->cpumask)) { > @@ -909,42 +782,50 @@ shootdown: > } > } > sched_unpin(); > -#else > - if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) > - pmap_invalidate_page(kernel_pmap, sf->kva); > -#endif > -done: > - mtx_unlock(&sf_buf_lock); > - return (sf); > } > +#endif > > /* > - * Remove a reference from the given sf_buf, adding it to the free > - * list when its reference count reaches zero. A freed sf_buf still, > - * however, retains its virtual-to-physical mapping until it is > - * recycled or reactivated by sf_buf_alloc(9). > + * MD part of sf_buf_free(). > */ > -void > -sf_buf_free(struct sf_buf *sf) > +int > +sf_buf_unmap(struct sf_buf *sf) > { > - > - mtx_lock(&sf_buf_lock); > - sf->ref_count--; > - if (sf->ref_count == 0) { > - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); > - nsfbufsused--; > #ifdef XEN > + /* > + * Xen doesn't like having dangling R/W mappings > + */ > + pmap_qremove(sf->kva, 1); > + return (1); > +#else > + return (0); > +#endif > +} > + > +static void > +sf_buf_invalidate(struct sf_buf *sf) > +{ > + vm_page_t m = sf->m; > + > + /* > + * Use pmap_qenter to update the pte for > + * existing mapping, in particular, the PAT > + * settings are recalculated. > + */ > + pmap_qenter(sf->kva, &m, 1); > + pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE); > +} > + > /* > - * Xen doesn't like having dangling R/W mappings > + * Invalidate the cache lines that may belong to the page, if > + * (possibly old) mapping of the page by sf buffer exists. Returns > + * TRUE when mapping was found and cache invalidated. > */ > - pmap_qremove(sf->kva, 1); > - sf->m = NULL; > - LIST_REMOVE(sf, list_entry); > -#endif > - if (sf_buf_alloc_want > 0) > - wakeup(&sf_buf_freelist); > - } > - mtx_unlock(&sf_buf_lock); > +boolean_t > +sf_buf_invalidate_cache(vm_page_t m) > +{ > + > + return (sf_buf_process_page(m, sf_buf_invalidate)); > } > > /* > > Modified: head/sys/i386/include/sf_buf.h > ============================================================================== > --- head/sys/i386/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/i386/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2003, 2005 Alan L. Cox > + * Copyright (c) 2014 Gleb Smirnoff > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -29,39 +29,8 @@ > #ifndef _MACHINE_SF_BUF_H_ > #define _MACHINE_SF_BUF_H_ > > -#include > -#include > - > -struct vm_page; > - > -struct sf_buf { > - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ > - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ > - struct vm_page *m; /* currently mapped page */ > - vm_offset_t kva; /* va of mapping */ > - int ref_count; /* usage of this mapping */ > -#ifdef SMP > - cpuset_t cpumask; /* cpus on which mapping is valid */ > -#endif > -}; > - > -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); > -void sf_buf_free(struct sf_buf *sf); > - > -static __inline vm_offset_t > -sf_buf_kva(struct sf_buf *sf) > -{ > - > - return (sf->kva); > -} > - > -static __inline struct vm_page * > -sf_buf_page(struct sf_buf *sf) > -{ > - > - return (sf->m); > -} > - > -boolean_t sf_buf_invalidate_cache(vm_page_t m); > +void sf_buf_map(struct sf_buf *, int); > +int sf_buf_unmap(struct sf_buf *); > +boolean_t sf_buf_invalidate_cache(vm_page_t); > > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/i386/include/vmparam.h > ============================================================================== > --- head/sys/i386/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/i386/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -198,4 +198,9 @@ > #define VM_MAX_AUTOTUNE_MAXUSERS 384 > #endif > > +#define SFBUF > +#define SFBUF_MAP > +#define SFBUF_CPUSET > +#define SFBUF_PROCESS_PAGE > + > #endif /* _MACHINE_VMPARAM_H_ */ > > Added: head/sys/kern/subr_sfbuf.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/kern/subr_sfbuf.c Tue Aug 5 09:44:10 2014 (r269577) > @@ -0,0 +1,226 @@ > +/*- > + * Copyright (c) 2014 Gleb Smirnoff > + * Copyright (c) 2003, 2005 Alan L. Cox > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#ifndef NSFBUFS > +#define NSFBUFS (512 + maxusers * 16) > +#endif > + > +static int nsfbufs; > +static int nsfbufspeak; > +static int nsfbufsused; > + > +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, > + "Maximum number of sendfile(2) sf_bufs available"); > +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, > + "Number of sendfile(2) sf_bufs at peak usage"); > +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, > + "Number of sendfile(2) sf_bufs in use"); > + > +static void sf_buf_init(void *arg); > +SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); > + > +LIST_HEAD(sf_head, sf_buf); > + > +/* > + * A hash table of active sendfile(2) buffers > + */ > +static struct sf_head *sf_buf_active; > +static u_long sf_buf_hashmask; > + > +#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) > + > +static TAILQ_HEAD(, sf_buf) sf_buf_freelist; > +static u_int sf_buf_alloc_want; > + > +/* > + * A lock used to synchronize access to the hash table and free list > + */ > +static struct mtx sf_buf_lock; > + > +/* > + * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) > + */ > +static void > +sf_buf_init(void *arg) > +{ > + struct sf_buf *sf_bufs; > + vm_offset_t sf_base; > + int i; > + > +#ifdef SFBUF_OPTIONAL_DIRECT_MAP > + if (SFBUF_OPTIONAL_DIRECT_MAP) > + return; > +#endif > + > + nsfbufs = NSFBUFS; > + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); > + > + sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); > + TAILQ_INIT(&sf_buf_freelist); > + sf_base = kva_alloc(nsfbufs * PAGE_SIZE); > + sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, > + M_NOWAIT | M_ZERO); > + KASSERT(sf_bufs, ("%s: malloc failure", __func__)); > + for (i = 0; i < nsfbufs; i++) { > + sf_bufs[i].kva = sf_base + i * PAGE_SIZE; > + TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); > + } > + sf_buf_alloc_want = 0; > + mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); > +} > + > +/* > + * Get an sf_buf from the freelist. May block if none are available. > + */ > +struct sf_buf * > +sf_buf_alloc(struct vm_page *m, int flags) > +{ > + struct sf_head *hash_list; > + struct sf_buf *sf; > + int error; > + > +#ifdef SFBUF_OPTIONAL_DIRECT_MAP > + if (SFBUF_OPTIONAL_DIRECT_MAP) > + return ((struct sf_buf *)m); > +#endif > + > + KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, > + ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); > + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; > + mtx_lock(&sf_buf_lock); > + LIST_FOREACH(sf, hash_list, list_entry) { > + if (sf->m == m) { > + sf->ref_count++; > + if (sf->ref_count == 1) { > + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > + nsfbufsused++; > + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > + } > +#if defined(SMP) && defined(SFBUF_CPUSET) > + sf_buf_shootdown(sf, flags); > +#endif > + goto done; > + } > + } > + while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { > + if (flags & SFB_NOWAIT) > + goto done; > + sf_buf_alloc_want++; > + SFSTAT_INC(sf_allocwait); > + error = msleep(&sf_buf_freelist, &sf_buf_lock, > + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); > + sf_buf_alloc_want--; > + > + /* > + * If we got a signal, don't risk going back to sleep. > + */ > + if (error) > + goto done; > + } > + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); > + if (sf->m != NULL) > + LIST_REMOVE(sf, list_entry); > + LIST_INSERT_HEAD(hash_list, sf, list_entry); > + sf->ref_count = 1; > + sf->m = m; > + nsfbufsused++; > + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); > + sf_buf_map(sf, flags); > +done: > + mtx_unlock(&sf_buf_lock); > + return (sf); > +} > + > +/* > + * Remove a reference from the given sf_buf, adding it to the free > + * list when its reference count reaches zero. A freed sf_buf still, > + * however, retains its virtual-to-physical mapping until it is > + * recycled or reactivated by sf_buf_alloc(9). > + */ > +void > +sf_buf_free(struct sf_buf *sf) > +{ > + > +#ifdef SFBUF_OPTIONAL_DIRECT_MAP > + if (SFBUF_OPTIONAL_DIRECT_MAP) > + return; > +#endif > + > + mtx_lock(&sf_buf_lock); > + sf->ref_count--; > + if (sf->ref_count == 0) { > + TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); > + nsfbufsused--; > + if (sf_buf_unmap(sf)) { > + sf->m = NULL; > + LIST_REMOVE(sf, list_entry); > + } > + if (sf_buf_alloc_want > 0) > + wakeup(&sf_buf_freelist); > + } > + mtx_unlock(&sf_buf_lock); > +} > + > +#ifdef SFBUF_PROCESS_PAGE > +/* > + * Run callback function on sf_buf that holds a certain page. > + */ > +boolean_t > +sf_buf_process_page(vm_page_t m, void (*cb)(struct sf_buf *)) > +{ > + struct sf_head *hash_list; > + struct sf_buf *sf; > + > + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; > + mtx_lock(&sf_buf_lock); > + LIST_FOREACH(sf, hash_list, list_entry) { > + if (sf->m == m) { > + cb(sf); > + mtx_unlock(&sf_buf_lock); > + return (TRUE); > + } > + } > + mtx_unlock(&sf_buf_lock); > + return (FALSE); > +} > +#endif /* SFBUF_PROCESS_PAGE */ > > Modified: head/sys/mips/include/sf_buf.h > ============================================================================== > --- head/sys/mips/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/mips/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -29,31 +29,9 @@ > #ifndef _MACHINE_SF_BUF_H_ > #define _MACHINE_SF_BUF_H_ > > -#ifdef __mips_n64 > -#include > -#include > -#include > -#else > -#include > -#endif > - > -#ifdef __mips_n64 > -/* In 64 bit the whole memory is directly mapped */ > -struct sf_buf; > +#ifdef __mips_n64 /* In 64 bit the whole memory is directly mapped */ > > -static inline struct sf_buf * > -sf_buf_alloc(struct vm_page *m, int pri) > -{ > - > - return ((struct sf_buf *)m); > -} > - > -static inline void > -sf_buf_free(struct sf_buf *sf) > -{ > -} > - > -static __inline vm_offset_t > +static inline vm_offset_t > sf_buf_kva(struct sf_buf *sf) > { > vm_page_t m; > @@ -62,38 +40,12 @@ sf_buf_kva(struct sf_buf *sf) > return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); > } > > -static __inline struct vm_page * > +static inline struct vm_page * > sf_buf_page(struct sf_buf *sf) > { > > return ((vm_page_t)sf); > } > > -#else /* ! __mips_n64 */ > -struct vm_page; > - > -struct sf_buf { > - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ > - struct vm_page *m; /* currently mapped page */ > - vm_offset_t kva; /* va of mapping */ > -}; > - > -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); > -void sf_buf_free(struct sf_buf *sf); > - > -static __inline vm_offset_t > -sf_buf_kva(struct sf_buf *sf) > -{ > - > - return (sf->kva); > -} > - > -static __inline struct vm_page * > -sf_buf_page(struct sf_buf *sf) > -{ > - > - return (sf->m); > -} > #endif /* __mips_n64 */ > - > #endif /* !_MACHINE_SF_BUF_H_ */ > > Modified: head/sys/mips/include/vmparam.h > ============================================================================== > --- head/sys/mips/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/mips/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) > @@ -187,4 +187,8 @@ > > #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ > > +#ifndef __mips_n64 > +#define SFBUF > +#endif > + > #endif /* !_MACHINE_VMPARAM_H_ */ > > Modified: head/sys/mips/mips/vm_machdep.c > ============================================================================== > --- head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) > +++ head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) > @@ -76,9 +76,6 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#ifndef __mips_n64 > -#include > -#endif > > /* Duplicated from asm.h */ > #if defined(__mips_o32) > @@ -92,38 +89,6 @@ __FBSDID("$FreeBSD$"); > #define CALLFRAME_SIZ (SZREG * 4) > #endif > > -#ifndef __mips_n64 > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 21:23:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 250204AA; Sat, 6 Sep 2014 21:23:15 +0000 (UTC) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC761886; Sat, 6 Sep 2014 21:23:14 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id i8so13519470qcq.8 for ; Sat, 06 Sep 2014 14:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=q8lf2dd0gTaWb94Iq6a6+53ElZIM5YMcajUK85vPGo4=; b=vvrIZGE/chNa3QskC91P4Jf+eu2uB1JaZ9AIvjPsu2IFHawcMYAM81Ii+Ao6FupNvB 3mZu1l3oE4uuCfPaUyyrsJgjZIu/bPKO8D4jG+e1+kB4vr/Ka11Q9owk7Xr/F9aunZwr y+9J6Q0fL7SbjPmj+5x9ukBuzdfJ+5PEEwk1GYrHzFshWLv0qy9XKRk4xgc6rEeiZ0EG 8wV1AwJg0bxjEsAUMjY35bHninpozpgVeC8HJ3YSkNSwlDMIOzcDcwVtkmhbOyBonKHD xYYl2VVdVfC8z6g93ONoUS31WjNOj9TT6NMUUMOlr0b7ZAVxshMegfT5P16xBeJyBkKO F4qA== MIME-Version: 1.0 X-Received: by 10.224.36.4 with SMTP id r4mr29512264qad.69.1410038593753; Sat, 06 Sep 2014 14:23:13 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Sat, 6 Sep 2014 14:23:13 -0700 (PDT) In-Reply-To: References: <53e0a76b.5936.428818a9@svn.freebsd.org> Date: Sat, 6 Sep 2014 14:23:13 -0700 X-Google-Sender-Auth: wxxAl1udBQihPZp-iQ6WFObKrOU Message-ID: Subject: Re: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 21:23:15 -0000 . and I've submitted this as a bug: Bug: 193400 Note: this is a mipseb platform, not a mipsel platform. -a On 6 September 2014 14:15, Adrian Chadd wrote: > Hi Gleb! > > This commit has broken mips32 on my 128MB RAM routerstation pro board. > > I've tested the commit before this one (and it works). > > I've also tested today's -HEAD as there was some subsequent fixes to > the sfbuf code. It hasn't completely fixed things - I still see > processes throwing VM errors: > > umass0:0:0: Attached to scbus0 > Trying to mount root from ufs:redboot/rootfs.uzip []... > warning: no time-of-day clock registered, system time will not be set accurately > da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 > da0: Removable Direct Access SCSI-0 device > da0: Serial Number 000000009451 > da0: 40.000MB/s transfers > da0: 3902MB (7991296 512 byte sectors: 255H 63S/T 497C) > da0: quirks=0x3 > Aug 28 08:07:57 init: login_getclass: unknown class 'daemon' > BAD_PAGE_FAULT: pid 27 tid 100045 (mount), uid 0: pc 0x40514dd0 got a > read fault (type 0x2) at 0x4040011c > Trapframe Register Dump: > zero: 0 at: 0x7fffffff v0: 0 v1: 0x404000fc > a0: 0x54 a1: 0x40400000 a2: 0 a3: 0x1 > t0: 0 t1: 0x40c0300c t2: 0x40800168 t3: 0x2f > t4: 0x40c00030 t5: 0 t6: 0x748 t7: 0x402c70 > t8: 0x13 t9: 0x40514d58 s0: 0x3 s1: 0x40418798 > s2: 0 s3: 0x404ec4 s4: 0x40418798 s5: 0x40418798 > s6: 0 s7: 0 k0: 0 k1: 0 > gp: 0x405ec910 sp: 0x7ffee348 s8: 0 ra: 0x4051534c > sr: 0xfc13 mullo: 0x6719 mulhi: 0xc badvaddr: 0x4040011c > cause: 0x8 pc: 0x40514dd0 > Page table info for pc address 0x40514dd0: pde = 0x813da000, pte = 0xa00569da > Dumping 4 words starting at pc address 0x40514dd0: > 8c700020 32030ff0 00032102 240300ff > Page table info for bad address 0x4040011c: pde = 0x813da000, pte = 0 > pid 27 (mount), uid 0: exited on signal 11 > *** Populating /var .. > > .. so how can we debug what's going on? > > > > -a > > > On 5 August 2014 02:44, Gleb Smirnoff wrote: >> Author: glebius >> Date: Tue Aug 5 09:44:10 2014 >> New Revision: 269577 >> URL: http://svnweb.freebsd.org/changeset/base/269577 >> >> Log: >> Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c >> The MD allocators were very common, however there were some minor >> differencies. These differencies were all consolidated in the MI allocator, >> under ifdefs. The defines from machine/vmparam.h turn on features required >> for a particular machine. For details look in the comment in sys/sf_buf.h. >> >> As result no MD code left in sys/*/*/vm_machdep.c. Some arches still have >> machine/sf_buf.h, which is usually quite small. >> >> Tested by: glebius (i386), tuexen (arm32), kevlo (arm32) >> Reviewed by: kib >> Sponsored by: Netflix >> Sponsored by: Nginx, Inc. >> >> Added: >> head/sys/kern/subr_sfbuf.c (contents, props changed) >> Deleted: >> head/sys/powerpc/include/sf_buf.h >> head/sys/sparc64/include/sf_buf.h >> Modified: >> head/sys/amd64/include/sf_buf.h >> head/sys/arm/arm/vm_machdep.c >> head/sys/arm/include/sf_buf.h >> head/sys/arm/include/vmparam.h >> head/sys/conf/files.arm >> head/sys/conf/files.i386 >> head/sys/conf/files.mips >> head/sys/conf/files.pc98 >> head/sys/conf/files.powerpc >> head/sys/conf/files.sparc64 >> head/sys/i386/i386/vm_machdep.c >> head/sys/i386/include/sf_buf.h >> head/sys/i386/include/vmparam.h >> head/sys/mips/include/sf_buf.h >> head/sys/mips/include/vmparam.h >> head/sys/mips/mips/vm_machdep.c >> head/sys/powerpc/include/vmparam.h >> head/sys/powerpc/powerpc/vm_machdep.c >> head/sys/sparc64/include/vmparam.h >> head/sys/sparc64/sparc64/vm_machdep.c >> head/sys/sys/sf_buf.h >> >> Modified: head/sys/amd64/include/sf_buf.h >> ============================================================================== >> --- head/sys/amd64/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/amd64/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,42 +29,23 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> -#include >> -#include >> - >> /* >> * On this machine, the only purpose for which sf_buf is used is to implement >> * an opaque pointer required by the machine-independent parts of the kernel. >> * That pointer references the vm_page that is "mapped" by the sf_buf. The >> * actual mapping is provided by the direct virtual-to-physical mapping. >> */ >> -struct sf_buf; >> - >> -static inline struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int pri) >> -{ >> - >> - return ((struct sf_buf *)m); >> -} >> - >> -static inline void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> -} >> - >> -static __inline vm_offset_t >> +static inline vm_offset_t >> sf_buf_kva(struct sf_buf *sf) >> { >> >> return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); >> } >> >> -static __inline vm_page_t >> +static inline vm_page_t >> sf_buf_page(struct sf_buf *sf) >> { >> >> return ((vm_page_t)sf); >> } >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/arm/arm/vm_machdep.c >> ============================================================================== >> --- head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #include >> #include >> @@ -83,42 +82,6 @@ __FBSDID("$FreeBSD$"); >> CTASSERT(sizeof(struct switchframe) == 24); >> CTASSERT(sizeof(struct trapframe) == 80); >> >> -#ifndef NSFBUFS >> -#define NSFBUFS (512 + maxusers * 16) >> -#endif >> - >> -static int nsfbufs; >> -static int nsfbufspeak; >> -static int nsfbufsused; >> - >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> - "Maximum number of sendfile(2) sf_bufs available"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> - "Number of sendfile(2) sf_bufs at peak usage"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> - "Number of sendfile(2) sf_bufs in use"); >> - >> -static void sf_buf_init(void *arg); >> -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> - >> -LIST_HEAD(sf_head, sf_buf); >> - >> -/* >> - * A hash table of active sendfile(2) buffers >> - */ >> -static struct sf_head *sf_buf_active; >> -static u_long sf_buf_hashmask; >> - >> -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> - >> -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> -static u_int sf_buf_alloc_want; >> - >> -/* >> - * A lock used to synchronize access to the hash table and free list >> - */ >> -static struct mtx sf_buf_lock; >> - >> /* >> * Finish a fork operation, with process p2 nearly set up. >> * Copy and update the pcb, set up the stack so that the child >> @@ -184,106 +147,6 @@ cpu_thread_swapout(struct thread *td) >> { >> } >> >> -/* >> - * Detatch mapped page and release resources back to the system. >> - */ >> -void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> - >> - mtx_lock(&sf_buf_lock); >> - sf->ref_count--; >> - if (sf->ref_count == 0) { >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused--; >> - pmap_kremove(sf->kva); >> - sf->m = NULL; >> - LIST_REMOVE(sf, list_entry); >> - if (sf_buf_alloc_want > 0) >> - wakeup(&sf_buf_freelist); >> - } >> - mtx_unlock(&sf_buf_lock); >> -} >> - >> -/* >> - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> - */ >> -static void >> -sf_buf_init(void *arg) >> -{ >> - struct sf_buf *sf_bufs; >> - vm_offset_t sf_base; >> - int i; >> - >> - nsfbufs = NSFBUFS; >> - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> - >> - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> - TAILQ_INIT(&sf_buf_freelist); >> - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> - M_NOWAIT | M_ZERO); >> - for (i = 0; i < nsfbufs; i++) { >> - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> - } >> - sf_buf_alloc_want = 0; >> - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> -} >> - >> -/* >> - * Get an sf_buf from the freelist. Will block if none are available. >> - */ >> -struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int flags) >> -{ >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> - int error; >> - >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - sf->ref_count++; >> - if (sf->ref_count == 1) { >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - } >> - goto done; >> - } >> - } >> - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> - if (flags & SFB_NOWAIT) >> - goto done; >> - sf_buf_alloc_want++; >> - SFSTAT_INC(sf_allocwait); >> - error = msleep(&sf_buf_freelist, &sf_buf_lock, >> - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> - sf_buf_alloc_want--; >> - >> - >> - /* >> - * If we got a signal, don't risk going back to sleep. >> - */ >> - if (error) >> - goto done; >> - } >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - if (sf->m != NULL) >> - LIST_REMOVE(sf, list_entry); >> - LIST_INSERT_HEAD(hash_list, sf, list_entry); >> - sf->ref_count = 1; >> - sf->m = m; >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); >> -done: >> - mtx_unlock(&sf_buf_lock); >> - return (sf); >> -} >> - >> void >> cpu_set_syscall_retval(struct thread *td, int error) >> { >> >> Modified: head/sys/arm/include/sf_buf.h >> ============================================================================== >> --- head/sys/arm/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,33 +29,18 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> - >> -struct vm_page; >> - >> -struct sf_buf { >> - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ >> - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> - int ref_count; /* usage of this mapping */ >> -}; >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> +static inline void >> +sf_buf_map(struct sf_buf *sf, int flags) >> { >> >> - return (sf->kva); >> + pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); >> } >> >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> +static inline int >> +sf_buf_unmap(struct sf_buf *sf) >> { >> >> - return (sf->m); >> + pmap_kremove(sf->kva); >> + return (1); >> } >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/arm/include/vmparam.h >> ============================================================================== >> --- head/sys/arm/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -170,4 +170,7 @@ extern vm_offset_t vm_max_kernel_address >> #define VM_MAX_AUTOTUNE_MAXUSERS 384 >> #endif >> >> +#define SFBUF >> +#define SFBUF_MAP >> + >> #endif /* _MACHINE_VMPARAM_H_ */ >> >> Modified: head/sys/conf/files.arm >> ============================================================================== >> --- head/sys/conf/files.arm Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.arm Tue Aug 5 09:44:10 2014 (r269577) >> @@ -77,6 +77,7 @@ font.h optional sc \ >> clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" >> kern/subr_busdma_bufalloc.c standard >> kern/subr_dummy_vdso_tc.c standard >> +kern/subr_sfbuf.c standard >> libkern/arm/aeabi_unwind.c standard >> libkern/arm/divsi3.S standard >> libkern/arm/ffs.S standard >> >> Modified: head/sys/conf/files.i386 >> ============================================================================== >> --- head/sys/conf/files.i386 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.i386 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -520,6 +520,7 @@ isa/vga_isa.c optional vga >> kern/kern_clocksource.c standard >> kern/imgact_aout.c optional compat_aout >> kern/imgact_gzip.c optional gzip >> +kern/subr_sfbuf.c standard >> libkern/divdi3.c standard >> libkern/flsll.c standard >> libkern/memmove.c standard >> >> Modified: head/sys/conf/files.mips >> ============================================================================== >> --- head/sys/conf/files.mips Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.mips Tue Aug 5 09:44:10 2014 (r269577) >> @@ -51,6 +51,7 @@ mips/mips/vm_machdep.c standard >> kern/kern_clocksource.c standard >> kern/link_elf_obj.c standard >> kern/subr_dummy_vdso_tc.c standard >> +kern/subr_sfbuf.c optional mips | mipsel | mipsn32 >> >> # gcc/clang runtime >> libkern/ffsl.c standard >> >> Modified: head/sys/conf/files.pc98 >> ============================================================================== >> --- head/sys/conf/files.pc98 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.pc98 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -205,6 +205,7 @@ i386/svr4/svr4_machdep.c optional compat >> kern/kern_clocksource.c standard >> kern/imgact_aout.c optional compat_aout >> kern/imgact_gzip.c optional gzip >> +kern/subr_sfbuf.c standard >> libkern/divdi3.c standard >> libkern/flsll.c standard >> libkern/memmove.c standard >> >> Modified: head/sys/conf/files.powerpc >> ============================================================================== >> --- head/sys/conf/files.powerpc Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.powerpc Tue Aug 5 09:44:10 2014 (r269577) >> @@ -71,6 +71,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt aim >> kern/kern_clocksource.c standard >> kern/subr_dummy_vdso_tc.c standard >> kern/syscalls.c optional ktr >> +kern/subr_sfbuf.c standard >> libkern/ashldi3.c optional powerpc >> libkern/ashrdi3.c optional powerpc >> libkern/bcmp.c standard >> >> Modified: head/sys/conf/files.sparc64 >> ============================================================================== >> --- head/sys/conf/files.sparc64 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.sparc64 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -64,6 +64,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt >> kern/kern_clocksource.c standard >> kern/subr_dummy_vdso_tc.c standard >> kern/syscalls.c optional ktr >> +kern/subr_sfbuf.c standard >> libkern/ffs.c standard >> libkern/ffsl.c standard >> libkern/fls.c standard >> >> Modified: head/sys/i386/i386/vm_machdep.c >> ============================================================================== >> --- head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -118,38 +118,6 @@ static u_int cpu_reset_proxyid; >> static volatile u_int cpu_reset_proxy_active; >> #endif >> >> -static int nsfbufs; >> -static int nsfbufspeak; >> -static int nsfbufsused; >> - >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> - "Maximum number of sendfile(2) sf_bufs available"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> - "Number of sendfile(2) sf_bufs at peak usage"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> - "Number of sendfile(2) sf_bufs in use"); >> - >> -static void sf_buf_init(void *arg); >> -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> - >> -LIST_HEAD(sf_head, sf_buf); >> - >> -/* >> - * A hash table of active sendfile(2) buffers >> - */ >> -static struct sf_head *sf_buf_active; >> -static u_long sf_buf_hashmask; >> - >> -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> - >> -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> -static u_int sf_buf_alloc_want; >> - >> -/* >> - * A lock used to synchronize access to the hash table and free list >> - */ >> -static struct mtx sf_buf_lock; >> - >> extern int _ucodesel, _udatasel; >> >> /* >> @@ -750,121 +718,12 @@ cpu_reset_real() >> } >> >> /* >> - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> - */ >> -static void >> -sf_buf_init(void *arg) >> -{ >> - struct sf_buf *sf_bufs; >> - vm_offset_t sf_base; >> - int i; >> - >> - nsfbufs = NSFBUFS; >> - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> - >> - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> - TAILQ_INIT(&sf_buf_freelist); >> - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> - M_NOWAIT | M_ZERO); >> - for (i = 0; i < nsfbufs; i++) { >> - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> - } >> - sf_buf_alloc_want = 0; >> - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> -} >> - >> -/* >> - * Invalidate the cache lines that may belong to the page, if >> - * (possibly old) mapping of the page by sf buffer exists. Returns >> - * TRUE when mapping was found and cache invalidated. >> - */ >> -boolean_t >> -sf_buf_invalidate_cache(vm_page_t m) >> -{ >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> - boolean_t ret; >> - >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - ret = FALSE; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - /* >> - * Use pmap_qenter to update the pte for >> - * existing mapping, in particular, the PAT >> - * settings are recalculated. >> - */ >> - pmap_qenter(sf->kva, &m, 1); >> - pmap_invalidate_cache_range(sf->kva, sf->kva + >> - PAGE_SIZE); >> - ret = TRUE; >> - break; >> - } >> - } >> - mtx_unlock(&sf_buf_lock); >> - return (ret); >> -} >> - >> -/* >> * Get an sf_buf from the freelist. May block if none are available. >> */ >> -struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int flags) >> +void >> +sf_buf_map(struct sf_buf *sf, int flags) >> { >> pt_entry_t opte, *ptep; >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> -#ifdef SMP >> - cpuset_t other_cpus; >> - u_int cpuid; >> -#endif >> - int error; >> - >> - KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, >> - ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - sf->ref_count++; >> - if (sf->ref_count == 1) { >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - } >> -#ifdef SMP >> - goto shootdown; >> -#else >> - goto done; >> -#endif >> - } >> - } >> - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> - if (flags & SFB_NOWAIT) >> - goto done; >> - sf_buf_alloc_want++; >> - SFSTAT_INC(sf_allocwait); >> - error = msleep(&sf_buf_freelist, &sf_buf_lock, >> - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> - sf_buf_alloc_want--; >> - >> - /* >> - * If we got a signal, don't risk going back to sleep. >> - */ >> - if (error) >> - goto done; >> - } >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - if (sf->m != NULL) >> - LIST_REMOVE(sf, list_entry); >> - LIST_INSERT_HEAD(hash_list, sf, list_entry); >> - sf->ref_count = 1; >> - sf->m = m; >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> >> /* >> * Update the sf_buf's virtual-to-physical mapping, flushing the >> @@ -876,11 +735,11 @@ sf_buf_alloc(struct vm_page *m, int flag >> ptep = vtopte(sf->kva); >> opte = *ptep; >> #ifdef XEN >> - PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag >> - | PG_RW | PG_V | pmap_cache_bits(m->md.pat_mode, 0)); >> + PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(sf->m)) | pgeflag >> + | PG_RW | PG_V | pmap_cache_bits(sf->m->md.pat_mode, 0)); >> #else >> - *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V | >> - pmap_cache_bits(m->md.pat_mode, 0); >> + *ptep = VM_PAGE_TO_PHYS(sf->m) | pgeflag | PG_RW | PG_V | >> + pmap_cache_bits(sf->m->md.pat_mode, 0); >> #endif >> >> /* >> @@ -892,7 +751,21 @@ sf_buf_alloc(struct vm_page *m, int flag >> #ifdef SMP >> if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> CPU_ZERO(&sf->cpumask); >> -shootdown: >> + >> + sf_buf_shootdown(sf, flags); >> +#else >> + if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> + pmap_invalidate_page(kernel_pmap, sf->kva); >> +#endif >> +} >> + >> +#ifdef SMP >> +void >> +sf_buf_shootdown(struct sf_buf *sf, int flags) >> +{ >> + cpuset_t other_cpus; >> + u_int cpuid; >> + >> sched_pin(); >> cpuid = PCPU_GET(cpuid); >> if (!CPU_ISSET(cpuid, &sf->cpumask)) { >> @@ -909,42 +782,50 @@ shootdown: >> } >> } >> sched_unpin(); >> -#else >> - if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> - pmap_invalidate_page(kernel_pmap, sf->kva); >> -#endif >> -done: >> - mtx_unlock(&sf_buf_lock); >> - return (sf); >> } >> +#endif >> >> /* >> - * Remove a reference from the given sf_buf, adding it to the free >> - * list when its reference count reaches zero. A freed sf_buf still, >> - * however, retains its virtual-to-physical mapping until it is >> - * recycled or reactivated by sf_buf_alloc(9). >> + * MD part of sf_buf_free(). >> */ >> -void >> -sf_buf_free(struct sf_buf *sf) >> +int >> +sf_buf_unmap(struct sf_buf *sf) >> { >> - >> - mtx_lock(&sf_buf_lock); >> - sf->ref_count--; >> - if (sf->ref_count == 0) { >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused--; >> #ifdef XEN >> + /* >> + * Xen doesn't like having dangling R/W mappings >> + */ >> + pmap_qremove(sf->kva, 1); >> + return (1); >> +#else >> + return (0); >> +#endif >> +} >> + >> +static void >> +sf_buf_invalidate(struct sf_buf *sf) >> +{ >> + vm_page_t m = sf->m; >> + >> + /* >> + * Use pmap_qenter to update the pte for >> + * existing mapping, in particular, the PAT >> + * settings are recalculated. >> + */ >> + pmap_qenter(sf->kva, &m, 1); >> + pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE); >> +} >> + >> /* >> - * Xen doesn't like having dangling R/W mappings >> + * Invalidate the cache lines that may belong to the page, if >> + * (possibly old) mapping of the page by sf buffer exists. Returns >> + * TRUE when mapping was found and cache invalidated. >> */ >> - pmap_qremove(sf->kva, 1); >> - sf->m = NULL; >> - LIST_REMOVE(sf, list_entry); >> -#endif >> - if (sf_buf_alloc_want > 0) >> - wakeup(&sf_buf_freelist); >> - } >> - mtx_unlock(&sf_buf_lock); >> +boolean_t >> +sf_buf_invalidate_cache(vm_page_t m) >> +{ >> + >> + return (sf_buf_process_page(m, sf_buf_invalidate)); >> } >> >> /* >> >> Modified: head/sys/i386/include/sf_buf.h >> ============================================================================== >> --- head/sys/i386/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -1,5 +1,5 @@ >> /*- >> - * Copyright (c) 2003, 2005 Alan L. Cox >> + * Copyright (c) 2014 Gleb Smirnoff >> * All rights reserved. >> * >> * Redistribution and use in source and binary forms, with or without >> @@ -29,39 +29,8 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> -#include >> - >> -struct vm_page; >> - >> -struct sf_buf { >> - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ >> - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> - int ref_count; /* usage of this mapping */ >> -#ifdef SMP >> - cpuset_t cpumask; /* cpus on which mapping is valid */ >> -#endif >> -}; >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> -{ >> - >> - return (sf->kva); >> -} >> - >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> -{ >> - >> - return (sf->m); >> -} >> - >> -boolean_t sf_buf_invalidate_cache(vm_page_t m); >> +void sf_buf_map(struct sf_buf *, int); >> +int sf_buf_unmap(struct sf_buf *); >> +boolean_t sf_buf_invalidate_cache(vm_page_t); >> >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/i386/include/vmparam.h >> ============================================================================== >> --- head/sys/i386/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -198,4 +198,9 @@ >> #define VM_MAX_AUTOTUNE_MAXUSERS 384 >> #endif >> >> +#define SFBUF >> +#define SFBUF_MAP >> +#define SFBUF_CPUSET >> +#define SFBUF_PROCESS_PAGE >> + >> #endif /* _MACHINE_VMPARAM_H_ */ >> >> Added: head/sys/kern/subr_sfbuf.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/kern/subr_sfbuf.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -0,0 +1,226 @@ >> +/*- >> + * Copyright (c) 2014 Gleb Smirnoff >> + * Copyright (c) 2003, 2005 Alan L. Cox >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> + >> +#ifndef NSFBUFS >> +#define NSFBUFS (512 + maxusers * 16) >> +#endif >> + >> +static int nsfbufs; >> +static int nsfbufspeak; >> +static int nsfbufsused; >> + >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> + "Maximum number of sendfile(2) sf_bufs available"); >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> + "Number of sendfile(2) sf_bufs at peak usage"); >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> + "Number of sendfile(2) sf_bufs in use"); >> + >> +static void sf_buf_init(void *arg); >> +SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> + >> +LIST_HEAD(sf_head, sf_buf); >> + >> +/* >> + * A hash table of active sendfile(2) buffers >> + */ >> +static struct sf_head *sf_buf_active; >> +static u_long sf_buf_hashmask; >> + >> +#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> + >> +static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> +static u_int sf_buf_alloc_want; >> + >> +/* >> + * A lock used to synchronize access to the hash table and free list >> + */ >> +static struct mtx sf_buf_lock; >> + >> +/* >> + * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> + */ >> +static void >> +sf_buf_init(void *arg) >> +{ >> + struct sf_buf *sf_bufs; >> + vm_offset_t sf_base; >> + int i; >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return; >> +#endif >> + >> + nsfbufs = NSFBUFS; >> + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> + >> + sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> + TAILQ_INIT(&sf_buf_freelist); >> + sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> + sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> + M_NOWAIT | M_ZERO); >> + KASSERT(sf_bufs, ("%s: malloc failure", __func__)); >> + for (i = 0; i < nsfbufs; i++) { >> + sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> + TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> + } >> + sf_buf_alloc_want = 0; >> + mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> +} >> + >> +/* >> + * Get an sf_buf from the freelist. May block if none are available. >> + */ >> +struct sf_buf * >> +sf_buf_alloc(struct vm_page *m, int flags) >> +{ >> + struct sf_head *hash_list; >> + struct sf_buf *sf; >> + int error; >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return ((struct sf_buf *)m); >> +#endif >> + >> + KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, >> + ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); >> + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> + mtx_lock(&sf_buf_lock); >> + LIST_FOREACH(sf, hash_list, list_entry) { >> + if (sf->m == m) { >> + sf->ref_count++; >> + if (sf->ref_count == 1) { >> + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> + nsfbufsused++; >> + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> + } >> +#if defined(SMP) && defined(SFBUF_CPUSET) >> + sf_buf_shootdown(sf, flags); >> +#endif >> + goto done; >> + } >> + } >> + while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> + if (flags & SFB_NOWAIT) >> + goto done; >> + sf_buf_alloc_want++; >> + SFSTAT_INC(sf_allocwait); >> + error = msleep(&sf_buf_freelist, &sf_buf_lock, >> + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> + sf_buf_alloc_want--; >> + >> + /* >> + * If we got a signal, don't risk going back to sleep. >> + */ >> + if (error) >> + goto done; >> + } >> + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> + if (sf->m != NULL) >> + LIST_REMOVE(sf, list_entry); >> + LIST_INSERT_HEAD(hash_list, sf, list_entry); >> + sf->ref_count = 1; >> + sf->m = m; >> + nsfbufsused++; >> + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> + sf_buf_map(sf, flags); >> +done: >> + mtx_unlock(&sf_buf_lock); >> + return (sf); >> +} >> + >> +/* >> + * Remove a reference from the given sf_buf, adding it to the free >> + * list when its reference count reaches zero. A freed sf_buf still, >> + * however, retains its virtual-to-physical mapping until it is >> + * recycled or reactivated by sf_buf_alloc(9). >> + */ >> +void >> +sf_buf_free(struct sf_buf *sf) >> +{ >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return; >> +#endif >> + >> + mtx_lock(&sf_buf_lock); >> + sf->ref_count--; >> + if (sf->ref_count == 0) { >> + TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> + nsfbufsused--; >> + if (sf_buf_unmap(sf)) { >> + sf->m = NULL; >> + LIST_REMOVE(sf, list_entry); >> + } >> + if (sf_buf_alloc_want > 0) >> + wakeup(&sf_buf_freelist); >> + } >> + mtx_unlock(&sf_buf_lock); >> +} >> + >> +#ifdef SFBUF_PROCESS_PAGE >> +/* >> + * Run callback function on sf_buf that holds a certain page. >> + */ >> +boolean_t >> +sf_buf_process_page(vm_page_t m, void (*cb)(struct sf_buf *)) >> +{ >> + struct sf_head *hash_list; >> + struct sf_buf *sf; >> + >> + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> + mtx_lock(&sf_buf_lock); >> + LIST_FOREACH(sf, hash_list, list_entry) { >> + if (sf->m == m) { >> + cb(sf); >> + mtx_unlock(&sf_buf_lock); >> + return (TRUE); >> + } >> + } >> + mtx_unlock(&sf_buf_lock); >> + return (FALSE); >> +} >> +#endif /* SFBUF_PROCESS_PAGE */ >> >> Modified: head/sys/mips/include/sf_buf.h >> ============================================================================== >> --- head/sys/mips/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,31 +29,9 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#ifdef __mips_n64 >> -#include >> -#include >> -#include >> -#else >> -#include >> -#endif >> - >> -#ifdef __mips_n64 >> -/* In 64 bit the whole memory is directly mapped */ >> -struct sf_buf; >> +#ifdef __mips_n64 /* In 64 bit the whole memory is directly mapped */ >> >> -static inline struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int pri) >> -{ >> - >> - return ((struct sf_buf *)m); >> -} >> - >> -static inline void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> -} >> - >> -static __inline vm_offset_t >> +static inline vm_offset_t >> sf_buf_kva(struct sf_buf *sf) >> { >> vm_page_t m; >> @@ -62,38 +40,12 @@ sf_buf_kva(struct sf_buf *sf) >> return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); >> } >> >> -static __inline struct vm_page * >> +static inline struct vm_page * >> sf_buf_page(struct sf_buf *sf) >> { >> >> return ((vm_page_t)sf); >> } >> >> -#else /* ! __mips_n64 */ >> -struct vm_page; >> - >> -struct sf_buf { >> - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> -}; >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> -{ >> - >> - return (sf->kva); >> -} >> - >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> -{ >> - >> - return (sf->m); >> -} >> #endif /* __mips_n64 */ >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/mips/include/vmparam.h >> ============================================================================== >> --- head/sys/mips/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -187,4 +187,8 @@ >> >> #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ >> >> +#ifndef __mips_n64 >> +#define SFBUF >> +#endif >> + >> #endif /* !_MACHINE_VMPARAM_H_ */ >> >> Modified: head/sys/mips/mips/vm_machdep.c >> ============================================================================== >> --- head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -76,9 +76,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> #include >> -#ifndef __mips_n64 >> -#include >> -#endif >> >> /* Duplicated from asm.h */ >> #if defined(__mips_o32) >> @@ -92,38 +89,6 @@ __FBSDID("$FreeBSD$"); >> #define CALLFRAME_SIZ (SZREG * 4) >> #endif >> >> -#ifndef __mips_n64 >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 22:02:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68CA4AB5; Sat, 6 Sep 2014 22:02:19 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0486A1BA3; Sat, 6 Sep 2014 22:02:18 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s86M2BC0019942; Sat, 6 Sep 2014 17:02:11 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 1p7nyb09a3-1; Sat, 06 Sep 2014 17:02:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 20D014003F; Sat, 6 Sep 2014 17:02:00 -0500 (CDT) Message-ID: <540B8457.2020500@rice.edu> Date: Sat, 06 Sep 2014 17:01:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Adrian Chadd , Gleb Smirnoff Subject: Re: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys References: <53e0a76b.5936.428818a9@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=3.91514137776383e-08 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.714301145562988 urlsuspect_oldscore=0.714301145562988 suspectscore=13 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.714301145562988 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409060253 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 22:02:19 -0000 On 09/06/2014 16:15, Adrian Chadd wrote: > Hi Gleb! > > This commit has broken mips32 on my 128MB RAM routerstation pro board. > > I've tested the commit before this one (and it works). > > I've also tested today's -HEAD as there was some subsequent fixes to > the sfbuf code. It hasn't completely fixed things - I still see > processes throwing VM errors: Before this commit, the sf_buf code did not cache mappings on MIPS. Now, it does. So, I suspect that you're experiencing cache consistency issues. To return to the pre-commit state, you'll need to define machine-dependent sf_buf_{un,}map() functions in mips/include/sf_buf.h for mips32 that call pmap_q{remove,enter}, respectively. Look at arm for a similar configuration. > umass0:0:0: Attached to scbus0 > Trying to mount root from ufs:redboot/rootfs.uzip []... > warning: no time-of-day clock registered, system time will not be set accurately > da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 > da0: Removable Direct Access SCSI-0 device > da0: Serial Number 000000009451 > da0: 40.000MB/s transfers > da0: 3902MB (7991296 512 byte sectors: 255H 63S/T 497C) > da0: quirks=0x3 > Aug 28 08:07:57 init: login_getclass: unknown class 'daemon' > BAD_PAGE_FAULT: pid 27 tid 100045 (mount), uid 0: pc 0x40514dd0 got a > read fault (type 0x2) at 0x4040011c > Trapframe Register Dump: > zero: 0 at: 0x7fffffff v0: 0 v1: 0x404000fc > a0: 0x54 a1: 0x40400000 a2: 0 a3: 0x1 > t0: 0 t1: 0x40c0300c t2: 0x40800168 t3: 0x2f > t4: 0x40c00030 t5: 0 t6: 0x748 t7: 0x402c70 > t8: 0x13 t9: 0x40514d58 s0: 0x3 s1: 0x40418798 > s2: 0 s3: 0x404ec4 s4: 0x40418798 s5: 0x40418798 > s6: 0 s7: 0 k0: 0 k1: 0 > gp: 0x405ec910 sp: 0x7ffee348 s8: 0 ra: 0x4051534c > sr: 0xfc13 mullo: 0x6719 mulhi: 0xc badvaddr: 0x4040011c > cause: 0x8 pc: 0x40514dd0 > Page table info for pc address 0x40514dd0: pde = 0x813da000, pte = 0xa00569da > Dumping 4 words starting at pc address 0x40514dd0: > 8c700020 32030ff0 00032102 240300ff > Page table info for bad address 0x4040011c: pde = 0x813da000, pte = 0 > pid 27 (mount), uid 0: exited on signal 11 > *** Populating /var .. > > .. so how can we debug what's going on? > > > > -a > > > On 5 August 2014 02:44, Gleb Smirnoff wrote: >> Author: glebius >> Date: Tue Aug 5 09:44:10 2014 >> New Revision: 269577 >> URL: http://svnweb.freebsd.org/changeset/base/269577 >> >> Log: >> Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c >> The MD allocators were very common, however there were some minor >> differencies. These differencies were all consolidated in the MI allocator, >> under ifdefs. The defines from machine/vmparam.h turn on features required >> for a particular machine. For details look in the comment in sys/sf_buf.h. >> >> As result no MD code left in sys/*/*/vm_machdep.c. Some arches still have >> machine/sf_buf.h, which is usually quite small. >> >> Tested by: glebius (i386), tuexen (arm32), kevlo (arm32) >> Reviewed by: kib >> Sponsored by: Netflix >> Sponsored by: Nginx, Inc. >> >> Added: >> head/sys/kern/subr_sfbuf.c (contents, props changed) >> Deleted: >> head/sys/powerpc/include/sf_buf.h >> head/sys/sparc64/include/sf_buf.h >> Modified: >> head/sys/amd64/include/sf_buf.h >> head/sys/arm/arm/vm_machdep.c >> head/sys/arm/include/sf_buf.h >> head/sys/arm/include/vmparam.h >> head/sys/conf/files.arm >> head/sys/conf/files.i386 >> head/sys/conf/files.mips >> head/sys/conf/files.pc98 >> head/sys/conf/files.powerpc >> head/sys/conf/files.sparc64 >> head/sys/i386/i386/vm_machdep.c >> head/sys/i386/include/sf_buf.h >> head/sys/i386/include/vmparam.h >> head/sys/mips/include/sf_buf.h >> head/sys/mips/include/vmparam.h >> head/sys/mips/mips/vm_machdep.c >> head/sys/powerpc/include/vmparam.h >> head/sys/powerpc/powerpc/vm_machdep.c >> head/sys/sparc64/include/vmparam.h >> head/sys/sparc64/sparc64/vm_machdep.c >> head/sys/sys/sf_buf.h >> >> Modified: head/sys/amd64/include/sf_buf.h >> ============================================================================== >> --- head/sys/amd64/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/amd64/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,42 +29,23 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> -#include >> -#include >> - >> /* >> * On this machine, the only purpose for which sf_buf is used is to implement >> * an opaque pointer required by the machine-independent parts of the kernel. >> * That pointer references the vm_page that is "mapped" by the sf_buf. The >> * actual mapping is provided by the direct virtual-to-physical mapping. >> */ >> -struct sf_buf; >> - >> -static inline struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int pri) >> -{ >> - >> - return ((struct sf_buf *)m); >> -} >> - >> -static inline void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> -} >> - >> -static __inline vm_offset_t >> +static inline vm_offset_t >> sf_buf_kva(struct sf_buf *sf) >> { >> >> return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); >> } >> >> -static __inline vm_page_t >> +static inline vm_page_t >> sf_buf_page(struct sf_buf *sf) >> { >> >> return ((vm_page_t)sf); >> } >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/arm/arm/vm_machdep.c >> ============================================================================== >> --- head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/arm/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #include >> #include >> @@ -83,42 +82,6 @@ __FBSDID("$FreeBSD$"); >> CTASSERT(sizeof(struct switchframe) == 24); >> CTASSERT(sizeof(struct trapframe) == 80); >> >> -#ifndef NSFBUFS >> -#define NSFBUFS (512 + maxusers * 16) >> -#endif >> - >> -static int nsfbufs; >> -static int nsfbufspeak; >> -static int nsfbufsused; >> - >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> - "Maximum number of sendfile(2) sf_bufs available"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> - "Number of sendfile(2) sf_bufs at peak usage"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> - "Number of sendfile(2) sf_bufs in use"); >> - >> -static void sf_buf_init(void *arg); >> -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> - >> -LIST_HEAD(sf_head, sf_buf); >> - >> -/* >> - * A hash table of active sendfile(2) buffers >> - */ >> -static struct sf_head *sf_buf_active; >> -static u_long sf_buf_hashmask; >> - >> -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> - >> -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> -static u_int sf_buf_alloc_want; >> - >> -/* >> - * A lock used to synchronize access to the hash table and free list >> - */ >> -static struct mtx sf_buf_lock; >> - >> /* >> * Finish a fork operation, with process p2 nearly set up. >> * Copy and update the pcb, set up the stack so that the child >> @@ -184,106 +147,6 @@ cpu_thread_swapout(struct thread *td) >> { >> } >> >> -/* >> - * Detatch mapped page and release resources back to the system. >> - */ >> -void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> - >> - mtx_lock(&sf_buf_lock); >> - sf->ref_count--; >> - if (sf->ref_count == 0) { >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused--; >> - pmap_kremove(sf->kva); >> - sf->m = NULL; >> - LIST_REMOVE(sf, list_entry); >> - if (sf_buf_alloc_want > 0) >> - wakeup(&sf_buf_freelist); >> - } >> - mtx_unlock(&sf_buf_lock); >> -} >> - >> -/* >> - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> - */ >> -static void >> -sf_buf_init(void *arg) >> -{ >> - struct sf_buf *sf_bufs; >> - vm_offset_t sf_base; >> - int i; >> - >> - nsfbufs = NSFBUFS; >> - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> - >> - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> - TAILQ_INIT(&sf_buf_freelist); >> - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> - M_NOWAIT | M_ZERO); >> - for (i = 0; i < nsfbufs; i++) { >> - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> - } >> - sf_buf_alloc_want = 0; >> - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> -} >> - >> -/* >> - * Get an sf_buf from the freelist. Will block if none are available. >> - */ >> -struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int flags) >> -{ >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> - int error; >> - >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - sf->ref_count++; >> - if (sf->ref_count == 1) { >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - } >> - goto done; >> - } >> - } >> - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> - if (flags & SFB_NOWAIT) >> - goto done; >> - sf_buf_alloc_want++; >> - SFSTAT_INC(sf_allocwait); >> - error = msleep(&sf_buf_freelist, &sf_buf_lock, >> - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> - sf_buf_alloc_want--; >> - >> - >> - /* >> - * If we got a signal, don't risk going back to sleep. >> - */ >> - if (error) >> - goto done; >> - } >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - if (sf->m != NULL) >> - LIST_REMOVE(sf, list_entry); >> - LIST_INSERT_HEAD(hash_list, sf, list_entry); >> - sf->ref_count = 1; >> - sf->m = m; >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); >> -done: >> - mtx_unlock(&sf_buf_lock); >> - return (sf); >> -} >> - >> void >> cpu_set_syscall_retval(struct thread *td, int error) >> { >> >> Modified: head/sys/arm/include/sf_buf.h >> ============================================================================== >> --- head/sys/arm/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,33 +29,18 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> - >> -struct vm_page; >> - >> -struct sf_buf { >> - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ >> - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> - int ref_count; /* usage of this mapping */ >> -}; >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> +static inline void >> +sf_buf_map(struct sf_buf *sf, int flags) >> { >> >> - return (sf->kva); >> + pmap_kenter(sf->kva, VM_PAGE_TO_PHYS(sf->m)); >> } >> >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> +static inline int >> +sf_buf_unmap(struct sf_buf *sf) >> { >> >> - return (sf->m); >> + pmap_kremove(sf->kva); >> + return (1); >> } >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/arm/include/vmparam.h >> ============================================================================== >> --- head/sys/arm/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/arm/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -170,4 +170,7 @@ extern vm_offset_t vm_max_kernel_address >> #define VM_MAX_AUTOTUNE_MAXUSERS 384 >> #endif >> >> +#define SFBUF >> +#define SFBUF_MAP >> + >> #endif /* _MACHINE_VMPARAM_H_ */ >> >> Modified: head/sys/conf/files.arm >> ============================================================================== >> --- head/sys/conf/files.arm Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.arm Tue Aug 5 09:44:10 2014 (r269577) >> @@ -77,6 +77,7 @@ font.h optional sc \ >> clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" >> kern/subr_busdma_bufalloc.c standard >> kern/subr_dummy_vdso_tc.c standard >> +kern/subr_sfbuf.c standard >> libkern/arm/aeabi_unwind.c standard >> libkern/arm/divsi3.S standard >> libkern/arm/ffs.S standard >> >> Modified: head/sys/conf/files.i386 >> ============================================================================== >> --- head/sys/conf/files.i386 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.i386 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -520,6 +520,7 @@ isa/vga_isa.c optional vga >> kern/kern_clocksource.c standard >> kern/imgact_aout.c optional compat_aout >> kern/imgact_gzip.c optional gzip >> +kern/subr_sfbuf.c standard >> libkern/divdi3.c standard >> libkern/flsll.c standard >> libkern/memmove.c standard >> >> Modified: head/sys/conf/files.mips >> ============================================================================== >> --- head/sys/conf/files.mips Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.mips Tue Aug 5 09:44:10 2014 (r269577) >> @@ -51,6 +51,7 @@ mips/mips/vm_machdep.c standard >> kern/kern_clocksource.c standard >> kern/link_elf_obj.c standard >> kern/subr_dummy_vdso_tc.c standard >> +kern/subr_sfbuf.c optional mips | mipsel | mipsn32 >> >> # gcc/clang runtime >> libkern/ffsl.c standard >> >> Modified: head/sys/conf/files.pc98 >> ============================================================================== >> --- head/sys/conf/files.pc98 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.pc98 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -205,6 +205,7 @@ i386/svr4/svr4_machdep.c optional compat >> kern/kern_clocksource.c standard >> kern/imgact_aout.c optional compat_aout >> kern/imgact_gzip.c optional gzip >> +kern/subr_sfbuf.c standard >> libkern/divdi3.c standard >> libkern/flsll.c standard >> libkern/memmove.c standard >> >> Modified: head/sys/conf/files.powerpc >> ============================================================================== >> --- head/sys/conf/files.powerpc Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.powerpc Tue Aug 5 09:44:10 2014 (r269577) >> @@ -71,6 +71,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt aim >> kern/kern_clocksource.c standard >> kern/subr_dummy_vdso_tc.c standard >> kern/syscalls.c optional ktr >> +kern/subr_sfbuf.c standard >> libkern/ashldi3.c optional powerpc >> libkern/ashrdi3.c optional powerpc >> libkern/bcmp.c standard >> >> Modified: head/sys/conf/files.sparc64 >> ============================================================================== >> --- head/sys/conf/files.sparc64 Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/conf/files.sparc64 Tue Aug 5 09:44:10 2014 (r269577) >> @@ -64,6 +64,7 @@ dev/vt/hw/ofwfb/ofwfb.c optional vt >> kern/kern_clocksource.c standard >> kern/subr_dummy_vdso_tc.c standard >> kern/syscalls.c optional ktr >> +kern/subr_sfbuf.c standard >> libkern/ffs.c standard >> libkern/ffsl.c standard >> libkern/fls.c standard >> >> Modified: head/sys/i386/i386/vm_machdep.c >> ============================================================================== >> --- head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/i386/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -118,38 +118,6 @@ static u_int cpu_reset_proxyid; >> static volatile u_int cpu_reset_proxy_active; >> #endif >> >> -static int nsfbufs; >> -static int nsfbufspeak; >> -static int nsfbufsused; >> - >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> - "Maximum number of sendfile(2) sf_bufs available"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> - "Number of sendfile(2) sf_bufs at peak usage"); >> -SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> - "Number of sendfile(2) sf_bufs in use"); >> - >> -static void sf_buf_init(void *arg); >> -SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> - >> -LIST_HEAD(sf_head, sf_buf); >> - >> -/* >> - * A hash table of active sendfile(2) buffers >> - */ >> -static struct sf_head *sf_buf_active; >> -static u_long sf_buf_hashmask; >> - >> -#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> - >> -static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> -static u_int sf_buf_alloc_want; >> - >> -/* >> - * A lock used to synchronize access to the hash table and free list >> - */ >> -static struct mtx sf_buf_lock; >> - >> extern int _ucodesel, _udatasel; >> >> /* >> @@ -750,121 +718,12 @@ cpu_reset_real() >> } >> >> /* >> - * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> - */ >> -static void >> -sf_buf_init(void *arg) >> -{ >> - struct sf_buf *sf_bufs; >> - vm_offset_t sf_base; >> - int i; >> - >> - nsfbufs = NSFBUFS; >> - TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> - >> - sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> - TAILQ_INIT(&sf_buf_freelist); >> - sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> - sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> - M_NOWAIT | M_ZERO); >> - for (i = 0; i < nsfbufs; i++) { >> - sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> - } >> - sf_buf_alloc_want = 0; >> - mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> -} >> - >> -/* >> - * Invalidate the cache lines that may belong to the page, if >> - * (possibly old) mapping of the page by sf buffer exists. Returns >> - * TRUE when mapping was found and cache invalidated. >> - */ >> -boolean_t >> -sf_buf_invalidate_cache(vm_page_t m) >> -{ >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> - boolean_t ret; >> - >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - ret = FALSE; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - /* >> - * Use pmap_qenter to update the pte for >> - * existing mapping, in particular, the PAT >> - * settings are recalculated. >> - */ >> - pmap_qenter(sf->kva, &m, 1); >> - pmap_invalidate_cache_range(sf->kva, sf->kva + >> - PAGE_SIZE); >> - ret = TRUE; >> - break; >> - } >> - } >> - mtx_unlock(&sf_buf_lock); >> - return (ret); >> -} >> - >> -/* >> * Get an sf_buf from the freelist. May block if none are available. >> */ >> -struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int flags) >> +void >> +sf_buf_map(struct sf_buf *sf, int flags) >> { >> pt_entry_t opte, *ptep; >> - struct sf_head *hash_list; >> - struct sf_buf *sf; >> -#ifdef SMP >> - cpuset_t other_cpus; >> - u_int cpuid; >> -#endif >> - int error; >> - >> - KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, >> - ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); >> - hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> - mtx_lock(&sf_buf_lock); >> - LIST_FOREACH(sf, hash_list, list_entry) { >> - if (sf->m == m) { >> - sf->ref_count++; >> - if (sf->ref_count == 1) { >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> - } >> -#ifdef SMP >> - goto shootdown; >> -#else >> - goto done; >> -#endif >> - } >> - } >> - while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> - if (flags & SFB_NOWAIT) >> - goto done; >> - sf_buf_alloc_want++; >> - SFSTAT_INC(sf_allocwait); >> - error = msleep(&sf_buf_freelist, &sf_buf_lock, >> - (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> - sf_buf_alloc_want--; >> - >> - /* >> - * If we got a signal, don't risk going back to sleep. >> - */ >> - if (error) >> - goto done; >> - } >> - TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> - if (sf->m != NULL) >> - LIST_REMOVE(sf, list_entry); >> - LIST_INSERT_HEAD(hash_list, sf, list_entry); >> - sf->ref_count = 1; >> - sf->m = m; >> - nsfbufsused++; >> - nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> >> /* >> * Update the sf_buf's virtual-to-physical mapping, flushing the >> @@ -876,11 +735,11 @@ sf_buf_alloc(struct vm_page *m, int flag >> ptep = vtopte(sf->kva); >> opte = *ptep; >> #ifdef XEN >> - PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag >> - | PG_RW | PG_V | pmap_cache_bits(m->md.pat_mode, 0)); >> + PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(sf->m)) | pgeflag >> + | PG_RW | PG_V | pmap_cache_bits(sf->m->md.pat_mode, 0)); >> #else >> - *ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V | >> - pmap_cache_bits(m->md.pat_mode, 0); >> + *ptep = VM_PAGE_TO_PHYS(sf->m) | pgeflag | PG_RW | PG_V | >> + pmap_cache_bits(sf->m->md.pat_mode, 0); >> #endif >> >> /* >> @@ -892,7 +751,21 @@ sf_buf_alloc(struct vm_page *m, int flag >> #ifdef SMP >> if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> CPU_ZERO(&sf->cpumask); >> -shootdown: >> + >> + sf_buf_shootdown(sf, flags); >> +#else >> + if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> + pmap_invalidate_page(kernel_pmap, sf->kva); >> +#endif >> +} >> + >> +#ifdef SMP >> +void >> +sf_buf_shootdown(struct sf_buf *sf, int flags) >> +{ >> + cpuset_t other_cpus; >> + u_int cpuid; >> + >> sched_pin(); >> cpuid = PCPU_GET(cpuid); >> if (!CPU_ISSET(cpuid, &sf->cpumask)) { >> @@ -909,42 +782,50 @@ shootdown: >> } >> } >> sched_unpin(); >> -#else >> - if ((opte & (PG_V | PG_A)) == (PG_V | PG_A)) >> - pmap_invalidate_page(kernel_pmap, sf->kva); >> -#endif >> -done: >> - mtx_unlock(&sf_buf_lock); >> - return (sf); >> } >> +#endif >> >> /* >> - * Remove a reference from the given sf_buf, adding it to the free >> - * list when its reference count reaches zero. A freed sf_buf still, >> - * however, retains its virtual-to-physical mapping until it is >> - * recycled or reactivated by sf_buf_alloc(9). >> + * MD part of sf_buf_free(). >> */ >> -void >> -sf_buf_free(struct sf_buf *sf) >> +int >> +sf_buf_unmap(struct sf_buf *sf) >> { >> - >> - mtx_lock(&sf_buf_lock); >> - sf->ref_count--; >> - if (sf->ref_count == 0) { >> - TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> - nsfbufsused--; >> #ifdef XEN >> + /* >> + * Xen doesn't like having dangling R/W mappings >> + */ >> + pmap_qremove(sf->kva, 1); >> + return (1); >> +#else >> + return (0); >> +#endif >> +} >> + >> +static void >> +sf_buf_invalidate(struct sf_buf *sf) >> +{ >> + vm_page_t m = sf->m; >> + >> + /* >> + * Use pmap_qenter to update the pte for >> + * existing mapping, in particular, the PAT >> + * settings are recalculated. >> + */ >> + pmap_qenter(sf->kva, &m, 1); >> + pmap_invalidate_cache_range(sf->kva, sf->kva + PAGE_SIZE); >> +} >> + >> /* >> - * Xen doesn't like having dangling R/W mappings >> + * Invalidate the cache lines that may belong to the page, if >> + * (possibly old) mapping of the page by sf buffer exists. Returns >> + * TRUE when mapping was found and cache invalidated. >> */ >> - pmap_qremove(sf->kva, 1); >> - sf->m = NULL; >> - LIST_REMOVE(sf, list_entry); >> -#endif >> - if (sf_buf_alloc_want > 0) >> - wakeup(&sf_buf_freelist); >> - } >> - mtx_unlock(&sf_buf_lock); >> +boolean_t >> +sf_buf_invalidate_cache(vm_page_t m) >> +{ >> + >> + return (sf_buf_process_page(m, sf_buf_invalidate)); >> } >> >> /* >> >> Modified: head/sys/i386/include/sf_buf.h >> ============================================================================== >> --- head/sys/i386/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -1,5 +1,5 @@ >> /*- >> - * Copyright (c) 2003, 2005 Alan L. Cox >> + * Copyright (c) 2014 Gleb Smirnoff >> * All rights reserved. >> * >> * Redistribution and use in source and binary forms, with or without >> @@ -29,39 +29,8 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#include >> -#include >> - >> -struct vm_page; >> - >> -struct sf_buf { >> - LIST_ENTRY(sf_buf) list_entry; /* list of buffers */ >> - TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> - int ref_count; /* usage of this mapping */ >> -#ifdef SMP >> - cpuset_t cpumask; /* cpus on which mapping is valid */ >> -#endif >> -}; >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> -{ >> - >> - return (sf->kva); >> -} >> - >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> -{ >> - >> - return (sf->m); >> -} >> - >> -boolean_t sf_buf_invalidate_cache(vm_page_t m); >> +void sf_buf_map(struct sf_buf *, int); >> +int sf_buf_unmap(struct sf_buf *); >> +boolean_t sf_buf_invalidate_cache(vm_page_t); >> >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/i386/include/vmparam.h >> ============================================================================== >> --- head/sys/i386/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/i386/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -198,4 +198,9 @@ >> #define VM_MAX_AUTOTUNE_MAXUSERS 384 >> #endif >> >> +#define SFBUF >> +#define SFBUF_MAP >> +#define SFBUF_CPUSET >> +#define SFBUF_PROCESS_PAGE >> + >> #endif /* _MACHINE_VMPARAM_H_ */ >> >> Added: head/sys/kern/subr_sfbuf.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/kern/subr_sfbuf.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -0,0 +1,226 @@ >> +/*- >> + * Copyright (c) 2014 Gleb Smirnoff >> + * Copyright (c) 2003, 2005 Alan L. Cox >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> + >> +#ifndef NSFBUFS >> +#define NSFBUFS (512 + maxusers * 16) >> +#endif >> + >> +static int nsfbufs; >> +static int nsfbufspeak; >> +static int nsfbufsused; >> + >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0, >> + "Maximum number of sendfile(2) sf_bufs available"); >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0, >> + "Number of sendfile(2) sf_bufs at peak usage"); >> +SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0, >> + "Number of sendfile(2) sf_bufs in use"); >> + >> +static void sf_buf_init(void *arg); >> +SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); >> + >> +LIST_HEAD(sf_head, sf_buf); >> + >> +/* >> + * A hash table of active sendfile(2) buffers >> + */ >> +static struct sf_head *sf_buf_active; >> +static u_long sf_buf_hashmask; >> + >> +#define SF_BUF_HASH(m) (((m) - vm_page_array) & sf_buf_hashmask) >> + >> +static TAILQ_HEAD(, sf_buf) sf_buf_freelist; >> +static u_int sf_buf_alloc_want; >> + >> +/* >> + * A lock used to synchronize access to the hash table and free list >> + */ >> +static struct mtx sf_buf_lock; >> + >> +/* >> + * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) >> + */ >> +static void >> +sf_buf_init(void *arg) >> +{ >> + struct sf_buf *sf_bufs; >> + vm_offset_t sf_base; >> + int i; >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return; >> +#endif >> + >> + nsfbufs = NSFBUFS; >> + TUNABLE_INT_FETCH("kern.ipc.nsfbufs", &nsfbufs); >> + >> + sf_buf_active = hashinit(nsfbufs, M_TEMP, &sf_buf_hashmask); >> + TAILQ_INIT(&sf_buf_freelist); >> + sf_base = kva_alloc(nsfbufs * PAGE_SIZE); >> + sf_bufs = malloc(nsfbufs * sizeof(struct sf_buf), M_TEMP, >> + M_NOWAIT | M_ZERO); >> + KASSERT(sf_bufs, ("%s: malloc failure", __func__)); >> + for (i = 0; i < nsfbufs; i++) { >> + sf_bufs[i].kva = sf_base + i * PAGE_SIZE; >> + TAILQ_INSERT_TAIL(&sf_buf_freelist, &sf_bufs[i], free_entry); >> + } >> + sf_buf_alloc_want = 0; >> + mtx_init(&sf_buf_lock, "sf_buf", NULL, MTX_DEF); >> +} >> + >> +/* >> + * Get an sf_buf from the freelist. May block if none are available. >> + */ >> +struct sf_buf * >> +sf_buf_alloc(struct vm_page *m, int flags) >> +{ >> + struct sf_head *hash_list; >> + struct sf_buf *sf; >> + int error; >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return ((struct sf_buf *)m); >> +#endif >> + >> + KASSERT(curthread->td_pinned > 0 || (flags & SFB_CPUPRIVATE) == 0, >> + ("sf_buf_alloc(SFB_CPUPRIVATE): curthread not pinned")); >> + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> + mtx_lock(&sf_buf_lock); >> + LIST_FOREACH(sf, hash_list, list_entry) { >> + if (sf->m == m) { >> + sf->ref_count++; >> + if (sf->ref_count == 1) { >> + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> + nsfbufsused++; >> + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> + } >> +#if defined(SMP) && defined(SFBUF_CPUSET) >> + sf_buf_shootdown(sf, flags); >> +#endif >> + goto done; >> + } >> + } >> + while ((sf = TAILQ_FIRST(&sf_buf_freelist)) == NULL) { >> + if (flags & SFB_NOWAIT) >> + goto done; >> + sf_buf_alloc_want++; >> + SFSTAT_INC(sf_allocwait); >> + error = msleep(&sf_buf_freelist, &sf_buf_lock, >> + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); >> + sf_buf_alloc_want--; >> + >> + /* >> + * If we got a signal, don't risk going back to sleep. >> + */ >> + if (error) >> + goto done; >> + } >> + TAILQ_REMOVE(&sf_buf_freelist, sf, free_entry); >> + if (sf->m != NULL) >> + LIST_REMOVE(sf, list_entry); >> + LIST_INSERT_HEAD(hash_list, sf, list_entry); >> + sf->ref_count = 1; >> + sf->m = m; >> + nsfbufsused++; >> + nsfbufspeak = imax(nsfbufspeak, nsfbufsused); >> + sf_buf_map(sf, flags); >> +done: >> + mtx_unlock(&sf_buf_lock); >> + return (sf); >> +} >> + >> +/* >> + * Remove a reference from the given sf_buf, adding it to the free >> + * list when its reference count reaches zero. A freed sf_buf still, >> + * however, retains its virtual-to-physical mapping until it is >> + * recycled or reactivated by sf_buf_alloc(9). >> + */ >> +void >> +sf_buf_free(struct sf_buf *sf) >> +{ >> + >> +#ifdef SFBUF_OPTIONAL_DIRECT_MAP >> + if (SFBUF_OPTIONAL_DIRECT_MAP) >> + return; >> +#endif >> + >> + mtx_lock(&sf_buf_lock); >> + sf->ref_count--; >> + if (sf->ref_count == 0) { >> + TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry); >> + nsfbufsused--; >> + if (sf_buf_unmap(sf)) { >> + sf->m = NULL; >> + LIST_REMOVE(sf, list_entry); >> + } >> + if (sf_buf_alloc_want > 0) >> + wakeup(&sf_buf_freelist); >> + } >> + mtx_unlock(&sf_buf_lock); >> +} >> + >> +#ifdef SFBUF_PROCESS_PAGE >> +/* >> + * Run callback function on sf_buf that holds a certain page. >> + */ >> +boolean_t >> +sf_buf_process_page(vm_page_t m, void (*cb)(struct sf_buf *)) >> +{ >> + struct sf_head *hash_list; >> + struct sf_buf *sf; >> + >> + hash_list = &sf_buf_active[SF_BUF_HASH(m)]; >> + mtx_lock(&sf_buf_lock); >> + LIST_FOREACH(sf, hash_list, list_entry) { >> + if (sf->m == m) { >> + cb(sf); >> + mtx_unlock(&sf_buf_lock); >> + return (TRUE); >> + } >> + } >> + mtx_unlock(&sf_buf_lock); >> + return (FALSE); >> +} >> +#endif /* SFBUF_PROCESS_PAGE */ >> >> Modified: head/sys/mips/include/sf_buf.h >> ============================================================================== >> --- head/sys/mips/include/sf_buf.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/include/sf_buf.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -29,31 +29,9 @@ >> #ifndef _MACHINE_SF_BUF_H_ >> #define _MACHINE_SF_BUF_H_ >> >> -#ifdef __mips_n64 >> -#include >> -#include >> -#include >> -#else >> -#include >> -#endif >> - >> -#ifdef __mips_n64 >> -/* In 64 bit the whole memory is directly mapped */ >> -struct sf_buf; >> +#ifdef __mips_n64 /* In 64 bit the whole memory is directly mapped */ >> >> -static inline struct sf_buf * >> -sf_buf_alloc(struct vm_page *m, int pri) >> -{ >> - >> - return ((struct sf_buf *)m); >> -} >> - >> -static inline void >> -sf_buf_free(struct sf_buf *sf) >> -{ >> -} >> - >> -static __inline vm_offset_t >> +static inline vm_offset_t >> sf_buf_kva(struct sf_buf *sf) >> { >> vm_page_t m; >> @@ -62,38 +40,12 @@ sf_buf_kva(struct sf_buf *sf) >> return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); >> } >> >> -static __inline struct vm_page * >> +static inline struct vm_page * >> sf_buf_page(struct sf_buf *sf) >> { >> >> return ((vm_page_t)sf); >> } >> >> -#else /* ! __mips_n64 */ >> -struct vm_page; >> - >> -struct sf_buf { >> - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ >> - struct vm_page *m; /* currently mapped page */ >> - vm_offset_t kva; /* va of mapping */ >> -}; >> - >> -struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags); >> -void sf_buf_free(struct sf_buf *sf); >> - >> -static __inline vm_offset_t >> -sf_buf_kva(struct sf_buf *sf) >> -{ >> - >> - return (sf->kva); >> -} >> - >> -static __inline struct vm_page * >> -sf_buf_page(struct sf_buf *sf) >> -{ >> - >> - return (sf->m); >> -} >> #endif /* __mips_n64 */ >> - >> #endif /* !_MACHINE_SF_BUF_H_ */ >> >> Modified: head/sys/mips/include/vmparam.h >> ============================================================================== >> --- head/sys/mips/include/vmparam.h Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/include/vmparam.h Tue Aug 5 09:44:10 2014 (r269577) >> @@ -187,4 +187,8 @@ >> >> #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ >> >> +#ifndef __mips_n64 >> +#define SFBUF >> +#endif >> + >> #endif /* !_MACHINE_VMPARAM_H_ */ >> >> Modified: head/sys/mips/mips/vm_machdep.c >> ============================================================================== >> --- head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:35:25 2014 (r269576) >> +++ head/sys/mips/mips/vm_machdep.c Tue Aug 5 09:44:10 2014 (r269577) >> @@ -76,9 +76,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> #include >> -#ifndef __mips_n64 >> -#include >> -#endif >> >> /* Duplicated from asm.h */ >> #if defined(__mips_o32) >> @@ -92,38 +89,6 @@ __FBSDID("$FreeBSD$"); >> #define CALLFRAME_SIZ (SZREG * 4) >> #endif >> >> -#ifndef __mips_n64 >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> > > From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 22:36:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F2C1285; Sat, 6 Sep 2014 22:36:37 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF8E21E0E; Sat, 6 Sep 2014 22:36:36 +0000 (UTC) Received: by mail-qg0-f54.google.com with SMTP id q108so6309758qgd.13 for ; Sat, 06 Sep 2014 15:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tLXb0JB2ebmZlrCYy/ufPp1DtuRUWWxgm4ktzULFzPs=; b=XLHi9Pbijad2Yzzr6ksW+OFIJzySgEK6EFXK3/eFvW0aHlcFRvd4cmWyt1wUIlw+wM woH7ipVcVL+WRAlaep0MRALeDPSLrwHwb7aNo01S4ZyT7PVnHTZC3dqUDl0CaZtcgfNV WEZl8sgurKRo97chMDdXL2JKwta2+t8lG3HjWSPIoKzWo5+NuLCF7bqTilljcTCynCl0 D+hANvGXQQtAfUY8A6i9ZlysTOYxzPjM6K0Yx0wDGXSTK9YN4Z5USmIyFPIkBkN5lvej D1pXIqWFy810cD4BlhuPQovHCEbp/qh/6a0tT1PdFEM2q3+fo3k/82e6vHdyBzHynehJ mTbA== MIME-Version: 1.0 X-Received: by 10.224.151.69 with SMTP id b5mr30403076qaw.37.1410042995029; Sat, 06 Sep 2014 15:36:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Sat, 6 Sep 2014 15:36:34 -0700 (PDT) In-Reply-To: <540B8457.2020500@rice.edu> References: <53e0a76b.5936.428818a9@svn.freebsd.org> <540B8457.2020500@rice.edu> Date: Sat, 6 Sep 2014 15:36:34 -0700 X-Google-Sender-Auth: 8503W6r2Cub12BLIB2TgtmJ4uDk Message-ID: Subject: Re: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 22:36:37 -0000 On 6 September 2014 15:01, Alan Cox wrote: > On 09/06/2014 16:15, Adrian Chadd wrote: >> Hi Gleb! >> >> This commit has broken mips32 on my 128MB RAM routerstation pro board. >> >> I've tested the commit before this one (and it works). >> >> I've also tested today's -HEAD as there was some subsequent fixes to >> the sfbuf code. It hasn't completely fixed things - I still see >> processes throwing VM errors: > > > Before this commit, the sf_buf code did not cache mappings on MIPS. > Now, it does. So, I suspect that you're experiencing cache consistency > issues. To return to the pre-commit state, you'll need to define > machine-dependent sf_buf_{un,}map() functions in mips/include/sf_buf.h > for mips32 that call pmap_q{remove,enter}, respectively. Look at arm > for a similar configuration. Yup, I just noticed that, fixed it, and updated the bug (bug 193400.) Is this something that should be fixed in the vm/pmap code somewhere, or is this just the correct behaviour? -a From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 22:38:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F6885C4; Sat, 6 Sep 2014 22:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF0C1E2A; Sat, 6 Sep 2014 22:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86McXi5068467; Sat, 6 Sep 2014 22:38:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86McXJE068463; Sat, 6 Sep 2014 22:38:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409062238.s86McXJE068463@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 6 Sep 2014 22:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271213 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 22:38:33 -0000 Author: adrian Date: Sat Sep 6 22:38:32 2014 New Revision: 271213 URL: http://svnweb.freebsd.org/changeset/base/271213 Log: Implement local sfbuf_map and sfbuf_unmap for MIPS32. The pre-rework behaviour was not to keep the cached mappings around after the sfbuf was used but instead to recycle said mappings. PR: kern/193400 Modified: head/sys/mips/include/sf_buf.h head/sys/mips/include/vmparam.h Modified: head/sys/mips/include/sf_buf.h ============================================================================== --- head/sys/mips/include/sf_buf.h Sat Sep 6 22:37:47 2014 (r271212) +++ head/sys/mips/include/sf_buf.h Sat Sep 6 22:38:32 2014 (r271213) @@ -48,4 +48,23 @@ sf_buf_page(struct sf_buf *sf) } #endif /* __mips_n64 */ + +#ifndef __mips_n64 /* in 32 bit mode we manage our own mappings */ + +static inline void +sf_buf_map(struct sf_buf *sf, int flags) +{ + + pmap_qenter(sf->kva, &sf->m, 1); +} + +static inline int +sf_buf_unmap(struct sf_buf *sf) +{ + pmap_qremove(sf->kva, 1); + return (1); +} + +#endif /* ! __mips_n64 */ + #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Sat Sep 6 22:37:47 2014 (r271212) +++ head/sys/mips/include/vmparam.h Sat Sep 6 22:38:32 2014 (r271213) @@ -189,6 +189,7 @@ #ifndef __mips_n64 #define SFBUF +#define SFBUF_MAP #endif #endif /* !_MACHINE_VMPARAM_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Sep 6 23:03:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B783CA9; Sat, 6 Sep 2014 23:03:14 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47FA510BA; Sat, 6 Sep 2014 23:03:13 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s86N2Nmj012874; Sat, 6 Sep 2014 18:03:11 -0500 Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by pp2.rice.edu with ESMTP id 1p7nyb09nm-1; Sat, 06 Sep 2014 18:03:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 5D1D84C01C5; Sat, 6 Sep 2014 18:03:10 -0500 (CDT) Message-ID: <540B92AD.6020905@rice.edu> Date: Sat, 06 Sep 2014 18:03:09 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r269577 - in head/sys: amd64/include arm/arm arm/include conf i386/i386 i386/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sys References: <53e0a76b.5936.428818a9@svn.freebsd.org> <540B8457.2020500@rice.edu> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.605690798989426 urlsuspect_oldscore=0.00569079898942585 suspectscore=3 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.605690798989426 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1409060267 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 23:03:14 -0000 On 09/06/2014 17:36, Adrian Chadd wrote: > On 6 September 2014 15:01, Alan Cox wrote: >> On 09/06/2014 16:15, Adrian Chadd wrote: >>> Hi Gleb! >>> >>> This commit has broken mips32 on my 128MB RAM routerstation pro board. >>> >>> I've tested the commit before this one (and it works). >>> >>> I've also tested today's -HEAD as there was some subsequent fixes to >>> the sfbuf code. It hasn't completely fixed things - I still see >>> processes throwing VM errors: >> >> Before this commit, the sf_buf code did not cache mappings on MIPS. >> Now, it does. So, I suspect that you're experiencing cache consistency >> issues. To return to the pre-commit state, you'll need to define >> machine-dependent sf_buf_{un,}map() functions in mips/include/sf_buf.h >> for mips32 that call pmap_q{remove,enter}, respectively. Look at arm >> for a similar configuration. > Yup, I just noticed that, fixed it, and updated the bug (bug 193400.) > > Is this something that should be fixed in the vm/pmap code somewhere, > or is this just the correct behaviour? No. However, if you feel like tinkering, you could replace the body of sf_buf_unmap() with mips_dcache_wbinv_range_index(va, PAGE_SIZE); return (0); and see what happens. Can you remind me what the cache configuration is on mip32? Does software only have to worry about I and D cache consistency?