From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 00:35:07 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 44F2914A; Sun, 29 Sep 2013 00:35:07 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F97F2BB6; Sun, 29 Sep 2013 00:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T0Z7vI072749; Sun, 29 Sep 2013 00:35:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T0Z3Ng072724; Sun, 29 Sep 2013 00:35:03 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201309290035.r8T0Z3Ng072724@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 29 Sep 2013 00:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255932 - in head/sys: conf contrib/rdma dev/cxgb/ulp/iw_cxgb modules modules/ibcore modules/ipoib modules/mlx4 modules/mlx4ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/ml... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 00:35:07 -0000 Author: alfred Date: Sun Sep 29 00:35:03 2013 New Revision: 255932 URL: http://svnweb.freebsd.org/changeset/base/255932 Log: Update OFED to Linux 3.7 and update Mellanox drivers. Update the OFED Infiniband core to the version supplied in Linux version 3.7. The update to OFED is nearly all additional defines and functions with the exception of the addition of additional parameters to ib_register_device() and the reg_user_mr callback. In addition the ibcore (Infiniband core) and ipoib (IP over Infiniband) have both been made into completely loadable modules to facilitate testing of the OFED stack in FreeBSD. Finally the Mellanox Infiniband drivers are now updated to the latest version shipping with Linux 3.7. Submitted by: Mellanox FreeBSD driver team: Oded Shanoon (odeds mellanox.com), Meny Yossefi (menyy mellanox.com), Orit Moskovich (oritm mellanox.com) Approved by: re Added: head/sys/modules/ibcore/ head/sys/modules/ibcore/Makefile (contents, props changed) head/sys/modules/ipoib/ head/sys/modules/ipoib/Makefile (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/alias_GUID.c (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/cm.c (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c (contents, props changed) head/sys/ofed/drivers/infiniband/hw/mlx4/sysfs.c (contents, props changed) head/sys/ofed/drivers/net/mlx4/resource_tracker.c (contents, props changed) head/sys/ofed/drivers/net/mlx4/sys_tune.c (contents, props changed) head/sys/ofed/include/linux/atomic.h (contents, props changed) head/sys/ofed/include/linux/clocksource.h (contents, props changed) head/sys/ofed/include/rdma/ib_pma.h (contents, props changed) Modified: head/sys/conf/files head/sys/contrib/rdma/ib_umem.h head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c head/sys/modules/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/core_priv.h head/sys/ofed/drivers/infiniband/core/device.c head/sys/ofed/drivers/infiniband/core/sa_query.c head/sys/ofed/drivers/infiniband/core/sysfs.c head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/uverbs_main.c head/sys/ofed/drivers/infiniband/core/verbs.c head/sys/ofed/drivers/infiniband/hw/mlx4/Kconfig head/sys/ofed/drivers/infiniband/hw/mlx4/Makefile head/sys/ofed/drivers/infiniband/hw/mlx4/ah.c head/sys/ofed/drivers/infiniband/hw/mlx4/cq.c head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/infiniband/hw/mlx4/mlx4_ib.h head/sys/ofed/drivers/infiniband/hw/mlx4/mr.c head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c head/sys/ofed/drivers/infiniband/hw/mlx4/srq.c head/sys/ofed/drivers/infiniband/hw/mlx4/user.h head/sys/ofed/drivers/infiniband/hw/mlx4/wc.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/net/mlx4/Makefile head/sys/ofed/drivers/net/mlx4/alloc.c head/sys/ofed/drivers/net/mlx4/catas.c head/sys/ofed/drivers/net/mlx4/cmd.c head/sys/ofed/drivers/net/mlx4/cq.c head/sys/ofed/drivers/net/mlx4/en_cq.c head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/en_port.c head/sys/ofed/drivers/net/mlx4/en_port.h head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/ofed/drivers/net/mlx4/eq.c head/sys/ofed/drivers/net/mlx4/fw.c head/sys/ofed/drivers/net/mlx4/fw.h head/sys/ofed/drivers/net/mlx4/icm.c head/sys/ofed/drivers/net/mlx4/icm.h head/sys/ofed/drivers/net/mlx4/intf.c head/sys/ofed/drivers/net/mlx4/main.c head/sys/ofed/drivers/net/mlx4/mcg.c head/sys/ofed/drivers/net/mlx4/mlx4.h head/sys/ofed/drivers/net/mlx4/mlx4_en.h head/sys/ofed/drivers/net/mlx4/mr.c head/sys/ofed/drivers/net/mlx4/pd.c head/sys/ofed/drivers/net/mlx4/port.c head/sys/ofed/drivers/net/mlx4/profile.c head/sys/ofed/drivers/net/mlx4/qp.c head/sys/ofed/drivers/net/mlx4/reset.c head/sys/ofed/drivers/net/mlx4/sense.c head/sys/ofed/drivers/net/mlx4/srq.c head/sys/ofed/include/asm/atomic.h head/sys/ofed/include/asm/byteorder.h head/sys/ofed/include/linux/bitops.h head/sys/ofed/include/linux/compat.h head/sys/ofed/include/linux/device.h head/sys/ofed/include/linux/dma-mapping.h head/sys/ofed/include/linux/gfp.h head/sys/ofed/include/linux/idr.h head/sys/ofed/include/linux/if_ether.h head/sys/ofed/include/linux/in6.h head/sys/ofed/include/linux/kernel.h head/sys/ofed/include/linux/linux_compat.c head/sys/ofed/include/linux/list.h head/sys/ofed/include/linux/log2.h head/sys/ofed/include/linux/mlx4/cmd.h head/sys/ofed/include/linux/mlx4/cq.h head/sys/ofed/include/linux/mlx4/device.h head/sys/ofed/include/linux/mlx4/driver.h head/sys/ofed/include/linux/mlx4/qp.h head/sys/ofed/include/linux/mlx4/srq.h head/sys/ofed/include/linux/moduleparam.h head/sys/ofed/include/linux/pci.h head/sys/ofed/include/linux/sysfs.h head/sys/ofed/include/linux/types.h head/sys/ofed/include/linux/workqueue.h head/sys/ofed/include/rdma/ib_cm.h head/sys/ofed/include/rdma/ib_mad.h head/sys/ofed/include/rdma/ib_sa.h head/sys/ofed/include/rdma/ib_user_verbs.h head/sys/ofed/include/rdma/ib_verbs.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/conf/files Sun Sep 29 00:35:03 2013 (r255932) @@ -3542,6 +3542,18 @@ ofed/drivers/infiniband/ulp/sdp/sdp_tx.c no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" +ofed/drivers/infiniband/hw/mlx4/alias_GUID.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/mcg.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/sysfs.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" +ofed/drivers/infiniband/hw/mlx4/cm.c optional mlx4ib \ + no-depend obj-prefix "mlx4ib_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/ah.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" @@ -3624,7 +3636,10 @@ ofed/drivers/net/mlx4/sense.c optional ofed/drivers/net/mlx4/srq.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/xrcd.c optional mlx4ib | mlxen \ +ofed/drivers/net/mlx4/resource_tracker.c optional mlx4ib | mlxen \ + no-depend obj-prefix "mlx4_" \ + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" +ofed/drivers/net/mlx4/sys_tune.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" Modified: head/sys/contrib/rdma/ib_umem.h ============================================================================== --- head/sys/contrib/rdma/ib_umem.h Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/contrib/rdma/ib_umem.h Sun Sep 29 00:35:03 2013 (r255932) @@ -28,21 +28,17 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * - * $FreeBSD$ */ #ifndef IB_UMEM_H #define IB_UMEM_H -struct ib_ucontext; +#include +#include +#include +#include -struct ib_umem_chunk { - TAILQ_ENTRY(ib_umem_chunk) entry; - int nents; - int nmap; - struct rdma_scatterlist page_list[0]; -}; +struct ib_ucontext; struct ib_umem { struct ib_ucontext *context; @@ -50,28 +46,76 @@ struct ib_umem { int offset; int page_size; int writable; - TAILQ_HEAD(, ib_umem_chunk) chunk_list; -#ifdef notyet + int hugetlb; + struct list_head chunk_list; struct work_struct work; struct mm_struct *mm; -#endif unsigned long diff; }; +/* contiguous memory structure */ +struct ib_cmem { + + struct ib_ucontext *context; + size_t length; + /* Link list of contiguous blocks being part of that cmem */ + struct list_head ib_cmem_block; + + /* Order of cmem block, 2^ block_order will equal number + of physical pages per block + */ + unsigned long block_order; + /* Refernce counter for that memory area + - When value became 0 pages will be returned to the kernel. + */ + struct kref refcount; +}; + + +struct ib_cmem_block { + + struct list_head list; + /* page will point to the page struct of the head page + in the current compound page. + block order is saved once as part of ib_cmem. + */ + struct page *page; +}; + + + +struct ib_umem_chunk { + struct list_head list; + int nents; + int nmap; + struct dma_attrs attrs; + struct scatterlist page_list[0]; +}; + #ifdef CONFIG_INFINIBAND_USER_MEM struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, - size_t size, int access); + size_t size, int access, int dmasync); void ib_umem_release(struct ib_umem *umem); int ib_umem_page_count(struct ib_umem *umem); +int ib_cmem_map_contiguous_pages_to_vma(struct ib_cmem *ib_cmem, + struct vm_area_struct *vma); +struct ib_cmem *ib_cmem_alloc_contiguous_pages(struct ib_ucontext *context, + unsigned long total_size, + unsigned long page_size_order); +void ib_cmem_release_contiguous_pages(struct ib_cmem *cmem); +int ib_umem_map_to_vma(struct ib_umem *umem, + struct vm_area_struct *vma); + #else /* CONFIG_INFINIBAND_USER_MEM */ +#include static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, size_t size, - int access) { - return ERR_PTR(EINVAL); + int access, int dmasync) { + return ERR_PTR(-EINVAL); } static inline void ib_umem_release(struct ib_umem *umem) { } static inline int ib_umem_page_count(struct ib_umem *umem) { return 0; } Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Sun Sep 29 00:35:03 2013 (r255932) @@ -541,7 +541,8 @@ static int iwch_reregister_phys_mem(stru static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, - u64 virt, int acc, struct ib_udata *udata) + u64 virt, int acc, struct ib_udata *udata, + int mr_id) { __be64 *pages; int shift, i, n; @@ -1136,7 +1137,7 @@ int iwch_register_device(struct iwch_dev dev->ibdev.iwcm->rem_ref = iwch_qp_rem_ref; dev->ibdev.iwcm->get_qp = iwch_get_qp; - ret = ib_register_device(&dev->ibdev); + ret = ib_register_device(&dev->ibdev, NULL); if (ret) goto bail1; Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/modules/Makefile Sun Sep 29 00:35:03 2013 (r255932) @@ -128,6 +128,7 @@ SUBDIR= \ hwpmc \ ${_hyperv} \ ${_i2c} \ + ${_ibcore} \ ${_ibcs2} \ ${_ichwd} \ ${_ida} \ @@ -149,6 +150,7 @@ SUBDIR= \ ${_igb} \ ${_iir} \ ${_io} \ + ${_ipoib} \ ${_ipdivert} \ ${_ipfilter} \ ${_ipfw} \ @@ -499,11 +501,17 @@ _fe= fe _glxiic= glxiic _glxsb= glxsb _i2c= i2c +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ibcore= ibcore +.endif _ibcs2= ibcs2 _ie= ie _if_ndis= if_ndis _igb= igb _io= io +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ipoib= ipoib +.endif _lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs @@ -675,6 +683,9 @@ _hptrr= hptrr .endif _hyperv= hyperv _i2c= i2c +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ibcore= ibcore +.endif _ichwd= ichwd _ida= ida _if_ndis= if_ndis @@ -682,6 +693,9 @@ _igb= igb _iir= iir _io= io _ipmi= ipmi +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ipoib= ipoib +.endif _ips= ips _ipw= ipw .if ${MK_SOURCELESS_UCODE} != "no" Added: head/sys/modules/ibcore/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ibcore/Makefile Sun Sep 29 00:35:03 2013 (r255932) @@ -0,0 +1,23 @@ +# $FreeBSD$ +.PATH: ${.CURDIR}/../../ofed/drivers/infiniband/core +.PATH: ${.CURDIR}/../../ofed/include/linux + +.include + +KMOD = ibcore +SRCS = addr.c cm_msgs.h iwcm.c mad_rmpp.h sa_query.c ucma.c uverbs_cmd.c +SRCS+= agent.c local_sa.c iwcm.h multicast.c smi.c ud_header.c uverbs_main.c +SRCS+= agent.h core_priv.h mad.c notice.c smi.h umem.c uverbs_marshall.c +SRCS+= cache.c device.c mad_priv.h packer.c sysfs.c user_mad.c verbs.c +SRCS+= cm.c fmr_pool.c mad_rmpp.c sa.h ucm.c uverbs.h cma.c +SRCS+= linux_compat.c linux_radix.c linux_idr.c +SRCS+= vnode_if.h device_if.h bus_if.h pci_if.h opt_inet.h + +CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/core +CFLAGS+= -I${.CURDIR}/../mlx4ib +CFLAGS+= -I${.CURDIR}/../../ofed/include/ +CFLAGS+= -DINET6 -DINET -DOFED + +.include + +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions Added: head/sys/modules/ipoib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ipoib/Makefile Sun Sep 29 00:35:03 2013 (r255932) @@ -0,0 +1,31 @@ +# $FreeBSD$ +.PATH: ${.CURDIR}/../../ofed/drivers/infiniband/ulp/ipoib +.PATH: ${.CURDIR}/../../ofed/include/linux + +.include + +KMOD = ipoib +SRCS = device_if.h bus_if.h opt_ofed.h vnode_if.h opt_inet.h opt_inet6.h +SRCS += ipoib_cm.c ipoib_ib.c ipoib_main.c ipoib_multicast.c ipoib_verbs.c ipoib.h +SRCS+= linux_compat.c linux_radix.c linux_idr.c + +CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/ulp/ipoib +CFLAGS+= -I${.CURDIR}/../ibcore +CFLAGS+= -I${.CURDIR}/../../ofed/include/ +CFLAGS+= -DINET6 -DINET -DOFED + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + +.include + +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions Modified: head/sys/modules/mlx4/Makefile ============================================================================== --- head/sys/modules/mlx4/Makefile Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/modules/mlx4/Makefile Sun Sep 29 00:35:03 2013 (r255932) @@ -3,11 +3,11 @@ .include +.PATH: ${.CURDIR}/../../ofed/include/linux KMOD = mlx4 SRCS = device_if.h bus_if.h pci_if.h vnode_if.h -SRCS+= alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c -SRCS+= pd.c port.c profile.c qp.c reset.c sense.c srq.c xrcd.c -SRCS+= opt_inet.h opt_inet6.h +SRCS+= alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c linux_compat.c linux_radix.c linux_idr.c +SRCS+= pd.c port.c profile.c qp.c reset.c sense.c srq.c resource_tracker.c sys_tune.c CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ Modified: head/sys/modules/mlx4ib/Makefile ============================================================================== --- head/sys/modules/mlx4ib/Makefile Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/modules/mlx4ib/Makefile Sun Sep 29 00:35:03 2013 (r255932) @@ -1,14 +1,21 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 +.PATH: ${.CURDIR}/../../ofed/include/linux .include KMOD = mlx4ib SRCS = device_if.h bus_if.h pci_if.h vnode_if.h -SRCS+= ah.c cq.c doorbell.c mad.c main.c mr.c qp.c srq.c wc.c +SRCS+= linux_compat.c linux_radix.c linux_idr.c +SRCS+= alias_GUID.c mcg.c sysfs.c ah.c cq.c doorbell.c mad.c main.c mr.c qp.c srq.c wc.c cm.c SRCS+= opt_inet.h opt_inet6.h +#CFLAGS+= -I${.CURDIR}/../../ofed/include/ +#CFLAGS+= -I${.CURDIR}/../../../../include +CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ +CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM +CFLAGS+= -DINET6 -DINET -DOFED .if !defined(KERNBUILDDIR) .if ${MK_INET_SUPPORT} != "no" Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/addr.c Sun Sep 29 00:35:03 2013 (r255932) @@ -356,7 +356,7 @@ static int addr_resolve(struct sockaddr u_char edst[MAX_ADDR_LEN]; int multi; int bcast; - int error; + int error = 0; /* * Determine whether the address is unicast, multicast, or broadcast Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/cma.c Sun Sep 29 00:35:03 2013 (r255932) @@ -2957,7 +2957,7 @@ static void cma_set_mgid(struct rdma_id_ 0xFF10A01B)) { /* IPv6 address is an SA assigned MGID. */ memcpy(mgid, &sin6->sin6_addr, sizeof *mgid); - } else if ((addr->sa_family == AF_INET6)) { + } else if (addr->sa_family == AF_INET6) { ipv6_ib_mc_map(&sin6->sin6_addr, dev_addr->broadcast, mc_map); if (id_priv->id.ps == RDMA_PS_UDP) mc_map[7] = 0x01; /* Use RDMA CM signature */ Modified: head/sys/ofed/drivers/infiniband/core/core_priv.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/core_priv.h Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/core_priv.h Sun Sep 29 00:35:03 2013 (r255932) @@ -38,7 +38,8 @@ #include -int ib_device_register_sysfs(struct ib_device *device); +int ib_device_register_sysfs(struct ib_device *device, int (*port_callback)(struct ib_device *, + u8, struct kobject *)); void ib_device_unregister_sysfs(struct ib_device *device); int ib_sysfs_setup(void); Modified: head/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/device.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/device.c Sun Sep 29 00:35:03 2013 (r255932) @@ -273,7 +273,9 @@ out: * callback for each device that is added. @device must be allocated * with ib_alloc_device(). */ -int ib_register_device(struct ib_device *device) +int ib_register_device(struct ib_device *device, + int (*port_callback)(struct ib_device *, + u8, struct kobject *)) { int ret; @@ -294,8 +296,6 @@ int ib_register_device(struct ib_device INIT_LIST_HEAD(&device->client_data_list); spin_lock_init(&device->event_handler_lock); spin_lock_init(&device->client_data_lock); - device->ib_uverbs_xrcd_table = RB_ROOT; - mutex_init(&device->xrcd_table_mutex); ret = read_port_table_lengths(device); if (ret) { @@ -304,7 +304,7 @@ int ib_register_device(struct ib_device goto out; } - ret = ib_device_register_sysfs(device); + ret = ib_device_register_sysfs(device, port_callback); if (ret) { printk(KERN_WARNING "Couldn't register device %s with driver model\n", device->name); @@ -752,3 +752,19 @@ static void __exit ib_core_cleanup(void) module_init(ib_core_init); module_exit(ib_core_cleanup); + +#undef MODULE_VERSION +#include +static int +ibcore_evhand(module_t mod, int event, void *arg) +{ + return (0); +} + +static moduledata_t ibcore_mod = { + .name = "ibcore", + .evhand = ibcore_evhand, +}; + +MODULE_VERSION(ibcore, 1); +DECLARE_MODULE(ibcore, ibcore_mod, SI_SUB_SMP, SI_ORDER_ANY); Modified: head/sys/ofed/drivers/infiniband/core/sa_query.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/sa_query.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/sa_query.c Sun Sep 29 00:35:03 2013 (r255932) @@ -1105,6 +1105,27 @@ static void ib_sa_inform_release(struct kfree(container_of(sa_query, struct ib_sa_inform_query, sa_query)); } +int ib_sa_guid_info_rec_query(struct ib_sa_client *client, + struct ib_device *device, u8 port_num, + struct ib_sa_guidinfo_rec *rec, + ib_sa_comp_mask comp_mask, u8 method, + int timeout_ms, gfp_t gfp_mask, + void (*callback)(int status, + struct ib_sa_guidinfo_rec *resp, + void *context), + void *context, + struct ib_sa_query **sa_query) +{ + // stub function - + // called originally from mad.c under mlx4_ib_init_sriov() + // which calls mlx4_ib_init_alias_guid_service() in alias_GUID.c + // which goes down to this function + + printk("ERROR: function should be called only in SRIOV flow!!!"); + + return 0; +} + /** * ib_sa_informinfo_query - Start an InformInfo registration. * @client:SA client Modified: head/sys/ofed/drivers/infiniband/core/sysfs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/sysfs.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/sysfs.c Sun Sep 29 00:35:03 2013 (r255932) @@ -38,6 +38,7 @@ #include #include +#include struct ib_port { struct kobject kobj; @@ -103,7 +104,7 @@ static ssize_t state_show(struct ib_port return ret; return sprintf(buf, "%d: %s\n", attr.state, - attr.state >= 0 && attr.state < ARRAY_SIZE(state_name) ? + attr.state < ARRAY_SIZE(state_name) ? state_name[attr.state] : "UNKNOWN"); } @@ -292,118 +293,124 @@ static ssize_t show_port_pkey(struct ib_ return sprintf(buf, "0x%04x\n", pkey); } -#define PORT_PMA_ATTR(_name, _counter, _width, _offset) \ -struct port_table_attribute port_pma_attr_##_name = { \ - .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \ - .index = (_offset) | ((_width) << 16) | ((_counter) << 24) \ -} - -static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr, - char *buf) +static ssize_t get_pma_counters(struct ib_port *p, struct port_attribute *attr, + char *buf, int c_ext) { - struct port_table_attribute *tab_attr = - container_of(attr, struct port_table_attribute, attr); - int offset = tab_attr->index & 0xffff; - int width = (tab_attr->index >> 16) & 0xff; - struct ib_mad *in_mad = NULL; - struct ib_mad *out_mad = NULL; - ssize_t ret; + struct port_table_attribute *tab_attr = + container_of(attr, struct port_table_attribute, attr); + int offset = tab_attr->index & 0xffff; + int width = (tab_attr->index >> 16) & 0xff; + struct ib_mad *in_mad = NULL; + struct ib_mad *out_mad = NULL; + ssize_t ret; + + if (!p->ibdev->process_mad) + return -ENXIO; + + in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); + out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); + if (!in_mad || !out_mad) { + ret = -ENOMEM; + goto out; + } + + in_mad->mad_hdr.base_version = 1; + in_mad->mad_hdr.mgmt_class = IB_MGMT_CLASS_PERF_MGMT; + in_mad->mad_hdr.class_version = 1; + in_mad->mad_hdr.method = IB_MGMT_METHOD_GET; + if (c_ext) + in_mad->mad_hdr.attr_id = IB_PMA_PORT_COUNTERS_EXT; + else + in_mad->mad_hdr.attr_id = IB_PMA_PORT_COUNTERS; + + in_mad->data[41] = p->port_num; /* PortSelect field */ + + if ((p->ibdev->process_mad(p->ibdev, IB_MAD_IGNORE_MKEY, + p->port_num, NULL, NULL, in_mad, out_mad) & + (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) != + (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) { + ret = -EINVAL; + goto out; + } + + switch (width) { + case 4: + ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> + (4 - (offset % 8))) & 0xf); + break; + case 8: + ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]); + break; + case 16: + ret = sprintf(buf, "%u\n", + be16_to_cpup((__be16 *)(out_mad->data + 40 + offset / 8))); + break; + case 32: + ret = sprintf(buf, "%u\n", + be32_to_cpup((__be32 *)(out_mad->data + 40 + offset / 8))); + break; + case 64: + ret = sprintf(buf, "%llu\n", (unsigned long long) + be64_to_cpup((__be64 *)(out_mad->data + 40 + offset / 8))); + break; + default: + ret = 0; + } - if (!p->ibdev->process_mad) - return sprintf(buf, "N/A (no PMA)\n"); - - in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); - out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); - if (!in_mad || !out_mad) { - ret = -ENOMEM; - goto out; - } +out: + kfree(in_mad); + kfree(out_mad); - in_mad->mad_hdr.base_version = 1; - in_mad->mad_hdr.mgmt_class = IB_MGMT_CLASS_PERF_MGMT; - in_mad->mad_hdr.class_version = 1; - in_mad->mad_hdr.method = IB_MGMT_METHOD_GET; - in_mad->mad_hdr.attr_id = cpu_to_be16(0x12); /* PortCounters */ - - in_mad->data[41] = p->port_num; /* PortSelect field */ - - if ((p->ibdev->process_mad(p->ibdev, IB_MAD_IGNORE_MKEY, - p->port_num, NULL, NULL, in_mad, out_mad) & - (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) != - (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) { - ret = -EINVAL; - goto out; - } - - switch (width) { - case 4: - ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> - (4 - (offset % 8))) & 0xf); - break; - case 8: - ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]); - break; - case 16: - ret = sprintf(buf, "%u\n", - be16_to_cpup((__be16 *)(out_mad->data + 40 + offset / 8))); - break; - case 32: - ret = sprintf(buf, "%u\n", - be32_to_cpup((__be32 *)(out_mad->data + 40 + offset / 8))); - break; - default: - ret = 0; - } + return ret; +} -out: - kfree(in_mad); - kfree(out_mad); +#define PORT_PMA_ATTR(_name, _counter, _width, _offset) \ +struct port_table_attribute port_pma_attr_##_name = { \ + .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \ + .index = (_offset) | ((_width) << 16) | ((_counter) << 24) \ +} - return ret; +static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr, + char *buf) +{ + return get_pma_counters(p, attr, buf, 0); } -static PORT_PMA_ATTR(symbol_error , 0, 16, 32); -static PORT_PMA_ATTR(link_error_recovery , 1, 8, 48); -static PORT_PMA_ATTR(link_downed , 2, 8, 56); -static PORT_PMA_ATTR(port_rcv_errors , 3, 16, 64); +static PORT_PMA_ATTR(symbol_error , 0, 16, 32); +static PORT_PMA_ATTR(link_error_recovery , 1, 8, 48); +static PORT_PMA_ATTR(link_downed , 2, 8, 56); +static PORT_PMA_ATTR(port_rcv_errors , 3, 16, 64); static PORT_PMA_ATTR(port_rcv_remote_physical_errors, 4, 16, 80); static PORT_PMA_ATTR(port_rcv_switch_relay_errors , 5, 16, 96); -static PORT_PMA_ATTR(port_xmit_discards , 6, 16, 112); +static PORT_PMA_ATTR(port_xmit_discards , 6, 16, 112); static PORT_PMA_ATTR(port_xmit_constraint_errors , 7, 8, 128); -static PORT_PMA_ATTR(port_rcv_constraint_errors , 8, 8, 136); +static PORT_PMA_ATTR(port_rcv_constraint_errors , 8, 8, 136); static PORT_PMA_ATTR(local_link_integrity_errors , 9, 4, 152); static PORT_PMA_ATTR(excessive_buffer_overrun_errors, 10, 4, 156); -static PORT_PMA_ATTR(VL15_dropped , 11, 16, 176); -static PORT_PMA_ATTR(port_xmit_data , 12, 32, 192); -static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224); -static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256); -static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288); -/* - * There is no bit allocated for port_xmit_wait in the CounterSelect field - * (IB spec). However, since this bit is ignored when reading - * (show_pma_counter), the _counter field of port_xmit_wait can be set to zero. - */ -static PORT_PMA_ATTR(port_xmit_wait , 0, 32, 320); +static PORT_PMA_ATTR(VL15_dropped , 11, 16, 176); +static PORT_PMA_ATTR(port_xmit_data , 12, 32, 192); +static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224); +static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256); +static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288); static struct attribute *pma_attrs[] = { - &port_pma_attr_symbol_error.attr.attr, - &port_pma_attr_link_error_recovery.attr.attr, - &port_pma_attr_link_downed.attr.attr, - &port_pma_attr_port_rcv_errors.attr.attr, - &port_pma_attr_port_rcv_remote_physical_errors.attr.attr, - &port_pma_attr_port_rcv_switch_relay_errors.attr.attr, - &port_pma_attr_port_xmit_discards.attr.attr, - &port_pma_attr_port_xmit_constraint_errors.attr.attr, - &port_pma_attr_port_rcv_constraint_errors.attr.attr, - &port_pma_attr_local_link_integrity_errors.attr.attr, - &port_pma_attr_excessive_buffer_overrun_errors.attr.attr, - &port_pma_attr_VL15_dropped.attr.attr, - &port_pma_attr_port_xmit_data.attr.attr, - &port_pma_attr_port_rcv_data.attr.attr, - &port_pma_attr_port_xmit_packets.attr.attr, - &port_pma_attr_port_rcv_packets.attr.attr, - &port_pma_attr_port_xmit_wait.attr.attr, - NULL + &port_pma_attr_symbol_error.attr.attr, + &port_pma_attr_link_error_recovery.attr.attr, + &port_pma_attr_link_downed.attr.attr, + &port_pma_attr_port_rcv_errors.attr.attr, + &port_pma_attr_port_rcv_remote_physical_errors.attr.attr, + &port_pma_attr_port_rcv_switch_relay_errors.attr.attr, + &port_pma_attr_port_xmit_discards.attr.attr, + &port_pma_attr_port_xmit_constraint_errors.attr.attr, + &port_pma_attr_port_rcv_constraint_errors.attr.attr, + &port_pma_attr_local_link_integrity_errors.attr.attr, + &port_pma_attr_excessive_buffer_overrun_errors.attr.attr, + &port_pma_attr_VL15_dropped.attr.attr, + &port_pma_attr_port_xmit_data.attr.attr, + &port_pma_attr_port_rcv_data.attr.attr, + &port_pma_attr_port_xmit_packets.attr.attr, + &port_pma_attr_port_rcv_packets.attr.attr, + NULL }; static struct attribute_group pma_group = { @@ -411,6 +418,44 @@ static struct attribute_group pma_group .attrs = pma_attrs }; +#define PORT_PMA_ATTR_EXT(_name, _counter, _width, _offset) \ +struct port_table_attribute port_pma_attr_ext_##_name = { \ + .attr = __ATTR(_name, S_IRUGO, show_pma_counter_ext, NULL), \ + .index = (_offset) | ((_width) << 16) | ((_counter) << 24) \ +} + +static ssize_t show_pma_counter_ext(struct ib_port *p, + struct port_attribute *attr, char *buf) +{ + return get_pma_counters(p, attr, buf, 1); +} + +static PORT_PMA_ATTR_EXT(port_xmit_data_64 , 0, 64, 64); +static PORT_PMA_ATTR_EXT(port_rcv_data_64 , 0, 64, 128); +static PORT_PMA_ATTR_EXT(port_xmit_packets_64 , 0, 64, 192); +static PORT_PMA_ATTR_EXT(port_rcv_packets_64 , 0, 64, 256); +static PORT_PMA_ATTR_EXT(port_unicast_xmit_packets , 0, 64, 320); +static PORT_PMA_ATTR_EXT(port_unicast_rcv_packets , 0, 64, 384); +static PORT_PMA_ATTR_EXT(port_multicast_xmit_packets , 0, 64, 448); +static PORT_PMA_ATTR_EXT(port_multicast_rcv_packets , 0, 64, 512); + +static struct attribute *pma_attrs_ext[] = { + &port_pma_attr_ext_port_xmit_data_64.attr.attr, + &port_pma_attr_ext_port_rcv_data_64.attr.attr, + &port_pma_attr_ext_port_xmit_packets_64.attr.attr, + &port_pma_attr_ext_port_rcv_packets_64.attr.attr, + &port_pma_attr_ext_port_unicast_xmit_packets.attr.attr, + &port_pma_attr_ext_port_unicast_rcv_packets.attr.attr, + &port_pma_attr_ext_port_multicast_xmit_packets.attr.attr, + &port_pma_attr_ext_port_multicast_rcv_packets.attr.attr, + NULL +}; + +static struct attribute_group pma_ext_group = { + .name = "counters_ext", + .attrs = pma_attrs_ext +}; + static void ib_port_release(struct kobject *kobj) { struct ib_port *p = container_of(kobj, struct ib_port, kobj); @@ -503,7 +548,9 @@ err: return NULL; } -static int add_port(struct ib_device *device, int port_num) +static int add_port(struct ib_device *device, int port_num, + int (*port_callback)(struct ib_device *, + u8, struct kobject *)) { struct ib_port *p; struct ib_port_attr attr; @@ -522,7 +569,7 @@ static int add_port(struct ib_device *de p->port_num = port_num; ret = kobject_init_and_add(&p->kobj, &port_type, - device->ports_parent, + kobject_get(device->ports_parent), "%d", port_num); if (ret) goto err_put; @@ -531,10 +578,14 @@ static int add_port(struct ib_device *de if (ret) goto err_put; + ret = sysfs_create_group(&p->kobj, &pma_ext_group); + if (ret) + goto err_remove_pma; + p->gid_group.name = "gids"; p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len); if (!p->gid_group.attrs) - goto err_remove_pma; + goto err_remove_pma_ext; ret = sysfs_create_group(&p->kobj, &p->gid_group); if (ret) @@ -550,6 +601,12 @@ static int add_port(struct ib_device *de if (ret) goto err_free_pkey; + if (port_callback) { + ret = port_callback(device, port_num, &p->kobj); + if (ret) + goto err_remove_pkey; + } + list_add_tail(&p->kobj.entry, &device->port_list); #ifdef __linux__ @@ -557,6 +614,9 @@ static int add_port(struct ib_device *de #endif return 0; +err_remove_pkey: + sysfs_remove_group(&p->kobj, &p->pkey_group); + err_free_pkey: for (i = 0; i < attr.pkey_tbl_len; ++i) kfree(p->pkey_group.attrs[i]); @@ -572,6 +632,9 @@ err_free_gid: kfree(p->gid_group.attrs); +err_remove_pma_ext: + sysfs_remove_group(&p->kobj, &pma_ext_group); + err_remove_pma: sysfs_remove_group(&p->kobj, &pma_group); @@ -786,16 +849,17 @@ static struct attribute_group iw_stats_g .attrs = iw_proto_stats_attrs, }; -int ib_device_register_sysfs(struct ib_device *device) +int ib_device_register_sysfs(struct ib_device *device, + int (*port_callback)(struct ib_device *, u8, struct kobject *)) { struct device *class_dev = &device->dev; int ret; int i; class_dev->class = &ib_class; - class_dev->driver_data = device; class_dev->parent = device->dma_device; - dev_set_name(class_dev, device->name); + dev_set_name(class_dev, device->name); + dev_set_drvdata(class_dev, device); INIT_LIST_HEAD(&device->port_list); @@ -810,19 +874,19 @@ int ib_device_register_sysfs(struct ib_d } device->ports_parent = kobject_create_and_add("ports", - &class_dev->kobj); - if (!device->ports_parent) { + kobject_get(&class_dev->kobj)); + if (!device->ports_parent) { ret = -ENOMEM; goto err_put; } if (device->node_type == RDMA_NODE_IB_SWITCH) { - ret = add_port(device, 0); + ret = add_port(device, 0, port_callback); if (ret) goto err_put; } else { for (i = 1; i <= device->phys_port_cnt; ++i) { - ret = add_port(device, i); + ret = add_port(device, i, port_callback); if (ret) goto err_put; } @@ -864,10 +928,15 @@ void ib_device_unregister_sysfs(struct i { struct kobject *p, *t; struct ib_port *port; + int i; /* Hold kobject until ib_dealloc_device() */ kobject_get(&device->dev.kobj); + for (i = 0; i < ARRAY_SIZE(ib_class_attributes); ++i) { + device_remove_file(&device->dev, ib_class_attributes[i]); + } + list_for_each_entry_safe(p, t, &device->port_list, entry) { list_del(&p->entry); port = container_of(p, struct ib_port, kobj); @@ -891,7 +960,7 @@ void ib_sysfs_cleanup(void) class_unregister(&ib_class); } -int ib_sysfs_create_port_files(struct ib_device *device, +/*int ib_sysfs_create_port_files(struct ib_device *device, int (*create)(struct ib_device *dev, u8 port_num, struct kobject *kobj)) { @@ -908,4 +977,4 @@ int ib_sysfs_create_port_files(struct ib return ret; } -EXPORT_SYMBOL(ib_sysfs_create_port_files); +EXPORT_SYMBOL(ib_sysfs_create_port_files);*/ Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Sun Sep 29 00:35:03 2013 (r255932) @@ -312,7 +312,7 @@ ssize_t ib_uverbs_get_context(struct ib_ INIT_LIST_HEAD(&ucontext->qp_list); INIT_LIST_HEAD(&ucontext->srq_list); INIT_LIST_HEAD(&ucontext->ah_list); - INIT_LIST_HEAD(&ucontext->xrc_domain_list); + INIT_LIST_HEAD(&ucontext->xrcd_list); ucontext->closing = 0; resp.num_comp_vectors = file->device->num_comp_vectors; @@ -633,7 +633,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverb } mr = pd->device->reg_user_mr(pd, cmd.start, cmd.length, cmd.hca_va, - cmd.access_flags, &udata); + cmd.access_flags, &udata, 0); if (IS_ERR(mr)) { ret = PTR_ERR(mr); goto err_put; @@ -1087,7 +1087,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uv attr.srq = srq; attr.sq_sig_type = cmd.sq_sig_all ? IB_SIGNAL_ALL_WR : IB_SIGNAL_REQ_WR; attr.qp_type = cmd.qp_type; - attr.xrc_domain = xrcd; + attr.xrcd = xrcd; attr.create_flags = 0; attr.cap.max_send_wr = cmd.max_send_wr; @@ -1115,14 +1115,14 @@ ssize_t ib_uverbs_create_qp(struct ib_uv qp->event_handler = attr.event_handler; qp->qp_context = attr.qp_context; qp->qp_type = attr.qp_type; - qp->xrcd = attr.xrc_domain; + qp->xrcd = attr.xrcd; atomic_inc(&pd->usecnt); atomic_inc(&attr.send_cq->usecnt); atomic_inc(&attr.recv_cq->usecnt); if (attr.srq) atomic_inc(&attr.srq->usecnt); - else if (attr.xrc_domain) - atomic_inc(&attr.xrc_domain->usecnt); + else if (attr.xrcd) + atomic_inc(&attr.xrcd->usecnt); obj->uevent.uobject.object = qp; ret = idr_add_uobj(&ib_uverbs_qp_idr, &obj->uevent.uobject); @@ -2032,8 +2032,8 @@ ssize_t ib_uverbs_create_srq(struct ib_u srq->uobject = &obj->uobject; srq->event_handler = attr.event_handler; srq->srq_context = attr.srq_context; - srq->xrc_cq = NULL; - srq->xrcd = NULL; + srq->ext.xrc.cq = NULL; + srq->ext.xrc.xrcd = NULL; atomic_inc(&pd->usecnt); atomic_set(&srq->usecnt, 0); @@ -2083,7 +2083,7 @@ ssize_t ib_uverbs_create_xrc_srq(struct const char __user *buf, int in_len, int out_len) { - struct ib_uverbs_create_xrc_srq cmd; + struct ib_uverbs_create_xsrq cmd; struct ib_uverbs_create_srq_resp resp; struct ib_udata udata; struct ib_uevent_object *obj; @@ -2119,7 +2119,7 @@ ssize_t ib_uverbs_create_xrc_srq(struct goto err; } - xrc_cq = idr_read_cq(cmd.xrc_cq, file->ucontext, 0); + xrc_cq = idr_read_cq(cmd.cq_handle, file->ucontext, 0); if (!xrc_cq) { ret = -EINVAL; goto err_put_pd; @@ -2152,8 +2152,8 @@ ssize_t ib_uverbs_create_xrc_srq(struct srq->uobject = &obj->uobject; srq->event_handler = attr.event_handler; srq->srq_context = attr.srq_context; - srq->xrc_cq = xrc_cq; - srq->xrcd = xrcd; + srq->ext.xrc.cq = xrc_cq; + srq->ext.xrc.xrcd = xrcd; atomic_inc(&pd->usecnt); atomic_inc(&xrc_cq->usecnt); atomic_inc(&xrcd->usecnt); @@ -2528,7 +2528,7 @@ ssize_t ib_uverbs_open_xrc_domain(struct INIT_LIST_HEAD(&xrcd_uobj->xrc_reg_qp_list); mutex_lock(&file->mutex); - list_add_tail(&uobj->list, &file->ucontext->xrc_domain_list); + list_add_tail(&uobj->list, &file->ucontext->xrcd_list); mutex_unlock(&file->mutex); uobj->live = 1; @@ -2598,7 +2598,7 @@ ssize_t ib_uverbs_close_xrc_domain(struc if (!ret) { list_for_each_entry(t_uobj, &file->ucontext->srq_list, list) { struct ib_srq *srq = t_uobj->object; - if (srq->xrcd && srq->xrcd == uobj->object) { + if (srq->ext.xrc.xrcd && srq->ext.xrc.xrcd == uobj->object) { ret = -EBUSY; break; } @@ -2702,7 +2702,7 @@ ssize_t ib_uverbs_create_xrc_rcv_qp(stru init_attr.sq_sig_type = cmd.sq_sig_all ? IB_SIGNAL_ALL_WR : IB_SIGNAL_REQ_WR; init_attr.qp_type = IB_QPT_XRC; - init_attr.xrc_domain = xrcd; + init_attr.xrcd = xrcd; init_attr.cap.max_send_wr = 1; init_attr.cap.max_recv_wr = 0; Modified: head/sys/ofed/drivers/infiniband/core/uverbs_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_main.c Sat Sep 28 23:03:40 2013 (r255931) +++ head/sys/ofed/drivers/infiniband/core/uverbs_main.c Sun Sep 29 00:35:03 2013 (r255932) @@ -110,8 +110,8 @@ static ssize_t (*uverbs_cmd_table[])(str [IB_USER_VERBS_CMD_QUERY_SRQ] = ib_uverbs_query_srq, [IB_USER_VERBS_CMD_DESTROY_SRQ] = ib_uverbs_destroy_srq, [IB_USER_VERBS_CMD_CREATE_XRC_SRQ] = ib_uverbs_create_xrc_srq, - [IB_USER_VERBS_CMD_OPEN_XRC_DOMAIN] = ib_uverbs_open_xrc_domain, - [IB_USER_VERBS_CMD_CLOSE_XRC_DOMAIN] = ib_uverbs_close_xrc_domain, + [IB_USER_VERBS_CMD_OPEN_XRCD] = ib_uverbs_open_xrc_domain, + [IB_USER_VERBS_CMD_CLOSE_XRCD] = ib_uverbs_close_xrc_domain, [IB_USER_VERBS_CMD_CREATE_XRC_RCV_QP] = ib_uverbs_create_xrc_rcv_qp, [IB_USER_VERBS_CMD_MODIFY_XRC_RCV_QP] = ib_uverbs_modify_xrc_rcv_qp, [IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP] = ib_uverbs_query_xrc_rcv_qp, @@ -258,7 +258,7 @@ static int ib_uverbs_cleanup_ucontext(st } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 00:47:06 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 7C931310; Sun, 29 Sep 2013 00:47:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1C7C2C16; Sun, 29 Sep 2013 00:47:05 +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 989D525D3810; Sun, 29 Sep 2013 00:47:03 +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 B1D2FBF8CB5; Sun, 29 Sep 2013 00:47:02 +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 oUKZp9XUHB1G; Sun, 29 Sep 2013 00:47:00 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9390FBF8C77; Sun, 29 Sep 2013 00:47:00 +0000 (UTC) Date: Sun, 29 Sep 2013 00:46:59 +0000 (UTC) From: "Bjoern A. Zeeb" To: Ulrich Spoerlein Subject: Re: svn commit: r255923 - in head/sys/modules/hyperv: netvsc stordisengage storvsc utilities vmbus In-Reply-To: <201309280704.r8S743An074956@svn.freebsd.org> Message-ID: References: <201309280704.r8S743An074956@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 00:47:06 -0000 On Sat, 28 Sep 2013, Ulrich Spoerlein wrote: > Author: uqs > Date: Sat Sep 28 07:04:03 2013 > New Revision: 255923 > URL: http://svnweb.freebsd.org/changeset/base/255923 > > Log: > Fix make depend, apply a bit of style. please try not to in one commit. It's a pain to figure out the function from the style change -- even for Makefiles. > Approved by: re (marius) > Reviewed by: grehan > > Modified: > head/sys/modules/hyperv/netvsc/Makefile > head/sys/modules/hyperv/stordisengage/Makefile > head/sys/modules/hyperv/storvsc/Makefile > head/sys/modules/hyperv/utilities/Makefile > head/sys/modules/hyperv/vmbus/Makefile > > Modified: head/sys/modules/hyperv/netvsc/Makefile > ============================================================================== > --- head/sys/modules/hyperv/netvsc/Makefile Sat Sep 28 05:56:37 2013 (r255922) > +++ head/sys/modules/hyperv/netvsc/Makefile Sat Sep 28 07:04:03 2013 (r255923) > @@ -2,12 +2,12 @@ > > .PATH: ${.CURDIR}/../../../dev/hyperv/netvsc > > -KMOD = hv_netvsc > +KMOD= hv_netvsc > +SRCS= hv_net_vsc.c \ > + hv_netvsc_drv_freebsd.c \ > + hv_rndis_filter.c > +SRCS+= bus_if.h device_if.h > > -SRCS = hv_net_vsc.c \ > - hv_netvsc_drv_freebsd.c \ > - hv_rndis_filter.c > - > -CFLAGS += -I${.CURDIR}/../../../dev/hyperv/netvsc > +CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc > > .include > > Modified: head/sys/modules/hyperv/stordisengage/Makefile > ============================================================================== > --- head/sys/modules/hyperv/stordisengage/Makefile Sat Sep 28 05:56:37 2013 (r255922) > +++ head/sys/modules/hyperv/stordisengage/Makefile Sat Sep 28 07:04:03 2013 (r255923) > @@ -2,8 +2,8 @@ > > .PATH: ${.CURDIR}/../../../dev/hyperv/stordisengage > > -KMOD= hv_ata_pci_disengage > - > -SRCS= hv_ata_pci_disengage.c ata_if.h > +KMOD= hv_ata_pci_disengage > +SRCS= hv_ata_pci_disengage.c > +SRCS+= ata_if.h bus_if.h device_if.h pci_if.h > > .include > > Modified: head/sys/modules/hyperv/storvsc/Makefile > ============================================================================== > --- head/sys/modules/hyperv/storvsc/Makefile Sat Sep 28 05:56:37 2013 (r255922) > +++ head/sys/modules/hyperv/storvsc/Makefile Sat Sep 28 07:04:03 2013 (r255923) > @@ -2,10 +2,10 @@ > > .PATH: ${.CURDIR}/../../../dev/hyperv/storvsc > > -KMOD= hv_storvsc > - > +KMOD= hv_storvsc > SRCS = hv_storvsc_drv_freebsd.c \ > hv_vstorage.h > +SRCS+= bus_if.h device_if.h opt_cam.h > > CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ > -I${.CURDIR}/../../../dev/hyperv/vmbus \ > > Modified: head/sys/modules/hyperv/utilities/Makefile > ============================================================================== > --- head/sys/modules/hyperv/utilities/Makefile Sat Sep 28 05:56:37 2013 (r255922) > +++ head/sys/modules/hyperv/utilities/Makefile Sat Sep 28 07:04:03 2013 (r255923) > @@ -3,8 +3,8 @@ > .PATH: ${.CURDIR}/../../../dev/hyperv/utilities > > KMOD= hv_utils > - > -SRCS = hv_util.c > +SRCS= hv_util.c > +SRCS+= bus_if.h device_if.h > > CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ > -I${.CURDIR}/../../../dev/hyperv/vmbus > > Modified: head/sys/modules/hyperv/vmbus/Makefile > ============================================================================== > --- head/sys/modules/hyperv/vmbus/Makefile Sat Sep 28 05:56:37 2013 (r255922) > +++ head/sys/modules/hyperv/vmbus/Makefile Sat Sep 28 07:04:03 2013 (r255923) > @@ -3,15 +3,15 @@ > .PATH: ${.CURDIR}/../../../dev/hyperv/vmbus \ > ${.CURDIR}/../../../dev/hyperv/utilities > > -KMOD= hv_vmbus > - > -SRCS = hv_channel.c \ > +KMOD= hv_vmbus > +SRCS= hv_channel.c \ > hv_channel_mgmt.c \ > hv_connection.c \ > hv_hv.c \ > hv_ring_buffer.c \ > hv_vmbus_drv_freebsd.c \ > hv_vmbus_priv.h > +SRCS+= bus_if.h device_if.h > > CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ > -I${.CURDIR}/../../../dev/hyperv/vmbus \ > -- Bjoern A. Zeeb ????????? ??? ??????? ??????: '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 01:05:00 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id D76D2695; Sun, 29 Sep 2013 01:05:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C59D62CB0; Sun, 29 Sep 2013 01:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T15009088189; Sun, 29 Sep 2013 01:05:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T150rh088188; Sun, 29 Sep 2013 01:05:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201309290105.r8T150rh088188@svn.freebsd.org> From: Glen Barber Date: Sun, 29 Sep 2013 01:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255933 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 01:05:00 -0000 Author: gjb Date: Sun Sep 29 01:05:00 2013 New Revision: 255933 URL: http://svnweb.freebsd.org/changeset/base/255933 Log: Update head/ to -ALPHA4. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Sep 29 00:35:03 2013 (r255932) +++ head/sys/conf/newvers.sh Sun Sep 29 01:05:00 2013 (r255933) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="ALPHA3" +BRANCH="ALPHA4" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 07:42:25 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id BD0628CD; Sun, 29 Sep 2013 07:42:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA9742A64; Sun, 29 Sep 2013 07:42:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T7gP7o099886; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T7gPac099885; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201309290742.r8T7gPac099885@svn.freebsd.org> From: Xin LI Date: Sun, 29 Sep 2013 07:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255934 - in stable: 8/lib/libedit 9/lib/libedit X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 07:42:25 -0000 Author: delphij Date: Sun Sep 29 07:42:25 2013 New Revision: 255934 URL: http://svnweb.freebsd.org/changeset/base/255934 Log: MFC r255891: Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL). Modified: stable/9/lib/libedit/readline.c Directory Properties: stable/9/lib/libedit/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libedit/readline.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/readline.c ============================================================================== --- stable/9/lib/libedit/readline.c Sun Sep 29 01:05:00 2013 (r255933) +++ stable/9/lib/libedit/readline.c Sun Sep 29 07:42:25 2013 (r255934) @@ -1363,6 +1363,9 @@ add_history(const char *line) TYPE(HistEvent) ev; const Char *wline; + if (line == NULL) + return 0; + if (h == NULL || e == NULL) rl_initialize(); From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 07:42:26 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 1C7FE8CE; Sun, 29 Sep 2013 07:42:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3052A65; Sun, 29 Sep 2013 07:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T7gPer099894; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T7gPJG099893; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201309290742.r8T7gPJG099893@svn.freebsd.org> From: Xin LI Date: Sun, 29 Sep 2013 07:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r255934 - in stable: 8/lib/libedit 9/lib/libedit X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 07:42:26 -0000 Author: delphij Date: Sun Sep 29 07:42:25 2013 New Revision: 255934 URL: http://svnweb.freebsd.org/changeset/base/255934 Log: MFC r255891: Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL). Modified: stable/8/lib/libedit/readline.c Directory Properties: stable/8/lib/libedit/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/libedit/readline.c Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/readline.c ============================================================================== --- stable/8/lib/libedit/readline.c Sun Sep 29 01:05:00 2013 (r255933) +++ stable/8/lib/libedit/readline.c Sun Sep 29 07:42:25 2013 (r255934) @@ -1363,6 +1363,9 @@ add_history(const char *line) TYPE(HistEvent) ev; const Char *wline; + if (line == NULL) + return 0; + if (h == NULL || e == NULL) rl_initialize(); From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 10:14:16 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id D26776DB; Sun, 29 Sep 2013 10:14:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFD662F9C; Sun, 29 Sep 2013 10:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TAEGWU084025; Sun, 29 Sep 2013 10:14:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TAEGCI084024; Sun, 29 Sep 2013 10:14:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201309291014.r8TAEGCI084024@svn.freebsd.org> From: Adrian Chadd Date: Sun, 29 Sep 2013 10:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255935 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 10:14:16 -0000 Author: adrian Date: Sun Sep 29 10:14:16 2013 New Revision: 255935 URL: http://svnweb.freebsd.org/changeset/base/255935 Log: Add pagemask debugging output in "show tlb" in the debugger. Approved by: re (marius) Obtained from: bsdimp Modified: head/sys/mips/mips/tlb.c Modified: head/sys/mips/mips/tlb.c ============================================================================== --- head/sys/mips/mips/tlb.c Sun Sep 29 07:42:25 2013 (r255934) +++ head/sys/mips/mips/tlb.c Sun Sep 29 10:14:16 2013 (r255935) @@ -54,6 +54,7 @@ struct tlb_state { register_t entryhi; register_t entrylo0; register_t entrylo1; + register_t pagemask; } entry[MIPS_MAX_TLB_ENTRIES]; }; @@ -285,6 +286,7 @@ tlb_save(void) tlb_read(); tlb_state[cpu].entry[i].entryhi = mips_rd_entryhi(); + tlb_state[cpu].entry[i].pagemask = mips_rd_pagemask(); tlb_state[cpu].entry[i].entrylo0 = mips_rd_entrylo0(); tlb_state[cpu].entry[i].entrylo1 = mips_rd_entrylo1(); } @@ -339,7 +341,7 @@ tlb_invalidate_one(unsigned i) DB_SHOW_COMMAND(tlb, ddb_dump_tlb) { - register_t ehi, elo0, elo1; + register_t ehi, elo0, elo1, epagemask; unsigned i, cpu, ntlb; /* @@ -378,11 +380,12 @@ DB_SHOW_COMMAND(tlb, ddb_dump_tlb) ehi = tlb_state[cpu].entry[i].entryhi; elo0 = tlb_state[cpu].entry[i].entrylo0; elo1 = tlb_state[cpu].entry[i].entrylo1; + epagemask = tlb_state[cpu].entry[i].pagemask; if (elo0 == 0 && elo1 == 0) continue; - db_printf("#%u\t=> %jx\n", i, (intmax_t)ehi); + db_printf("#%u\t=> %jx (pagemask %jx)\n", i, (intmax_t)ehi, (intmax_t) epagemask); db_printf(" Lo0\t%jx\t(%#jx)\n", (intmax_t)elo0, (intmax_t)TLBLO_PTE_TO_PA(elo0)); db_printf(" Lo1\t%jx\t(%#jx)\n", (intmax_t)elo1, (intmax_t)TLBLO_PTE_TO_PA(elo1)); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 13:05:23 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 5CBD0DFF; Sun, 29 Sep 2013 13:05:23 +0000 (UTC) (envelope-from philip@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 497DE2634; Sun, 29 Sep 2013 13:05:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TD5NwM078150; Sun, 29 Sep 2013 13:05:23 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TD5Ndr078149; Sun, 29 Sep 2013 13:05:23 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201309291305.r8TD5Ndr078149@svn.freebsd.org> From: Philip Paeps Date: Sun, 29 Sep 2013 13:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255936 - head/sys/modules/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 13:05:23 -0000 Author: philip Date: Sun Sep 29 13:05:22 2013 New Revision: 255936 URL: http://svnweb.freebsd.org/changeset/base/255936 Log: DEBUG_FLAGS -g is default for GENERIC and its presence interferes with disabling the sfxge.ko.symbols build for embedded systems. Approved by: re (marius) MFC after: 3 days Modified: head/sys/modules/sfxge/Makefile Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Sun Sep 29 10:14:16 2013 (r255935) +++ head/sys/modules/sfxge/Makefile Sun Sep 29 13:05:22 2013 (r255936) @@ -20,6 +20,6 @@ SRCS+= efx_vpd.c efx_wol.c SRCS+= siena_mac.c siena_nic.c siena_nvram.c siena_phy.c SRCS+= siena_sram.c siena_vpd.c -DEBUG_FLAGS= -g -DDEBUG=1 +DEBUG_FLAGS= -DDEBUG=1 .include From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 13:09:26 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 00F4DEC; Sun, 29 Sep 2013 13:09:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E33DC265F; Sun, 29 Sep 2013 13:09:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TD9Pxw079117; Sun, 29 Sep 2013 13:09:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TD9PSI079113; Sun, 29 Sep 2013 13:09:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201309291309.r8TD9PSI079113@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Sep 2013 13:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255937 - head/sys/sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 13:09:26 -0000 Author: marius Date: Sun Sep 29 13:09:25 2013 New Revision: 255937 URL: http://svnweb.freebsd.org/changeset/base/255937 Log: Implement GET_STACK_USAGE. Discussed with: mav Approved by: re (kib) MFC after: 1 week Modified: head/sys/sparc64/include/proc.h Modified: head/sys/sparc64/include/proc.h ============================================================================== --- head/sys/sparc64/include/proc.h Sun Sep 29 13:05:22 2013 (r255936) +++ head/sys/sparc64/include/proc.h Sun Sep 29 13:09:25 2013 (r255937) @@ -55,6 +55,17 @@ struct mdproc { #ifdef _KERNEL +#include + +/* Get the current kernel thread stack usage. */ +#define GET_STACK_USAGE(total, used) do { \ + struct thread *td = curthread; \ + (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \ + (used) = (char *)td->td_kstack + \ + td->td_kstack_pages * PAGE_SIZE - \ + (char *)&td; \ +} while (0) + struct syscall_args { u_int code; struct sysent *callp; From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 14:06:20 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 7D1CAE79; Sun, 29 Sep 2013 14:06:20 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6998C2863; Sun, 29 Sep 2013 14:06:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TE6Kvs010447; Sun, 29 Sep 2013 14:06:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TE6K6H010446; Sun, 29 Sep 2013 14:06:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309291406.r8TE6K6H010446@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 29 Sep 2013 14:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255938 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 14:06:20 -0000 Author: des Date: Sun Sep 29 14:06:19 2013 New Revision: 255938 URL: http://svnweb.freebsd.org/changeset/base/255938 Log: Yet more BIND files that weren't listed in OptionalObsoleteFiles. Approved by: re (blanket) Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Sep 29 13:09:25 2013 (r255937) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Sep 29 14:06:19 2013 (r255938) @@ -234,10 +234,17 @@ OLD_FILES+=usr/lib/liblwres.a OLD_FILES+=usr/lib/liblwres_p.a OLD_LIBS+=usr/lib/liblwres.so.50 OLD_FILES+=usr/lib/liblwres.so +OLD_FILES+=usr/sbin/arpaname +OLD_FILES+=usr/sbin/ddns-confgen +OLD_FILES+=usr/sbin/genrandom +OLD_FILES+=usr/sbin/isc-hmac-fixup +OLD_FILES+=usr/sbin/nsec3hash OLD_FILES+=usr/sbin/named OLD_FILES+=usr/sbin/lwresd OLD_FILES+=usr/sbin/named-checkconf OLD_FILES+=usr/sbin/named-checkzone +OLD_FILES+=usr/sbin/named-compilezone +OLD_FILES+=usr/sbin/named-journalprint OLD_FILES+=usr/sbin/named.reload OLD_FILES+=usr/sbin/named.reconfig OLD_FILES+=usr/sbin/rndc @@ -295,8 +302,10 @@ OLD_FILES+=usr/share/doc/bind9/COPYRIGHT OLD_FILES+=usr/share/doc/bind9/FAQ OLD_FILES+=usr/share/doc/bind9/HISTORY OLD_FILES+=usr/share/doc/bind9/README +OLD_FILES+=usr/share/man/man1/arpaname.1.gz OLD_FILES+=usr/share/man/man1/dig.1.gz OLD_FILES+=usr/share/man/man1/nslookup.1.gz +OLD_FILES+=usr/share/man/man1/nsupdate.1.gz OLD_FILES+=usr/share/man/man3/lwres.3.gz OLD_FILES+=usr/share/man/man3/lwres_buffer.3.gz OLD_FILES+=usr/share/man/man3/lwres_config.3.gz @@ -384,15 +393,18 @@ OLD_FILES+=usr/share/man/man3/lwres_getn OLD_FILES+=usr/share/man/man3/lwres_string_parse.3.gz OLD_FILES+=usr/share/man/man5/named.conf.5.gz OLD_FILES+=usr/share/man/man5/rndc.conf.5.gz -OLD_FILES+=usr/share/man/man1/nsupdate.1.gz -OLD_FILES+=usr/share/man/man8/dnssec-keygen.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz -OLD_FILES+=usr/share/man/man8/named.8.gz -OLD_FILES+=usr/share/man/man8/lwresd.8.gz +OLD_FILES+=usr/share/man/man8/ddns-confgen.8.gz +OLD_FILES+=usr/share/man/man8/genrandom.8.gz +OLD_FILES+=usr/share/man/man8/isc-hmac-fixup.8.gz OLD_FILES+=usr/share/man/man8/named-checkconf.8.gz OLD_FILES+=usr/share/man/man8/named-checkzone.8.gz +OLD_FILES+=usr/share/man/man8/named-compilezone.8.gz +OLD_FILES+=usr/share/man/man8/named-journalprint.8.gz OLD_FILES+=usr/share/man/man8/named.reload.8.gz OLD_FILES+=usr/share/man/man8/named.reconfig.8.gz +OLD_FILES+=usr/share/man/man8/named.8.gz +OLD_FILES+=usr/share/man/man8/nsec3hash.8.gz +OLD_FILES+=usr/share/man/man8/lwresd.8.gz OLD_FILES+=usr/share/man/man8/rndc.8.gz OLD_FILES+=usr/share/man/man8/rndc-confgen.8.gz OLD_DIRS+=var/named/dev @@ -405,8 +417,18 @@ OLD_DIRS+=var/named/var .endif .if ${MK_BIND_DNSSEC} == no || ${MK_BIND} == no +OLD_FILES+=usr/sbin/dnssec-dsfromkey +OLD_FILES+=usr/sbin/dnssec-keyfromlabel OLD_FILES+=usr/sbin/dnssec-keygen +OLD_FILES+=usr/sbin/dnssec-revoke +OLD_FILES+=usr/sbin/dnssec-settime OLD_FILES+=usr/sbin/dnssec-signzone +OLD_FILES+=usr/share/man/man8/dnssec-dsfromkey.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-keyfromlabel.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-keygen.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-revoke.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-settime.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz .endif .if ${MK_BIND_ETC} == no || ${MK_BIND} == no From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 15:19:35 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id D87CE1AC; Sun, 29 Sep 2013 15:19:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB8352B1E; Sun, 29 Sep 2013 15:19:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TFJZxP050003; Sun, 29 Sep 2013 15:19:35 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TFJZHJ049999; Sun, 29 Sep 2013 15:19:35 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201309291519.r8TFJZHJ049999@svn.freebsd.org> From: Andrew Turner Date: Sun, 29 Sep 2013 15:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255939 - in head/sys: boot/arm/ixp425/boot2 libkern libkern/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 15:19:35 -0000 Author: andrew Date: Sun Sep 29 15:19:34 2013 New Revision: 255939 URL: http://svnweb.freebsd.org/changeset/base/255939 Log: Fix ixp425 boot2 with ARM EABI: - libkern is missing __aeabi_llsl, implement this by calling __ashldi3. - Because of how the asm entry macros are defined the boot2 code requires the unwind symbols to exist, include them in boot2. Approved by: re (marius) Modified: head/sys/boot/arm/ixp425/boot2/Makefile head/sys/libkern/arm/aeabi_unwind.c head/sys/libkern/ashldi3.c Modified: head/sys/boot/arm/ixp425/boot2/Makefile ============================================================================== --- head/sys/boot/arm/ixp425/boot2/Makefile Sun Sep 29 14:06:19 2013 (r255938) +++ head/sys/boot/arm/ixp425/boot2/Makefile Sun Sep 29 15:19:34 2013 (r255939) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # We get a lot of the std lib functions from here. .PATH: ${.CURDIR}/../../at91/libat91 @@ -15,6 +17,9 @@ FILES=${P} SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c +.if ${MK_ARM_EABI} != "no" +SRCS+=aeabi_unwind.c +.endif NO_MAN= KERNPHYSADDR=0x180000 Modified: head/sys/libkern/arm/aeabi_unwind.c ============================================================================== --- head/sys/libkern/arm/aeabi_unwind.c Sun Sep 29 14:06:19 2013 (r255938) +++ head/sys/libkern/arm/aeabi_unwind.c Sun Sep 29 15:19:34 2013 (r255939) @@ -29,7 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#ifdef _KERNEL #include +#else +#define panic(x) (void)0 +#endif #ifdef __ARM_EABI__ /* We need to provide these functions never call them */ Modified: head/sys/libkern/ashldi3.c ============================================================================== --- head/sys/libkern/ashldi3.c Sun Sep 29 14:06:19 2013 (r255938) +++ head/sys/libkern/ashldi3.c Sun Sep 29 15:19:34 2013 (r255939) @@ -59,3 +59,13 @@ __ashldi3(a, shift) } return (aa.q); } + +#ifdef __ARM_EABI__ +long long __aeabi_llsl(long long, int); + +long long +__aeabi_llsl(long long a, int b) +{ + return __ashldi3(a, b); +} +#endif From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 18:02:24 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id DDFD6E13; Sun, 29 Sep 2013 18:02:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B053A212A; Sun, 29 Sep 2013 18:02:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TI2OYB054300; Sun, 29 Sep 2013 18:02:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TI2OTR054298; Sun, 29 Sep 2013 18:02:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201309291802.r8TI2OTR054298@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Sep 2013 18:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255940 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 18:02:24 -0000 Author: kib Date: Sun Sep 29 18:02:23 2013 New Revision: 255940 URL: http://svnweb.freebsd.org/changeset/base/255940 Log: Add LK_TRYUPGRADE operation for lockmgr(9), which attempts to atomically upgrade shared lock to exclusive. On failure, error is returned and lock is not dropped in the process. Tested by: pho (previous version) No objections from: attilio Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (glebius) Modified: head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Sep 29 15:19:34 2013 (r255939) +++ head/sys/kern/kern_lock.c Sun Sep 29 18:02:23 2013 (r255940) @@ -497,6 +497,7 @@ __lockmgr_args(struct lock *lk, u_int fl op = LK_EXCLUSIVE; break; case LK_UPGRADE: + case LK_TRYUPGRADE: case LK_DOWNGRADE: _lockmgr_assert(lk, KA_XLOCKED | KA_NOTRECURSED, file, line); @@ -694,6 +695,7 @@ __lockmgr_args(struct lock *lk, u_int fl } break; case LK_UPGRADE: + case LK_TRYUPGRADE: _lockmgr_assert(lk, KA_SLOCKED, file, line); v = lk->lk_lock; x = v & LK_ALL_WAITERS; @@ -714,6 +716,17 @@ __lockmgr_args(struct lock *lk, u_int fl } /* + * In LK_TRYUPGRADE mode, do not drop the lock, + * returning EBUSY instead. + */ + if (op == LK_TRYUPGRADE) { + LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", + __func__, lk); + error = EBUSY; + break; + } + + /* * We have been unable to succeed in upgrading, so just * give up the shared lock. */ Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Sun Sep 29 15:19:34 2013 (r255939) +++ head/sys/sys/lockmgr.h Sun Sep 29 18:02:23 2013 (r255940) @@ -169,6 +169,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_RELEASE 0x100000 #define LK_SHARED 0x200000 #define LK_UPGRADE 0x400000 +#define LK_TRYUPGRADE 0x800000 #define LK_TOTAL_MASK (LK_INIT_MASK | LK_EATTR_MASK | LK_TYPE_MASK) From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 18:04:58 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 1D3A5F61; Sun, 29 Sep 2013 18:04:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A451213A; Sun, 29 Sep 2013 18:04:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TI4vKP054992; Sun, 29 Sep 2013 18:04:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TI4vm9054991; Sun, 29 Sep 2013 18:04:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201309291804.r8TI4vm9054991@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Sep 2013 18:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255941 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 18:04:58 -0000 Author: kib Date: Sun Sep 29 18:04:57 2013 New Revision: 255941 URL: http://svnweb.freebsd.org/changeset/base/255941 Log: Reimplement r255797 using LK_TRYUPGRADE. The r255797 was: Increase the chance of the buffer write from the bufdaemon helper context to succeed. If the locked vnode which owns the buffer to be written is shared locked, try the non-blocking upgrade of the lock to exclusive. PR: kern/178997 Reported and tested by: Klaus Weber Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (glebius) Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Sep 29 18:02:23 2013 (r255940) +++ head/sys/kern/vfs_bio.c Sun Sep 29 18:04:57 2013 (r255941) @@ -2624,6 +2624,8 @@ flushbufqueues(struct vnode *lvp, int ta int hasdeps; int flushed; int queue; + int error; + bool unlock; flushed = 0; queue = QUEUE_DIRTY; @@ -2699,7 +2701,16 @@ flushbufqueues(struct vnode *lvp, int ta BUF_UNLOCK(bp); continue; } - if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_CANRECURSE) == 0) { + if (lvp == NULL) { + unlock = true; + error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); + } else { + ASSERT_VOP_LOCKED(vp, "getbuf"); + unlock = false; + error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : + vn_lock(vp, LK_TRYUPGRADE); + } + if (error == 0) { mtx_unlock(&bqdirty); CTR3(KTR_BUF, "flushbufqueue(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); @@ -2711,7 +2722,8 @@ flushbufqueues(struct vnode *lvp, int ta notbufdflushes++; } vn_finished_write(mp); - VOP_UNLOCK(vp, 0); + if (unlock) + VOP_UNLOCK(vp, 0); flushwithdeps += hasdeps; flushed++; From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 18:07:14 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EFD3B1FC; Sun, 29 Sep 2013 18:07:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCBAD214A; Sun, 29 Sep 2013 18:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TI7Ed0055962; Sun, 29 Sep 2013 18:07:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TI7E3o055959; Sun, 29 Sep 2013 18:07:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201309291807.r8TI7E3o055959@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Sep 2013 18:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255942 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 18:07:15 -0000 Author: kib Date: Sun Sep 29 18:07:14 2013 New Revision: 255942 URL: http://svnweb.freebsd.org/changeset/base/255942 Log: For vunref(), try to upgrade the vnode lock if the function was called with the vnode shared-locked. If upgrade succeeded, the inactivation can be done immediately, instead of being postponed. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (glebius) Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Sep 29 18:04:57 2013 (r255941) +++ head/sys/kern/vfs_subr.c Sun Sep 29 18:07:14 2013 (r255942) @@ -2218,8 +2218,10 @@ vputx(struct vnode *vp, int func) } break; case VPUTX_VUNREF: - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) - error = EBUSY; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_TRYUPGRADE | LK_INTERLOCK); + VI_LOCK(vp); + } break; } if (vp->v_usecount > 0) From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 20:10:23 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 57D38C98; Sun, 29 Sep 2013 20:10:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B38626C2; Sun, 29 Sep 2013 20:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TKANgg023048; Sun, 29 Sep 2013 20:10:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TKAN0j023046; Sun, 29 Sep 2013 20:10:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201309292010.r8TKAN0j023046@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 29 Sep 2013 20:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255943 - head/sys/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 20:10:23 -0000 Author: nwhitehorn Date: Sun Sep 29 20:10:22 2013 New Revision: 255943 URL: http://svnweb.freebsd.org/changeset/base/255943 Log: Changes to CAM or busdma have caused SIMs to be sent 0-length CCBs on occasion. This resulted in zero mapped segments, triggering an assert in the PS3 CDROM driver. Allow no DMA for 0-length transfers. Approved by: re (glebius) MFC after: 1 week Modified: head/sys/powerpc/ps3/ps3cdrom.c Modified: head/sys/powerpc/ps3/ps3cdrom.c ============================================================================== --- head/sys/powerpc/ps3/ps3cdrom.c Sun Sep 29 18:07:14 2013 (r255942) +++ head/sys/powerpc/ps3/ps3cdrom.c Sun Sep 29 20:10:22 2013 (r255943) @@ -557,7 +557,9 @@ ps3cdrom_transfer(void *arg, bus_dma_seg uint64_t start_sector, block_count; int err; - KASSERT(nsegs == 1, ("invalid number of DMA segments")); + KASSERT(nsegs == 1 || nsegs == 0, + ("ps3cdrom_transfer: invalid number of DMA segments %d", nsegs)); + KASSERT(error == 0, ("ps3cdrom_transfer: DMA error %d", error)); PS3CDROM_ASSERT_LOCKED(sc); @@ -581,6 +583,7 @@ ps3cdrom_transfer(void *arg, bus_dma_seg switch (cdb[0]) { case READ_10: + KASSERT(nsegs == 1, ("ps3cdrom_transfer: no data to read")); start_sector = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; block_count = (cdb[7] << 8) | cdb[8]; @@ -592,6 +595,7 @@ ps3cdrom_transfer(void *arg, bus_dma_seg BUS_DMASYNC_POSTREAD); break; case WRITE_10: + KASSERT(nsegs == 1, ("ps3cdrom_transfer: no data to write")); start_sector = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5]; block_count = (cdb[7] << 8) | cdb[8]; @@ -622,9 +626,10 @@ ps3cdrom_transfer(void *arg, bus_dma_seg atapi_cmd.proto = NON_DATA_PROTO; } - atapi_cmd.nblocks = atapi_cmd.arglen = segs[0].ds_len; + atapi_cmd.nblocks = atapi_cmd.arglen = + (nsegs == 0) ? 0 : segs[0].ds_len; atapi_cmd.blksize = 1; - atapi_cmd.buf = segs[0].ds_addr; + atapi_cmd.buf = (nsegs == 0) ? 0 : segs[0].ds_addr; if (ccb->ccb_h.flags & CAM_DIR_OUT) bus_dmamap_sync(sc->sc_dmatag, xp->x_dmamap, From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 20:20:19 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E3726F7A; Sun, 29 Sep 2013 20:20:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2BAD2751; Sun, 29 Sep 2013 20:20:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TKKIdE027939; Sun, 29 Sep 2013 20:20:18 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TKKHjG027932; Sun, 29 Sep 2013 20:20:17 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201309292020.r8TKKHjG027932@svn.freebsd.org> From: Bryan Drewery Date: Sun, 29 Sep 2013 20:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255944 - in head/sys/boot: i386/efi powerpc/boot1.chrp userboot/libstand userboot/test userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 20:20:19 -0000 Author: bdrewery (ports committer) Date: Sun Sep 29 20:20:17 2013 New Revision: 255944 URL: http://svnweb.freebsd.org/changeset/base/255944 Log: Use MK_SSP=no after including bsd.own.mk to disable SSP instead of user-knob WITH[OUT]_SSP to avoid hitting an error if user has WITH_SSP in their make.conf. Ports now use this knob. make[7]: "/usr/src/share/mk/bsd.own.mk" line 466: WITH_SSP and WITHOUT_SSP can't both be set. This is similar to previous cleanup done in r188895 Approved by: bapt Reviewed by: jlh (earlier version) Approved by: re (marius) MFC after: 1 week Modified: head/sys/boot/i386/efi/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/test/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/i386/efi/Makefile ============================================================================== --- head/sys/boot/i386/efi/Makefile Sun Sep 29 20:10:22 2013 (r255943) +++ head/sys/boot/i386/efi/Makefile Sun Sep 29 20:20:17 2013 (r255944) @@ -1,10 +1,10 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= BUILDING_EFI= .include +MK_SSP= no PROG= loader.sym INTERNALPROG= Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Sun Sep 29 20:10:22 2013 (r255943) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Sun Sep 29 20:20:17 2013 (r255944) @@ -1,6 +1,6 @@ # $FreeBSD$ -WITHOUT_SSP= +SSP_CFLAGS= PROG= boot1.elf NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Sun Sep 29 20:10:22 2013 (r255943) +++ head/sys/boot/userboot/libstand/Makefile Sun Sep 29 20:20:17 2013 (r255944) @@ -6,10 +6,10 @@ # quite large. # -WITHOUT_SSP= NO_MAN= .include +MK_SSP= no S= ${.CURDIR}/../../../../lib/libstand Modified: head/sys/boot/userboot/test/Makefile ============================================================================== --- head/sys/boot/userboot/test/Makefile Sun Sep 29 20:10:22 2013 (r255943) +++ head/sys/boot/userboot/test/Makefile Sun Sep 29 20:20:17 2013 (r255944) @@ -2,9 +2,9 @@ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= test INTERNALPROG= Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Sun Sep 29 20:10:22 2013 (r255943) +++ head/sys/boot/userboot/userboot/Makefile Sun Sep 29 20:20:17 2013 (r255944) @@ -1,9 +1,9 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no SHLIB_NAME= userboot.so NO_CTF= yes From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 20:21:34 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id B966B144; Sun, 29 Sep 2013 20:21:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A73AC2757; Sun, 29 Sep 2013 20:21:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TKLYjB028600; Sun, 29 Sep 2013 20:21:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TKLYE2028599; Sun, 29 Sep 2013 20:21:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201309292021.r8TKLYE2028599@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Sep 2013 20:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255945 - head/sys/security/mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 20:21:34 -0000 Author: kib Date: Sun Sep 29 20:21:34 2013 New Revision: 255945 URL: http://svnweb.freebsd.org/changeset/base/255945 Log: Make the mac_policy_rm lock recursable, which allows reentrance into the mac framework. It is needed when priv_check_cred(9) is called from the mac callback, e.g. in the mac_portacl(4). Reported by: az Reviewed by: rwatson Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/security/mac/mac_framework.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Sun Sep 29 20:20:17 2013 (r255944) +++ head/sys/security/mac/mac_framework.c Sun Sep 29 20:21:34 2013 (r255945) @@ -292,7 +292,8 @@ mac_init(void) mac_labelzone_init(); #ifndef MAC_STATIC - rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS); + rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS | + RM_RECURSE); sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS); #endif } From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 20:35:41 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C6796476; Sun, 29 Sep 2013 20:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0BFC27C4; Sun, 29 Sep 2013 20:35:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TKZfij035353; Sun, 29 Sep 2013 20:35:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TKZdOQ035322; Sun, 29 Sep 2013 20:35:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201309292035.r8TKZdOQ035322@svn.freebsd.org> From: Dimitry Andric Date: Sun, 29 Sep 2013 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255946 - in stable/9/contrib/llvm/lib: CodeGen/SelectionDAG Target/AArch64 Target/ARM Target/Hexagon Target/MSP430 Target/Mips Target/NVPTX Target/PowerPC Target/R600 Target/Sparc Targ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 20:35:41 -0000 Author: dim Date: Sun Sep 29 20:35:38 2013 New Revision: 255946 URL: http://svnweb.freebsd.org/changeset/base/255946 Log: MFC r255804: Pull in r191165 from upstream llvm trunk: ISelDAG: spot chain cycles involving MachineNodes Previously, the DAGISel function WalkChainUsers was spotting that it had entered already-selected territory by whether a node was a MachineNode (amongst other things). Since it's fairly common practice to insert MachineNodes during ISelLowering, this was not the correct check. Looking around, it seems that other nodes get their NodeId set to -1 upon selection, so this makes sure the same thing happens to all MachineNodes and uses that characteristic to determine whether we should stop looking for a loop during selection. This should fix PR15840. Specifically, this fixes the long-standing assertion failure when compiling the multimedia/gstreamer port on i386. Thanks to Tijl Coosemans for his help in getting upstream to fix it. Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1736,15 +1736,15 @@ WalkChainUsers(const SDNode *ChainedNode SDNode *User = *UI; + if (User->getOpcode() == ISD::HANDLENODE) // Root of the graph. + continue; + // If we see an already-selected machine node, then we've gone beyond the // pattern that we're selecting down into the already selected chunk of the // DAG. - if (User->isMachineOpcode() || - User->getOpcode() == ISD::HANDLENODE) // Root of the graph. - continue; - unsigned UserOpcode = User->getOpcode(); - if (UserOpcode == ISD::CopyToReg || + if (User->isMachineOpcode() || + UserOpcode == ISD::CopyToReg || UserOpcode == ISD::CopyFromReg || UserOpcode == ISD::INLINEASM || UserOpcode == ISD::EH_LABEL || Modified: stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -395,6 +395,7 @@ SDNode *AArch64DAGToDAGISel::Select(SDNo if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -2546,8 +2546,10 @@ SDNode *ARMDAGToDAGISel::SelectAtomic64( SDNode *ARMDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1334,8 +1334,10 @@ SDNode *HexagonDAGToDAGISel::SelectAdd(S SDNode *HexagonDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -394,6 +394,7 @@ SDNode *MSP430DAGToDAGISel::Select(SDNod DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -97,6 +97,7 @@ SDNode* MipsDAGToDAGISel::Select(SDNode // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -91,8 +91,10 @@ NVPTXDAGToDAGISel::NVPTXDAGToDAGISel(NVP /// expanded, promoted and normal instructions. SDNode *NVPTXDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } SDNode *ResNode = NULL; switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -895,8 +895,10 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDN // target-specific node if it hasn't already been changed. SDNode *PPCDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -158,6 +158,7 @@ bool AMDGPUDAGToDAGISel::SelectADDR64(SD SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) { unsigned int Opc = N->getOpcode(); if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. } switch (Opc) { Modified: stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -137,8 +137,10 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDV SDNode *SparcDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -540,6 +540,7 @@ SDNode *SystemZDAGToDAGISel::Select(SDNo // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return 0; } Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1988,6 +1988,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode * if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << '\n'); + Node->setNodeId(-1); return NULL; // Already selected. } From owner-svn-src-all@FreeBSD.ORG Sun Sep 29 23:38:54 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 55DD7996; Sun, 29 Sep 2013 23:38:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28C972EAA; Sun, 29 Sep 2013 23:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TNcsC2034094; Sun, 29 Sep 2013 23:38:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TNcsFN034093; Sun, 29 Sep 2013 23:38:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201309292338.r8TNcsFN034093@svn.freebsd.org> From: Eitan Adler Date: Sun, 29 Sep 2013 23:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255947 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 23:38:54 -0000 Author: eadler Date: Sun Sep 29 23:38:53 2013 New Revision: 255947 URL: http://svnweb.freebsd.org/changeset/base/255947 Log: Add the newest NetBSD releases. Approved by: re (gjb) Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun Sep 29 20:35:38 2013 (r255946) +++ head/share/misc/bsd-family-tree Sun Sep 29 23:38:53 2013 (r255947) @@ -253,13 +253,20 @@ FreeBSD 5.2 | | *--FreeBSD | | | | | | | | 9.0 | | | | NetBSD | DragonFly 3.0.1 | | FreeBSD | | | 5.1.2 | | - | | 8.3 | | | OpenBSD 5.1 | + | | 8.3 | | | | | | + | | | | | | NetBSD | | + | | | | | | 5.1.3 | | + | | | | | | OpenBSD 5.1 | | | | Mac OS X | `----. | | | | | 10.8 | \ | | | | | | NetBSD 6.0 | | | | | | | | | | | OpenBSD 5.2 DragonFly 3.2.1 | FreeBSD | | | | | NetBSD | | | 9.1 | | | | | 5.2 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 5.2.1 | | + | | | | | | | | | | | | | \ | | | | | | | NetBSD | | | | | | | 6.0.1 | | @@ -580,6 +587,8 @@ OpenBSD 5.3 2013-05-01 [OBD] NetBSD 6.0.2 2013-05-18 [NBD] (security/critical release) NetBSD 6.1 2013-05-18 [NBD] FreeBSD 8.4 2013-06-07 [FBD] +NetBSD 5.1.3 2013-09-29 [NBD] +NetBSD 5.2.1 2013-09-29 [NBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 09:21:18 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id F40D9D3B; Mon, 30 Sep 2013 09:21:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1EA8261D; Mon, 30 Sep 2013 09:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8U9LHkS049078; Mon, 30 Sep 2013 09:21:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8U9LHVW049077; Mon, 30 Sep 2013 09:21:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201309300921.r8U9LHVW049077@svn.freebsd.org> From: Robert Watson Date: Mon, 30 Sep 2013 09:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255948 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 09:21:18 -0000 Author: rwatson Date: Mon Sep 30 09:21:17 2013 New Revision: 255948 URL: http://svnweb.freebsd.org/changeset/base/255948 Log: Update ddb(9) to show how to print 64-bit values with "examine". MFC after: 3 days Approved by: re (gjb) Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sun Sep 29 23:38:53 2013 (r255947) +++ head/share/man/man4/ddb.4 Mon Sep 30 09:21:17 2013 (r255948) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2011 +.Dd September 30, 2013 .Dt DDB 4 .Os .Sh NAME @@ -219,6 +219,8 @@ look at by bytes (8 bits) look at by half words (16 bits) .It Cm l look at by long words (32 bits) +.It Cm g +look at by quad words (64 bits) .It Cm a print the location being displayed .It Cm A From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:23:48 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id A0A34A92; Mon, 30 Sep 2013 17:23:48 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B38726CE; Mon, 30 Sep 2013 17:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UHNmd1008637; Mon, 30 Sep 2013 17:23:48 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UHNj8m008620; Mon, 30 Sep 2013 17:23:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309301723.r8UHNj8m008620@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 30 Sep 2013 17:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255949 - in head: . contrib/bind9 etc etc/mtree include lib lib/bind release share/doc share/doc/bind9 share/mk tools/build/mk tools/build/options usr.bin usr.bin/host usr.bin/nslookup... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:23:48 -0000 Author: des Date: Mon Sep 30 17:23:45 2013 New Revision: 255949 URL: http://svnweb.freebsd.org/changeset/base/255949 Log: Remove BIND. Approved by: re (gjb) Deleted: head/contrib/bind9/ head/etc/mtree/BIND.chroot.dist head/etc/mtree/BIND.include.dist head/lib/bind/ head/share/doc/bind9/ head/tools/build/options/WITHOUT_BIND_DNSSEC head/tools/build/options/WITHOUT_BIND_ETC head/tools/build/options/WITHOUT_BIND_LIBS_LWRES head/tools/build/options/WITHOUT_BIND_MTREE head/tools/build/options/WITHOUT_BIND_NAMED head/tools/build/options/WITHOUT_BIND_UTILS head/tools/build/options/WITH_BIND head/tools/build/options/WITH_BIND_IDN head/tools/build/options/WITH_BIND_LARGE_FILE head/tools/build/options/WITH_BIND_LIBS head/tools/build/options/WITH_BIND_SIGCHASE head/tools/build/options/WITH_BIND_XML head/usr.bin/nslookup/ head/usr.bin/nsupdate/ head/usr.sbin/arpaname/ head/usr.sbin/ddns-confgen/ head/usr.sbin/dnssec-dsfromkey/ head/usr.sbin/dnssec-keyfromlabel/ head/usr.sbin/dnssec-keygen/ head/usr.sbin/dnssec-revoke/ head/usr.sbin/dnssec-settime/ head/usr.sbin/dnssec-signzone/ head/usr.sbin/dnssec-verify/ head/usr.sbin/genrandom/ head/usr.sbin/isc-hmac-fixup/ head/usr.sbin/named/ head/usr.sbin/named-checkconf/ head/usr.sbin/named-checkzone/ head/usr.sbin/named-journalprint/ head/usr.sbin/nsec3hash/ head/usr.sbin/rndc/ head/usr.sbin/rndc-confgen/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/etc/Makefile head/etc/mtree/BSD.var.dist head/include/Makefile head/lib/Makefile head/release/Makefile head/share/doc/Makefile head/share/mk/bsd.libnames.mk head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile head/usr.bin/host/Makefile head/usr.sbin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Sep 30 09:21:17 2013 (r255948) +++ head/Makefile.inc1 Mon Sep 30 17:23:45 2013 (r255949) @@ -395,7 +395,7 @@ LIB32WMAKEFLAGS+= \ -DNO_LINT LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ - -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML + -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ ${IMAKE_INSTALL} .endif @@ -485,10 +485,6 @@ _worldtmp: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ -p ${WORLDTMP}/usr/lib >/dev/null .endif -.if ${MK_BIND_LIBS} != "no" - mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ - -p ${WORLDTMP}/usr/include >/dev/null -.endif .for _mtree in ${LOCAL_MTREE} mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null .endfor Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Sep 30 09:21:17 2013 (r255948) +++ head/ObsoleteFiles.inc Mon Sep 30 17:23:45 2013 (r255949) @@ -38,6 +38,235 @@ # xargs -n1 | sort | uniq -d; # done +# 20130930: BIND removed from base +OLD_FILES+=etc/namedb +OLD_FILES+=etc/periodic/daily/470.status-named +OLD_FILES+=usr/bin/dig +OLD_FILES+=usr/bin/nslookup +OLD_FILES+=usr/bin/nsupdate +OLD_DIRS+=usr/include/lwres +OLD_FILES+=usr/include/lwres/context.h +OLD_FILES+=usr/include/lwres/int.h +OLD_FILES+=usr/include/lwres/ipv6.h +OLD_FILES+=usr/include/lwres/lang.h +OLD_FILES+=usr/include/lwres/list.h +OLD_FILES+=usr/include/lwres/lwbuffer.h +OLD_FILES+=usr/include/lwres/lwpacket.h +OLD_FILES+=usr/include/lwres/lwres.h +OLD_FILES+=usr/include/lwres/net.h +OLD_FILES+=usr/include/lwres/netdb.h +OLD_FILES+=usr/include/lwres/platform.h +OLD_FILES+=usr/include/lwres/result.h +OLD_FILES+=usr/include/lwres/version.h +OLD_FILES+=usr/lib/liblwres.a +OLD_FILES+=usr/lib/liblwres.so +OLD_LIBS+=usr/lib/liblwres.so.50 +OLD_FILES+=usr/lib/liblwres_p.a +OLD_FILES+=usr/sbin/arpaname +OLD_FILES+=usr/sbin/ddns-confgen +OLD_FILES+=usr/sbin/dnssec-dsfromkey +OLD_FILES+=usr/sbin/dnssec-keyfromlabel +OLD_FILES+=usr/sbin/dnssec-keygen +OLD_FILES+=usr/sbin/dnssec-revoke +OLD_FILES+=usr/sbin/dnssec-settime +OLD_FILES+=usr/sbin/dnssec-signzone +OLD_FILES+=usr/sbin/genrandom +OLD_FILES+=usr/sbin/isc-hmac-fixup +OLD_FILES+=usr/sbin/lwresd +OLD_FILES+=usr/sbin/named +OLD_FILES+=usr/sbin/named-checkconf +OLD_FILES+=usr/sbin/named-checkzone +OLD_FILES+=usr/sbin/named-compilezone +OLD_FILES+=usr/sbin/named-journalprint +OLD_FILES+=usr/sbin/named.reconfig +OLD_FILES+=usr/sbin/named.reload +OLD_FILES+=usr/sbin/nsec3hash +OLD_FILES+=usr/sbin/rndc +OLD_FILES+=usr/sbin/rndc-confgen +OLD_DIRS+=usr/share/doc/bind9 +OLD_FILES+=usr/share/doc/bind9/CHANGES +OLD_FILES+=usr/share/doc/bind9/COPYRIGHT +OLD_FILES+=usr/share/doc/bind9/FAQ +OLD_FILES+=usr/share/doc/bind9/HISTORY +OLD_FILES+=usr/share/doc/bind9/README +OLD_DIRS+=usr/share/doc/bind9/arm +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch01.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch02.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch03.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch04.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch05.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch06.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch07.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch08.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch09.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch10.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.html +OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.pdf +OLD_FILES+=usr/share/doc/bind9/arm/man.arpaname.html +OLD_FILES+=usr/share/doc/bind9/arm/man.ddns-confgen.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dig.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-dsfromkey.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-keyfromlabel.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-keygen.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-revoke.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-settime.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-signzone.html +OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-verify.html +OLD_FILES+=usr/share/doc/bind9/arm/man.genrandom.html +OLD_FILES+=usr/share/doc/bind9/arm/man.host.html +OLD_FILES+=usr/share/doc/bind9/arm/man.isc-hmac-fixup.html +OLD_FILES+=usr/share/doc/bind9/arm/man.named-checkconf.html +OLD_FILES+=usr/share/doc/bind9/arm/man.named-checkzone.html +OLD_FILES+=usr/share/doc/bind9/arm/man.named-journalprint.html +OLD_FILES+=usr/share/doc/bind9/arm/man.named.html +OLD_FILES+=usr/share/doc/bind9/arm/man.nsec3hash.html +OLD_FILES+=usr/share/doc/bind9/arm/man.nsupdate.html +OLD_FILES+=usr/share/doc/bind9/arm/man.rndc-confgen.html +OLD_FILES+=usr/share/doc/bind9/arm/man.rndc.conf.html +OLD_FILES+=usr/share/doc/bind9/arm/man.rndc.html +OLD_DIRS+=usr/share/doc/bind9/misc +OLD_FILES+=usr/share/doc/bind9/misc/dnssec +OLD_FILES+=usr/share/doc/bind9/misc/format-options.pl +OLD_FILES+=usr/share/doc/bind9/misc/ipv6 +OLD_FILES+=usr/share/doc/bind9/misc/migration +OLD_FILES+=usr/share/doc/bind9/misc/migration-4to9 +OLD_FILES+=usr/share/doc/bind9/misc/options +OLD_FILES+=usr/share/doc/bind9/misc/rfc-compliance +OLD_FILES+=usr/share/doc/bind9/misc/roadmap +OLD_FILES+=usr/share/doc/bind9/misc/sdb +OLD_FILES+=usr/share/doc/bind9/misc/sort-options.pl +OLD_FILES+=usr/share/man/man1/arpaname.1.gz +OLD_FILES+=usr/share/man/man1/dig.1.gz +OLD_FILES+=usr/share/man/man1/nslookup.1.gz +OLD_FILES+=usr/share/man/man1/nsupdate.1.gz +OLD_FILES+=usr/share/man/man3/lwres.3.gz +OLD_FILES+=usr/share/man/man3/lwres_addr_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_add.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_back.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_clear.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_first.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_forward.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_getmem.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint16.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint32.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint8.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_init.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_invalidate.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_putmem.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint16.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint32.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint8.3.gz +OLD_FILES+=usr/share/man/man3/lwres_buffer_subtract.3.gz +OLD_FILES+=usr/share/man/man3/lwres_conf_clear.3.gz +OLD_FILES+=usr/share/man/man3/lwres_conf_get.3.gz +OLD_FILES+=usr/share/man/man3/lwres_conf_init.3.gz +OLD_FILES+=usr/share/man/man3/lwres_conf_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_conf_print.3.gz +OLD_FILES+=usr/share/man/man3/lwres_config.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_allocmem.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_create.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_destroy.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_freemem.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_initserial.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_nextserial.3.gz +OLD_FILES+=usr/share/man/man3/lwres_context_sendrecv.3.gz +OLD_FILES+=usr/share/man/man3/lwres_endhostent.3.gz +OLD_FILES+=usr/share/man/man3/lwres_endhostent_r.3.gz +OLD_FILES+=usr/share/man/man3/lwres_freeaddrinfo.3.gz +OLD_FILES+=usr/share/man/man3/lwres_freehostent.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabn.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gai_strerror.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getaddrinfo.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getaddrsbyname.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostbyaddr.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostbyaddr_r.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostbyname.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostbyname2.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostbyname_r.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostent.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gethostent_r.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getipnode.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getipnodebyaddr.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getipnodebyname.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getnamebyaddr.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getnameinfo.3.gz +OLD_FILES+=usr/share/man/man3/lwres_getrrsetbyname.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnba.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_herror.3.gz +OLD_FILES+=usr/share/man/man3/lwres_hstrerror.3.gz +OLD_FILES+=usr/share/man/man3/lwres_inetntop.3.gz +OLD_FILES+=usr/share/man/man3/lwres_lwpacket_parseheader.3.gz +OLD_FILES+=usr/share/man/man3/lwres_lwpacket_renderheader.3.gz +OLD_FILES+=usr/share/man/man3/lwres_net_ntop.3.gz +OLD_FILES+=usr/share/man/man3/lwres_noop.3.gz +OLD_FILES+=usr/share/man/man3/lwres_nooprequest_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_nooprequest_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_nooprequest_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_noopresponse_free.3.gz +OLD_FILES+=usr/share/man/man3/lwres_noopresponse_parse.3.gz +OLD_FILES+=usr/share/man/man3/lwres_noopresponse_render.3.gz +OLD_FILES+=usr/share/man/man3/lwres_packet.3.gz +OLD_FILES+=usr/share/man/man3/lwres_resutil.3.gz +OLD_FILES+=usr/share/man/man3/lwres_sethostent.3.gz +OLD_FILES+=usr/share/man/man3/lwres_sethostent_r.3.gz +OLD_FILES+=usr/share/man/man3/lwres_string_parse.3.gz +OLD_FILES+=usr/share/man/man5/named.conf.5.gz +OLD_FILES+=usr/share/man/man5/rndc.conf.5.gz +OLD_FILES+=usr/share/man/man8/ddns-confgen.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-dsfromkey.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-keyfromlabel.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-keygen.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-revoke.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-settime.8.gz +OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz +OLD_FILES+=usr/share/man/man8/genrandom.8.gz +OLD_FILES+=usr/share/man/man8/isc-hmac-fixup.8.gz +OLD_FILES+=usr/share/man/man8/lwresd.8.gz +OLD_FILES+=usr/share/man/man8/named-checkconf.8.gz +OLD_FILES+=usr/share/man/man8/named-checkzone.8.gz +OLD_FILES+=usr/share/man/man8/named-compilezone.8.gz +OLD_FILES+=usr/share/man/man8/named-journalprint.8.gz +OLD_FILES+=usr/share/man/man8/named.8.gz +OLD_FILES+=usr/share/man/man8/named.reconfig.8.gz +OLD_FILES+=usr/share/man/man8/named.reload.8.gz +OLD_FILES+=usr/share/man/man8/nsec3hash.8.gz +OLD_FILES+=usr/share/man/man8/rndc-confgen.8.gz +OLD_FILES+=usr/share/man/man8/rndc.8.gz +OLD_DIRS+=var/named/dev +OLD_DIRS+=var/named/etc +OLD_DIRS+=var/named/etc/namedb +OLD_FILES+=var/named/etc/namedb/PROTO.localhost-v6.rev +OLD_FILES+=var/named/etc/namedb/PROTO.localhost.rev +OLD_DIRS+=var/named/etc/namedb/dynamic +OLD_FILES+=var/named/etc/namedb/make-localhost +OLD_DIRS+=var/named/etc/namedb/master +OLD_FILES+=var/named/etc/namedb/master/empty.db +OLD_FILES+=var/named/etc/namedb/master/localhost-forward.db +OLD_FILES+=var/named/etc/namedb/master/localhost-reverse.db +#OLD_FILES+=var/named/etc/namedb/named.conf # intentionally left out +OLD_FILES+=var/named/etc/namedb/named.root +OLD_DIRS+=var/named/etc/namedb/slave +OLD_DIRS+=var/named/var +OLD_DIRS+=var/named/var/dump +OLD_DIRS+=var/named/var/log +OLD_DIRS+=var/named/var/run +OLD_DIRS+=var/named/var/run/named +OLD_DIRS+=var/named/var/stats +OLD_DIRS+=var/run/named # 20130908: libssh becomes private OLD_FILES+=usr/lib/libssh.a OLD_FILES+=usr/lib/libssh.so Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/etc/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -142,12 +142,6 @@ MTREE= BSD.include.dist BSD.root.dist BS .if ${MK_SENDMAIL} != "no" MTREE+= BSD.sendmail.dist .endif -.if ${MK_BIND} != "no" -MTREE+= BIND.chroot.dist -.if ${MK_BIND_LIBS} != "no" -MTREE+= BIND.include.dist -.endif -.endif .if ${MK_DEBUG_FILES} != "no" MTREE+= BSD.debug.dist .endif @@ -242,14 +236,6 @@ distribution: ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR} cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} -.if ${MK_BIND_MTREE} != "no" - if [ ! -e ${DESTDIR}/etc/namedb ]; then \ - ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \ - fi -.endif -.if ${MK_BIND_ETC} != "no" - ${_+_}cd ${.CURDIR}/namedb; ${MAKE} install -.endif .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ @@ -328,12 +314,6 @@ MTREES= mtree/BSD.root.dist / \ .if ${MK_DEBUG_FILES} != "no" MTREES+= mtree/BSD.debug.dist /usr/lib .endif -.if ${MK_BIND_LIBS} != "no" -MTREES+= mtree/BIND.include.dist /usr/include -.endif -.if ${MK_BIND_MTREE} != "no" -MTREES+= mtree/BIND.chroot.dist /var/named -.endif .if ${MK_GROFF} != "no" MTREES+= mtree/BSD.groff.dist /usr .endif Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Mon Sep 30 09:21:17 2013 (r255948) +++ head/etc/mtree/BSD.var.dist Mon Sep 30 17:23:45 2013 (r255949) @@ -63,13 +63,9 @@ .. msgs uname=daemon .. - named - .. preserve .. run - named uname=bind gname=bind - .. ppp gname=network mode=0770 .. wpa_supplicant Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/include/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -149,11 +149,6 @@ compat: mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ -p ${DESTDIR}${INCLUDEDIR} -.if ${MK_BIND_LIBS} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ - -f ${.CURDIR}/../etc/mtree/BIND.include.dist \ - -p ${DESTDIR}${INCLUDEDIR} -.endif copies: .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/lib/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -127,7 +127,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ libyaml \ libz \ ${_atf} \ - ${_bind} \ ${_clang} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) @@ -150,10 +149,6 @@ _atf= atf _libngatm= libngatm .endif -.if ${MK_BIND} != "no" -_bind= bind -.endif - .if ${MK_BLUETOOTH} != "no" _libbluetooth= libbluetooth _libsdp= libsdp Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/release/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -142,8 +142,7 @@ bootonly: packagesystem mkdir -p bootonly cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/bootonly WITHOUT_AMD=1 WITHOUT_AT=1 \ - WITHOUT_BIND_DNSSEC=1 WITHOUT_BIND_ETC=1 WITHOUT_BIND_MTREE=1 \ - WITHOUT_BIND_NAMED=1 WITHOUT_GAMES=1 WITHOUT_GROFF=1 \ + WITHOUT_GAMES=1 WITHOUT_GROFF=1 \ WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \ WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \ WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \ Modified: head/share/doc/Makefile ============================================================================== --- head/share/doc/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/share/doc/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -5,7 +5,6 @@ SUBDIR= ${_IPv6} \ ${_atf} \ - ${_bind9} \ legal \ ${_llvm} \ ${_roffdocs} @@ -14,10 +13,6 @@ SUBDIR= ${_IPv6} \ _atf= atf .endif -.if ${MK_BIND} != "no" -_bind9= bind9 -.endif - .if ${MK_CLANG} != "no" _llvm= llvm .endif Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Sep 30 09:21:17 2013 (r255948) +++ head/share/mk/bsd.libnames.mk Mon Sep 30 17:23:45 2013 (r255949) @@ -19,10 +19,6 @@ LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a -.if ${MK_BIND_LIBS} != "no" -LIBBIND?= ${DESTDIR}${LIBDIR}/libbind.a -LIBBIND9?= ${DESTDIR}${LIBDIR}/libbind9.a -.endif LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a LIBBSDYML?= ${DESTDIR}${LIBDIR}/libbsdyml.a @@ -74,11 +70,6 @@ LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec. .if ${MK_IPX} != "no" LIBIPX?= ${DESTDIR}${LIBDIR}/libipx.a .endif -.if ${MK_BIND_LIBS} != "no" -LIBISC?= ${DESTDIR}${LIBDIR}/libisc.a -LIBISCCC?= ${DESTDIR}${LIBDIR}/libisccc.a -LIBISCCFG?= ${DESTDIR}${LIBDIR}/libisccfg.a -.endif LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a LIBKADM5SRV?= ${DESTDIR}${LIBDIR}/libkadm5srv.a @@ -93,9 +84,6 @@ LIBL?= ${DESTDIR}${LIBDIR}/libl.a LIBLDNS?= ${DESTDIR}${LIBPRIVATEDIR}/libldns.a .endif LIBLN?= "don't use LIBLN, use LIBL" -.if ${MK_BIND} != "no" -LIBLWRES?= ${DESTDIR}${LIBDIR}/liblwres.a -.endif LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR}/libm.a LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Sep 30 09:21:17 2013 (r255948) +++ head/share/mk/bsd.own.mk Mon Sep 30 17:23:45 2013 (r255949) @@ -255,12 +255,6 @@ __DEFAULT_YES_OPTIONS = \ ATM \ AUDIT \ AUTHPF \ - BIND_DNSSEC \ - BIND_ETC \ - BIND_LIBS_LWRES \ - BIND_MTREE \ - BIND_NAMED \ - BIND_UTILS \ BINUTILS \ BLUETOOTH \ BMAKE \ @@ -367,12 +361,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BIND \ - BIND_IDN \ - BIND_LARGE_FILE \ - BIND_LIBS \ - BIND_SIGCHASE \ - BIND_XML \ BSD_GREP \ CLANG_EXTRAS \ CTF \ @@ -503,20 +491,6 @@ MK_${var}:= no MK_LIBTHR:= no .endif -.if ${MK_LIBTHR} == "no" -MK_BIND:= no -.endif - -.if ${MK_BIND} == "no" -MK_BIND_DNSSEC:= no -MK_BIND_ETC:= no -MK_BIND_LIBS:= no -MK_BIND_LIBS_LWRES:= no -MK_BIND_MTREE:= no -MK_BIND_NAMED:= no -MK_BIND_UTILS:= no -.endif - .if ${MK_ICONV} == "no" MK_LIBICONV_COMPAT:= no .endif @@ -526,14 +500,6 @@ MK_LDNS_UTILS:= no MK_UNBOUND:= no .endif -.if ${MK_LDNS_UTILS} != "no" -MK_BIND_UTILS:= no -.endif - -.if ${MK_BIND_MTREE} == "no" -MK_BIND_ETC:= no -.endif - .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Sep 30 09:21:17 2013 (r255948) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Sep 30 17:23:45 2013 (r255949) @@ -211,254 +211,6 @@ OLD_FILES+=usr/share/man/man8/authpf.8.g OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz .endif -.if ${MK_BIND} == no -OLD_FILES+=etc/periodic/daily/470.status-named -OLD_FILES+=usr/bin/dig -OLD_FILES+=usr/bin/nslookup -OLD_FILES+=usr/bin/nsupdate -OLD_FILES+=usr/include/lwres/context.h -OLD_FILES+=usr/include/lwres/int.h -OLD_FILES+=usr/include/lwres/ipv6.h -OLD_FILES+=usr/include/lwres/lang.h -OLD_FILES+=usr/include/lwres/list.h -OLD_FILES+=usr/include/lwres/lwbuffer.h -OLD_FILES+=usr/include/lwres/lwpacket.h -OLD_FILES+=usr/include/lwres/lwres.h -OLD_FILES+=usr/include/lwres/result.h -OLD_FILES+=usr/include/lwres/version.h -OLD_FILES+=usr/include/lwres/net.h -OLD_FILES+=usr/include/lwres/netdb.h -OLD_FILES+=usr/include/lwres/platform.h -OLD_DIRS+=usr/include/lwres -OLD_FILES+=usr/lib/liblwres.a -OLD_FILES+=usr/lib/liblwres_p.a -OLD_LIBS+=usr/lib/liblwres.so.50 -OLD_FILES+=usr/lib/liblwres.so -OLD_FILES+=usr/sbin/arpaname -OLD_FILES+=usr/sbin/ddns-confgen -OLD_FILES+=usr/sbin/genrandom -OLD_FILES+=usr/sbin/isc-hmac-fixup -OLD_FILES+=usr/sbin/nsec3hash -OLD_FILES+=usr/sbin/named -OLD_FILES+=usr/sbin/lwresd -OLD_FILES+=usr/sbin/named-checkconf -OLD_FILES+=usr/sbin/named-checkzone -OLD_FILES+=usr/sbin/named-compilezone -OLD_FILES+=usr/sbin/named-journalprint -OLD_FILES+=usr/sbin/named.reload -OLD_FILES+=usr/sbin/named.reconfig -OLD_FILES+=usr/sbin/rndc -OLD_FILES+=usr/sbin/rndc-confgen -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch01.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch02.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch03.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch04.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch05.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch06.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch07.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch08.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch09.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.ch10.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.html -OLD_FILES+=usr/share/doc/bind9/arm/Bv9ARM.pdf -OLD_FILES+=usr/share/doc/bind9/arm/man.arpaname.html -OLD_FILES+=usr/share/doc/bind9/arm/man.ddns-confgen.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dig.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-dsfromkey.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-keyfromlabel.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-keygen.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-revoke.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-settime.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-signzone.html -OLD_FILES+=usr/share/doc/bind9/arm/man.dnssec-verify.html -OLD_FILES+=usr/share/doc/bind9/arm/man.genrandom.html -OLD_FILES+=usr/share/doc/bind9/arm/man.host.html -OLD_FILES+=usr/share/doc/bind9/arm/man.isc-hmac-fixup.html -OLD_FILES+=usr/share/doc/bind9/arm/man.named-checkconf.html -OLD_FILES+=usr/share/doc/bind9/arm/man.named-checkzone.html -OLD_FILES+=usr/share/doc/bind9/arm/man.named-journalprint.html -OLD_FILES+=usr/share/doc/bind9/arm/man.named.html -OLD_FILES+=usr/share/doc/bind9/arm/man.nsec3hash.html -OLD_FILES+=usr/share/doc/bind9/arm/man.nsupdate.html -OLD_FILES+=usr/share/doc/bind9/arm/man.rndc-confgen.html -OLD_FILES+=usr/share/doc/bind9/arm/man.rndc.conf.html -OLD_FILES+=usr/share/doc/bind9/arm/man.rndc.html -OLD_DIRS+=usr/share/doc/bind9/arm -OLD_FILES+=usr/share/doc/bind9/misc -OLD_FILES+=usr/share/doc/bind9/misc/dnssec -OLD_FILES+=usr/share/doc/bind9/misc/format-options.pl -OLD_FILES+=usr/share/doc/bind9/misc/ipv6 -OLD_FILES+=usr/share/doc/bind9/misc/migration -OLD_FILES+=usr/share/doc/bind9/misc/migration-4to9 -OLD_FILES+=usr/share/doc/bind9/misc/options -OLD_FILES+=usr/share/doc/bind9/misc/rfc-compliance -OLD_FILES+=usr/share/doc/bind9/misc/roadmap -OLD_FILES+=usr/share/doc/bind9/misc/sdb -OLD_FILES+=usr/share/doc/bind9/misc/sort-options.pl -OLD_DIRS+=usr/share/doc/bind9/misc -OLD_DIRS+=usr/share/doc/bind9 -OLD_FILES+=usr/share/doc/bind9/CHANGES -OLD_FILES+=usr/share/doc/bind9/COPYRIGHT -OLD_FILES+=usr/share/doc/bind9/FAQ -OLD_FILES+=usr/share/doc/bind9/HISTORY -OLD_FILES+=usr/share/doc/bind9/README -OLD_FILES+=usr/share/man/man1/arpaname.1.gz -OLD_FILES+=usr/share/man/man1/dig.1.gz -OLD_FILES+=usr/share/man/man1/nslookup.1.gz -OLD_FILES+=usr/share/man/man1/nsupdate.1.gz -OLD_FILES+=usr/share/man/man3/lwres.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer.3.gz -OLD_FILES+=usr/share/man/man3/lwres_config.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabn.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gai_strerror.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getaddrinfo.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostent.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getipnode.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getnameinfo.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getrrsetbyname.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnba.3.gz -OLD_FILES+=usr/share/man/man3/lwres_inetntop.3.gz -OLD_FILES+=usr/share/man/man3/lwres_hstrerror.3.gz -OLD_FILES+=usr/share/man/man3/lwres_noop.3.gz -OLD_FILES+=usr/share/man/man3/lwres_packet.3.gz -OLD_FILES+=usr/share/man/man3/lwres_resutil.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_add.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_back.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_clear.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_first.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_forward.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_getmem.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint16.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint32.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_getuint8.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_init.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_invalidate.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_putmem.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint16.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint32.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_putuint8.3.gz -OLD_FILES+=usr/share/man/man3/lwres_buffer_subtract.3.gz -OLD_FILES+=usr/share/man/man3/lwres_conf_clear.3.gz -OLD_FILES+=usr/share/man/man3/lwres_conf_get.3.gz -OLD_FILES+=usr/share/man/man3/lwres_conf_init.3.gz -OLD_FILES+=usr/share/man/man3/lwres_conf_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_conf_print.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_allocmem.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_create.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_destroy.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_freemem.3.gz -OLD_FILES+=usr/share/man/man3/lwres_freeaddrinfo.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_initserial.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_nextserial.3.gz -OLD_FILES+=usr/share/man/man3/lwres_context_sendrecv.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnrequest_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gabnresponse_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_endhostent.3.gz -OLD_FILES+=usr/share/man/man3/lwres_endhostent_r.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostbyaddr.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostbyaddr_r.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostbyname.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostbyname2.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostbyname_r.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gethostent_r.3.gz -OLD_FILES+=usr/share/man/man3/lwres_sethostent.3.gz -OLD_FILES+=usr/share/man/man3/lwres_sethostent_r.3.gz -OLD_FILES+=usr/share/man/man3/lwres_freehostent.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getipnodebyaddr.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getipnodebyname.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbarequest_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_gnbaresponse_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_herror.3.gz -OLD_FILES+=usr/share/man/man3/lwres_net_ntop.3.gz -OLD_FILES+=usr/share/man/man3/lwres_nooprequest_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_nooprequest_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_nooprequest_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_noopresponse_free.3.gz -OLD_FILES+=usr/share/man/man3/lwres_noopresponse_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_noopresponse_render.3.gz -OLD_FILES+=usr/share/man/man3/lwres_lwpacket_parseheader.3.gz -OLD_FILES+=usr/share/man/man3/lwres_lwpacket_renderheader.3.gz -OLD_FILES+=usr/share/man/man3/lwres_addr_parse.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getaddrsbyname.3.gz -OLD_FILES+=usr/share/man/man3/lwres_getnamebyaddr.3.gz -OLD_FILES+=usr/share/man/man3/lwres_string_parse.3.gz -OLD_FILES+=usr/share/man/man5/named.conf.5.gz -OLD_FILES+=usr/share/man/man5/rndc.conf.5.gz -OLD_FILES+=usr/share/man/man8/ddns-confgen.8.gz -OLD_FILES+=usr/share/man/man8/genrandom.8.gz -OLD_FILES+=usr/share/man/man8/isc-hmac-fixup.8.gz -OLD_FILES+=usr/share/man/man8/named-checkconf.8.gz -OLD_FILES+=usr/share/man/man8/named-checkzone.8.gz -OLD_FILES+=usr/share/man/man8/named-compilezone.8.gz -OLD_FILES+=usr/share/man/man8/named-journalprint.8.gz -OLD_FILES+=usr/share/man/man8/named.reload.8.gz -OLD_FILES+=usr/share/man/man8/named.reconfig.8.gz -OLD_FILES+=usr/share/man/man8/named.8.gz -OLD_FILES+=usr/share/man/man8/nsec3hash.8.gz -OLD_FILES+=usr/share/man/man8/lwresd.8.gz -OLD_FILES+=usr/share/man/man8/rndc.8.gz -OLD_FILES+=usr/share/man/man8/rndc-confgen.8.gz -OLD_DIRS+=var/named/dev -OLD_DIRS+=var/named/var/stats -OLD_DIRS+=var/named/var/run/named -OLD_DIRS+=var/named/var/run -OLD_DIRS+=var/named/var/log -OLD_DIRS+=var/named/var/dump -OLD_DIRS+=var/named/var -.endif - -.if ${MK_BIND_DNSSEC} == no || ${MK_BIND} == no -OLD_FILES+=usr/sbin/dnssec-dsfromkey -OLD_FILES+=usr/sbin/dnssec-keyfromlabel -OLD_FILES+=usr/sbin/dnssec-keygen -OLD_FILES+=usr/sbin/dnssec-revoke -OLD_FILES+=usr/sbin/dnssec-settime -OLD_FILES+=usr/sbin/dnssec-signzone -OLD_FILES+=usr/share/man/man8/dnssec-dsfromkey.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-keyfromlabel.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-keygen.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-revoke.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-settime.8.gz -OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz -.endif - -.if ${MK_BIND_ETC} == no || ${MK_BIND} == no -OLD_FILES+=var/named/etc/namedb/PROTO.localhost-v6.rev -OLD_FILES+=var/named/etc/namedb/PROTO.localhost.rev -OLD_FILES+=var/named/etc/namedb/make-localhost -#OLD_FILES+=var/named/etc/namedb/named.conf # intentionally left out -OLD_FILES+=var/named/etc/namedb/named.root -OLD_FILES+=var/named/etc/namedb/master/empty.db -OLD_FILES+=var/named/etc/namedb/master/localhost-forward.db -OLD_FILES+=var/named/etc/namedb/master/localhost-reverse.db -OLD_DIRS+=var/named/etc/namedb/slave -OLD_DIRS+=var/named/etc/namedb/master -OLD_DIRS+=var/named/etc/namedb/dynamic -#OLD_DIRS+=var/named/etc/namedb -#OLD_DIRS+=var/named/etc -.endif - -#.if ${MK_BIND_LIBS} == no || ${MK_BIND} == no -# to be filled in and removed above -#.endif - -#.if ${MK_BIND_LIBS_LWRES} == no || ${MK_BIND} == no -# to be filled in and removed above -#.endif - -#.if ${MK_BIND_NAMED} == no || ${MK_BIND} == no -# to be filled in and removed above -#.endif - .if ${MK_BLUETOOTH} == no OLD_FILES+=etc/bluetooth/hcsecd.conf OLD_FILES+=etc/bluetooth/hosts @@ -3452,11 +3204,9 @@ OLD_FILES+=usr/lib32/private/libldns_p.a .if ${MK_LDNS_UTILS} == no OLD_FILES+=usr/bin/drill OLD_FILES+=usr/share/man/man1/drill.1.gz -.if ${MK_BIND} == no OLD_FILES+=usr/bin/host OLD_FILES+=usr/share/man/man1/host.1.gz .endif -.endif #.if ${MK_LIB32} == no # to be filled in Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/usr.bin/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -218,13 +218,6 @@ _atf= atf SUBDIR+= atm .endif -.if ${MK_BIND_UTILS} != "no" -SUBDIR+= dig -SUBDIR+= host -SUBDIR+= nslookup -SUBDIR+= nsupdate -.endif - .if ${MK_BLUETOOTH} != "no" SUBDIR+= bluetooth .endif Modified: head/usr.bin/host/Makefile ============================================================================== --- head/usr.bin/host/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/usr.bin/host/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -.if ${MK_LDNS_UTILS} != "no" - LDNSDIR= ${.CURDIR}/../../contrib/ldns LDNSHOSTDIR= ${.CURDIR}/../../contrib/ldns-host @@ -22,28 +18,4 @@ DPADD+= ${LIBLDNS} ${LIBCRYPTO} LDADD+= -lldns -lcrypto USEPRIVATELIB= ldns -.else - -BIND_DIR= ${.CURDIR}/../../contrib/bind9 -LIB_BIND_REL= ../../lib/bind -LIB_BIND_DIR= ${.CURDIR}/${LIB_BIND_REL} -SRCDIR= ${BIND_DIR}/bin/dig - -.include "${LIB_BIND_DIR}/config.mk" - -PROG= host - -.PATH: ${SRCDIR} -SRCS+= dighost.c host.c - -CFLAGS+= -I${SRCDIR}/include -CFLAGS+= -I${BIND_DIR}/lib/isc/${ISC_ATOMIC_ARCH}/include - -WARNS?= 0 - -DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD} -LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD} - -.endif - .include Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Sep 30 09:21:17 2013 (r255948) +++ head/usr.sbin/Makefile Mon Sep 30 17:23:45 2013 (r255949) @@ -124,29 +124,6 @@ SUBDIR+= praudit SUBDIR+= authpf .endif -.if ${MK_BIND_DNSSEC} != "no" && ${MK_OPENSSL} != "no" -SUBDIR+= dnssec-dsfromkey -SUBDIR+= dnssec-keyfromlabel -SUBDIR+= dnssec-keygen -SUBDIR+= dnssec-revoke -SUBDIR+= dnssec-settime -SUBDIR+= dnssec-signzone -SUBDIR+= dnssec-verify -.endif -.if ${MK_BIND_NAMED} != "no" -SUBDIR+= arpaname -SUBDIR+= ddns-confgen -SUBDIR+= genrandom -SUBDIR+= isc-hmac-fixup -SUBDIR+= named -SUBDIR+= named-checkconf -SUBDIR+= named-checkzone -SUBDIR+= named-journalprint -SUBDIR+= nsec3hash -SUBDIR+= rndc -SUBDIR+= rndc-confgen -.endif - .if ${MK_BLUETOOTH} != "no" SUBDIR+= bluetooth .endif From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:35:48 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id D3E53CBF; Mon, 30 Sep 2013 17:35:48 +0000 (UTC) (envelope-from jmg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5FC3275C; Mon, 30 Sep 2013 17:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UHZmHi014698; Mon, 30 Sep 2013 17:35:48 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UHZmp5014697; Mon, 30 Sep 2013 17:35:48 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201309301735.r8UHZmp5014697@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 30 Sep 2013 17:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r255950 - stable/8/sys/fs/cd9660 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:35:48 -0000 Author: jmg Date: Mon Sep 30 17:35:48 2013 New Revision: 255950 URL: http://svnweb.freebsd.org/changeset/base/255950 Log: MFC: r255866, r255867 fix a bug where we access a bread buffer after we have brelse'd it... The kernel normally didn't unmap/context switch away before we accessed the buffer most of the time, but under heavy I/O pressure and lots of mount/unmounting this would cause a fault on nofault panic... NULL stale pointers (should be a no-op as they should no longer be used)... Modified: stable/8/sys/fs/cd9660/cd9660_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/8/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:23:45 2013 (r255949) +++ stable/8/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:35:48 2013 (r255950) @@ -369,6 +369,9 @@ iso_mountfs(devvp, mp) pribp->b_flags |= B_AGE; brelse(pribp); pribp = NULL; + rootp = NULL; + pri = NULL; + pri_sierra = NULL; mp->mnt_data = isomp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); @@ -391,11 +394,11 @@ iso_mountfs(devvp, mp) /* Check the Rock Ridge Extension support */ if (!(isomp->im_flags & ISOFSMNT_NORRIP)) { - if ((error = bread(isomp->im_devvp, - (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << - (isomp->im_bshift - DEV_BSHIFT), - isomp->logical_block_size, NOCRED, &bp)) != 0) - goto out; + if ((error = bread(isomp->im_devvp, (isomp->root_extent + + isonum_711(((struct iso_directory_record *)isomp->root)-> + ext_attr_length)) << (isomp->im_bshift - DEV_BSHIFT), + isomp->logical_block_size, NOCRED, &bp)) != 0) + goto out; rootp = (struct iso_directory_record *)bp->b_data; @@ -412,6 +415,7 @@ iso_mountfs(devvp, mp) bp->b_flags |= B_AGE; brelse(bp); bp = NULL; + rootp = NULL; } if (isomp->im_flags & ISOFSMNT_KICONV && cd9660_iconv) { @@ -466,6 +470,7 @@ iso_mountfs(devvp, mp) if (supbp) { brelse(supbp); supbp = NULL; + sup = NULL; } return 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:40:40 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 4670BE74; Mon, 30 Sep 2013 17:40:40 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33A6F27B1; Mon, 30 Sep 2013 17:40:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UHeeo2017500; Mon, 30 Sep 2013 17:40:40 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UHeeul017442; Mon, 30 Sep 2013 17:40:40 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309301740.r8UHeeul017442@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 30 Sep 2013 17:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255951 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:40:40 -0000 Author: des Date: Mon Sep 30 17:40:39 2013 New Revision: 255951 URL: http://svnweb.freebsd.org/changeset/base/255951 Log: Regenerate. Approved by: re (gjb) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Sep 30 17:35:48 2013 (r255950) +++ head/share/man/man5/src.conf.5 Mon Sep 30 17:40:39 2013 (r255951) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z bapt .\" $FreeBSD$ -.Dd September 24, 2013 +.Dd September 30, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -127,50 +127,6 @@ Set to not build audit support into syst .\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . -.It Va WITH_BIND -.\" from FreeBSD: head/tools/build/options/WITH_BIND 255850 2013-09-24 14:33:31Z des -Setting this variable will enable BIND. -When set, the following options are also in effect: -.Pp -.Bl -inset -compact -.It Va WITH_BIND_DNSSEC -(unless -.Va WITHOUT_BIND_DNSSEC -is set explicitly) -.It Va WITH_BIND_ETC -(unless -.Va WITHOUT_BIND_ETC -is set explicitly) -.It Va WITH_BIND_LIBS_LWRES -(unless -.Va WITHOUT_BIND_LIBS_LWRES -is set explicitly) -.It Va WITH_BIND_MTREE -(unless -.Va WITHOUT_BIND_MTREE -is set explicitly) -.It Va WITH_BIND_NAMED -(unless -.Va WITHOUT_BIND_NAMED -is set explicitly) -.El -.It Va WITH_BIND_IDN -.\" from FreeBSD: head/tools/build/options/WITH_BIND_IDN 193280 2009-06-01 21:58:59Z dougb -Set to enable IDN support for dig, host, and nslookup. -This requires ports/dns/idnkit to be installed in /usr/local. -.It Va WITH_BIND_LARGE_FILE -.\" from FreeBSD: head/tools/build/options/WITH_BIND_LARGE_FILE 193280 2009-06-01 21:58:59Z dougb -Set to enable 64-bit file support. -.It Va WITH_BIND_LIBS -.\" from FreeBSD: head/tools/build/options/WITH_BIND_LIBS 193280 2009-06-01 21:58:59Z dougb -Set to install BIND libraries and include files. -.It Va WITH_BIND_SIGCHASE -.\" from FreeBSD: head/tools/build/options/WITH_BIND_SIGCHASE 193280 2009-06-01 21:58:59Z dougb -Set to enable DNSSEC validation support for dig, host, and nslookup. -.It Va WITH_BIND_XML -.\" from FreeBSD: head/tools/build/options/WITH_BIND_XML 193280 2009-06-01 21:58:59Z dougb -Set to enable the http statistics interface for named. -This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BINUTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 235342 2012-05-12 16:12:36Z gjb Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, @@ -698,20 +654,6 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITHOUT_BIND -.It -.Va WITHOUT_BIND_DNSSEC -.It -.Va WITHOUT_BIND_ETC -.It -.Va WITHOUT_BIND_LIBS -.It -.Va WITHOUT_BIND_LIBS_LWRES -.It -.Va WITHOUT_BIND_MTREE -.It -.Va WITHOUT_BIND_NAMED -.It .Va WITHOUT_LIBTHR .El .It Va WITHOUT_LIBTHR @@ -720,24 +662,6 @@ Set to not build the .Nm libthr (1:1 threading) library. -When set, it also enforces the following options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_BIND -.It -.Va WITHOUT_BIND_DNSSEC -.It -.Va WITHOUT_BIND_ETC -.It -.Va WITHOUT_BIND_LIBS -.It -.Va WITHOUT_BIND_LIBS_LWRES -.It -.Va WITHOUT_BIND_MTREE -.It -.Va WITHOUT_BIND_NAMED -.El .It Va WITH_LLDB .\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste Set to build the LLDB debugger. From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:48:24 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 7AE2C163; Mon, 30 Sep 2013 17:48:24 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from ns1.jnielsen.net (secure.freebsdsolutions.net [69.55.234.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF8E427FD; Mon, 30 Sep 2013 17:48:23 +0000 (UTC) Received: from [10.10.1.32] (office.betterlinux.com [199.58.199.60]) (authenticated bits=0) by ns1.jnielsen.net (8.14.4/8.14.4) with ESMTP id r8UHmFVk047438 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 30 Sep 2013 13:48:15 -0400 (EDT) (envelope-from lists@jnielsen.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r255949 - in head: . contrib/bind9 etc etc/mtree include lib lib/bind release share/doc share/doc/bind9 share/mk tools/build/mk tools/build/options usr.bin usr.bin/host usr.bin/nslookup... From: John Nielsen In-Reply-To: <201309301723.r8UHNj8m008620@svn.freebsd.org> Date: Mon, 30 Sep 2013 11:48:23 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <77EB4066-70F9-4D4C-9ACE-CA9B45A5342F@jnielsen.net> References: <201309301723.r8UHNj8m008620@svn.freebsd.org> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1510) X-DCC-sonic.net-Metrics: ns1.jnielsen.net 1156; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: clamav-milter 0.97.8 at ns1.jnielsen.net X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:48:24 -0000 On Sep 30, 2013, at 11:23 AM, Dag-Erling Sm=F8rgrav = wrote: > Author: des > Date: Mon Sep 30 17:23:45 2013 > New Revision: 255949 > URL: http://svnweb.freebsd.org/changeset/base/255949 >=20 > Log: > Remove BIND. >=20 > Approved by: re (gjb) Thanks for all your work around this. Are you planning to add a note to = UPDATING with a heads-up and some hints on how to transition from = BIND-in-base to one of either unbound-in-base or BIND-from-ports? The = same info should also appear prominently in the release notes. JN From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:53:15 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C66F153C; Mon, 30 Sep 2013 17:53:15 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 882F22889; Mon, 30 Sep 2013 17:53:15 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 6396D65DE; Mon, 30 Sep 2013 17:53:08 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 2019C51C32; Mon, 30 Sep 2013 19:53:09 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org Subject: Re: svn commit: r255951 - head/share/man/man5 References: <201309301740.r8UHeeul017442@svn.freebsd.org> Date: Mon, 30 Sep 2013 19:53:09 +0200 In-Reply-To: <201309301740.r8UHeeul017442@svn.freebsd.org> (Dag-Erling SmXXrgrav's message of "Mon, 30 Sep 2013 17:40:40 +0000 (UTC)") Message-ID: <86had25h8a.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:53:15 -0000 Dag-Erling SmXXrgrav writes: > Log: > Regenerate. >=20=20=20 > Approved by: re (gjb) > > Modified: > head/share/man/man5/src.conf.5 Note that I intentionally left out the toolchain-related changes that somebody[tm] forgot to commit earlier. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:57:23 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 5F20B8A1; Mon, 30 Sep 2013 17:57:23 +0000 (UTC) (envelope-from jmg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3247F28C3; Mon, 30 Sep 2013 17:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UHvNSs025530; Mon, 30 Sep 2013 17:57:23 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UHvNki025529; Mon, 30 Sep 2013 17:57:23 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201309301757.r8UHvNki025529@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 30 Sep 2013 17:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255952 - stable/9/sys/fs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:57:23 -0000 Author: jmg Date: Mon Sep 30 17:57:22 2013 New Revision: 255952 URL: http://svnweb.freebsd.org/changeset/base/255952 Log: MFC: r255866, r255867 fix a bug where we access a bread buffer after we have brelse'd it... The kernel normally didn't unmap/context switch away before we accessed the buffer most of the time, but under heavy I/O pressure and lots of mount/unmounting this would cause a fault on nofault panic... NULL stale pointers (should be a no-op as they should no longer be used)... Modified: stable/9/sys/fs/cd9660/cd9660_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/9/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:40:39 2013 (r255951) +++ stable/9/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:57:22 2013 (r255952) @@ -369,6 +369,9 @@ iso_mountfs(devvp, mp) pribp->b_flags |= B_AGE; brelse(pribp); pribp = NULL; + rootp = NULL; + pri = NULL; + pri_sierra = NULL; mp->mnt_data = isomp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); @@ -391,11 +394,11 @@ iso_mountfs(devvp, mp) /* Check the Rock Ridge Extension support */ if (!(isomp->im_flags & ISOFSMNT_NORRIP)) { - if ((error = bread(isomp->im_devvp, - (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << - (isomp->im_bshift - DEV_BSHIFT), - isomp->logical_block_size, NOCRED, &bp)) != 0) - goto out; + if ((error = bread(isomp->im_devvp, (isomp->root_extent + + isonum_711(((struct iso_directory_record *)isomp->root)-> + ext_attr_length)) << (isomp->im_bshift - DEV_BSHIFT), + isomp->logical_block_size, NOCRED, &bp)) != 0) + goto out; rootp = (struct iso_directory_record *)bp->b_data; @@ -412,6 +415,7 @@ iso_mountfs(devvp, mp) bp->b_flags |= B_AGE; brelse(bp); bp = NULL; + rootp = NULL; } if (isomp->im_flags & ISOFSMNT_KICONV && cd9660_iconv) { @@ -466,6 +470,7 @@ iso_mountfs(devvp, mp) if (supbp) { brelse(supbp); supbp = NULL; + sup = NULL; } return 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 17:58:59 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8907EB28; Mon, 30 Sep 2013 17:58:59 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 48BD428E1; Mon, 30 Sep 2013 17:58:59 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A08076603; Mon, 30 Sep 2013 17:58:58 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 63B4051C3E; Mon, 30 Sep 2013 19:58:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Nielsen Subject: Re: svn commit: r255949 - in head: . contrib/bind9 etc etc/mtree include lib lib/bind release share/doc share/doc/bind9 share/mk tools/build/mk tools/build/options usr.bin usr.bin/host usr.bin/nslookup... References: <201309301723.r8UHNj8m008620@svn.freebsd.org> <77EB4066-70F9-4D4C-9ACE-CA9B45A5342F@jnielsen.net> Date: Mon, 30 Sep 2013 19:58:59 +0200 In-Reply-To: <77EB4066-70F9-4D4C-9ACE-CA9B45A5342F@jnielsen.net> (John Nielsen's message of "Mon, 30 Sep 2013 11:48:23 -0600") Message-ID: <868uye5gyk.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:58:59 -0000 John Nielsen writes: > Thanks for all your work around this. Are you planning to add a note > to UPDATING with a heads-up and some hints on how to transition from > BIND-in-base to one of either unbound-in-base or BIND-from-ports? The > same info should also appear prominently in the release notes. Sure, thanks for the reminder. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 18:00:55 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 9CCD4CB7; Mon, 30 Sep 2013 18:00:55 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 712BE2924; Mon, 30 Sep 2013 18:00:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UI0tIo028872; Mon, 30 Sep 2013 18:00:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UI0trq028871; Mon, 30 Sep 2013 18:00:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309301800.r8UI0trq028871@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 30 Sep 2013 18:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255953 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 18:00:55 -0000 Author: des Date: Mon Sep 30 18:00:54 2013 New Revision: 255953 URL: http://svnweb.freebsd.org/changeset/base/255953 Log: Remove /usr/include/lwres Approved by: re (gjb) Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Mon Sep 30 17:57:22 2013 (r255952) +++ head/etc/mtree/BSD.include.dist Mon Sep 30 18:00:54 2013 (r255953) @@ -249,8 +249,6 @@ .. libmilter .. - lwres - .. lzma .. machine From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 18:06:44 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 5DA141A3; Mon, 30 Sep 2013 18:06:44 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6692A04; Mon, 30 Sep 2013 18:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UI6i6G031525; Mon, 30 Sep 2013 18:06:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UI6iWv031524; Mon, 30 Sep 2013 18:06:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309301806.r8UI6iWv031524@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 30 Sep 2013 18:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255954 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 18:06:44 -0000 Author: des Date: Mon Sep 30 18:06:43 2013 New Revision: 255954 URL: http://svnweb.freebsd.org/changeset/base/255954 Log: Note the removal of BIND, where to find it, and how to use local_unbound instead. Approved by: re (gjb) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 30 18:00:54 2013 (r255953) +++ head/UPDATING Mon Sep 30 18:06:43 2013 (r255954) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130930: + BIND has been removed from the base system. If all you need + is a local resolver, simply enable and start the local_unbound + service instead. Otherwise, several versions of BIND are + available in the ports tree. + 20130916: With the addition of unbound(8), a new unbound user is now required during installworld. "mergemaster -p" can be used to From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 20:33:56 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E1B24B38; Mon, 30 Sep 2013 20:33:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CED9F2341; Mon, 30 Sep 2013 20:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UKXuRm017130; Mon, 30 Sep 2013 20:33:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UKXue6017129; Mon, 30 Sep 2013 20:33:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201309302033.r8UKXue6017129@svn.freebsd.org> From: Xin LI Date: Mon, 30 Sep 2013 20:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255955 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 20:33:57 -0000 Author: delphij Date: Mon Sep 30 20:33:56 2013 New Revision: 255955 URL: http://svnweb.freebsd.org/changeset/base/255955 Log: Reverse directories order when doing 'make delete-old-dir'. This ensures subdirectories gets removed before their parents when doing make delete-old. Approved by: re (gjb) MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Sep 30 18:06:43 2013 (r255954) +++ head/Makefile.inc1 Mon Sep 30 20:33:56 2013 (r255955) @@ -1673,7 +1673,7 @@ delete-old-files: # the Makefile parser segfault. @exec 3<&0; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ + -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort -r | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 20:49:11 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 213775CC; Mon, 30 Sep 2013 20:49:11 +0000 (UTC) (envelope-from rene@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9087243C; Mon, 30 Sep 2013 20:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UKnACE024914; Mon, 30 Sep 2013 20:49:10 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UKnAXY024913; Mon, 30 Sep 2013 20:49:10 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201309302049.r8UKnAXY024913@svn.freebsd.org> From: Rene Ladan Date: Mon, 30 Sep 2013 20:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255956 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 20:49:11 -0000 Author: rene (doc,ports committer) Date: Mon Sep 30 20:49:10 2013 New Revision: 255956 URL: http://svnweb.freebsd.org/changeset/base/255956 Log: Update the Dutch calendar entries: - prince Johan Friso passed away in 2013 - correct status of queen Maxima and crown princess Catharina-Amalia - language fixes Approved by: remko (mentor) Approved by: re (gjb) MFC after: 3 days Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Mon Sep 30 20:33:56 2013 (r255955) +++ head/usr.bin/calendar/calendars/calendar.dutch Mon Sep 30 20:49:10 2013 (r255956) @@ -22,11 +22,11 @@ nov/01 Allerheiligen nov/02 Allerzielen nov/11 Sint Maarten nov/11 Elfde-van-de-elfde -dec/05 Sinterklaas avond +dec/05 Sinterklaasavond dec/15 Koninkrijksdag dec/24 Kerstavond -dec/25 Eerste kerstdag -dec/26 Tweede kerstdag +dec/25 Eerste Kerstdag +dec/26 Tweede Kerstdag dec/28 Feest der Onnozele Kinderen dec/31 Oudjaar @@ -40,10 +40,10 @@ Pasen-47 Carnaval (Vastenavond) Pasen-46 Aswoensdag Pasen-7 Palmzondag Pasen-3 Witte Donderdag -Pasen-2 Goede vrijdag -Pasen-1 Stille zaterdag -Pasen Eerste paasdag -Pasen+1 Tweede paasdag +Pasen-2 Goede Vrijdag +Pasen-1 Stille Zaterdag +Pasen Eerste Paasdag +Pasen+1 Tweede Paasdag Pasen+39 Hemelvaartsdag Pasen+49 Eerste Pinksterdag Pasen+50 Tweede Pinksterdag @@ -65,15 +65,15 @@ feb/17 Prins Willem III (1817 - 1890) feb/18 Prinses Christina (1947) apr/10 Prinses Ariane (2007) apr/19 Prins Hendrik (1876 - 1934) -apr/27 Koning Willem Alexander (1967) +apr/27 Koning Willem-Alexander (1967) apr/30 Prinses Juliana (1909 - 2004) apr/30 Mr. Pieter van Vollenhoven (1939) -mei/17 Prinses Maxima (1971) +mei/17 Koningin Maxima (1971) jun/26 Prinses Alexia (2005) jun/29 Prins Bernhard (1911 - 2004) aug/05 Prinses Irene (1939) aug/31 Prinses Wilhelmina (1880 - 1962) sep/06 Prins Claus (1925 - 2002) -sep/25 Prins Johan Friso (1968) +sep/25 Prins Johan Friso (1968 - 2013) okt/11 Prins Constantijn (1969) -dec/07 Prinses Catharina-Amalia (2003) +dec/07 Kroonprinses Catharina-Amalia (2003) From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 21:00:12 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8C4D4D40; Mon, 30 Sep 2013 21:00:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A9C8253A; Mon, 30 Sep 2013 21:00:12 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::a9cb:6a3f:5290:e31d] (unknown [IPv6:2001:7b8:3a7:0:a9cb:6a3f:5290:e31d]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 532A45C44; Mon, 30 Sep 2013 23:00:07 +0200 (CEST) From: Dimitry Andric Content-Type: multipart/signed; boundary="Apple-Mail=_0239F370-613E-4E66-A73E-9850C6252918"; protocol="application/pgp-signature"; micalg=pgp-sha1 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r255931 - head/contrib/binutils/bfd Date: Mon, 30 Sep 2013 22:59:54 +0200 References: <201309282303.r8SN3foW022674@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201309282303.r8SN3foW022674@svn.freebsd.org> X-Mailer: Apple Mail (2.1510) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 21:00:12 -0000 --Apple-Mail=_0239F370-613E-4E66-A73E-9850C6252918 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Sep 29, 2013, at 01:03, Dimitry Andric wrote: > Author: dim > Date: Sat Sep 28 23:03:40 2013 > New Revision: 255931 > URL: http://svnweb.freebsd.org/changeset/base/255931 >=20 > Log: > Fix a bug in ld, where indirect symbols are not handled properly = during > linking of a shared library, leading to corrupt indexes in the = dynamic > symbol table. This should fix the multimedia/ffmpegthumbnailer port. The reason for this commit is an unfortunate interaction between our base ld (which is at 2.17.50, quite ancient), and ports ld (2.23.2). The latter version can put versioned symbols into an .so file in a way that is not handled by the former version, leading to corrupt symbol table entries. Here is an example, derived from the original problem Steve Wills reported. Suppose we are building a libavcodec.so, which uses versioned symbols, and it assigns those versions to *all* its symbols, using the following version script: $ cat libavcodec.ver LIBAVCODEC_52 { global: *; }; Next we link some empty object file (the contents do not matter) into libavcodec.so, using the version script, with the base ld: $ touch empty.c $ cc empty.c -o libavcodec.so -shared -s = -Wl,--version-script,libavcodec.ver The resulting .so file has several NOTYPE GLOBAL symbols (_end, _edata and __bss_start), which are marked as ABS (absolute): $ readelf -a libavcodec.so | grep -A8 "Symbol table '\.dynsym'" Symbol table '.dynsym' contains 9 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 413 FUNC WEAK DEFAULT UND = __cxa_finalize@FBSD_1.0 (3) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 3: 00001510 0 NOTYPE GLOBAL DEFAULT ABS _end@@LIBAVCODEC_52 4: 00001510 0 NOTYPE GLOBAL DEFAULT ABS _edata@@LIBAVCODEC_52 5: 00000000 0 OBJECT GLOBAL DEFAULT ABS LIBAVCODEC_52 6: 00001510 0 NOTYPE GLOBAL DEFAULT ABS = __bss_start@@LIBAVCODEC_52 But if you link the .so with the ports ld (by using the cc -B option), the output is slightly different: $ cc -B/usr/local/bin empty.c -o libavcodec.so -shared -s = -Wl,--version-script=3Dlibavcodec.ver The resulting .so file again has several NOTYPE GLOBAL symbols, but this time they point to the .data section (Ndx=3D21 in this case): $ readelf -a libavcodec.so | grep -A8 "Symbol table '\.dynsym'" Symbol table '.dynsym' contains 9 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 2: 00000000 0 FUNC WEAK DEFAULT UND = __cxa_finalize@FBSD_1.0 (3) 3: 00001510 0 NOTYPE GLOBAL DEFAULT 21 _edata@@LIBAVCODEC_52 4: 00001510 0 NOTYPE GLOBAL DEFAULT 21 _end@@LIBAVCODEC_52 5: 00000000 0 OBJECT GLOBAL DEFAULT ABS LIBAVCODEC_52 6: 00001510 0 NOTYPE GLOBAL DEFAULT 21 = __bss_start@@LIBAVCODEC_52 If you now attempt to link any other .so file, using the libavcodec.so produced by ports ld as a dependency, with the _base_ ld, it will not handle those symbols correctly, and corrupt them: $ cc empty.c -o libffmpegthumbnailer.so -shared -s libavcodec.so $ readelf -a libffmpegthumbnailer.so | grep -A8 "Symbol table = '\.dynsym'" Symbol table '.dynsym' contains 8 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 413 FUNC WEAK DEFAULT UND = __cxa_finalize@FBSD_1.0 (2) 2: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses 3: a5a5a5a5 0xa5a5a5a5 COMMON : 10 INTERNAL [: = a4] bad section index[42405] 4: a5a5a5a5 0xa5a5a5a5 COMMON : 10 INTERNAL [: = a4] bad section index[42405] 5: a5a5a5a5 0xa5a5a5a5 COMMON : 10 INTERNAL [: = a4] bad section index[42405] 6: 00000260 0 FUNC GLOBAL DEFAULT 9 _init Any attempt to link with the resulting libffmpegthumbnailer.so will fail. (The a5a5a5a5 number is actually an uninitialized value.) The r255931 commit fixes this by making ld properly handle these so-called 'indirect' symbols, similar to what upstream ld has already implemented. -Dimitry --Apple-Mail=_0239F370-613E-4E66-A73E-9850C6252918 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) iEYEARECAAYFAlJJ5lEACgkQsF6jCi4glqPZAgCgxDsEEWhpUs566fhg2gBaLTsX OZ8AoIPUJCWp34NPMKyG/ZZUJKJBD8zR =Vvo3 -----END PGP SIGNATURE----- --Apple-Mail=_0239F370-613E-4E66-A73E-9850C6252918-- From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 21:01:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 927ADEE9; Mon, 30 Sep 2013 21:01:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 807812550; Mon, 30 Sep 2013 21:01:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UL14jG033773; Mon, 30 Sep 2013 21:01:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UL140q033772; Mon, 30 Sep 2013 21:01:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201309302101.r8UL140q033772@svn.freebsd.org> From: Ian Lepore Date: Mon, 30 Sep 2013 21:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255957 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 21:01:04 -0000 Author: ian Date: Mon Sep 30 21:01:04 2013 New Revision: 255957 URL: http://svnweb.freebsd.org/changeset/base/255957 Log: Set proper permissions on the generated osreldate.h file; a file readable only by root can cause install problems, especially over nfs. Submitted by: jilles@ Approved by: re (gjb) Modified: head/include/mk-osreldate.sh Modified: head/include/mk-osreldate.sh ============================================================================== --- head/include/mk-osreldate.sh Mon Sep 30 20:49:10 2013 (r255956) +++ head/include/mk-osreldate.sh Mon Sep 30 21:01:04 2013 (r255957) @@ -48,4 +48,5 @@ $COPYRIGHT #define __FreeBSD_version $RELDATE #endif EOF +chmod 644 $tmpfile mv $tmpfile osreldate.h From owner-svn-src-all@FreeBSD.ORG Mon Sep 30 21:26:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 7848BB2C; Mon, 30 Sep 2013 21:26:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC9B2706; Mon, 30 Sep 2013 21:26:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ULQ41A045877; Mon, 30 Sep 2013 21:26:04 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8ULQ4cN045876; Mon, 30 Sep 2013 21:26:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201309302126.r8ULQ4cN045876@svn.freebsd.org> From: Devin Teske Date: Mon, 30 Sep 2013 21:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255958 - in head/contrib/dialog/samples: copifuncs install X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 21:26:04 -0000 Author: dteske Date: Mon Sep 30 21:26:03 2013 New Revision: 255958 URL: http://svnweb.freebsd.org/changeset/base/255958 Log: Add missing mergeinfo associated with r255852. Approved by: re (gjb) Deleted: head/contrib/dialog/samples/copifuncs/ head/contrib/dialog/samples/install/ Modified: Directory Properties: head/contrib/dialog/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 00:49:58 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8654460C; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 738CF2087; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r910nw8c056526; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r910nwoJ056525; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310010049.r910nwoJ056525@svn.freebsd.org> From: Xin LI Date: Tue, 1 Oct 2013 00:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255959 - in stable: 8/sys/dev/nfe 9/sys/dev/nfe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 00:49:58 -0000 Author: delphij Date: Tue Oct 1 00:49:57 2013 New Revision: 255959 URL: http://svnweb.freebsd.org/changeset/base/255959 Log: MFC r255648: Fix a typo when accounting for tx_broadcast statistics. Submitted by: Paul A. Patience Modified: stable/9/sys/dev/nfe/if_nfe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/nfe/if_nfe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/nfe/ (props changed) Modified: stable/9/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/9/sys/dev/nfe/if_nfe.c Mon Sep 30 21:26:03 2013 (r255958) +++ stable/9/sys/dev/nfe/if_nfe.c Tue Oct 1 00:49:57 2013 (r255959) @@ -3261,7 +3261,7 @@ nfe_stats_update(struct nfe_softc *sc) if ((sc->nfe_flags & NFE_MIB_V3) != 0) { stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); - stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + stats->tx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 00:49:58 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C222960D; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF7652088; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r910nw7E056532; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r910nwgg056531; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310010049.r910nwgg056531@svn.freebsd.org> From: Xin LI Date: Tue, 1 Oct 2013 00:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r255959 - in stable: 8/sys/dev/nfe 9/sys/dev/nfe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 00:49:58 -0000 Author: delphij Date: Tue Oct 1 00:49:57 2013 New Revision: 255959 URL: http://svnweb.freebsd.org/changeset/base/255959 Log: MFC r255648: Fix a typo when accounting for tx_broadcast statistics. Submitted by: Paul A. Patience Modified: stable/8/sys/dev/nfe/if_nfe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/nfe/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/nfe/if_nfe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Mon Sep 30 21:26:03 2013 (r255958) +++ stable/8/sys/dev/nfe/if_nfe.c Tue Oct 1 00:49:57 2013 (r255959) @@ -3261,7 +3261,7 @@ nfe_stats_update(struct nfe_softc *sc) if ((sc->nfe_flags & NFE_MIB_V3) != 0) { stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); - stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + stats->tx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); } } From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 07:19:24 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 0D0AAB2A; Tue, 1 Oct 2013 07:19:24 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EED5F2422; Tue, 1 Oct 2013 07:19:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r917JNAE064513; Tue, 1 Oct 2013 07:19:23 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r917JNXB064511; Tue, 1 Oct 2013 07:19:23 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310010719.r917JNXB064511@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 1 Oct 2013 07:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255963 - in head: etc/mtree etc/periodic/daily usr.bin/dig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 07:19:24 -0000 Author: des Date: Tue Oct 1 07:19:23 2013 New Revision: 255963 URL: http://svnweb.freebsd.org/changeset/base/255963 Log: Odds and ends left over from BIND and unnoticed because they didn't affect 'make universe'. Approved by: re (gjb) Deleted: head/usr.bin/dig/ Modified: head/etc/mtree/Makefile head/etc/periodic/daily/Makefile Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Tue Oct 1 05:27:48 2013 (r255962) +++ head/etc/mtree/Makefile Tue Oct 1 07:19:23 2013 (r255963) @@ -2,20 +2,12 @@ .include -FILES= ${_BIND.chroot.dist} \ - ${_BIND.include.dist} \ - ${_BSD.debug.dist} \ - BSD.include.dist \ +FILES= BSD.include.dist \ BSD.root.dist \ ${_BSD.sendmail.dist} \ BSD.usr.dist \ BSD.var.dist -.if ${MK_BIND} != "no" -_BIND.chroot.dist= BIND.chroot.dist -.if ${MK_BIND_LIBS} != "no" -_BIND.include.dist= BIND.include.dist -.endif .endif .if ${MK_DEBUG_FILES} != "no" _BSD.debug.dist= BSD.debug.dist Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Tue Oct 1 05:27:48 2013 (r255962) +++ head/etc/periodic/daily/Makefile Tue Oct 1 07:19:23 2013 (r255963) @@ -24,10 +24,6 @@ FILES= 100.clean-disks \ FILES+= 310.accounting .endif -.if ${MK_BIND_NAMED} != "no" -FILES+= 470.status-named -.endif - .if ${MK_CALENDAR} != "no" FILES+= 300.calendar .endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 07:22:05 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 67455CC5; Tue, 1 Oct 2013 07:22:05 +0000 (UTC) (envelope-from des@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 554C5245F; Tue, 1 Oct 2013 07:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r917M5rE067229; Tue, 1 Oct 2013 07:22:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r917M5VE067227; Tue, 1 Oct 2013 07:22:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201310010722.r917M5VE067227@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 1 Oct 2013 07:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255964 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 07:22:05 -0000 Author: des Date: Tue Oct 1 07:22:04 2013 New Revision: 255964 URL: http://svnweb.freebsd.org/changeset/base/255964 Log: Have makeman always use the mk files from the source tree it's operating on rather than those from the installed system. Approved by: re (delphij) Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue Oct 1 07:19:23 2013 (r255963) +++ head/tools/build/options/makeman Tue Oct 1 07:22:04 2013 (r255964) @@ -10,6 +10,9 @@ ident='$FreeBSD$' t=$(mktemp -d -t makeman) trap 'test -d $t && rm -rf $t' exit +srcdir=$(realpath ../../..) +make="make -C $srcdir -m $srcdir/share/mk" + # # usage: no_targets all_targets yes_targets # @@ -27,10 +30,10 @@ no_targets() show_options() { - ALL_TARGETS=$(echo $(make -C ../../.. targets | tail -n +2)) + ALL_TARGETS=$(echo $(${make} targets | tail -n +2)) rm -f $t/settings for target in ${ALL_TARGETS} ; do - make -C ../../.. showconfig \ + ${make} showconfig \ SRCCONF=/dev/null __MAKE_CONF=/dev/null \ TARGET_ARCH=${target#*/} TARGET=${target%/*} | while read var _ val ; do @@ -93,7 +96,7 @@ show() exit 1 ;; esac - make -C ../../.. "$@" showconfig __MAKE_CONF=/dev/null | + ${make} "$@" showconfig __MAKE_CONF=/dev/null | while read var _ val ; do opt=${var#MK_} case ${val} in From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 08:38:48 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 51DD09C9; Tue, 1 Oct 2013 08:38:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E88727B4; Tue, 1 Oct 2013 08:38:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r918cmV6006998; Tue, 1 Oct 2013 08:38:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r918cl7r006995; Tue, 1 Oct 2013 08:38:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310010838.r918cl7r006995@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 1 Oct 2013 08:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255965 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 08:38:48 -0000 Author: hselasky Date: Tue Oct 1 08:38:47 2013 New Revision: 255965 URL: http://svnweb.freebsd.org/changeset/base/255965 Log: MFC r255768: Stability fixes for Intel LynxPoint XHCI controllers. Disable XHCI port routing if we get certain errors. Poll for command completion upon command timeouts. The XHCI error events might not generate interrupts. PR: usb/181159 Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci.c Tue Oct 1 08:38:47 2013 (r255965) @@ -94,6 +94,8 @@ TUNABLE_INT("hw.usb.xhci.debug", &xhcide SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); +#else +#define xhciroute 0 #endif #define XHCI_INTR_ENDPT 1 @@ -179,16 +181,6 @@ xhci_dump_device(struct xhci_softc *sc, } #endif -uint32_t -xhci_get_port_route(void) -{ -#ifdef USB_DEBUG - return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); -#else - return (0xFFFFFFFFU); -#endif -} - static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { @@ -480,6 +472,11 @@ xhci_start_controller(struct xhci_softc /* catch any lost interrupts */ xhci_do_poll(&sc->sc_bus); + if (sc->sc_port_route != NULL) { + /* Route all ports to the XHCI by default */ + sc->sc_port_route(sc->sc_bus.parent, + ~xhciroute, xhciroute); + } return (0); } @@ -917,7 +914,7 @@ xhci_check_transfer(struct xhci_softc *s } } -static void +static int xhci_check_command(struct xhci_softc *sc, struct xhci_trb *trb) { if (sc->sc_cmd_addr == trb->qwTrb0) { @@ -925,16 +922,19 @@ xhci_check_command(struct xhci_softc *sc sc->sc_cmd_result[0] = trb->dwTrb2; sc->sc_cmd_result[1] = trb->dwTrb3; cv_signal(&sc->sc_cmd_cv); + return (1); /* command match */ } + return (0); } -static void +static int xhci_interrupt_poll(struct xhci_softc *sc) { struct usb_page_search buf_res; struct xhci_hw_root *phwr; uint64_t addr; uint32_t temp; + int retval = 0; uint16_t i; uint8_t event; uint8_t j; @@ -974,7 +974,7 @@ xhci_interrupt_poll(struct xhci_softc *s xhci_check_transfer(sc, &phwr->hwr_events[i]); break; case XHCI_TRB_EVENT_CMD_COMPLETE: - xhci_check_command(sc, &phwr->hwr_events[i]); + retval |= xhci_check_command(sc, &phwr->hwr_events[i]); break; default: DPRINTF("Unhandled event = %u\n", event); @@ -1011,6 +1011,8 @@ xhci_interrupt_poll(struct xhci_softc *s XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); + + return (retval); } static usb_error_t @@ -1098,7 +1100,15 @@ xhci_do_command(struct xhci_softc *sc, s err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, USB_MS_TO_TICKS(timeout_ms)); - if (err) { + /* + * In some error cases event interrupts are not generated. + * Poll one time to see if the command has completed. + */ + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { DPRINTFN(0, "Command timeout!\n"); err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; @@ -1277,6 +1287,14 @@ xhci_set_address(struct usb_device *udev (address == 0), index); if (err != 0) { + temp = le32toh(sc->sc_cmd_result[0]); + if (address == 0 && sc->sc_port_route != NULL && + XHCI_TRB_2_ERROR_GET(temp) == + XHCI_TRB_ERROR_PARAMETER) { + /* LynxPoint XHCI - ports are not switchable */ + /* Un-route all ports from the XHCI */ + sc->sc_port_route(sc->sc_bus.parent, 0, ~0); + } DPRINTF("Could not set address " "for slot %u.\n", index); if (address != 0) Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci.h Tue Oct 1 08:38:47 2013 (r255965) @@ -421,6 +421,8 @@ union xhci_hub_desc { uint8_t temp[128]; }; +typedef int (xhci_port_route_t)(device_t, uint32_t, uint32_t); + struct xhci_softc { struct xhci_hw_softc sc_hw; /* base device */ @@ -429,6 +431,8 @@ struct xhci_softc { struct usb_process sc_config_proc; struct usb_bus_msg sc_config_msg[2]; + xhci_port_route_t *sc_port_route; + union xhci_hub_desc sc_hub_desc; struct cv sc_cmd_cv; @@ -491,7 +495,6 @@ struct xhci_softc { /* prototypes */ -uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 08:38:47 2013 (r255965) @@ -136,6 +136,25 @@ static int xhci_use_msi = 1; TUNABLE_INT("hw.usb.xhci.msi", &xhci_use_msi); static int +xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) +{ + uint32_t temp; + + temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | + pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); + + temp |= set; + temp &= ~clear; + + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + + device_printf(self, "Port routing mask set to 0x%08x\n", temp); + + return (0); +} + +static int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); @@ -200,6 +219,16 @@ xhci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + switch (pci_get_devid(self)) { + case 0x1e318086: /* Panther Point */ + case 0x8c318086: /* Lynx Point */ + sc->sc_port_route = &xhci_pci_port_route; + break; + default: + break; + } + xhci_pci_take_controller(self); err = xhci_halt_controller(sc); @@ -266,7 +295,6 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); - uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -307,13 +335,5 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } - - /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ - if (device_id == 0x1e318086 /* Panther Point */ || - device_id == 0x8c318086 /* Lynx Point */) { - uint32_t temp = xhci_get_port_route(); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); - } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 08:41:29 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C704EBAE; Tue, 1 Oct 2013 08:41:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B363727FF; Tue, 1 Oct 2013 08:41:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r918fTjQ010083; Tue, 1 Oct 2013 08:41:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r918fTa0010077; Tue, 1 Oct 2013 08:41:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310010841.r918fTa0010077@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 1 Oct 2013 08:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r255966 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 08:41:29 -0000 Author: hselasky Date: Tue Oct 1 08:41:28 2013 New Revision: 255966 URL: http://svnweb.freebsd.org/changeset/base/255966 Log: MFC r255768: Stability fixes for Intel LynxPoint XHCI controllers. Disable XHCI port routing if we get certain errors. Poll for command completion upon command timeouts. The XHCI error events might not generate interrupts. PR: usb/181159 Modified: stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/controller/xhci.h stable/8/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Tue Oct 1 08:38:47 2013 (r255965) +++ stable/8/sys/dev/usb/controller/xhci.c Tue Oct 1 08:41:28 2013 (r255966) @@ -94,6 +94,8 @@ TUNABLE_INT("hw.usb.xhci.debug", &xhcide SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); +#else +#define xhciroute 0 #endif #define XHCI_INTR_ENDPT 1 @@ -179,16 +181,6 @@ xhci_dump_device(struct xhci_softc *sc, } #endif -uint32_t -xhci_get_port_route(void) -{ -#ifdef USB_DEBUG - return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); -#else - return (0xFFFFFFFFU); -#endif -} - static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { @@ -480,6 +472,11 @@ xhci_start_controller(struct xhci_softc /* catch any lost interrupts */ xhci_do_poll(&sc->sc_bus); + if (sc->sc_port_route != NULL) { + /* Route all ports to the XHCI by default */ + sc->sc_port_route(sc->sc_bus.parent, + ~xhciroute, xhciroute); + } return (0); } @@ -917,7 +914,7 @@ xhci_check_transfer(struct xhci_softc *s } } -static void +static int xhci_check_command(struct xhci_softc *sc, struct xhci_trb *trb) { if (sc->sc_cmd_addr == trb->qwTrb0) { @@ -925,16 +922,19 @@ xhci_check_command(struct xhci_softc *sc sc->sc_cmd_result[0] = trb->dwTrb2; sc->sc_cmd_result[1] = trb->dwTrb3; cv_signal(&sc->sc_cmd_cv); + return (1); /* command match */ } + return (0); } -static void +static int xhci_interrupt_poll(struct xhci_softc *sc) { struct usb_page_search buf_res; struct xhci_hw_root *phwr; uint64_t addr; uint32_t temp; + int retval = 0; uint16_t i; uint8_t event; uint8_t j; @@ -974,7 +974,7 @@ xhci_interrupt_poll(struct xhci_softc *s xhci_check_transfer(sc, &phwr->hwr_events[i]); break; case XHCI_TRB_EVENT_CMD_COMPLETE: - xhci_check_command(sc, &phwr->hwr_events[i]); + retval |= xhci_check_command(sc, &phwr->hwr_events[i]); break; default: DPRINTF("Unhandled event = %u\n", event); @@ -1011,6 +1011,8 @@ xhci_interrupt_poll(struct xhci_softc *s XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); + + return (retval); } static usb_error_t @@ -1098,7 +1100,15 @@ xhci_do_command(struct xhci_softc *sc, s err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, USB_MS_TO_TICKS(timeout_ms)); - if (err) { + /* + * In some error cases event interrupts are not generated. + * Poll one time to see if the command has completed. + */ + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { DPRINTFN(0, "Command timeout!\n"); err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; @@ -1277,6 +1287,14 @@ xhci_set_address(struct usb_device *udev (address == 0), index); if (err != 0) { + temp = le32toh(sc->sc_cmd_result[0]); + if (address == 0 && sc->sc_port_route != NULL && + XHCI_TRB_2_ERROR_GET(temp) == + XHCI_TRB_ERROR_PARAMETER) { + /* LynxPoint XHCI - ports are not switchable */ + /* Un-route all ports from the XHCI */ + sc->sc_port_route(sc->sc_bus.parent, 0, ~0); + } DPRINTF("Could not set address " "for slot %u.\n", index); if (address != 0) Modified: stable/8/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.h Tue Oct 1 08:38:47 2013 (r255965) +++ stable/8/sys/dev/usb/controller/xhci.h Tue Oct 1 08:41:28 2013 (r255966) @@ -421,6 +421,8 @@ union xhci_hub_desc { uint8_t temp[128]; }; +typedef int (xhci_port_route_t)(device_t, uint32_t, uint32_t); + struct xhci_softc { struct xhci_hw_softc sc_hw; /* base device */ @@ -429,6 +431,8 @@ struct xhci_softc { struct usb_process sc_config_proc; struct usb_bus_msg sc_config_msg[2]; + xhci_port_route_t *sc_port_route; + union xhci_hub_desc sc_hub_desc; struct cv sc_cmd_cv; @@ -490,7 +494,6 @@ struct xhci_softc { /* prototypes */ -uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 08:38:47 2013 (r255965) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 08:41:28 2013 (r255966) @@ -130,6 +130,25 @@ xhci_pci_probe(device_t self) } static int +xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) +{ + uint32_t temp; + + temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | + pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); + + temp |= set; + temp &= ~clear; + + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + + device_printf(self, "Port routing mask set to 0x%08x\n", temp); + + return (0); +} + +static int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); @@ -184,6 +203,16 @@ xhci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + switch (pci_get_devid(self)) { + case 0x1e318086: /* Panther Point */ + case 0x8c318086: /* Lynx Point */ + sc->sc_port_route = &xhci_pci_port_route; + break; + default: + break; + } + xhci_pci_take_controller(self); err = xhci_halt_controller(sc); @@ -247,7 +276,6 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); - uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -288,13 +316,5 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } - - /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ - if (device_id == 0x1e318086 /* Panther Point */ || - device_id == 0x8c318086 /* Lynx Point */) { - uint32_t temp = xhci_get_port_route(); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); - } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 12:01:21 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 665CD227; Tue, 1 Oct 2013 12:01:21 +0000 (UTC) (envelope-from br@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 504592536; Tue, 1 Oct 2013 12:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91C1L8O014816; Tue, 1 Oct 2013 12:01:21 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91C1L6j014815; Tue, 1 Oct 2013 12:01:21 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201310011201.r91C1L6j014815@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 1 Oct 2013 12:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255967 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 12:01:21 -0000 Author: br Date: Tue Oct 1 12:01:20 2013 New Revision: 255967 URL: http://svnweb.freebsd.org/changeset/base/255967 Log: - Enable unmapped buffers on Exynos5 again, because board now able to see all the 2GB ram it has - Also unbreak gcc build Approved by: cognet (mentor) Approved by: re (marius) Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Tue Oct 1 08:41:28 2013 (r255966) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Tue Oct 1 12:01:20 2013 (r255967) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000 -extern int unmapped_buf_allowed; - vm_offset_t initarm_lastaddr(void) { @@ -64,9 +62,6 @@ initarm_gpio_init(void) void initarm_late_init(void) { - - /* XXX: PR arm/180080 */ - unmapped_buf_allowed = 0; } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 14:21:02 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id AD3EBBAE; Tue, 1 Oct 2013 14:21:02 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 393C62EFF; Tue, 1 Oct 2013 14:21:02 +0000 (UTC) Received: by mail-qa0-f49.google.com with SMTP id k15so3348425qaq.8 for ; Tue, 01 Oct 2013 07:21:01 -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=q9YD+ob/Pg4b14MTkn7ir9O0/y2okTYLEGWuup3doxc=; b=s+QhOyz0+Z2E63QTRl+3XsBMaxXjFTPCxDHhV+QUJYTuVlFlwjByeQe5VhyrWetRbL Gmt/c+7hvsFMfuM1WZ2umok6D+aUuezMdewd8W/qIKouVfXNACwc1iu6H4gK22idQaQY 0gQOnyxv8vDKfpwvf0iF2YsBFUxLopYLMcwJJOm7QWZSz9uDLw6dbM32oIFcHbu3eKhU rLGcZTqQ1gYkRFFIAIg+3QeBFZayKkNiH8llGIScoiB/hOaHZiDQBxoQxICP39mg7uWU PUbd7Zee4Zem9lTMiwt61HoLWt6RLcwJirxDviVgxJJCV3+Hzsvy6fbcTAEdkdPVS5Ws 79IQ== MIME-Version: 1.0 X-Received: by 10.229.130.135 with SMTP id t7mr35806179qcs.18.1380637261319; Tue, 01 Oct 2013 07:21:01 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.225.129 with HTTP; Tue, 1 Oct 2013 07:21:01 -0700 (PDT) In-Reply-To: <201310010719.r917JNXB064511@svn.freebsd.org> References: <201310010719.r917JNXB064511@svn.freebsd.org> Date: Tue, 1 Oct 2013 07:21:01 -0700 X-Google-Sender-Auth: stYVpMSkC9PHsC0TIZmF3y_zuV8 Message-ID: Subject: Re: svn commit: r255963 - in head: etc/mtree etc/periodic/daily usr.bin/dig From: Matthew Fleming To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 14:21:02 -0000 On Tue, Oct 1, 2013 at 12:19 AM, Dag-Erling Sm=F8rgrav wro= te: > Author: des > Date: Tue Oct 1 07:19:23 2013 > New Revision: 255963 > URL: http://svnweb.freebsd.org/changeset/base/255963 > > Log: > Odds and ends left over from BIND and unnoticed because they didn't > affect 'make universe'. > > Approved by: re (gjb) > > Deleted: > head/usr.bin/dig/ > Modified: > head/etc/mtree/Makefile > head/etc/periodic/daily/Makefile > > Modified: head/etc/mtree/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/etc/mtree/Makefile Tue Oct 1 05:27:48 2013 (r255962) > +++ head/etc/mtree/Makefile Tue Oct 1 07:19:23 2013 (r255963) > @@ -2,20 +2,12 @@ > > .include > > -FILES=3D ${_BIND.chroot.dist} \ > - ${_BIND.include.dist} \ > - ${_BSD.debug.dist} \ > - BSD.include.dist \ > +FILES=3D BSD.include.dist \ > It looks like {_BSD.debug.list} is no longer in FILES. > BSD.root.dist \ > ${_BSD.sendmail.dist} \ > BSD.usr.dist \ > BSD.var.dist > > -.if ${MK_BIND} !=3D "no" > -_BIND.chroot.dist=3D BIND.chroot.dist > -.if ${MK_BIND_LIBS} !=3D "no" > -_BIND.include.dist=3D BIND.include.dist > -.endif > .endif > This .endif needs to be removed too, as the MK_BIND_LIBS was nested inside MK_BIND check. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:33:01 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 23E69BDD; Tue, 1 Oct 2013 15:33:01 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 114DC231D; Tue, 1 Oct 2013 15:33:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FX0ra029631; Tue, 1 Oct 2013 15:33:00 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91FX0YU029630; Tue, 1 Oct 2013 15:33:00 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310011533.r91FX0YU029630@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 1 Oct 2013 15:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255968 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:33:01 -0000 Author: alfred Date: Tue Oct 1 15:33:00 2013 New Revision: 255968 URL: http://svnweb.freebsd.org/changeset/base/255968 Log: Fix mis-merge of upstream fix. We would accidentally make the string one byte too short. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re Modified: head/sys/ofed/include/linux/sysfs.h Modified: head/sys/ofed/include/linux/sysfs.h ============================================================================== --- head/sys/ofed/include/linux/sysfs.h Tue Oct 1 12:01:20 2013 (r255967) +++ head/sys/ofed/include/linux/sysfs.h Tue Oct 1 15:33:00 2013 (r255968) @@ -105,10 +105,6 @@ sysctl_handle_attr(SYSCTL_HANDLER_ARGS) /* Trim trailing newline. */ buf[len] = '\0'; } - - /* Trim trailing newline. */ - len--; - ((char*)buf)[len] = '\0'; } /* Leave one trailing byte to append a newline. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:36:52 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 48E2DE69; Tue, 1 Oct 2013 15:36:52 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 347BA239D; Tue, 1 Oct 2013 15:36:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FaqaH030666; Tue, 1 Oct 2013 15:36:52 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91Fapcg030662; Tue, 1 Oct 2013 15:36:51 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310011536.r91Fapcg030662@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 1 Oct 2013 15:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255969 - in head/sys/ofed/drivers: infiniband/hw/mlx4 net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:36:52 -0000 Author: alfred Date: Tue Oct 1 15:36:51 2013 New Revision: 255969 URL: http://svnweb.freebsd.org/changeset/base/255969 Log: Fixed kernel crash when removing IPOIB_CM option from configuration file Changed module init from module_init() to module_init_order() with SI_ORDER_MIDDLE flag Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/net/mlx4/main.c Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Oct 1 15:33:00 2013 (r255968) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Oct 1 15:36:51 2013 (r255969) @@ -2431,7 +2431,7 @@ static void __exit mlx4_ib_cleanup(void) } -module_init(mlx4_ib_init); +module_init_order(mlx4_ib_init, SI_ORDER_MIDDLE); module_exit(mlx4_ib_cleanup); #undef MODULE_VERSION Modified: head/sys/ofed/drivers/net/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/main.c Tue Oct 1 15:33:00 2013 (r255968) +++ head/sys/ofed/drivers/net/mlx4/main.c Tue Oct 1 15:36:51 2013 (r255969) @@ -2859,7 +2859,7 @@ static void __exit mlx4_cleanup(void) destroy_workqueue(mlx4_wq); } -module_init(mlx4_init); +module_init_order(mlx4_init, SI_ORDER_MIDDLE); module_exit(mlx4_cleanup); #undef MODULE_VERSION From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:38:29 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id D0E04FF0; Tue, 1 Oct 2013 15:38:29 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AECD823CC; Tue, 1 Oct 2013 15:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FcT54030961; Tue, 1 Oct 2013 15:38:29 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91FcTq8030960; Tue, 1 Oct 2013 15:38:29 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310011538.r91FcTq8030960@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 1 Oct 2013 15:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255970 - head/sys/ofed/drivers/infiniband/hw/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:38:30 -0000 Author: alfred Date: Tue Oct 1 15:38:29 2013 New Revision: 255970 URL: http://svnweb.freebsd.org/changeset/base/255970 Log: Fixed 'Couldn't Create QP' issue when running rc_pingpong, uc_pingpong, srq_pingpong IBverbs Removed refrences using 'ifdef __linux__' to qpg functions and related fields in struct ib_qp_init_attr. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Oct 1 15:36:51 2013 (r255969) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Oct 1 15:38:29 2013 (r255970) @@ -611,6 +611,7 @@ static int qp_has_rq(struct ib_qp_init_a return !attr->srq; } +#ifdef __linux__ static int init_qpg_parent(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *pqp, struct ib_qp_init_attr *attr, int *qpn) { @@ -791,6 +792,7 @@ static void free_qpg_qpn(struct mlx4_ib_ break; } } +#endif static int alloc_qpn_common(struct mlx4_ib_dev *dev, struct mlx4_ib_qp *qp, struct ib_qp_init_attr *attr, int *qpn) @@ -811,11 +813,15 @@ static int alloc_qpn_common(struct mlx4_ } break; case IB_QPG_PARENT: +#ifdef __linux__ err = init_qpg_parent(dev, qp, attr, qpn); +#endif break; case IB_QPG_CHILD_TX: case IB_QPG_CHILD_RX: +#ifdef __linux__ err = alloc_qpg_qpn(attr, qp, qpn); +#endif break; default: qp->qpg_type = IB_QPG_NONE; @@ -839,11 +845,15 @@ static void free_qpn_common(struct mlx4_ mlx4_qp_release_range(dev->dev, qpn, 1); break; case IB_QPG_PARENT: +#ifdef __linux__ free_qpg_parent(dev, qp); +#endif break; case IB_QPG_CHILD_TX: case IB_QPG_CHILD_RX: +#ifdef __linux__ free_qpg_qpn(qp, qpn); +#endif break; default: break; @@ -872,6 +882,10 @@ static int create_qp_common(struct mlx4_ struct mlx4_ib_qp *qp; enum mlx4_ib_qp_type qp_type = (enum mlx4_ib_qp_type) init_attr->qp_type; +#ifndef __linux__ + init_attr->qpg_type = IB_QPG_NONE; +#endif + /* When tunneling special qps, we use a plain UD qp */ if (sqpn) { if (mlx4_is_mfunc(dev->dev) && @@ -1287,6 +1301,7 @@ static u32 get_sqp_num(struct mlx4_ib_de return dev->dev->caps.qp1_proxy[attr->port_num - 1]; } +#ifdef __linux__ static int check_qpg_attr(struct mlx4_ib_dev *dev, struct ib_qp_init_attr *attr) { @@ -1332,6 +1347,7 @@ static int check_qpg_attr(struct mlx4_ib } return 0; } +#endif #define RESERVED_FLAGS_MASK ((((unsigned int)IB_QP_CREATE_RESERVED_END - 1) | IB_QP_CREATE_RESERVED_END) \ & ~(IB_QP_CREATE_RESERVED_START - 1)) @@ -1390,9 +1406,11 @@ struct ib_qp *mlx4_ib_create_qp(struct i init_attr->qp_type > IB_QPT_GSI))) return ERR_PTR(-EINVAL); +#ifdef __linux__ err = check_qpg_attr(to_mdev(device), init_attr); if (err) return ERR_PTR(err); +#endif switch (init_attr->qp_type) { case IB_QPT_XRC_TGT: From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:40:29 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 720DC212; Tue, 1 Oct 2013 15:40:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7A523F7; Tue, 1 Oct 2013 15:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FeT2Y031831; Tue, 1 Oct 2013 15:40:29 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91FeSIq031823; Tue, 1 Oct 2013 15:40:28 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310011540.r91FeSIq031823@svn.freebsd.org> From: Mark Johnston Date: Tue, 1 Oct 2013 15:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255971 - in head/sys: compat/linux security/mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:40:29 -0000 Author: markj Date: Tue Oct 1 15:40:27 2013 New Revision: 255971 URL: http://svnweb.freebsd.org/changeset/base/255971 Log: Fix some typos that were causing probe argument types to show up as unknown. Reviewed by: rwatson (mac provider) Approved by: re (glebius) MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c head/sys/compat/linux/linux_uid16.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_internal.h head/sys/security/mac/mac_posix_shm.c head/sys/security/mac/mac_vfs.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/compat/linux/linux_futex.c Tue Oct 1 15:40:27 2013 (r255971) @@ -119,7 +119,7 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_sleep LIN_SDT_PROBE_DEFINE3(futex, futex_wake, entry, "struct futex *", "int", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_wake, iterate, "uint32_t", - "struct waiting_proc *", "uin32_t"); + "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, wakeup, "struct waiting_proc *"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_requeue, entry, "struct futex *", "int", Modified: head/sys/compat/linux/linux_uid16.c ============================================================================== --- head/sys/compat/linux/linux_uid16.c Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/compat/linux/linux_uid16.c Tue Oct 1 15:40:27 2013 (r255971) @@ -87,7 +87,7 @@ LIN_SDT_PROBE_DEFINE1(uid16, linux_setgi LIN_SDT_PROBE_DEFINE1(uid16, linux_setgid16, return, "int"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, entry, "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, return, "int"); -LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_git16_t", "l_git16_t"); +LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_gid16_t", "l_gid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setregid16, return, "int"); LIN_SDT_PROBE_DEFINE2(uid16, linux_setreuid16, entry, "l_uid16_t", "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setreuid16, return, "int"); Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/security/mac/mac_framework.c Tue Oct 1 15:40:27 2013 (r255971) @@ -95,7 +95,7 @@ SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", - "struct mac_policy_conf *mpc"); + "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/security/mac/mac_internal.h Tue Oct 1 15:40:27 2013 (r255971) @@ -119,7 +119,7 @@ SDT_PROVIDER_DECLARE(mac_framework); /* SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ mac-grant-err, "int", arg0, arg1); \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - mac-grant-ok, "INT", arg0, arg1); + mac-grant-ok, "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ Modified: head/sys/security/mac/mac_posix_shm.c ============================================================================== --- head/sys/security/mac/mac_posix_shm.c Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/security/mac/mac_posix_shm.c Tue Oct 1 15:40:27 2013 (r255971) @@ -133,7 +133,7 @@ mac_posixshm_check_mmap(struct ucred *cr } MAC_CHECK_PROBE_DEFINE3(posixshm_check_open, "struct ucred *", - "struct shmfd *", "accmode_t accmode"); + "struct shmfd *", "accmode_t"); int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, Modified: head/sys/security/mac/mac_vfs.c ============================================================================== --- head/sys/security/mac/mac_vfs.c Tue Oct 1 15:38:29 2013 (r255970) +++ head/sys/security/mac/mac_vfs.c Tue Oct 1 15:40:27 2013 (r255971) @@ -783,7 +783,7 @@ mac_vnode_check_revoke(struct ucred *cre } MAC_CHECK_PROBE_DEFINE4(vnode_check_setacl, "struct ucred *", - "struct vnode *", "acl_tpe_t", "struct acl *"); + "struct vnode *", "acl_type_t", "struct acl *"); int mac_vnode_check_setacl(struct ucred *cred, struct vnode *vp, acl_type_t type, From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:42:40 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 0CA66491; Tue, 1 Oct 2013 15:42:40 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE55124A3; Tue, 1 Oct 2013 15:42:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FgdFg034374; Tue, 1 Oct 2013 15:42:39 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91FgdrZ034371; Tue, 1 Oct 2013 15:42:39 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310011542.r91FgdrZ034371@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 1 Oct 2013 15:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255972 - in head/sys/ofed: drivers/infiniband/core drivers/infiniband/hw/mlx4 include/rdma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:42:40 -0000 Author: alfred Date: Tue Oct 1 15:42:38 2013 New Revision: 255972 URL: http://svnweb.freebsd.org/changeset/base/255972 Log: Enable ib_dev.mmap function Removed the ifdef linux from this function. Added stub function for contiguous pages to avoid compilation errors. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re Modified: head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/include/rdma/ib_umem.h Modified: head/sys/ofed/drivers/infiniband/core/umem.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/umem.c Tue Oct 1 15:40:27 2013 (r255971) +++ head/sys/ofed/drivers/infiniband/core/umem.c Tue Oct 1 15:42:38 2013 (r255972) @@ -530,3 +530,46 @@ int ib_umem_page_count(struct ib_umem *u return n; } EXPORT_SYMBOL(ib_umem_page_count); + +/**********************************************/ +/* + * Stub functions for contiguous pages - + * We currently do not support this feature + */ +/**********************************************/ + +/** + * ib_cmem_release_contiguous_pages - release memory allocated by + * ib_cmem_alloc_contiguous_pages. + * @cmem: cmem struct to release + */ +void ib_cmem_release_contiguous_pages(struct ib_cmem *cmem) +{ +} +EXPORT_SYMBOL(ib_cmem_release_contiguous_pages); + +/** + * * ib_cmem_alloc_contiguous_pages - allocate contiguous pages + * * @context: userspace context to allocate memory for + * * @total_size: total required size for that allocation. + * * @page_size_order: order of one contiguous page. + * */ +struct ib_cmem *ib_cmem_alloc_contiguous_pages(struct ib_ucontext *context, + unsigned long total_size, + unsigned long page_size_order) +{ + return NULL; +} +EXPORT_SYMBOL(ib_cmem_alloc_contiguous_pages); + +/** + * * ib_cmem_map_contiguous_pages_to_vma - map contiguous pages into VMA + * * @ib_cmem: cmem structure returned by ib_cmem_alloc_contiguous_pages + * * @vma: VMA to inject pages into. + * */ +int ib_cmem_map_contiguous_pages_to_vma(struct ib_cmem *ib_cmem, + struct vm_area_struct *vma) +{ + return 0; +} +EXPORT_SYMBOL(ib_cmem_map_contiguous_pages_to_vma); Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Oct 1 15:40:27 2013 (r255971) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Oct 1 15:42:38 2013 (r255972) @@ -726,6 +726,7 @@ full_search: addr = ALIGN(vma->vm_end, 1 << page_size_order); } } +#endif static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) { @@ -780,7 +781,6 @@ static int mlx4_ib_mmap(struct ib_uconte return 0; } -#endif static struct ib_pd *mlx4_ib_alloc_pd(struct ib_device *ibdev, struct ib_ucontext *context, @@ -1984,8 +1984,8 @@ static void *mlx4_ib_add(struct mlx4_dev ibdev->ib_dev.modify_port = mlx4_ib_modify_port; ibdev->ib_dev.alloc_ucontext = mlx4_ib_alloc_ucontext; ibdev->ib_dev.dealloc_ucontext = mlx4_ib_dealloc_ucontext; -#ifdef __linux__ ibdev->ib_dev.mmap = mlx4_ib_mmap; +#ifdef __linux__ ibdev->ib_dev.get_unmapped_area = mlx4_ib_get_unmapped_area; #endif ibdev->ib_dev.alloc_pd = mlx4_ib_alloc_pd; Modified: head/sys/ofed/include/rdma/ib_umem.h ============================================================================== --- head/sys/ofed/include/rdma/ib_umem.h Tue Oct 1 15:40:27 2013 (r255971) +++ head/sys/ofed/include/rdma/ib_umem.h Tue Oct 1 15:42:38 2013 (r255972) @@ -57,6 +57,24 @@ struct ib_umem { unsigned long diff; }; +struct ib_cmem { + + struct ib_ucontext *context; + size_t length; + /* Link list of contiguous blocks being part of that cmem */ + struct list_head ib_cmem_block; + + /* Order of cmem block, 2^ block_order will equal number + of physical pages per block + */ + unsigned long block_order; + /* Refernce counter for that memory area + - When value became 0 pages will be returned to the kernel. + */ + struct kref refcount; +}; + + struct ib_umem_chunk { struct list_head list; int nents; @@ -70,4 +88,14 @@ struct ib_umem *ib_umem_get(struct ib_uc void ib_umem_release(struct ib_umem *umem); int ib_umem_page_count(struct ib_umem *umem); +int ib_cmem_map_contiguous_pages_to_vma(struct ib_cmem *ib_cmem, + struct vm_area_struct *vma); +struct ib_cmem *ib_cmem_alloc_contiguous_pages(struct ib_ucontext *context, + unsigned long total_size, + unsigned long page_size_order); +void ib_cmem_release_contiguous_pages(struct ib_cmem *cmem); +int ib_umem_map_to_vma(struct ib_umem *umem, + struct vm_area_struct *vma); + + #endif /* IB_UMEM_H */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 15:43:24 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 41B005D7; Tue, 1 Oct 2013 15:43:24 +0000 (UTC) (envelope-from alfred@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB1324AB; Tue, 1 Oct 2013 15:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91FhOsB034568; Tue, 1 Oct 2013 15:43:24 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91FhOm4034567; Tue, 1 Oct 2013 15:43:24 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201310011543.r91FhOm4034567@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 1 Oct 2013 15:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255973 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:43:24 -0000 Author: alfred Date: Tue Oct 1 15:43:23 2013 New Revision: 255973 URL: http://svnweb.freebsd.org/changeset/base/255973 Log: Fixed kernel crash when running devinfo When calling to ib_uverbs_cleanup_ucontext, there is a call to mutex_lock of xrcd_table_mutex, which was not initialized. Added missing initialization for xrcd_table_mutex. Submitted by: Orit Moskovich (oritm mellanox.com) Approved by: re Modified: head/sys/ofed/drivers/infiniband/core/device.c Modified: head/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/device.c Tue Oct 1 15:42:38 2013 (r255972) +++ head/sys/ofed/drivers/infiniband/core/device.c Tue Oct 1 15:43:23 2013 (r255973) @@ -296,6 +296,8 @@ int ib_register_device(struct ib_device INIT_LIST_HEAD(&device->client_data_list); spin_lock_init(&device->event_handler_lock); spin_lock_init(&device->client_data_lock); + device->ib_uverbs_xrcd_table = RB_ROOT; + mutex_init(&device->xrcd_table_mutex); ret = read_port_table_lengths(device); if (ret) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 17:40:57 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id B651CE3E; Tue, 1 Oct 2013 17:40:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88C042BD7; Tue, 1 Oct 2013 17:40:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91HevlT098314; Tue, 1 Oct 2013 17:40:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91HeuDo098310; Tue, 1 Oct 2013 17:40:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310011740.r91HeuDo098310@svn.freebsd.org> From: Ed Maste Date: Tue, 1 Oct 2013 17:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255974 - in head: . gnu/usr.bin/binutils gnu/usr.bin/binutils/ar gnu/usr.bin/binutils/ranlib tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 17:40:57 -0000 Author: emaste Date: Tue Oct 1 17:40:56 2013 New Revision: 255974 URL: http://svnweb.freebsd.org/changeset/base/255974 Log: Remove long-unused GNU ar and ranlib The libarchive-based replacements have been used since 2009; the GNU ones were kept to support source upgrades from FreeBSD 6. Approved by: re@ (delphij) Deleted: head/gnu/usr.bin/binutils/ar/Makefile head/gnu/usr.bin/binutils/ar/ar.1 head/gnu/usr.bin/binutils/ranlib/Makefile head/gnu/usr.bin/binutils/ranlib/ranlib.1 Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/binutils/Makefile head/tools/build/options/WITHOUT_BINUTILS Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 1 15:43:23 2013 (r255973) +++ head/ObsoleteFiles.inc Tue Oct 1 17:40:56 2013 (r255974) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20131001: ar and ranlib from binutils not used +OLD_FILES+=usr/bin/gnu-ar +OLD_FILES+=usr/bin/gnu-ranlib # 20130930: BIND removed from base OLD_FILES+=etc/namedb OLD_FILES+=etc/periodic/daily/470.status-named Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Tue Oct 1 15:43:23 2013 (r255973) +++ head/gnu/usr.bin/binutils/Makefile Tue Oct 1 17:40:56 2013 (r255974) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR= libiberty libbfd libopcodes libbinutils \ - addr2line ar as ld nm objcopy objdump ranlib readelf \ + addr2line as ld nm objcopy objdump readelf \ size strings strip doc .include Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Tue Oct 1 15:43:23 2013 (r255973) +++ head/tools/build/options/WITHOUT_BINUTILS Tue Oct 1 17:40:56 2013 (r255974) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, +Set to not install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic The option does not generally work for build targets, unless some alternative From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 17:46:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C1E8A1CF; Tue, 1 Oct 2013 17:46:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEED02C0C; Tue, 1 Oct 2013 17:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91Hk4cP099549; Tue, 1 Oct 2013 17:46:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91Hk40C099548; Tue, 1 Oct 2013 17:46:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310011746.r91Hk40C099548@svn.freebsd.org> From: Ed Maste Date: Tue, 1 Oct 2013 17:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255975 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 17:46:04 -0000 Author: emaste Date: Tue Oct 1 17:46:04 2013 New Revision: 255975 URL: http://svnweb.freebsd.org/changeset/base/255975 Log: Regen. Approved by: re (implicit) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Oct 1 17:40:56 2013 (r255974) +++ head/share/man/man5/src.conf.5 Tue Oct 1 17:46:04 2013 (r255975) @@ -128,8 +128,8 @@ Set to not build audit support into syst Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 235342 2012-05-12 16:12:36Z gjb -Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste +Set to not install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic The option does not generally work for build targets, unless some alternative From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 17:51:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id AD1D9358; Tue, 1 Oct 2013 17:51:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AFDA2C51; Tue, 1 Oct 2013 17:51:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91Hp4J9003078; Tue, 1 Oct 2013 17:51:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91Hp46i003077; Tue, 1 Oct 2013 17:51:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310011751.r91Hp46i003077@svn.freebsd.org> From: Ed Maste Date: Tue, 1 Oct 2013 17:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255976 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 17:51:04 -0000 Author: emaste Date: Tue Oct 1 17:51:04 2013 New Revision: 255976 URL: http://svnweb.freebsd.org/changeset/base/255976 Log: Also remove GNU ar and ranlib man pages This was missed in r255974. Approved by: re (implicit) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 1 17:46:04 2013 (r255975) +++ head/ObsoleteFiles.inc Tue Oct 1 17:51:04 2013 (r255976) @@ -41,6 +41,8 @@ # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib +OLD_FILES+=usr/share/man/man1/gnu-ar.1.gz +OLD_FILES+=usr/share/man/man1/gnu-ranlib.1.gz # 20130930: BIND removed from base OLD_FILES+=etc/namedb OLD_FILES+=etc/periodic/daily/470.status-named From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 18:41:58 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id A4FAD482; Tue, 1 Oct 2013 18:41:58 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1A82F42; Tue, 1 Oct 2013 18:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91Ifwr3030598; Tue, 1 Oct 2013 18:41:58 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91IfslI030515; Tue, 1 Oct 2013 18:41:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310011841.r91IfslI030515@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 1 Oct 2013 18:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255977 - in head: bin/dd sbin/bsdlabel sbin/ccdconfig sbin/fdisk sbin/gbde sbin/geom/class/eli sbin/geom/class/shsec sbin/geom/class/virstor sbin/gvinum sbin/mount_msdosfs sbin/newfs s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 18:41:58 -0000 Author: pluknet Date: Tue Oct 1 18:41:53 2013 New Revision: 255977 URL: http://svnweb.freebsd.org/changeset/base/255977 Log: Sweep man pages replacing ad -> ada. Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only Modified: head/bin/dd/dd.1 head/sbin/bsdlabel/bsdlabel.8 head/sbin/ccdconfig/ccdconfig.8 head/sbin/fdisk/fdisk.8 head/sbin/gbde/gbde.8 head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/shsec/gshsec.8 head/sbin/geom/class/virstor/gvirstor.8 head/sbin/gvinum/gvinum.8 head/sbin/mount_msdosfs/mount_msdosfs.8 head/sbin/newfs/newfs.8 head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_nandfs/newfs_nandfs.8 head/sbin/recoverdisk/recoverdisk.1 head/share/man/man4/geom_linux_lvm.4 head/share/man/man5/ext2fs.5 head/share/man/man5/msdosfs.5 head/share/man/man5/reiserfs.5 head/share/man/man8/picobsd.8 head/sys/boot/common/loader.8 head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Tue Oct 1 17:51:04 2013 (r255976) +++ head/bin/dd/dd.1 Tue Oct 1 18:41:53 2013 (r255977) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd October 1, 2013 .Dt DD 1 .Os .Sh NAME @@ -378,12 +378,12 @@ will exit. .Sh EXAMPLES Check that a disk drive contains no bad blocks: .Pp -.Dl "dd if=/dev/ad0 of=/dev/null bs=1m" +.Dl "dd if=/dev/ada0 of=/dev/null bs=1m" .Pp Do a refresh of a disk drive, in order to prevent presently recoverable read errors from progressing into unrecoverable read errors: .Pp -.Dl "dd if=/dev/ad0 of=/dev/ad0 bs=1m" +.Dl "dd if=/dev/ada0 of=/dev/ada0 bs=1m" .Pp Remove parity bit from a file: .Pp Modified: head/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- head/sbin/bsdlabel/bsdlabel.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/bsdlabel/bsdlabel.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -31,7 +31,7 @@ .\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd March 5, 2011 +.Dd October 1, 2013 .Dt BSDLABEL 8 .Os .Sh NAME @@ -457,9 +457,9 @@ such as and .Cm * , which could be used as a source file for -.Dq Li "bsdlabel -R ad0s1 new_label_file" : +.Dq Li "bsdlabel -R ada0s1 new_label_file" : .Bd -literal -offset 4n -# /dev/ad0s1: +# /dev/ada0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] Modified: head/sbin/ccdconfig/ccdconfig.8 ============================================================================== --- head/sbin/ccdconfig/ccdconfig.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/ccdconfig/ccdconfig.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 1995 +.Dd October 1, 2013 .Dt CCDCONFIG 8 .Os .Sh NAME @@ -180,7 +180,7 @@ and read it from mdadm --create --chunk=32 --level=0 --raid-devices=2 /dev/md0 \\ /dev/hda1 /dev/hdb1 # Make the RAID-0 just created available on FreeBSD: -ccdconfig -c /dev/ccd0 32 linux /dev/ad0s1 /dev/ad0s2 +ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2 .Ed .Pp When you create a new ccd disk you generally want to Modified: head/sbin/fdisk/fdisk.8 ============================================================================== --- head/sbin/fdisk/fdisk.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/fdisk/fdisk.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd May 24, 2009 +.Dd October 1, 2013 .Dt FDISK 8 .Os .Sh NAME @@ -159,7 +159,7 @@ mounted root device. When called with no arguments, it prints the sector 0 slice table. An example follows: .Bd -literal - ******* Working on device /dev/ad0 ******* + ******* Working on device /dev/ada0 ******* parameters extracted from in-core disklabel are: cylinders=769 heads=15 sectors/track=33 (495 blks/cyl) Modified: head/sbin/gbde/gbde.8 ============================================================================== --- head/sbin/gbde/gbde.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/gbde/gbde.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2006 +.Dd October 1, 2013 .Dt GBDE 8 .Os .Sh NAME @@ -207,23 +207,23 @@ used). .Sh EXAMPLES To initialize a device, using default parameters: .Pp -.Dl "gbde init /dev/ad0s1f -L /etc/ad0s1f.lock" +.Dl "gbde init /dev/ada0s1f -L /etc/ada0s1f.lock" .Pp To attach an encrypted device: .Pp -.Dl "gbde attach ad0s1f -l /etc/ad0s1f.lock" +.Dl "gbde attach ada0s1f -l /etc/ada0s1f.lock" .Pp The encrypted device has the suffix .Pa .bde so a typical command to create and mount a file system would be: .Pp -.Dl "newfs /dev/ad0s1f.bde" -.Dl "mount /dev/ad0s1f.bde /secret" +.Dl "newfs /dev/ada0s1f.bde" +.Dl "mount /dev/ada0s1f.bde /secret" .Pp To detach an encrypted device: .Pp -.Dl "gbde detach ad0s1f" +.Dl "gbde detach ada0s1f" .Pp Please notice that detaching an encrypted device corresponds to physically removing it, do not forget to unmount the file system first. @@ -231,11 +231,11 @@ physically removing it, do not forget to To initialize the second key using a detached lockfile and a trivial pass-phrase: .Pp -.Dl "gbde setkey ad0s1f -n 2 -P foo -L key2.lockfile" +.Dl "gbde setkey ada0s1f -n 2 -P foo -L key2.lockfile" .Pp To destroy all copies of the masterkey: .Pp -.Dl "gbde destroy ad0s1f -n -1" +.Dl "gbde destroy ada0s1f -n -1" .Sh SEE ALSO .Xr gbde 4 , .Xr geom 4 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/geom/class/eli/geli.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2013 +.Dd October 1, 2013 .Dt GELI 8 .Os .Sh NAME @@ -841,10 +841,10 @@ Create an encrypted provider for use by forget their passphrases, so backup the Master Key with your own random key: .Bd -literal -offset indent # dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1 -# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ad0s1e -# geli backup /dev/ad0s1e /mnt/pendrive/backups/`hostname` +# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ada0s1e +# geli backup /dev/ada0s1e /mnt/pendrive/backups/`hostname` (use key number 0, so the encrypted Master Key will be re-encrypted by this) -# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ad0s1e +# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ada0s1e (allow the user to enter his passphrase) Enter new passphrase: Reenter new passphrase: @@ -852,9 +852,9 @@ Reenter new passphrase: .Pp Encrypted swap partition setup: .Bd -literal -offset indent -# dd if=/dev/random of=/dev/ad0s1b bs=1m -# geli onetime -d -e 3des ad0s1b -# swapon /dev/ad0s1b.eli +# dd if=/dev/random of=/dev/ada0s1b bs=1m +# geli onetime -d -e 3des ada0s1b +# swapon /dev/ada0s1b.eli .Ed .Pp The example below shows how to configure two providers which will be attached Modified: head/sbin/geom/class/shsec/gshsec.8 ============================================================================== --- head/sbin/geom/class/shsec/gshsec.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/geom/class/shsec/gshsec.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2005 +.Dd October 1, 2013 .Dt GSHSEC 8 .Os .Sh NAME @@ -108,7 +108,7 @@ Exit status is 0 on success, and 1 if th The following example shows how to create a shared secret device. The secret will be split between a slice on a local disk and a USB Pen drive. .Bd -literal -offset indent -gshsec label -v secret /dev/ad0s1 /dev/da0 +gshsec label -v secret /dev/ada0s1 /dev/da0 newfs /dev/shsec/secret .Ed .Pp Modified: head/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- head/sbin/geom/class/virstor/gvirstor.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/geom/class/virstor/gvirstor.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2012 +.Dd October 1, 2013 .Dt GVIRSTOR 8 .Os .Sh NAME @@ -161,7 +161,7 @@ size .Pq 4 MiB , with two physical devices for backing storage. .Bd -literal -offset indent -.No gvirstor label -v Ar mydata Ar /dev/ad4 Ar /dev/ad6 +.No gvirstor label -v Ar mydata Ar /dev/ada4 Ar /dev/ada6 .No newfs Ar /dev/virstor/mydata .Ed .Pp @@ -170,11 +170,11 @@ From now on, the virtual device will be device entry. To add a new physical device / component to an active virstor device: .Bd -literal -offset indent -.No gvirstor add Ar mydata Ar ad8 +.No gvirstor add Ar mydata Ar ada8 .Ed .Pp This will add physical storage of -.Ar ad8 +.Ar ada8 to .Pa /dev/virstor/mydata device. Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/gvinum/gvinum.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2009 +.Dd October 1, 2013 .Dt GVINUM 8 .Os .Sh NAME @@ -279,27 +279,27 @@ directory with device nodes for objects .El .Sh EXAMPLES -To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop +To create a mirror on disks /dev/ada1 and /dev/ada2, create a filesystem, +mount, unmount and then stop .Ic gvinum : .Pp -.Dl "gvinum mirror /dev/ad1 /dev/ad2" +.Dl "gvinum mirror /dev/ada1 /dev/ada2" .Dl "newfs /dev/gvinum/gvinumvolume0" .Dl "mount /dev/gvinum/gvinumvolume0 /mnt" .Dl "..." .Dl "unmount /mnt" .Dl "gvinum stop" .Pp -To create a striped mirror on disks /dev/ad1 /dev/ad2 /dev/ad3 and /dev/ad4 -named "data" and create a filesystem: +To create a striped mirror on disks /dev/ada1 /dev/ada2 /dev/ada3 and +/dev/ada4 named "data" and create a filesystem: .Pp -.Dl "gvinum mirror -s -n data /dev/ad1 /dev/ad2 /dev/ad3 /dev/ad4" +.Dl "gvinum mirror -s -n data /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4" .Dl "newfs /dev/gvinum/data" .Pp -To create a raid5 array on disks /dev/ad1 /dev/ad2 and /dev/ad3, with stripesize -493k you can use the raid5 command: +To create a raid5 array on disks /dev/ada1 /dev/ada2 and /dev/ada3, +with stripesize 493k you can use the raid5 command: .Pp -.Dl "gvinum raid5 -s 493k /dev/ad1 /dev/ad2 /dev/ad3" +.Dl "gvinum raid5 -s 493k /dev/ada1 /dev/ada2 /dev/ada3" .Pp Then the volume will be created automatically. Afterwards, you have to initialize the volume: @@ -313,9 +313,9 @@ The list command will give you informati Imagine that one of the drives fails, and the output of 'printconfig' looks something like this: .Pp -.Dl "drive gvinumdrive1 device /dev/ad2" +.Dl "drive gvinumdrive1 device /dev/ada2" .Dl "drive gvinumdrive2 device /dev/???" -.Dl "drive gvinumdrive0 device /dev/ad1" +.Dl "drive gvinumdrive0 device /dev/ada1" .Dl "volume myraid5vol" .Dl "plex name myraid5vol.p0 org raid5 986s vol myraid5vol" .Dl "sd name myraid5vol.p0.s2 drive gvinumdrive2 len 32538s driveoffset 265s" @@ -327,7 +327,7 @@ something like this: .Pp Create a new drive with this configuration: .Pp -.Dl "drive gdrive4 device /dev/ad4" +.Dl "drive gdrive4 device /dev/ada4" .Pp Then move the stale subdisk to the new drive: .Pp @@ -344,7 +344,7 @@ might be delayed. Given the configuration as in the previous example, growing a RAID-5 or STRIPED array is accomplished by using the grow command: .Pp -.Dl "gvinum grow myraid5vol.p0 /dev/ad4" +.Dl "gvinum grow myraid5vol.p0 /dev/ada4" .Pp If everything went ok, the plex state should now be set to growable. You can then start the growing with the Modified: head/sbin/mount_msdosfs/mount_msdosfs.8 ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/mount_msdosfs/mount_msdosfs.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd October 1, 2013 .Dt MOUNT_MSDOSFS 8 .Os .Sh NAME @@ -182,14 +182,14 @@ Specify text file name with conversion t .El .Sh EXAMPLES To mount a Russian MS-DOS file system located in -.Pa /dev/ad1s1 : +.Pa /dev/ada1s1 : .Pp -.Dl "mount_msdosfs -L ru_RU.KOI8-R -D CP866 /dev/ad1s1 /mnt" +.Dl "mount_msdosfs -L ru_RU.KOI8-R -D CP866 /dev/ada1s1 /mnt" .Pp To mount a Japanese MS-DOS file system located in -.Pa /dev/ad1s1 : +.Pa /dev/ada1s1 : .Pp -.Dl "mount_msdosfs -L ja_JP.eucJP -D CP932 /dev/ad1s1 /mnt" +.Dl "mount_msdosfs -L ja_JP.eucJP -D CP932 /dev/ada1s1 /mnt" .Sh SEE ALSO .Xr mount 2 , .Xr unmount 2 , Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/newfs/newfs.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd June 22, 2011 +.Dd October 1, 2013 .Dt NEWFS 8 .Os .Sh NAME @@ -285,10 +285,10 @@ to find the alternate superblocks if the The size of a sector in bytes (almost never anything but 512). .El .Sh EXAMPLES -.Dl newfs /dev/ad3s1a +.Dl newfs /dev/ada3s1a .Pp Creates a new ufs file system on -.Pa ad3s1a . +.Pa ada3s1a . The .Nm utility will use a block size of 32768 bytes, a fragment size of 4096 bytes Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/newfs_msdos/newfs_msdos.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2010 +.Dd October 1, 2013 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -209,9 +209,9 @@ The maximum file size is 4GB, even if th Exit status is 0 on success and 1 on error. .Sh EXAMPLES Create a file system, using default parameters, on -.Pa /dev/ad0s1 : +.Pa /dev/ada0s1 : .Bd -literal -offset indent -newfs_msdos /dev/ad0s1 +newfs_msdos /dev/ada0s1 .Ed .Pp Create a standard 1.44M file system, with volume label Modified: head/sbin/newfs_nandfs/newfs_nandfs.8 ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/newfs_nandfs/newfs_nandfs.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2009 +.Dd October 1, 2013 .Dt NEWFS_NANDFS 8 .Os .Sh NAME @@ -58,9 +58,9 @@ Percentage of reserved blocks (5 if not Exit status is 0 on success and 1 on error. .Sh EXAMPLES Create a file system, using default parameters, on -.Pa /dev/ad0s1 : +.Pa /dev/ada0s1 : .Bd -literal -offset indent -newfs_nandfs /dev/ad0s1 +newfs_nandfs /dev/ada0s1 .Ed .Sh SEE ALSO .Xr disktab 5 , Modified: head/sbin/recoverdisk/recoverdisk.1 ============================================================================== --- head/sbin/recoverdisk/recoverdisk.1 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sbin/recoverdisk/recoverdisk.1 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2012 +.Dd October 1, 2013 .Dt RECOVERDISK 1 .Os .Sh NAME @@ -104,11 +104,11 @@ Percent complete. .El .Sh EXAMPLES .Bd -literal -# recover data from failing hard drive ad3 -recoverdisk /dev/ad3 /data/disk.img +# recover data from failing hard drive ada3 +recoverdisk /dev/ada3 /data/disk.img # clone a hard disk -recoverdisk /dev/ad3 /dev/ad4 +recoverdisk /dev/ada3 /dev/ada4 # read an ISO image from a CD-ROM recoverdisk /dev/cd0 /data/cd.iso @@ -120,7 +120,7 @@ recoverdisk -r worklist -w worklist /dev recoverdisk /cdrom/file.avi file.avi # If the disk hangs the system on read-errors try: -recoverdisk -b 0 /dev/ad3 /somewhere +recoverdisk -b 0 /dev/ada3 /somewhere .Ed .Sh SEE ALSO Modified: head/share/man/man4/geom_linux_lvm.4 ============================================================================== --- head/share/man/man4/geom_linux_lvm.4 Tue Oct 1 17:51:04 2013 (r255976) +++ head/share/man/man4/geom_linux_lvm.4 Tue Oct 1 18:41:53 2013 (r255977) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2008 +.Dd October 1, 2013 .Dt GEOM_LINUX_LVM 4 .Os .Sh NAME @@ -72,7 +72,7 @@ Providers: Sectorsize: 512 Mode: r0w0e0 Consumers: -1. Name: ad0s1 +1. Name: ada0s1 Mediasize: 80023716864 (75G) Sectorsize: 512 Mode: r0w0e0 Modified: head/share/man/man5/ext2fs.5 ============================================================================== --- head/share/man/man5/ext2fs.5 Tue Oct 1 17:51:04 2013 (r255976) +++ head/share/man/man5/ext2fs.5 Tue Oct 1 18:41:53 2013 (r255977) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd October 1, 2013 .Dt EXT2FS 5 .Os .Sh NAME @@ -53,9 +53,9 @@ file systems. To mount a .Nm volume located on -.Pa /dev/ad1s1 : +.Pa /dev/ada1s1 : .Pp -.Dl "mount -t ext2fs /dev/ad1s1 /mnt" +.Dl "mount -t ext2fs /dev/ada1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , Modified: head/share/man/man5/msdosfs.5 ============================================================================== --- head/share/man/man5/msdosfs.5 Tue Oct 1 17:51:04 2013 (r255976) +++ head/share/man/man5/msdosfs.5 Tue Oct 1 18:41:53 2013 (r255977) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd August 22, 2007 +.Dd October 1, 2013 .Dt MSDOSFS 5 .Os .Sh NAME @@ -21,7 +21,7 @@ based file systems. .Pp The most common usage follows: .Pp -.Dl "mount -t msdosfs /dev/ad0sN /mnt" +.Dl "mount -t msdosfs /dev/ada0sN /mnt" .Pp where .Ar N @@ -40,7 +40,7 @@ It is possible to define an entry in .Pa /etc/fstab that looks similar to: .Bd -literal -/dev/ad0sN /dos msdosfs rw 0 0 +/dev/ada0sN /dos msdosfs rw 0 0 .Ed .Pp This will mount an Modified: head/share/man/man5/reiserfs.5 ============================================================================== --- head/share/man/man5/reiserfs.5 Tue Oct 1 17:51:04 2013 (r255976) +++ head/share/man/man5/reiserfs.5 Tue Oct 1 18:41:53 2013 (r255977) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd October 1, 2013 .Dt REISERFS 5 .Os .Sh NAME @@ -53,9 +53,9 @@ file systems. To mount a .Nm volume located on -.Pa /dev/ad1s1 : +.Pa /dev/ada1s1 : .Pp -.Dl "mount -t reiserfs /dev/ad1s1 /mnt" +.Dl "mount -t reiserfs /dev/ada1s1 /mnt" .Sh SEE ALSO .Xr nmount 2 , .Xr unmount 2 , Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/share/man/man8/picobsd.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -1,6 +1,6 @@ .\" -*- nroff-fill -*- .\" $FreeBSD$ -.Dd June 25, 2009 +.Dd October 1, 2013 .Dt PICOBSD 8 .Os .Sh NAME @@ -408,9 +408,9 @@ and the floppy is ready to boot. The same process can be used to store the image on a hard disk (entire volume or one of the slices): .Bd -literal -offset indent -dd if=picobsd.bin of=/dev/ad2 -dd if=picobsd.bin of=/dev/ad2s3 -dd if=picobsd.bin of=/dev/ad2 oseek=NN +dd if=picobsd.bin of=/dev/ada2 +dd if=picobsd.bin of=/dev/ada2s3 +dd if=picobsd.bin of=/dev/ada2 oseek=NN .Ed .Pp The first form will install the image on the entire disk, and it @@ -435,8 +435,8 @@ You have to use the command to properly initialize the label (do not ask why!). One way to do this is .Bd -literal -offset indent -disklabel -w ad0s2 auto -disklabel -e ad0s2 +disklabel -w ada0s2 auto +disklabel -e ada0s2 .Ed .Pp and from the editor enter a line corresponding to the actual partition, e.g.\& Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/sys/boot/common/loader.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2012 +.Dd October 1, 2013 .Dt LOADER 8 .Os .Sh NAME @@ -972,7 +972,7 @@ autoboot 5 .Pp Set the disk unit of the root device to 2, and then boot. This would be needed in a system with two IDE disks, -with the second IDE disk hardwired to ad2 instead of ad1. +with the second IDE disk hardwired to ada2 instead of ada1. .Bd -literal -offset indent set root_disk_unit=2 boot /boot/kernel/kernel Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Tue Oct 1 17:51:04 2013 (r255976) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Tue Oct 1 18:41:53 2013 (r255977) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2012 +.Dd October 1, 2013 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -173,17 +173,17 @@ Image for serial consoles (COM1,9600,8,N .Sh EXAMPLES To boot slice 2 on the next boot: .Pp -.Dl "boot0cfg -s 2 ad0" +.Dl "boot0cfg -s 2 ada0" .Pp To enable just slices 1 and 3 in the menu: .Pp -.Dl "boot0cfg -m 0x5 ad0" +.Dl "boot0cfg -m 0x5 ada0" .Pp To go back to non-interactive booting, use .Xr fdisk 8 to install the default MBR: .Pp -.Dl "fdisk -B ad0" +.Dl "fdisk -B ada0" .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 19:14:25 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 5D51CDB3; Tue, 1 Oct 2013 19:14:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A33D2135; Tue, 1 Oct 2013 19:14:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91JEPnN047738; Tue, 1 Oct 2013 19:14:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91JEPMr047737; Tue, 1 Oct 2013 19:14:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310011914.r91JEPMr047737@svn.freebsd.org> From: Dimitry Andric Date: Tue, 1 Oct 2013 19:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255978 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 19:14:25 -0000 Author: dim Date: Tue Oct 1 19:14:24 2013 New Revision: 255978 URL: http://svnweb.freebsd.org/changeset/base/255978 Log: Pull in r191711 from upstream llvm trunk: The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress on ADD16rr opcodes, if src1 != src, since that would cause convertToThreeAddress to try to create a virtual register. This is not permitted after register allocation, which is when the X86FixupLEAs pass runs. This patch fixes PR16785. Pull in r191715 from upstream llvm trunk: Forgot to add a break statement. This should enable building the x11-toolskits/libXaw port with CPUTYPE=atom. Approved by: re (gjb) Reported by: Kenta Suzumoto MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Modified: head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Tue Oct 1 18:41:53 2013 (r255977) +++ head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Tue Oct 1 19:14:24 2013 (r255978) @@ -125,6 +125,15 @@ FixupLEAPass::postRAConvertToLEA(Machine // which requires isImm() to be true return 0; } + break; + case X86::ADD16rr: + case X86::ADD16rr_DB: + if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) { + // if src1 != src2, then convertToThreeAddress will + // need to create a Virtual register, which we cannot do + // after register allocation. + return 0; + } } return TII->convertToThreeAddress(MFI, MBBI, 0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 20:18:33 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EE453ADB; Tue, 1 Oct 2013 20:18:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB9CA2712; Tue, 1 Oct 2013 20:18:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91KIXtK063531; Tue, 1 Oct 2013 20:18:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91KIX5H063530; Tue, 1 Oct 2013 20:18:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310012018.r91KIX5H063530@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 1 Oct 2013 20:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255979 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 20:18:34 -0000 Author: kib Date: Tue Oct 1 20:18:33 2013 New Revision: 255979 URL: http://svnweb.freebsd.org/changeset/base/255979 Log: When printing the vnode information from ddb, print the lengths of the dirty and clean buffer queues. Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Oct 1 19:14:24 2013 (r255978) +++ head/sys/kern/vfs_subr.c Tue Oct 1 20:18:33 2013 (r255979) @@ -2892,9 +2892,12 @@ vn_printf(struct vnode *vp, const char * if (mtx_owned(VI_MTX(vp))) printf(" VI_LOCKed"); if (vp->v_object != NULL) - printf(" v_object %p ref %d pages %d\n", + printf(" v_object %p ref %d pages %d " + "cleanbuf %d dirtybuf %d\n", vp->v_object, vp->v_object->ref_count, - vp->v_object->resident_page_count); + vp->v_object->resident_page_count, + vp->v_bufobj.bo_dirty.bv_cnt, + vp->v_bufobj.bo_clean.bv_cnt); printf(" "); lockmgr_printinfo(vp->v_vnlock); if (vp->v_data != NULL) From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 21:17:18 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 992C4B33; Tue, 1 Oct 2013 21:17:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 865102B0A; Tue, 1 Oct 2013 21:17:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91LHIuw029613; Tue, 1 Oct 2013 21:17:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91LHIKh029612; Tue, 1 Oct 2013 21:17:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310012117.r91LHIKh029612@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 1 Oct 2013 21:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255980 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 21:17:18 -0000 Author: jilles Date: Tue Oct 1 21:17:18 2013 New Revision: 255980 URL: http://svnweb.freebsd.org/changeset/base/255980 Log: accept(2): Update portability note for accept4(). The accept(2) man page warns that O_NONBLOCK and other properties on the new socket may vary across implementations. However, this issue only applies to accept() and not to accept4(). On the other hand, accept4() is not commonly available yet. Reported by: pluknet Reviewed by: bjk Approved by: re (kib) Modified: head/lib/libc/sys/accept.2 Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Tue Oct 1 20:18:33 2013 (r255979) +++ head/lib/libc/sys/accept.2 Tue Oct 1 21:17:18 2013 (r255980) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd October 1, 2013 .Dt ACCEPT 2 .Os .Sh NAME @@ -155,13 +155,20 @@ For some applications, performance may b .Xr accept_filter 9 to pre-process incoming connections. .Pp -Portable programs should not rely on the +When using +.Fn accept , +portable programs should not rely on the .Dv O_NONBLOCK and .Dv O_ASYNC properties and the signal destination being inherited, but should set them explicitly using -.Xr fcntl 2 . +.Xr fcntl 2 ; +.Fn accept4 +sets these properties consistently, +but may not be fully portable across +.Ux +platforms. .Sh RETURN VALUES These calls return \-1 on error. If they succeed, they return a non-negative From owner-svn-src-all@FreeBSD.ORG Tue Oct 1 22:53:28 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 737CFCBB; Tue, 1 Oct 2013 22:53:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6056D21BB; Tue, 1 Oct 2013 22:53:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91MrSRR018888; Tue, 1 Oct 2013 22:53:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91MrSkT018886; Tue, 1 Oct 2013 22:53:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310012253.r91MrSkT018886@svn.freebsd.org> From: Xin LI Date: Tue, 1 Oct 2013 22:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255981 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 22:53:28 -0000 Author: delphij Date: Tue Oct 1 22:53:27 2013 New Revision: 255981 URL: http://svnweb.freebsd.org/changeset/base/255981 Log: Revert-and-redo r255955: the sort -r should be added to delete-old-dirs. Approved by: re (gjb) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 1 21:17:18 2013 (r255980) +++ head/Makefile.inc1 Tue Oct 1 22:53:27 2013 (r255981) @@ -1673,7 +1673,7 @@ delete-old-files: # the Makefile parser segfault. @exec 3<&0; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | sort -r | \ + -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ @@ -1738,7 +1738,7 @@ check-old-libs: delete-old-dirs: @echo ">>> Removing old directories" @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ - -V OLD_DIRS | xargs -n1 | \ + -V OLD_DIRS | xargs -n1 | sort -r | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ rmdir -v "${DESTDIR}/$${dir}" || true; \ From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 00:50:27 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id A4AB22B9; Wed, 2 Oct 2013 00:50:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92AC927FF; Wed, 2 Oct 2013 00:50:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r920oRnj005509; Wed, 2 Oct 2013 00:50:27 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r920oRLt005507; Wed, 2 Oct 2013 00:50:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310020050.r920oRLt005507@svn.freebsd.org> From: Ed Maste Date: Wed, 2 Oct 2013 00:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255982 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 00:50:27 -0000 Author: emaste Date: Wed Oct 2 00:50:27 2013 New Revision: 255982 URL: http://svnweb.freebsd.org/changeset/base/255982 Log: Use correct size for MIPS .rld_map section On MIPS .dynamic is read-only and so a special section .rld_map is used to store the pointer to the rtld information for debuggers. This section had a hard coded size of 4 bytes which is not correct for mips64. (Note that FreeBSD's rtld does not yet populate .rld_map.) Sponsored by: DARPA, AFRL Approved by: re (delphij) Modified: head/contrib/binutils/bfd/elfxx-mips.c Modified: head/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- head/contrib/binutils/bfd/elfxx-mips.c Tue Oct 1 22:53:27 2013 (r255981) +++ head/contrib/binutils/bfd/elfxx-mips.c Wed Oct 2 00:50:27 2013 (r255982) @@ -557,6 +557,10 @@ static bfd *reldyn_sorting_bfd; #define MIPS_ELF_DYN_SIZE(abfd) \ (get_elf_backend_data (abfd)->s->sizeof_dyn) +/* The size of the rld_map pointer. */ +#define MIPS_ELF_RLD_MAP_SIZE(abfd) \ + (get_elf_backend_data (abfd)->s->arch_size / 8) + /* The size of a GOT entry. */ #define MIPS_ELF_GOT_SIZE(abfd) \ (get_elf_backend_data (abfd)->s->arch_size / 8) @@ -7492,7 +7496,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd { /* We add a room for __rld_map. It will be filled in by the rtld to contain a pointer to the _r_debug structure. */ - s->size += 4; + s->size += MIPS_ELF_RLD_MAP_SIZE (output_bfd); } else if (SGI_COMPAT (output_bfd) && CONST_STRNEQ (name, ".compact_rel")) From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 02:32:59 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8C0C33F8; Wed, 2 Oct 2013 02:32:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0722E48; Wed, 2 Oct 2013 02:32:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r922Wx1r051574; Wed, 2 Oct 2013 02:32:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r922WxgJ051573; Wed, 2 Oct 2013 02:32:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310020232.r922WxgJ051573@svn.freebsd.org> From: Ed Maste Date: Wed, 2 Oct 2013 02:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255983 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 02:32:59 -0000 Author: emaste Date: Wed Oct 2 02:32:58 2013 New Revision: 255983 URL: http://svnweb.freebsd.org/changeset/base/255983 Log: Populate .rld_map on MIPS for debuggers On MIPS the .dynamic section is read-only, so the pointer to rtld information for debuggers cannot be stored there (in DT_DEBUG). Instead, a special section .rld_map is used. Sponsored by: DARPA, AFRL Approved by: re (delphij) Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Oct 2 00:50:27 2013 (r255982) +++ head/libexec/rtld-elf/rtld.c Wed Oct 2 02:32:58 2013 (r255983) @@ -1111,11 +1111,7 @@ digest_dynamic1(Obj_Entry *obj, int earl break; case DT_MIPS_RLD_MAP: -#ifdef notyet - if (!early) - dbg("Filling in DT_DEBUG entry"); - ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; -#endif + *((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr) &r_debug; break; #endif From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 04:18:00 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E5DCABCE; Wed, 2 Oct 2013 04:18:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D351D2695; Wed, 2 Oct 2013 04:18:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r924I0mN074772; Wed, 2 Oct 2013 04:18:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r924I0cd074769; Wed, 2 Oct 2013 04:18:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310020418.r924I0cd074769@svn.freebsd.org> From: Glen Barber Date: Wed, 2 Oct 2013 04:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255984 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 04:18:01 -0000 Author: gjb Date: Wed Oct 2 04:18:00 2013 New Revision: 255984 URL: http://svnweb.freebsd.org/changeset/base/255984 Log: MFC r255712: Remove extra 'MAKE_FLAGS' line. Modified: stable/9/release/release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/release.sh ============================================================================== --- stable/9/release/release.sh Wed Oct 2 02:32:58 2013 (r255983) +++ stable/9/release/release.sh Wed Oct 2 04:18:00 2013 (r255984) @@ -77,7 +77,6 @@ TARGET_ARCH="${TARGET}" # ports/ checkout also forces NODOC to be set. NODOC= NOPORTS= -MAKE_FLAGS="${MAKE_FLAGS}" get_rev_branch () { # Set up the OSVERSION, BRANCH, and REVISION based on the src/ tree From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 04:40:47 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 2DB0B93; Wed, 2 Oct 2013 04:40:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1ED2863; Wed, 2 Oct 2013 04:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r924ekvN004400; Wed, 2 Oct 2013 04:40:46 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r924eksU004398; Wed, 2 Oct 2013 04:40:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310020440.r924eksU004398@svn.freebsd.org> From: Glen Barber Date: Wed, 2 Oct 2013 04:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255985 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 04:40:47 -0000 Author: gjb Date: Wed Oct 2 04:40:46 2013 New Revision: 255985 URL: http://svnweb.freebsd.org/changeset/base/255985 Log: Add FreeBSD 9.2-RELEASE to the BSD Family Tree Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Oct 2 04:18:00 2013 (r255984) +++ head/share/misc/bsd-family-tree Wed Oct 2 04:40:46 2013 (r255985) @@ -263,22 +263,23 @@ FreeBSD 5.2 | | | | | | | | | | OpenBSD 5.2 DragonFly 3.2.1 | FreeBSD | | | | | NetBSD | | | 9.1 | | | | | 5.2 | | - | | | | | | | | | - | | | | | | NetBSD | | - | | | | | | 5.2.1 | | - | | | | | | | | - | | | | | \ | | - | | | | | NetBSD | | - | | | | | 6.0.1 | | - | | | | | | OpenBSD 5.3 DragonFly 3.4.1 - | | | | | NetBSD | | - | | | | | 6.0.2 | | - | | | | | | | - | | | | `-NetBSD 6.1 | | - | FreeBSD | | | | - | 8.4 | | | | - | | | | | - | | | | | + | | | | | | | | | | + | | | | | | | NetBSD | | + | | | | | | | 5.2.1 | | + | | | | | | | | | + | | | | | | \ | | + | | | | | | NetBSD | | + | | | | | | 6.0.1 | | + | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 + | | | | | | NetBSD | | + | | | | | | 6.0.2 | | + | | | | | | | | + | | | | | `-NetBSD 6.1 | | + | | FreeBSD | | | | + | | 8.4 | | | | + | | | | | | + | FreeBSD | | | | + | 9.2 | | | | | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | @@ -589,6 +590,7 @@ NetBSD 6.1 2013-05-18 [NBD] FreeBSD 8.4 2013-06-07 [FBD] NetBSD 5.1.3 2013-09-29 [NBD] NetBSD 5.2.1 2013-09-29 [NBD] +FreeBSD 9.2 2013-09-30 [FBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 05:30:01 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8CCF6961; Wed, 2 Oct 2013 05:30:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2ACC02C00; Wed, 2 Oct 2013 05:30:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r925TqwN011681; Wed, 2 Oct 2013 08:29:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r925TqwN011681 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r925TqLm011680; Wed, 2 Oct 2013 08:29:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Oct 2013 08:29:51 +0300 From: Konstantin Belousov To: Ed Maste Subject: Re: svn commit: r255983 - head/libexec/rtld-elf Message-ID: <20131002052951.GU41229@kib.kiev.ua> References: <201310020232.r922WxgJ051573@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DdbKCPkVBkC7ZIh6" Content-Disposition: inline In-Reply-To: <201310020232.r922WxgJ051573@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 05:30:01 -0000 --DdbKCPkVBkC7ZIh6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 02, 2013 at 02:32:59AM +0000, Ed Maste wrote: > Author: emaste > Date: Wed Oct 2 02:32:58 2013 > New Revision: 255983 > URL: http://svnweb.freebsd.org/changeset/base/255983 >=20 > Log: > Populate .rld_map on MIPS for debuggers > =20 > On MIPS the .dynamic section is read-only, so the pointer to rtld > information for debuggers cannot be stored there (in DT_DEBUG). > Instead, a special section .rld_map is used. > =20 > Sponsored by: DARPA, AFRL > Approved by: re (delphij) >=20 > Modified: > head/libexec/rtld-elf/rtld.c >=20 > Modified: head/libexec/rtld-elf/rtld.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/libexec/rtld-elf/rtld.c Wed Oct 2 00:50:27 2013 (r255982) > +++ head/libexec/rtld-elf/rtld.c Wed Oct 2 02:32:58 2013 (r255983) > @@ -1111,11 +1111,7 @@ digest_dynamic1(Obj_Entry *obj, int earl > break; > =20 > case DT_MIPS_RLD_MAP: > -#ifdef notyet > - if (!early) > - dbg("Filling in DT_DEBUG entry"); > - ((Elf_Dyn*)dynp)->d_un.d_ptr =3D (Elf_Addr) &r_debug; > -#endif > + *((Elf_Addr *)(dynp->d_un.d_ptr)) =3D (Elf_Addr) &r_debug; > break; > #endif > =20 Could the DT_DEBUG and DT_MIPS_RLD_MAP cases be collapsed some more, e.g. by putting only the 'case :' lines under ifdef ? Also, you removed the if (!early) test. Is rtld relocated enough in the init_rtld() for this assignment to work correctly ? --DdbKCPkVBkC7ZIh6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSS69PAAoJEJDCuSvBvK1BG5wQAKIzUYRV3O+u/J34XQGR/tuS O0dxqFqG0x84ouSKUih/HS11XOGcAzwXaUcrfLlZJ9i8vE8szdljuPVZo32wT9ll nPu2jV5XiEZyc/dpGkVr8QmogPcW6adOvfdTAsG/BDBOhy6/mecqZeO/yt4Il1dq +9HjsTMpEmYdxP35oHuOqwhq3YR3DDjCtEvvtanvGwFZFVhJiIvrrt1Mumg1z/K/ +qZmaea0q8+mgkCiedU/qbrhkwtxpy0e+vwrgZ/0uEP/l6ozE9UtU6LVx9xw1Af3 vbeJNdv9/cEweIjNYBTNXJomQvca8vXF3/VsaC4i9kanecolzwxrviAajHpvMEUA WF3Je7hHkGwI1Gx3SGWRz+1GmcrIl8THPstZ1XQIvOnXLOKUXmj4/hlqNSseD/Ob 2grvEUNdaemyHWJzVjefRFVtHEazF7MtL0RxeRzKLt9Wsij5PCRcuPZPUefy+paX AoOTr7s5XrgMNAeFF8QvW9uSg6CaXaBbfSfZ7Eo84upo1YCo1PBBL3+3p/h/EOYP R8JAHOyv26pi4OK5JsEWS93nrrt0k48z5f+LRP3CBRmJOq+LXTah+FyyIaOBd33x E1Glc9g9PVff+f5dEf/HtIjbPyZdUCHAOdocLjjdVcPw2XOwWpW3aTAWmjeQoeFL 2WhvQ+XPfiwQK+abgbRu =3/ng -----END PGP SIGNATURE----- --DdbKCPkVBkC7ZIh6-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 06:00:35 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 9E2F2FE; Wed, 2 Oct 2013 06:00:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC562E59; Wed, 2 Oct 2013 06:00:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9260ZFh002820; Wed, 2 Oct 2013 06:00:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9260Z6g002791; Wed, 2 Oct 2013 06:00:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310020600.r9260Z6g002791@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 2 Oct 2013 06:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255986 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 06:00:35 -0000 Author: kib Date: Wed Oct 2 06:00:34 2013 New Revision: 255986 URL: http://svnweb.freebsd.org/changeset/base/255986 Log: When helping the bufdaemon from the buffer allocation context, there is no sense to walk the whole dirty buffer queue. We are only interested in, and can operate on, the buffers owned by the current vnode [1]. Instead of calling generic queue flush routine, do VOP_FSYNC() if possible. Holding the dirty buffer queue lock in the bufdaemon, without dropping it, can cause starvation of buffer writes from other threads. This is esp. easy to reproduce on the big memory machines, where large files are written, causing almost all dirty buffers accumulating in several big files, which vnodes are locked by writers. Bufdaemon cannot flush any buffer, but is iterating over the whole dirty queue continuously. Since dirty queue mutex is not dropped, bufdone() in g_up thread is starved, usually deadlocking the machine [2]. Mitigate this by dropping the queue lock after the vnode is locked, allowing other queue lock contenders to make a progress. Discussed with: Jeff [1] Reported by: pho [2] Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (hrs) Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Oct 2 04:40:46 2013 (r255985) +++ head/sys/kern/vfs_bio.c Wed Oct 2 06:00:34 2013 (r255986) @@ -113,8 +113,8 @@ static void vfs_setdirty_locked_object(s static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno); -static int buf_flush(struct vnode *vp, int); -static int flushbufqueues(struct vnode *, int, int); +static int buf_flush(int); +static int flushbufqueues(int, int); static void buf_daemon(void); static void bremfreel(struct buf *bp); static __inline void bd_wakeup(void); @@ -2048,7 +2048,7 @@ getnewbuf_bufd_help(struct vnode *vp, in { struct thread *td; char *waitmsg; - int fl, flags, norunbuf; + int cnt, error, flags, norunbuf, wait; mtx_assert(&bqclean, MA_OWNED); @@ -2072,10 +2072,13 @@ getnewbuf_bufd_help(struct vnode *vp, in return; td = curthread; + cnt = 0; + wait = MNT_NOWAIT; mtx_lock(&nblock); while (needsbuffer & flags) { if (vp != NULL && (td->td_pflags & TDP_BUFNEED) == 0) { mtx_unlock(&nblock); + /* * getblk() is called with a vnode locked, and * some majority of the dirty buffers may as @@ -2084,15 +2087,20 @@ getnewbuf_bufd_help(struct vnode *vp, in * cannot be achieved by the buf_daemon, that * cannot lock the vnode. */ - norunbuf = ~(TDP_BUFNEED | TDP_NORUNNINGBUF) | - (td->td_pflags & TDP_NORUNNINGBUF); - /* play bufdaemon */ - td->td_pflags |= TDP_BUFNEED | TDP_NORUNNINGBUF; - fl = buf_flush(vp, flushbufqtarget); - td->td_pflags &= norunbuf; + if (cnt++ > 2) + wait = MNT_WAIT; + ASSERT_VOP_LOCKED(vp, "bufd_helper"); + error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : + vn_lock(vp, LK_TRYUPGRADE); + if (error == 0) { + /* play bufdaemon */ + norunbuf = curthread_pflags_set(TDP_BUFNEED | + TDP_NORUNNINGBUF); + VOP_FSYNC(vp, wait, td); + atomic_add_long(¬bufdflushes, 1); + curthread_pflags_restore(norunbuf); + } mtx_lock(&nblock); - if (fl != 0) - continue; if ((needsbuffer & flags) == 0) break; } @@ -2510,20 +2518,18 @@ static struct kproc_desc buf_kp = { SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp); static int -buf_flush(struct vnode *vp, int target) +buf_flush(int target) { int flushed; - flushed = flushbufqueues(vp, target, 0); + flushed = flushbufqueues(target, 0); if (flushed == 0) { /* * Could not find any buffers without rollback * dependencies, so just write the first one * in the hopes of eventually making progress. */ - if (vp != NULL && target > 2) - target /= 2; - flushbufqueues(vp, target, 1); + flushed = flushbufqueues(target, 1); } return (flushed); } @@ -2560,7 +2566,7 @@ buf_daemon() * the I/O system. */ while (numdirtybuffers > lodirty) { - if (buf_flush(NULL, numdirtybuffers - lodirty) == 0) + if (buf_flush(numdirtybuffers - lodirty) == 0) break; kern_yield(PRI_USER); } @@ -2615,7 +2621,7 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps 0, "Number of buffers flushed with dependecies that require rollbacks"); static int -flushbufqueues(struct vnode *lvp, int target, int flushdeps) +flushbufqueues(int target, int flushdeps) { struct buf *sentinel; struct vnode *vp; @@ -2625,7 +2631,6 @@ flushbufqueues(struct vnode *lvp, int ta int flushed; int queue; int error; - bool unlock; flushed = 0; queue = QUEUE_DIRTY; @@ -2634,27 +2639,24 @@ flushbufqueues(struct vnode *lvp, int ta sentinel->b_qindex = QUEUE_SENTINEL; mtx_lock(&bqdirty); TAILQ_INSERT_HEAD(&bufqueues[queue], sentinel, b_freelist); + mtx_unlock(&bqdirty); while (flushed != target) { + maybe_yield(); + mtx_lock(&bqdirty); bp = TAILQ_NEXT(sentinel, b_freelist); if (bp != NULL) { TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist); TAILQ_INSERT_AFTER(&bufqueues[queue], bp, sentinel, b_freelist); - } else + } else { + mtx_unlock(&bqdirty); break; - /* - * Skip sentinels inserted by other invocations of the - * flushbufqueues(), taking care to not reorder them. - */ - if (bp->b_qindex == QUEUE_SENTINEL) - continue; - /* - * Only flush the buffers that belong to the - * vnode locked by the curthread. - */ - if (lvp != NULL && bp->b_vp != lvp) - continue; - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) + } + KASSERT(bp->b_qindex != QUEUE_SENTINEL, + ("parallel calls to flushbufqueues() bp %p", bp)); + error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL); + mtx_unlock(&bqdirty); + if (error != 0) continue; if (bp->b_pin_count > 0) { BUF_UNLOCK(bp); @@ -2670,11 +2672,9 @@ flushbufqueues(struct vnode *lvp, int ta continue; } if (bp->b_flags & B_INVAL) { - bremfreel(bp); - mtx_unlock(&bqdirty); + bremfreef(bp); brelse(bp); flushed++; - mtx_lock(&bqdirty); continue; } @@ -2701,45 +2701,23 @@ flushbufqueues(struct vnode *lvp, int ta BUF_UNLOCK(bp); continue; } - if (lvp == NULL) { - unlock = true; - error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); - } else { - ASSERT_VOP_LOCKED(vp, "getbuf"); - unlock = false; - error = VOP_ISLOCKED(vp) == LK_EXCLUSIVE ? 0 : - vn_lock(vp, LK_TRYUPGRADE); - } + error = vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT); if (error == 0) { - mtx_unlock(&bqdirty); CTR3(KTR_BUF, "flushbufqueue(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - if (curproc == bufdaemonproc) - vfs_bio_awrite(bp); - else { - bremfree(bp); - bwrite(bp); - notbufdflushes++; - } + vfs_bio_awrite(bp); vn_finished_write(mp); - if (unlock) - VOP_UNLOCK(vp, 0); + VOP_UNLOCK(vp, 0); flushwithdeps += hasdeps; flushed++; - - /* - * Sleeping on runningbufspace while holding - * vnode lock leads to deadlock. - */ - if (curproc == bufdaemonproc && - runningbufspace > hirunningspace) + if (runningbufspace > hirunningspace) waitrunningbufspace(); - mtx_lock(&bqdirty); continue; } vn_finished_write(mp); BUF_UNLOCK(bp); } + mtx_lock(&bqdirty); TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist); mtx_unlock(&bqdirty); free(sentinel, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 09:30:26 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 68D89DAE; Wed, 2 Oct 2013 09:30:26 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 2945122F2; Wed, 2 Oct 2013 09:30:26 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 5740C6E73; Wed, 2 Oct 2013 09:30:19 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id E9AD151944; Wed, 2 Oct 2013 11:30:20 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Matthew Fleming Subject: Re: svn commit: r255963 - in head: etc/mtree etc/periodic/daily usr.bin/dig References: <201310010719.r917JNXB064511@svn.freebsd.org> Date: Wed, 02 Oct 2013 11:30:20 +0200 In-Reply-To: (Matthew Fleming's message of "Tue, 1 Oct 2013 07:21:01 -0700") Message-ID: <86r4c4qatv.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 09:30:26 -0000 Matthew Fleming writes: > It looks like {_BSD.debug.list} is no longer in FILES. [...] This > .endif needs to be removed too, as the MK_BIND_LIBS was nested inside > MK_BIND check. Please fix it for me, as I am clearly incapable of getting it right the first or even the second time. And I simply cannot understand how that stray .endif didn't break my tests. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 10:22:39 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 15A8371; Wed, 2 Oct 2013 10:22:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-qe0-x22c.google.com (mail-qe0-x22c.google.com [IPv6:2607:f8b0:400d:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AACEE2810; Wed, 2 Oct 2013 10:22:38 +0000 (UTC) Received: by mail-qe0-f44.google.com with SMTP id 3so370061qeb.3 for ; Wed, 02 Oct 2013 03:22: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=TcrL+vyBMd9RHZsXpv9HijzSBMrCYTsYUhGWN2R1nlQ=; b=Ty30rfxhGqL1A6oAbdKN64mQDonY2ygww2tKYB8p5nsfoRe4gyxwGYNawZ45uTj+VO g+K9HWb32IuUqsd4kOeSVymBMXm4pB//JXCsGNP+FSqkDzLMlUH+JlWsiQY+4XnYB0yF jAHmVi+zT2lPrM7f3e65UxVFTl6umpFVJj8tN/MyCBkyT+PVsuCkfcCP0dd/25T9ZKfQ bBrtQqPlurqyUoSp/Q56vKv/F5uiFtphRpwV16TOxKMWiZSL4oiupaQ8FMHB1jaioPtc m6HefaCPmvZ0/4e/14nk2uZaZvaHNXloE5BDby33czxhmhuvWGEs+SB+H+xJW1pKolI4 dFAw== MIME-Version: 1.0 X-Received: by 10.224.129.200 with SMTP id p8mr2321482qas.5.1380709357589; Wed, 02 Oct 2013 03:22:37 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.224.213.136 with HTTP; Wed, 2 Oct 2013 03:22:37 -0700 (PDT) In-Reply-To: <20131002052951.GU41229@kib.kiev.ua> References: <201310020232.r922WxgJ051573@svn.freebsd.org> <20131002052951.GU41229@kib.kiev.ua> Date: Wed, 2 Oct 2013 06:22:37 -0400 X-Google-Sender-Auth: Mx3ErRHGxfWthFUURBMz2WdRTVY Message-ID: Subject: Re: svn commit: r255983 - head/libexec/rtld-elf From: Ed Maste To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 10:22:39 -0000 On 2 October 2013 01:29, Konstantin Belousov wrote: > On Wed, Oct 02, 2013 at 02:32:59AM +0000, Ed Maste wrote: >> Modified: head/libexec/rtld-elf/rtld.c >> ============================================================================== >> --- head/libexec/rtld-elf/rtld.c Wed Oct 2 00:50:27 2013 (r255982) >> +++ head/libexec/rtld-elf/rtld.c Wed Oct 2 02:32:58 2013 (r255983) >> @@ -1111,11 +1111,7 @@ digest_dynamic1(Obj_Entry *obj, int earl >> break; >> >> case DT_MIPS_RLD_MAP: >> -#ifdef notyet >> - if (!early) >> - dbg("Filling in DT_DEBUG entry"); >> - ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; >> -#endif >> + *((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr) &r_debug; >> break; >> #endif >> > Could the DT_DEBUG and DT_MIPS_RLD_MAP cases be collapsed some more, e.g. by > putting only the 'case :' lines under ifdef ? No, the case statement bodies are different as well: DT_DEBUG: ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; DT_MIPS_RLD_MAP: *((Elf_Addr *)(dynp->d_un.d_ptr)) = (Elf_Addr) &r_debug; > Also, you removed the if (!early) test. It was just a dbg() statement in the if (!early) case; the assignment was unconditional (well, aside from being #ifdef'd away). From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 12:35:03 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EC57E823; Wed, 2 Oct 2013 12:35:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D97FA269B; Wed, 2 Oct 2013 12:35:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92CZ36S045451; Wed, 2 Oct 2013 12:35:03 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92CZ3Ge045448; Wed, 2 Oct 2013 12:35:03 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201310021235.r92CZ3Ge045448@svn.freebsd.org> From: Philip Paeps Date: Wed, 2 Oct 2013 12:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255987 - stable/9/sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 12:35:04 -0000 Author: philip Date: Wed Oct 2 12:35:03 2013 New Revision: 255987 URL: http://svnweb.freebsd.org/changeset/base/255987 Log: MFC r255928: Use the correct EtherType for logging IPv6 packets. Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_log.c Wed Oct 2 06:00:34 2013 (r255986) +++ stable/9/sys/netpfil/ipfw/ip_fw_log.c Wed Oct 2 12:35:03 2013 (r255987) @@ -173,11 +173,18 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (args->eh) /* layer2, use orig hdr */ BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m); - else + else { /* Add fake header. Later we will store * more info in the header. */ - BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); + if (ip->ip_v == 4) + BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); + else if (ip->ip_v == 6) + BPF_MTAP2(log_if, "DDDDDDSSSSSS\x86\xdd", ETHER_HDR_LEN, m); + else + /* Obviously bogus EtherType. */ + BPF_MTAP2(log_if, "DDDDDDSSSSSS\xff\xff", ETHER_HDR_LEN, m); + } #endif /* !WITHOUT_BPF */ return; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 13:33:11 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 03FF799B; Wed, 2 Oct 2013 13:33:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E57EB2B71; Wed, 2 Oct 2013 13:33:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92DXAch004718; Wed, 2 Oct 2013 13:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92DXAbd004716; Wed, 2 Oct 2013 13:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310021333.r92DXAbd004716@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Oct 2013 13:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255988 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 13:33:11 -0000 Author: nwhitehorn Date: Wed Oct 2 13:33:10 2013 New Revision: 255988 URL: http://svnweb.freebsd.org/changeset/base/255988 Log: Only build the POWER hypervisor UART driver if device uart is included in the kernel config. Approved by: re (gjb) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Wed Oct 2 12:35:03 2013 (r255987) +++ head/sys/conf/files.powerpc Wed Oct 2 13:33:10 2013 (r255988) @@ -227,7 +227,7 @@ powerpc/ps3/ps3_syscons.c optional ps3 s powerpc/ps3/ps3-hvcall.S optional ps3 sc powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 -powerpc/pseries/phyp_console.c optional pseries powerpc64 +powerpc/pseries/phyp_console.c optional pseries powerpc64 uart powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus powerpc/pseries/platform_chrp.c optional pseries powerpc/pseries/plpar_iommu.c optional pseries powerpc64 From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 14:43:17 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C5470D50; Wed, 2 Oct 2013 14:43:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2D812F8F; Wed, 2 Oct 2013 14:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92EhHU9076386; Wed, 2 Oct 2013 14:43:17 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92EhHCS076384; Wed, 2 Oct 2013 14:43:17 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310021443.r92EhHCS076384@svn.freebsd.org> From: Sean Bruno Date: Wed, 2 Oct 2013 14:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255989 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 14:43:17 -0000 Author: sbruno Date: Wed Oct 2 14:43:17 2013 New Revision: 255989 URL: http://svnweb.freebsd.org/changeset/base/255989 Log: set ROOTDEVNAME to ada0 with no paritions. This makes it much more functional with makefs and other tools for testing and ports building Approved by: re (gjb) MFC after: 2 weeks Modified: head/sys/mips/conf/MALTA Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Wed Oct 2 13:33:10 2013 (r255988) +++ head/sys/mips/conf/MALTA Wed Oct 2 14:43:17 2013 (r255989) @@ -51,7 +51,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"ufs:ada0s1a\" +options ROOTDEVNAME=\"ufs:ada0\" # Debugging for use in -current From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 15:00:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EB37D176; Wed, 2 Oct 2013 15:00:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D81F32078; Wed, 2 Oct 2013 15:00:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92F041g093142; Wed, 2 Oct 2013 15:00:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92F04kZ093141; Wed, 2 Oct 2013 15:00:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310021500.r92F04kZ093141@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Oct 2013 15:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255990 - stable/9/sys/powerpc/powerpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 15:00:05 -0000 Author: nwhitehorn Date: Wed Oct 2 15:00:04 2013 New Revision: 255990 URL: http://svnweb.freebsd.org/changeset/base/255990 Log: MFC r255614,255639: Fix bug in busdma: if segs is a preexisting buffer, we memcpy it into the DMA map. The length of the buffer had not yet been initialized, however, so this would copy gibberish unless it happened to be right by chance. This bug mostly only affected systems with IOMMUs. Modified: stable/9/sys/powerpc/powerpc/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/9/sys/powerpc/powerpc/busdma_machdep.c Wed Oct 2 14:43:17 2013 (r255989) +++ stable/9/sys/powerpc/powerpc/busdma_machdep.c Wed Oct 2 15:00:04 2013 (r255990) @@ -843,16 +843,19 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dma_segment_t *segs, int nsegs, int error) { + map->nsegs = nsegs; if (segs != NULL) memcpy(map->segments, segs, map->nsegs*sizeof(segs[0])); - else - segs = map->segments; - map->nsegs = nsegs; if (dmat->iommu != NULL) IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs, dmat->lowaddr, dmat->highaddr, dmat->alignment, dmat->boundary, dmat->iommu_cookie); + if (segs != NULL) + memcpy(segs, map->segments, map->nsegs*sizeof(segs[0])); + else + segs = map->segments; + return (segs); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 16:32:09 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 669FC6D1; Wed, 2 Oct 2013 16:32:09 +0000 (UTC) (envelope-from dteske@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 520692672; Wed, 2 Oct 2013 16:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92GW9BS085343; Wed, 2 Oct 2013 16:32:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92GW8o1085331; Wed, 2 Oct 2013 16:32:08 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310021632.r92GW8o1085331@svn.freebsd.org> From: Devin Teske Date: Wed, 2 Oct 2013 16:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255991 - in stable/9/usr.sbin/bsdconfig: examples share/media X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 16:32:09 -0000 Author: dteske Date: Wed Oct 2 16:32:07 2013 New Revision: 255991 URL: http://svnweb.freebsd.org/changeset/base/255991 Log: MFC revisions 255908, 255925, and 255925: SVN r255908: Fix a bug in HTTP checking/fetching. Add Main Site to HTTP menu. Add new example script browse_packages_http.sh and move existing example script browse_packages.sh -> browse_packages_ftp.sh SVN r255925: Remove the is (Iceland) mirror per mail from the admins. SVN r255925: Remove ftp5.se.f.o, as per request to -hubs@ Added: stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh - copied unchanged from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh - copied unchanged from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Deleted: stable/9/usr.sbin/bsdconfig/examples/browse_packages.sh Modified: stable/9/usr.sbin/bsdconfig/examples/Makefile stable/9/usr.sbin/bsdconfig/share/media/ftp.subr stable/9/usr.sbin/bsdconfig/share/media/http.subr Directory Properties: stable/9/usr.sbin/bsdconfig/ (props changed) Modified: stable/9/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- stable/9/usr.sbin/bsdconfig/examples/Makefile Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/examples/Makefile Wed Oct 2 16:32:07 2013 (r255991) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= browse_packages.sh bsdconfigrc +FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Copied: stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh (from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Wed Oct 2 16:32:07 2013 (r255991, copy of r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from FTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _ftpPath=ftp://ftp.freebsd.org + # For older releases, use ftp://ftp-archive.freebsd.org + mediaSetFTP + mediaOpen + f_show_info "Downloading packages/INDEX from\n %s" "$_ftpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages Copied: stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh (from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh Wed Oct 2 16:32:07 2013 (r255991, copy of r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _httpPath=http://ftp.freebsd.org + # For older releases, use http://ftp-archive.freebsd.org + mediaSetHTTP + mediaOpen + f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages Modified: stable/9/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- stable/9/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 2 16:32:07 2013 (r255991) @@ -125,7 +125,6 @@ f_dialog_menu_media_ftp() ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_iceland' 'ftp.is.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' @@ -165,7 +164,6 @@ f_dialog_menu_media_ftp() ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #5' 'ftp5.se.freebsd.org' ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' Modified: stable/9/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- stable/9/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 2 16:32:07 2013 (r255991) @@ -77,7 +77,8 @@ f_dialog_menu_media_http() f_dialog_title_restore local prompt="$msg_please_select_the_site_closest_to_you_or_other" local menu_list=" - 'URL' '$msg_specify_some_other_http_site' + '$msg_main_site' 'ftp.freebsd.org' + 'URL' '$msg_specify_some_other_http_site' " # END-QUOTE local hline="$msg_select_a_site_thats_close" @@ -390,8 +391,12 @@ f_http_check_access() f_show_info "$msg_checking_access_to" "$http_path" local rx + case "$http_path" in + http://*|/*) : valid request ;; + *) http_path="/$http_path" # full URI requests only + esac if ! rx=$( - printf "GET /%s/ HTTP/1.0\r\n\r\n" "${http_path%/}" | + printf "GET %s/ HTTP/1.0\r\n\r\n" "${http_path%/}" | nc -n "$host" "$http_port" ); then f_show_msg "$msg_couldnt_connect_to_server http://%s:%s/" \ @@ -581,8 +586,12 @@ f_media_get_http() local http_path f_getvar $VAR_HTTP_PATH%/ http_path - local url="/$http_path/$file" rx + case "$http_path" in + http://*|/*) : valid request ;; + *) http_path="/$http_path" # full URI requests only + esac + local url="$http_path/$file" rx f_dprintf "sending http request for: %s" "$url" printf "GET %s HTTP/1.0\r\n\r\n" "$url" | nc -n "$host" "$http_port" | ( From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 17:14:13 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 47B8B8E2; Wed, 2 Oct 2013 17:14:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 343B129BF; Wed, 2 Oct 2013 17:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92HED9C026255; Wed, 2 Oct 2013 17:14:13 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92HECng026252; Wed, 2 Oct 2013 17:14:12 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310021714.r92HECng026252@svn.freebsd.org> From: Mark Johnston Date: Wed, 2 Oct 2013 17:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255993 - in head: cddl/lib/libdtrace 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 17:14:13 -0000 Author: markj Date: Wed Oct 2 17:14:12 2013 New Revision: 255993 URL: http://svnweb.freebsd.org/changeset/base/255993 Log: Add a separate translator for headers passed to the TCP probes in the input path. These probes get some of the fields in host order, whereas the output probes get them in network order, so a single translator isn't enough. This workaround ensures that the problem is essentially invisble to users: none of the probe arguments or their fields have changed. Approved by: re (hrs) Modified: head/cddl/lib/libdtrace/tcp.d head/sys/netinet/in_kdtrace.c Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Wed Oct 2 16:56:11 2013 (r255992) +++ head/cddl/lib/libdtrace/tcp.d Wed Oct 2 17:14:12 2013 (r255993) @@ -141,6 +141,25 @@ typedef struct tcpinfo { struct tcphdr *tcp_hdr; /* raw TCP header */ } tcpinfo_t; +/* + * A clone of tcpinfo_t used to handle the fact that the TCP input path + * overwrites some fields of the TCP header with their host-order equivalents. + * Unfortunately, DTrace doesn't let us simply typedef a new name for struct + * tcpinfo and define a separate translator for it. + */ +typedef struct tcpinfoh { + uint16_t tcp_sport; /* source port */ + uint16_t tcp_dport; /* destination port */ + uint32_t tcp_seq; /* sequence number */ + uint32_t tcp_ack; /* acknowledgment number */ + uint8_t tcp_offset; /* data offset, in bytes */ + uint8_t tcp_flags; /* flags */ + uint16_t tcp_window; /* window size */ + uint16_t tcp_checksum; /* checksum */ + uint16_t tcp_urgent; /* urgent data pointer */ + struct tcphdr *tcp_hdr; /* raw TCP header */ +} tcpinfoh_t; + #pragma D binding "1.0" translator translator csinfo_t < struct tcpcb *p > { cs_addr = NULL; @@ -180,7 +199,7 @@ translator tcpsinfo_t < struct tcpcb *p tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata; tcps_rto = p == NULL ? -1 : p->t_rxtcur / 1000; /* XXX */ tcps_mss = p == NULL ? -1 : p->t_maxseg; - tcps_retransmit = -1; /* XXX */ + tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; }; #pragma D binding "1.0" translator @@ -197,6 +216,25 @@ translator tcpinfo_t < struct tcphdr *p tcp_hdr = (struct tcphdr *)p; }; +/* + * This translator differs from the one for tcpinfo_t in that the sequence + * number, acknowledgement number, window size and urgent pointer are already + * in host order and thus don't need to be converted. + */ +#pragma D binding "1.0" translator +translator tcpinfoh_t < struct tcphdr *p > { + tcp_sport = p == NULL ? 0 : ntohs(p->th_sport); + tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); + tcp_seq = p == NULL ? -1 : p->th_seq; + tcp_ack = p == NULL ? -1 : p->th_ack; + tcp_offset = p == NULL ? -1 : (p->th_off >> 2); + tcp_flags = p == NULL ? 0 : p->th_flags; + tcp_window = p == NULL ? 0 : (p->th_win); + tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); + tcp_urgent = p == NULL ? 0 : p->th_urp; + tcp_hdr = (struct tcphdr *)p; +}; + #pragma D binding "1.0" translator translator tcplsinfo_t < int s > { tcps_state = s; Modified: head/sys/netinet/in_kdtrace.c ============================================================================== --- head/sys/netinet/in_kdtrace.c Wed Oct 2 16:56:11 2013 (r255992) +++ head/sys/netinet/in_kdtrace.c Wed Oct 2 17:14:12 2013 (r255993) @@ -60,7 +60,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , accept_ "struct tcpcb *", "csinfo_t *", "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , - "struct tcphdr *", "tcpinfo_t *"); + "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , accept_refused, accept-refused, "void *", "pktinfo_t *", @@ -74,14 +74,14 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect "struct tcpcb *", "csinfo_t *", "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , - "struct tcphdr *", "tcpinfo_t *"); + "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect_refused, connect-refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , - "struct tcphdr *", "tcpinfo_t *"); + "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect_request, connect-request, "void *", "pktinfo_t *", @@ -95,7 +95,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , receive "struct tcpcb *", "csinfo_t *", "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , - "struct tcphdr *", "tcpinfo_t *"); + "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , send, send, "void *", "pktinfo_t *", From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 18:41:15 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id A9EB2823; Wed, 2 Oct 2013 18:41:15 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD96D2FF6; Wed, 2 Oct 2013 18:41:14 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id x18so1141554lbi.3 for ; Wed, 02 Oct 2013 11:41: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=rbd3I9sWG7k/3VqPefhv0FViaQwnmAtu38lbOXv1p9A=; b=N7s9bwVDfSyfUt1HIaOb/GtsXIUm58qg8eEVPxpGXIO+wSTmsHYkfYEvFCZ1L75cyJ WT3DtBl51dRdJA383wuejhlqsH99bQXQEVdvX0X20fBl8x6mCi+qSeksYF9Aw381djk/ LoSLDzAybpwm7WqdbYw7oHlMp53kI3ALgHZaH6Br9sqMeJVdCezCzjM31Ut8Tvwnolai Y67T3l3Uuwfj8COe5CE1newcLqgGH7qiI+Nn7SqLZRoBmcJoe7a1p7AgFxXP4hJvmzfm OTICjZgrHudOI3PeEGVF+Jf/cj9mAInF1yZgnN6JUv4fTzXOb0znXEWMiyzBTq9qvKMN GSHg== MIME-Version: 1.0 X-Received: by 10.152.30.74 with SMTP id q10mr3122393lah.27.1380739272927; Wed, 02 Oct 2013 11:41:12 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.152.25.227 with HTTP; Wed, 2 Oct 2013 11:41:12 -0700 (PDT) In-Reply-To: <86r4c4qatv.fsf@nine.des.no> References: <201310010719.r917JNXB064511@svn.freebsd.org> <86r4c4qatv.fsf@nine.des.no> Date: Wed, 2 Oct 2013 11:41:12 -0700 X-Google-Sender-Auth: tkg-_o5gdc-UQLRL7YCvVw3nW0Q Message-ID: Subject: Re: svn commit: r255963 - in head: etc/mtree etc/periodic/daily usr.bin/dig From: Matthew Fleming To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 18:41:15 -0000 On Wed, Oct 2, 2013 at 2:30 AM, Dag-Erling Sm=F8rgrav wrote: > Matthew Fleming writes: > > It looks like {_BSD.debug.list} is no longer in FILES. [...] This > > .endif needs to be removed too, as the MK_BIND_LIBS was nested inside > > MK_BIND check. > > Please fix it for me, as I am clearly incapable of getting it right the > first or even the second time. And I simply cannot understand how that > stray .endif didn't break my tests. I'm setting up a FreeBSD 10 VM now to test it. It seemed odd to me it would work with an extra .endif, so it's always possible I'm just seeing things. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 18:45:40 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 144009CC; Wed, 2 Oct 2013 18:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F350E2034; Wed, 2 Oct 2013 18:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92Ijd9O014001; Wed, 2 Oct 2013 18:45:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92Ijcvu013978; Wed, 2 Oct 2013 18:45:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310021845.r92Ijcvu013978@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Oct 2013 18:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256001 - in stable/9: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 18:45:40 -0000 Author: jhb Date: Wed Oct 2 18:45:37 2013 New Revision: 256001 URL: http://svnweb.freebsd.org/changeset/base/256001 Log: MFC 236768,252209,253047: Several improvements to rmlock(9). Many of these are based on patches provided by Isilon. - Add an rm_assert() supporting various lock assertions similar to other locking primitives. Because rmlocks track readers the assertions are always fully accurate unlike rw_assert() and sx_assert(). - Flesh out the lock class methods for rmlocks to support sleeping via condvars and rm_sleep() (but only while holding write locks), rmlock details in 'show lock' in DDB, and the lc_owner method used by dtrace. - Add an internal destroyed cookie so that API functions can assert that an rmlock is not destroyed. - Make use of rm_assert() to add various assertions to the API (e.g. to assert locks are held when an unlock routine is called). - Give RM_SLEEPABLE locks their own lock class and always use the rmlock's own lock_object with WITNESS. - Various updates to the manpage. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/rmlock.9 stable/9/sys/kern/kern_cpuset.c stable/9/sys/kern/kern_rmlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/sys/_rmlock.h stable/9/sys/sys/cpuset.h stable/9/sys/sys/lock.h stable/9/sys/sys/rmlock.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/share/man/man9/Makefile Wed Oct 2 18:45:37 2013 (r256001) @@ -1058,12 +1058,15 @@ MLINKS+=rman.9 rman_activate_resource.9 rman.9 rman_set_bustag.9 \ rman.9 rman_set_rid.9 \ rman.9 rman_set_virtual.9 -MLINKS+=rmlock.9 rm_destroy.9 \ +MLINKS+=rmlock.9 rm_assert.9 \ + rmlock.9 rm_destroy.9 \ rmlock.9 rm_init.9 \ + rmlock.9 rm_init_flags.9 \ rmlock.9 rm_rlock.9 \ - rmlock.9 rm_try_rlock.9 \ rmlock.9 rm_runlock.9 \ + rmlock.9 rm_sleep.9 \ rmlock.9 RM_SYSINIT.9 \ + rmlock.9 rm_try_rlock.9 \ rmlock.9 rm_wlock.9 \ rmlock.9 rm_wowned.9 \ rmlock.9 rm_wunlock.9 Modified: stable/9/share/man/man9/rmlock.9 ============================================================================== --- stable/9/share/man/man9/rmlock.9 Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/share/man/man9/rmlock.9 Wed Oct 2 18:45:37 2013 (r256001) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" Based on rwlock.9 man page -.Dd November 10, 2007 +.Dd June 25, 2013 .Dt RMLOCK 9 .Os .Sh NAME @@ -40,8 +40,10 @@ .Nm rm_runlock , .Nm rm_wunlock , .Nm rm_wowned , +.Nm rm_sleep , +.Nm rm_assert , .Nm RM_SYSINIT -.Nd kernel reader/writer lock optimized for mostly read access patterns +.Nd kernel reader/writer lock optimized for read-mostly access patterns .Sh SYNOPSIS .In sys/param.h .In sys/lock.h @@ -64,10 +66,17 @@ .Fn rm_wunlock "struct rmlock *rm" .Ft int .Fn rm_wowned "struct rmlock *rm" +.Ft int +.Fn rm_sleep "void *wchan" "struct rmlock *rm" "int priority" "const char *wmesg" "int timo" +.Pp +.Cd "options INVARIANTS" +.Cd "options INVARIANT_SUPPORT" +.Ft void +.Fn rm_assert "struct rmlock *rm" "int what" .In sys/kernel.h .Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" "int opts" .Sh DESCRIPTION -Mostly reader locks allow shared access to protected data by multiple threads, +Read-mostly locks allow shared access to protected data by multiple threads, or exclusive access by a single thread. The threads with shared access are known as .Em readers @@ -76,83 +85,82 @@ A thread with exclusive access is known .Em writer since it can modify protected data. .Pp -Read mostly locks are designed to be efficient for locks almost exclusively +Read-mostly locks are designed to be efficient for locks almost exclusively used as reader locks and as such should be used for protecting data that rarely changes. -Acquiring an exclusive lock after the lock had been locked for shared access +Acquiring an exclusive lock after the lock has been locked for shared access is an expensive operation. .Pp -Although reader/writer locks look very similar to -.Xr sx 9 -locks, their usage pattern is different. -Reader/writer locks can be treated as mutexes (see -.Xr mutex 9 ) -with shared/exclusive semantics unless initialized with -.Dv RM_SLEEPABLE . +Normal read-mostly locks are similar to +.Xr rwlock 9 +locks and follow the same lock ordering rules as +.Xr rwlock 9 +locks. +Read-mostly locks have full priority propagation like mutexes. Unlike -.Xr sx 9 , -an -.Nm -can be locked while holding a non-spin mutex, and an -.Nm -cannot be held while sleeping, again unless initialized with -.Dv RM_SLEEPABLE . -The -.Nm -locks have full priority propagation like mutexes. -The +.Xr rwlock 9 , +read-mostly locks propagate priority to both readers and writers. +This is implemented via the .Va rm_priotracker -structure argument supplied in +structure argument supplied to .Fn rm_rlock and -.Fn rm_runlock -is used to keep track of the read owner(s). -Another important property is that shared holders of -.Nm -can recurse if the lock has been initialized with the -.Dv LO_RECURSABLE -option, however exclusive locks are not allowed to recurse. +.Fn rm_runlock . +Readers can recurse if the lock is initialized with the +.Dv RM_RECURSE +option; +however, writers are never allowed to recurse. +.Pp +Sleepable read-mostly locks are created by passing +.Dv RM_SLEEPABLE +to +.Fn rm_init_flags . +Unlike normal read-mostly locks, +sleepable read-mostly locks follow the same lock ordering rules as +.Xr sx 9 +locks. +Sleepable read-mostly locks do not propagate priority to writers, +but they do propagate priority to readers. +Writers are permitted to sleep while holding a read-mostly lock, +but readers are not. +Unlike other sleepable locks such as +.Xr sx 9 +locks, +readers must use try operations on other sleepable locks to avoid sleeping. .Ss Macros and Functions .Bl -tag -width indent .It Fn rm_init "struct rmlock *rm" "const char *name" -Initialize structure located at -.Fa rm -as mostly reader lock, described by -.Fa name . -The name description is used solely for debugging purposes. +Initialize the read-mostly lock +.Fa rm . +The +.Fa name +description is used solely for debugging purposes. This function must be called before any other operations on the lock. .It Fn rm_init_flags "struct rmlock *rm" "const char *name" "int opts" -Initialize the rm lock just like the -.Fn rm_init -function, but specifying a set of optional flags to alter the -behaviour of -.Fa rm , -through the +Similar to +.Fn rm_init , +initialize the read-mostly lock +.Fa rm +with a set of optional flags. +The .Fa opts -argument. -It contains one or more of the following flags: +arguments contains one or more of the following flags: .Bl -tag -width ".Dv RM_NOWITNESS" .It Dv RM_NOWITNESS Instruct .Xr witness 4 to ignore this lock. .It Dv RM_RECURSE -Allow threads to recursively acquire exclusive locks for +Allow threads to recursively acquire shared locks for .Fa rm . .It Dv RM_SLEEPABLE -Allow writers to sleep while holding the lock. -Readers must not sleep while holding the lock and can avoid to sleep on -taking the lock by using -.Fn rm_try_rlock -instead of -.Fn rm_rlock . +Create a sleepable read-mostly lock. .El .It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Lock .Fa rm -as a reader. -Using +as a reader using .Fa tracker to track read owners of a lock for priority propagation. This data structure is only used internally by @@ -161,28 +169,32 @@ and must persist until .Fn rm_runlock has been called. This data structure can be allocated on the stack since -rmlocks cannot be held while sleeping. +readers cannot sleep. If any thread holds this lock exclusively, the current thread blocks, and its priority is propagated to the exclusive holder. If the lock was initialized with the -.Dv LO_RECURSABLE +.Dv RM_RECURSE option the .Fn rm_rlock -function can be called when the thread has already acquired reader +function can be called when the current thread has already acquired reader access on .Fa rm . -This is called -.Dq "recursing on a lock" . .It Fn rm_try_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Try to lock .Fa rm as a reader. .Fn rm_try_rlock will return 0 if the lock cannot be acquired immediately; -otherwise the lock will be acquired and a non-zero value will be returned. +otherwise, +the lock will be acquired and a non-zero value will be returned. Note that .Fn rm_try_rlock may fail even while the lock is not currently held by a writer. +If the lock was initialized with the +.Dv RM_RECURSE +option, +.Fn rm_try_rlock +will succeed if the current thread has already acquired reader access. .It Fn rm_wlock "struct rmlock *rm" Lock .Fa rm @@ -212,12 +224,63 @@ lock must be unlocked. This function returns a non-zero value if the current thread owns an exclusive lock on .Fa rm . +.It Fn rm_sleep "void *wchan" "struct rmlock *rm" "int priority" "const char *wmesg" "int timo" +This function atomically releases +.Fa rm +while waiting for an event. +The +.Fa rm +lock must be exclusively locked. +For more details on the parameters to this function, +see +.Xr sleep 9 . +.It Fn rm_assert "struct rmlock *rm" "int what" +This function asserts that the +.Fa rm +lock is in the state specified by +.Fa what . +If the assertions are not true and the kernel is compiled with +.Cd "options INVARIANTS" +and +.Cd "options INVARIANT_SUPPORT" , +the kernel will panic. +Currently the following base assertions are supported: +.Bl -tag -width ".Dv RA_UNLOCKED" +.It Dv RA_LOCKED +Assert that current thread holds either a shared or exclusive lock +of +.Fa rm . +.It Dv RA_RLOCKED +Assert that current thread holds a shared lock of +.Fa rm . +.It Dv RA_WLOCKED +Assert that current thread holds an exclusive lock of +.Fa rm . +.It Dv RA_UNLOCKED +Assert that current thread holds neither a shared nor exclusive lock of +.Fa rm . +.El +.Pp +In addition, one of the following optional flags may be specified with +.Dv RA_LOCKED , +.Dv RA_RLOCKED , +or +.Dv RA_WLOCKED : +.Bl -tag -width ".Dv RA_NOTRECURSED" +.It Dv RA_RECURSED +Assert that the current thread holds a recursive lock of +.Fa rm . +.It Dv RA_NOTRECURSED +Assert that the current thread does not hold a recursive lock of +.Fa rm . +.El .El .Sh SEE ALSO .Xr locking 9 , .Xr mutex 9 , .Xr panic 9 , .Xr rwlock 9 , +.Xr sleep 9 , .Xr sema 9 , .Xr sx 9 .Sh HISTORY @@ -249,8 +312,3 @@ implementation uses a single per CPU lis rmlocks in the system. If rmlocks become popular, hashing to multiple per CPU queues may be needed to speed up the writer lock process. -.Pp -The -.Nm -can currently not be used as a lock argument for condition variable -wait functions. Modified: stable/9/sys/kern/kern_cpuset.c ============================================================================== --- stable/9/sys/kern/kern_cpuset.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/kern_cpuset.c Wed Oct 2 18:45:37 2013 (r256001) @@ -1149,25 +1149,34 @@ out: } #ifdef DDB +void +ddb_display_cpuset(const cpuset_t *set) +{ + int cpu, once; + + for (once = 0, cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, set)) { + if (once == 0) { + db_printf("%d", cpu); + once = 1; + } else + db_printf(",%d", cpu); + } + } + if (once == 0) + db_printf(""); +} + DB_SHOW_COMMAND(cpusets, db_show_cpusets) { struct cpuset *set; - int cpu, once; LIST_FOREACH(set, &cpuset_ids, cs_link) { db_printf("set=%p id=%-6u ref=%-6d flags=0x%04x parent id=%d\n", set, set->cs_id, set->cs_ref, set->cs_flags, (set->cs_parent != NULL) ? set->cs_parent->cs_id : 0); db_printf(" mask="); - for (once = 0, cpu = 0; cpu < CPU_SETSIZE; cpu++) { - if (CPU_ISSET(cpu, &set->cs_mask)) { - if (once == 0) { - db_printf("%d", cpu); - once = 1; - } else - db_printf(",%d", cpu); - } - } + ddb_display_cpuset(&set->cs_mask); db_printf("\n"); if (db_pager_quit) break; Modified: stable/9/sys/kern/kern_rmlock.c ============================================================================== --- stable/9/sys/kern/kern_rmlock.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/kern_rmlock.c Wed Oct 2 18:45:37 2013 (r256001) @@ -57,16 +57,26 @@ __FBSDID("$FreeBSD$"); #include #endif +/* + * A cookie to mark destroyed rmlocks. This is stored in the head of + * rm_activeReaders. + */ +#define RM_DESTROYED ((void *)0xdead) + +#define rm_destroyed(rm) \ + (LIST_FIRST(&(rm)->rm_activeReaders) == RM_DESTROYED) + #define RMPF_ONQUEUE 1 #define RMPF_SIGNAL 2 -/* - * To support usage of rmlock in CVs and msleep yet another list for the - * priority tracker would be needed. Using this lock for cv and msleep also - * does not seem very useful - */ +#ifndef INVARIANTS +#define _rm_assert(c, what, file, line) +#endif static void assert_rm(struct lock_object *lock, int what); +#ifdef DDB +static void db_show_rm(struct lock_object *lock); +#endif static void lock_rm(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS static int owner_rm(struct lock_object *lock, struct thread **owner); @@ -77,10 +87,22 @@ struct lock_class lock_class_rm = { .lc_name = "rm", .lc_flags = LC_SLEEPLOCK | LC_RECURSABLE, .lc_assert = assert_rm, -#if 0 #ifdef DDB - .lc_ddb_show = db_show_rwlock, + .lc_ddb_show = db_show_rm, +#endif + .lc_lock = lock_rm, + .lc_unlock = unlock_rm, +#ifdef KDTRACE_HOOKS + .lc_owner = owner_rm, #endif +}; + +struct lock_class lock_class_rm_sleepable = { + .lc_name = "sleepable rm", + .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE, + .lc_assert = assert_rm, +#ifdef DDB + .lc_ddb_show = db_show_rm, #endif .lc_lock = lock_rm, .lc_unlock = unlock_rm, @@ -93,29 +115,49 @@ static void assert_rm(struct lock_object *lock, int what) { - panic("assert_rm called"); + rm_assert((struct rmlock *)lock, what); } +/* + * These do not support read locks because it would be hard to make + * the tracker work correctly with the current lock_class API as you + * would need to have the tracker pointer available when calling + * rm_rlock() in lock_rm(). + */ static void lock_rm(struct lock_object *lock, int how) { + struct rmlock *rm; - panic("lock_rm called"); + rm = (struct rmlock *)lock; + if (how) + rm_wlock(rm); +#ifdef INVARIANTS + else + panic("lock_rm called in read mode"); +#endif } static int unlock_rm(struct lock_object *lock) { + struct rmlock *rm; - panic("unlock_rm called"); + rm = (struct rmlock *)lock; + rm_wunlock(rm); + return (1); } #ifdef KDTRACE_HOOKS static int owner_rm(struct lock_object *lock, struct thread **owner) { + struct rmlock *rm; + struct lock_class *lc; - panic("owner_rm called"); + rm = (struct rmlock *)lock; + lc = LOCK_CLASS(&rm->rm_wlock_object); + return (lc->lc_owner(&rm->rm_wlock_object, owner)); } #endif @@ -146,6 +188,28 @@ rm_tracker_add(struct pcpu *pc, struct r pc->pc_rm_queue.rmq_next = &tracker->rmp_cpuQueue; } +/* + * Return a count of the number of trackers the thread 'td' already + * has on this CPU for the lock 'rm'. + */ +static int +rm_trackers_present(const struct pcpu *pc, const struct rmlock *rm, + const struct thread *td) +{ + struct rm_queue *queue; + struct rm_priotracker *tracker; + int count; + + count = 0; + for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; + queue = queue->rmq_next) { + tracker = (struct rm_priotracker *)queue; + if ((tracker->rmp_rmlock == rm) && (tracker->rmp_thread == td)) + count++; + } + return (count); +} + static void inline rm_tracker_remove(struct pcpu *pc, struct rm_priotracker *tracker) { @@ -183,11 +247,10 @@ rm_cleanIPI(void *arg) } } -CTASSERT((RM_SLEEPABLE & LO_CLASSFLAGS) == RM_SLEEPABLE); - void rm_init_flags(struct rmlock *rm, const char *name, int opts) { + struct lock_class *lc; int liflags; liflags = 0; @@ -198,11 +261,14 @@ rm_init_flags(struct rmlock *rm, const c rm->rm_writecpus = all_cpus; LIST_INIT(&rm->rm_activeReaders); if (opts & RM_SLEEPABLE) { - liflags |= RM_SLEEPABLE; - sx_init_flags(&rm->rm_lock_sx, "rmlock_sx", SX_RECURSE); - } else + liflags |= LO_SLEEPABLE; + lc = &lock_class_rm_sleepable; + sx_init_flags(&rm->rm_lock_sx, "rmlock_sx", SX_NOWITNESS); + } else { + lc = &lock_class_rm; mtx_init(&rm->rm_lock_mtx, name, "rmlock_mtx", MTX_NOWITNESS); - lock_init(&rm->lock_object, &lock_class_rm, name, NULL, liflags); + } + lock_init(&rm->lock_object, lc, name, NULL, liflags); } void @@ -216,7 +282,9 @@ void rm_destroy(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + rm_assert(rm, RA_UNLOCKED); + LIST_FIRST(&rm->rm_activeReaders) = RM_DESTROYED; + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_destroy(&rm->rm_lock_sx); else mtx_destroy(&rm->rm_lock_mtx); @@ -227,7 +295,7 @@ int rm_wowned(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) return (sx_xlocked(&rm->rm_lock_sx)); else return (mtx_owned(&rm->rm_lock_mtx)); @@ -253,8 +321,6 @@ static int _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) { struct pcpu *pc; - struct rm_queue *queue; - struct rm_priotracker *atracker; critical_enter(); pc = pcpu_find(curcpu); @@ -285,20 +351,15 @@ _rm_rlock_hard(struct rmlock *rm, struct * Just grant the lock if this thread already has a tracker * for this lock on the per-cpu queue. */ - for (queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; queue = queue->rmq_next) { - atracker = (struct rm_priotracker *)queue; - if ((atracker->rmp_rmlock == rm) && - (atracker->rmp_thread == tracker->rmp_thread)) { - mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders, - tracker, rmp_qentry); - tracker->rmp_flags = RMPF_ONQUEUE; - mtx_unlock_spin(&rm_spinlock); - rm_tracker_add(pc, tracker); - critical_exit(); - return (1); - } + if (rm_trackers_present(pc, rm, curthread) != 0) { + mtx_lock_spin(&rm_spinlock); + LIST_INSERT_HEAD(&rm->rm_activeReaders, tracker, + rmp_qentry); + tracker->rmp_flags = RMPF_ONQUEUE; + mtx_unlock_spin(&rm_spinlock); + rm_tracker_add(pc, tracker); + critical_exit(); + return (1); } } @@ -306,7 +367,7 @@ _rm_rlock_hard(struct rmlock *rm, struct critical_exit(); if (trylock) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) { + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { if (!sx_try_xlock(&rm->rm_lock_sx)) return (0); } else { @@ -314,7 +375,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return (0); } } else { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xlock(&rm->rm_lock_sx); else mtx_lock(&rm->rm_lock_mtx); @@ -327,7 +388,7 @@ _rm_rlock_hard(struct rmlock *rm, struct sched_pin(); critical_exit(); - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xunlock(&rm->rm_lock_sx); else mtx_unlock(&rm->rm_lock_mtx); @@ -438,7 +499,7 @@ _rm_wlock(struct rmlock *rm) if (SCHEDULER_STOPPED()) return; - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xlock(&rm->rm_lock_sx); else mtx_lock(&rm->rm_lock_mtx); @@ -481,7 +542,7 @@ void _rm_wunlock(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xunlock(&rm->rm_lock_sx); else mtx_unlock(&rm->rm_lock_mtx); @@ -489,7 +550,8 @@ _rm_wunlock(struct rmlock *rm) #ifdef LOCK_DEBUG -void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wlock_debug(struct rmlock *rm, const char *file, int line) { if (SCHEDULER_STOPPED()) @@ -498,6 +560,10 @@ void _rm_wlock_debug(struct rmlock *rm, KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_wlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); + KASSERT(!rm_destroyed(rm), + ("rm_wlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_UNLOCKED, file, line); + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); @@ -505,11 +571,7 @@ void _rm_wlock_debug(struct rmlock *rm, LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line); - if (rm->lock_object.lo_flags & RM_SLEEPABLE) - WITNESS_LOCK(&rm->rm_lock_sx.lock_object, LOP_EXCLUSIVE, - file, line); - else - WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); + WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); curthread->td_locks++; @@ -522,14 +584,13 @@ _rm_wunlock_debug(struct rmlock *rm, con if (SCHEDULER_STOPPED()) return; - curthread->td_locks--; - if (rm->lock_object.lo_flags & RM_SLEEPABLE) - WITNESS_UNLOCK(&rm->rm_lock_sx.lock_object, LOP_EXCLUSIVE, - file, line); - else - WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); + KASSERT(!rm_destroyed(rm), + ("rm_wunlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_WLOCKED, file, line); + WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); + curthread->td_locks--; } int @@ -540,23 +601,43 @@ _rm_rlock_debug(struct rmlock *rm, struc if (SCHEDULER_STOPPED()) return (1); +#ifdef INVARIANTS + if (!(rm->lock_object.lo_flags & LO_RECURSABLE) && !trylock) { + critical_enter(); + KASSERT(rm_trackers_present(pcpu_find(curcpu), rm, + curthread) == 0, + ("rm_rlock: recursed on non-recursive rmlock %s @ %s:%d\n", + rm->lock_object.lo_name, file, line)); + critical_exit(); + } +#endif KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_rlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); - if (!trylock && (rm->lock_object.lo_flags & RM_SLEEPABLE)) - WITNESS_CHECKORDER(&rm->rm_lock_sx.lock_object, LOP_NEWORDER, - file, line, NULL); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL); + KASSERT(!rm_destroyed(rm), + ("rm_rlock() of destroyed rmlock @ %s:%d", file, line)); + if (!trylock) { + KASSERT(!rm_wowned(rm), + ("rm_rlock: wlock already held for %s @ %s:%d", + rm->lock_object.lo_name, file, line)); + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, + NULL); + } if (_rm_rlock(rm, tracker, trylock)) { - LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - + if (trylock) + LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 1, file, + line); + else + LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, + line); WITNESS_LOCK(&rm->lock_object, 0, file, line); curthread->td_locks++; return (1); - } + } else if (trylock) + LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 0, file, line); return (0); } @@ -569,10 +650,13 @@ _rm_runlock_debug(struct rmlock *rm, str if (SCHEDULER_STOPPED()) return; - curthread->td_locks--; + KASSERT(!rm_destroyed(rm), + ("rm_runlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_RLOCKED, file, line); WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); + curthread->td_locks--; } #else @@ -612,3 +696,130 @@ _rm_runlock_debug(struct rmlock *rm, str } #endif + +#ifdef INVARIANT_SUPPORT +#ifndef INVARIANTS +#undef _rm_assert +#endif + +/* + * Note that this does not need to use witness_assert() for read lock + * assertions since an exact count of read locks held by this thread + * is computable. + */ +void +_rm_assert(struct rmlock *rm, int what, const char *file, int line) +{ + int count; + + if (panicstr != NULL) + return; + switch (what) { + case RA_LOCKED: + case RA_LOCKED | RA_RECURSED: + case RA_LOCKED | RA_NOTRECURSED: + case RA_RLOCKED: + case RA_RLOCKED | RA_RECURSED: + case RA_RLOCKED | RA_NOTRECURSED: + /* + * Handle the write-locked case. Unlike other + * primitives, writers can never recurse. + */ + if (rm_wowned(rm)) { + if (what & RA_RLOCKED) + panic("Lock %s exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + if (what & RA_RECURSED) + panic("Lock %s not recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + } + + critical_enter(); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + critical_exit(); + + if (count == 0) + panic("Lock %s not %slocked @ %s:%d\n", + rm->lock_object.lo_name, (what & RA_RLOCKED) ? + "read " : "", file, line); + if (count > 1) { + if (what & RA_NOTRECURSED) + panic("Lock %s recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + } else if (what & RA_RECURSED) + panic("Lock %s not recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + case RA_WLOCKED: + if (!rm_wowned(rm)) + panic("Lock %s not exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + case RA_UNLOCKED: + if (rm_wowned(rm)) + panic("Lock %s exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + + critical_enter(); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + critical_exit(); + + if (count != 0) + panic("Lock %s read locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + default: + panic("Unknown rm lock assertion: %d @ %s:%d", what, file, + line); + } +} +#endif /* INVARIANT_SUPPORT */ + +#ifdef DDB +static void +print_tracker(struct rm_priotracker *tr) +{ + struct thread *td; + + td = tr->rmp_thread; + db_printf(" thread %p (tid %d, pid %d, \"%s\") {", td, td->td_tid, + td->td_proc->p_pid, td->td_name); + if (tr->rmp_flags & RMPF_ONQUEUE) { + db_printf("ONQUEUE"); + if (tr->rmp_flags & RMPF_SIGNAL) + db_printf(",SIGNAL"); + } else + db_printf("0"); + db_printf("}\n"); +} + +static void +db_show_rm(struct lock_object *lock) +{ + struct rm_priotracker *tr; + struct rm_queue *queue; + struct rmlock *rm; + struct lock_class *lc; + struct pcpu *pc; + + rm = (struct rmlock *)lock; + db_printf(" writecpus: "); + ddb_display_cpuset(__DEQUALIFY(const cpuset_t *, &rm->rm_writecpus)); + db_printf("\n"); + db_printf(" per-CPU readers:\n"); + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) + for (queue = pc->pc_rm_queue.rmq_next; + queue != &pc->pc_rm_queue; queue = queue->rmq_next) { + tr = (struct rm_priotracker *)queue; + if (tr->rmp_rmlock == rm) + print_tracker(tr); + } + db_printf(" active readers:\n"); + LIST_FOREACH(tr, &rm->rm_activeReaders, rmp_qentry) + print_tracker(tr); + lc = LOCK_CLASS(&rm->rm_wlock_object); + db_printf("Backing write-lock (%s):\n", lc->lc_name); + lc->lc_ddb_show(&rm->rm_wlock_object); +} +#endif Modified: stable/9/sys/kern/subr_lock.c ============================================================================== --- stable/9/sys/kern/subr_lock.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/subr_lock.c Wed Oct 2 18:45:37 2013 (r256001) @@ -66,6 +66,7 @@ struct lock_class *lock_classes[LOCK_CLA &lock_class_mtx_sleep, &lock_class_sx, &lock_class_rm, + &lock_class_rm_sleepable, &lock_class_rw, &lock_class_lockmgr, }; Modified: stable/9/sys/sys/_rmlock.h ============================================================================== --- stable/9/sys/sys/_rmlock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/_rmlock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -44,14 +44,17 @@ LIST_HEAD(rmpriolist,rm_priotracker); struct rmlock { - struct lock_object lock_object; + struct lock_object lock_object; volatile cpuset_t rm_writecpus; LIST_HEAD(,rm_priotracker) rm_activeReaders; union { + struct lock_object _rm_wlock_object; struct mtx _rm_lock_mtx; struct sx _rm_lock_sx; } _rm_lock; }; + +#define rm_wlock_object _rm_lock._rm_wlock_object #define rm_lock_mtx _rm_lock._rm_lock_mtx #define rm_lock_sx _rm_lock._rm_lock_sx Modified: stable/9/sys/sys/cpuset.h ============================================================================== --- stable/9/sys/sys/cpuset.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/cpuset.h Wed Oct 2 18:45:37 2013 (r256001) @@ -216,6 +216,9 @@ int cpuset_setproc_update_set(struct pro int cpusetobj_ffs(const cpuset_t *); char *cpusetobj_strprint(char *, const cpuset_t *); int cpusetobj_strscan(cpuset_t *, const char *); +#ifdef DDB +void ddb_display_cpuset(const cpuset_t *); +#endif #else __BEGIN_DECLS Modified: stable/9/sys/sys/lock.h ============================================================================== --- stable/9/sys/sys/lock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/lock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -192,6 +192,7 @@ extern struct lock_class lock_class_mtx_ extern struct lock_class lock_class_sx; extern struct lock_class lock_class_rw; extern struct lock_class lock_class_rm; +extern struct lock_class lock_class_rm_sleepable; extern struct lock_class lock_class_lockmgr; extern struct lock_class *lock_classes[]; Modified: stable/9/sys/sys/rmlock.h ============================================================================== --- stable/9/sys/sys/rmlock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/rmlock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -65,6 +65,10 @@ void _rm_wunlock(struct rmlock *rm); int _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock); void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void _rm_assert(struct rmlock *rm, int what, const char *file, + int line); +#endif /* * Public interface for lock operations. @@ -89,6 +93,9 @@ void _rm_runlock(struct rmlock *rm, str #define rm_try_rlock(rm,tracker) _rm_rlock((rm),(tracker), 1) #define rm_runlock(rm,tracker) _rm_runlock((rm), (tracker)) #endif +#define rm_sleep(chan, rm, pri, wmesg, timo) \ + _sleep((chan), &(rm)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) struct rm_args { struct rmlock *ra_rm; @@ -123,5 +130,20 @@ struct rm_args_flags { SYSUNINIT(name##_rm_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rm_destroy, (rm)) +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define RA_LOCKED LA_LOCKED +#define RA_RLOCKED LA_SLOCKED +#define RA_WLOCKED LA_XLOCKED +#define RA_UNLOCKED LA_UNLOCKED +#define RA_RECURSED LA_RECURSED +#define RA_NOTRECURSED LA_NOTRECURSED +#endif + +#ifdef INVARIANTS +#define rm_assert(rm, what) _rm_assert((rm), (what), LOCK_FILE, LOCK_LINE) +#else +#define rm_assert(rm, what) +#endif + #endif /* _KERNEL */ #endif /* !_SYS_RMLOCK_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 18:51:55 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 331FDD16; Wed, 2 Oct 2013 18:51:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B20920A4; Wed, 2 Oct 2013 18:51:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92Iptco021132; Wed, 2 Oct 2013 18:51:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92Ipnb3021018; Wed, 2 Oct 2013 18:51:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021851.r92Ipnb3021018@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256002 - in stable/9: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/ope... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 18:51:55 -0000 Author: pfg Date: Wed Oct 2 18:51:48 2013 New Revision: 256002 URL: http://svnweb.freebsd.org/changeset/base/256002 Log: MFC r250574, r250812, r253725; DTrace: option for time-ordered output Merge changes from illumos: 3021 option for time-ordered output from dtrace(1M) 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work 3025 register leak in D code generation This brings yet another feature implemented in upstream DTrace. A complete description is available here: http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/ This change bumps the DT_VERS_* number to 1.9.1 in accordance to what is done in illumos. Special thanks to Mark Johnston for fixes and testing. Illumos Revisions: 13758:23432da34147 Reference: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/1694 Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ - copied from r250812, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c - copied unchanged from r250574, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h - copied unchanged from r250574, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h Deleted: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c stable/9/cddl/lib/libdtrace/Makefile stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/cddl/lib/libdtrace/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Oct 2 18:51:48 2013 (r256002) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -1409,6 +1410,7 @@ main(int argc, char *argv[]) (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); #endif + (void) dtrace_setopt(g_dtp, "temporal", "yes"); /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Oct 2 18:51:48 2013 (r256002) @@ -583,6 +583,8 @@ if ($opt_x) { die "$PNAME: failed to open $PNAME.$$.log: $!\n" unless (!$opt_l || open(LOG, ">$PNAME.$$.log")); +$ENV{'DTRACE_DEBUG_REGSET'} = 'true'; + if ($opt_g) { $ENV{'UMEM_DEBUG'} = 'default,verbose'; $ENV{'UMEM_LOGGING'} = 'fail,contents'; Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d) @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +/* + * Make sure the sizes of compatible keys doesn't affect the sort order. + */ + +BEGIN +{ + @[(int)1, 0] = sum(10); + @[(uint64_t)2, 0] = sum(20); + @[(int)3, 0] = sum(30); + @[(uint64_t)4, 0] = sum(40); + printa(@); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out) @@ -0,0 +1,6 @@ + + 1 0 10 + 2 0 20 + 3 0 30 + 4 0 40 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out) @@ -0,0 +1,8 @@ +The value of i is 6 +The value of i is 18 +The value of i is 72 +The value of i is 25920 +The value of i is 935761216 +The value of i is -91738734 +The value of i is -91738729 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test compile-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + x = (int32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d) @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test narrowing at assignment. + */ + +#pragma D option quiet + +uint16_t x; +uint32_t y; + +BEGIN +{ + x = 0xbeefcafe; + y = x; + printf("%x", y); /* where's the beef? */ + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out) @@ -0,0 +1 @@ +cafe Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d) @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test execution-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + z = 0xfff0; + + x = (int32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Oct 2 18:51:48 2013 (r256002) @@ -23,26 +23,29 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: * Positive test for fill buffer policy. * * SECTION: Buffers and Buffering/fill Policy; - * Buffers and Buffering/Buffer Sizes; + * Buffers and Buffering/Buffer Sizes; * Options and Tunables/bufsize; * Options and Tunables/bufpolicy; * Options and Tunables/statusrate */ /* - * This is a brute-force way of testing fill buffers. We assume that each - * printf() stores 8 bytes. Because each fill buffer is per-CPU, we must - * fill up our buffer in one series of enablings on a single CPU. + * This is a brute-force way of testing fill buffers. We assume that + * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp + * lo, timestamp hi, and the variable i). Because each fill buffer is + * per-CPU, we must fill up our buffer in one series of enablings on a + * single CPU. */ #pragma D option bufpolicy=fill -#pragma D option bufsize=64 +#pragma D option bufsize=128 #pragma D option statusrate=10ms #pragma D option quiet Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh) @@ -0,0 +1,106 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -c 'sleep 3' -s /dev/stdin < $file.2 + +sort -n $file.2 | diff $file.2 - +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: output is not sorted + exit $status +fi + +head -n 1 $file.2 | grep begin >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: begin probe did not fire + exit $status +fi + +tail -n 2 $file.2 | grep end >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: end probe did not fire + exit $status +fi + +if [ $(tail -n 1 $file.2 | cut -f3 -d ' ') -ne \ + $(wc -l $file.2) ]; then + echo $tst: incorrect number of lines output + exit 1 +fi + +exit $status Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh) @@ -0,0 +1,102 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted, even when some +# buffers are empty +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -s /dev/stdin < $file.2 + +sort -n $file.2 | diff $file.2 - +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: output is not sorted + exit $status +fi + +exit $status Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d) @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * This test excercises the "remnant" handling of the temporal option. + * At the end of one pass of retrieving and printing data from all CPUs, + * some unprocessed data will remain, because its timestamp is after the + * time covered by all CPUs' buffers. This unprocessed data is + * rearranged in a more space-efficient manner. If this is done + * incorrectly, an alignment error may occur. To test this, we use a + * high-frequency probe so that data will be recorded in subsequent + * CPU's buffers after the first CPU's buffer is obtained. The + * combination of data traced here (a 8-byte value and a 4-byte value) + * is effective to cause alignment problems with an incorrect + * implementation. + * + * This test needs to be run on a multi-CPU system to be effective. + */ + +#pragma D option quiet +#pragma D option temporal + +profile-4997 +{ + printf("%u %u", 1ULL, 2); +} + +tick-1 +/i++ == 10/ +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d) @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + print(*curpsinfo); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d) @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +typedef struct pancakes { + int i; + string s; + timespec_t t; +} pancakes_t; + +translator pancakes_t < void *V > { + i = 2 * 10; + s = strjoin("I like ", "pancakes"); + t = *(timespec_t *)`dtrace_zero; +}; + +BEGIN +{ + print(*(xlate < pancakes_t * > ((void *)NULL))); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out) @@ -0,0 +1,8 @@ +pancakes_t { + int i = 0x14 + string s = [ "I like pancakes" ] + timespec_t t = { + time_t tv_sec = 0 + long tv_nsec = 0 + } +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Oct 2 18:51:48 2013 (r256002) @@ -1,6 +1,6 @@ -239 -52719 +-17 +-12817 -1867788817 1311768467294899695 Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d) @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Check %d v. %i v. %u. + */ + +#pragma D option quiet + +uint16_t x; +int16_t y; + +BEGIN +{ + x = 0xffffffff; + y = 0xffffffff; + + printf("%d %i %u\n", x, x, x); + printf("%d %i %u\n", y, y, y); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out) @@ -0,0 +1,3 @@ +65535 -1 65535 +-1 -1 65535 + Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Oct 2 18:51:48 2013 (r256002) @@ -24,7 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + /* * ASSERTION: @@ -35,17 +38,10 @@ * * NOTES: This test behaves differently depending on the values * assigned to bufsize. - * 1. 0 > bufsize. - * 2. 0 == bufsize. - * 3. 0 < bufsize <= 7 - * 4. 8 <= bufsize <= 31 - * 5. 32 <= bufsize <= 47 - * 6. 48 <= bufsize <= 71 - * 7. 72 <= bufsize */ #pragma D option quiet -#pragma D option bufsize=41 +#pragma D option bufsize=49 BEGIN { Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d) @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + trace(*curpsinfo); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh) @@ -0,0 +1,62 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output for stable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin < (curthread); + +#pragma D attributes Stable/Stable/Common myinfo + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out) @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Stable + Data Semantics: Stable + Dependency Class: Common + + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh) @@ -0,0 +1,60 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output of unstable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin < (curthread); + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out) @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Private + Data Semantics: Private + Dependency Class: Unknown + + Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Oct 2 18:51:48 2013 (r256002) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -894,33 +895,14 @@ dt_aggregate_valcmp(const void *lhs, con caddr_t rdata = rh->dtahe_data.dtada_data; dtrace_recdesc_t *lrec, *rrec; int64_t *laddr, *raddr; - int rval, i; - - if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0) - return (rval); - - if (lagg->dtagd_nrecs > ragg->dtagd_nrecs) - return (DT_GREATERTHAN); - - if (lagg->dtagd_nrecs < ragg->dtagd_nrecs) - return (DT_LESSTHAN); + int rval; - for (i = 0; i < lagg->dtagd_nrecs; i++) { - lrec = &lagg->dtagd_rec[i]; - rrec = &ragg->dtagd_rec[i]; + assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs); - if (lrec->dtrd_offset < rrec->dtrd_offset) - return (DT_LESSTHAN); - - if (lrec->dtrd_offset > rrec->dtrd_offset) - return (DT_GREATERTHAN); + lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1]; + rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1]; - if (lrec->dtrd_action < rrec->dtrd_action) - return (DT_LESSTHAN); - - if (lrec->dtrd_action > rrec->dtrd_action) - return (DT_GREATERTHAN); - } + assert(lrec->dtrd_action == rrec->dtrd_action); laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset); raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset); Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 18:51:48 2013 (r256002) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 19:06:05 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id B6B0C1B6; Wed, 2 Oct 2013 19:06:05 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A41D4215E; Wed, 2 Oct 2013 19:06:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92J658Z033900; Wed, 2 Oct 2013 19:06:05 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92J65Ji033898; Wed, 2 Oct 2013 19:06:05 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310021906.r92J65Ji033898@svn.freebsd.org> From: Colin Percival Date: Wed, 2 Oct 2013 19:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256003 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:06:05 -0000 Author: cperciva Date: Wed Oct 2 19:06:05 2013 New Revision: 256003 URL: http://svnweb.freebsd.org/changeset/base/256003 Log: MFC r255878: Now that the portsnap buildbox is generating the raw bits for INDEX-10, add it to the set of INDEX files built by portsnap. Modified: stable/9/etc/portsnap.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/portsnap.conf ============================================================================== --- stable/9/etc/portsnap.conf Wed Oct 2 18:51:48 2013 (r256002) +++ stable/9/etc/portsnap.conf Wed Oct 2 19:06:05 2013 (r256003) @@ -33,3 +33,4 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 +INDEX INDEX-10 DESCRIBE.10 From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 19:18:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 86C1E828; Wed, 2 Oct 2013 19:18:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63AC52219; Wed, 2 Oct 2013 19:18:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JI4iK045401; Wed, 2 Oct 2013 19:18:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JI0iP045342; Wed, 2 Oct 2013 19:18:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021918.r92JI0iP045342@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256004 - in stable/9/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/funcs cmd/dtrace/test/tst/common/pointers cmd/dtrace/test/tst/common/print cmd/dtrace/test/tst/common/safety c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:18:04 -0000 Author: pfg Date: Wed Oct 2 19:18:00 2013 New Revision: 256004 URL: http://svnweb.freebsd.org/changeset/base/256004 Log: MFC r249426; Merge change from illumos: 3519 DTrace fails to resolve const types from fbt 3520 dtrace internal error -- token type 316 is not a valid D compilation token 3521 clean up dtrace unit tests Illumos Revision: e98f46c Reference: https://www.illumos.org/issues/3519 https://www.illumos.org/issues/3520 https://www.illumos.org/issues/3521 Tested by: Fabian Keil Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #pragma D option quiet @@ -36,3 +38,8 @@ BEGIN printf("%s\n", strjoin("", "")); exit(0); } + +BEGIN +{ + exit(1); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: This test reproduces the alignment error. @@ -39,9 +41,10 @@ BEGIN { - x = (int *) 64; + x = (int *)64; y = *x; trace(y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -44,6 +46,7 @@ BEGIN y = (int *) (x - 3300778156056); *y = 3; trace(*y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -39,9 +41,10 @@ BEGIN { - y = (int *) (-33007); + y = (int *)-33007; *y = 3; trace(*y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Demonstrating valid memory access. @@ -40,10 +42,11 @@ BEGIN { x = (int *)alloca(sizeof (int)); - printf("Address x: %x\n", (int) x); - y = (int *) (x - 2); + printf("Address x: %x\n", (int)x); + y = (int *)(x - 2); *y = 3; - printf("Address y: %x\tValue: %d\n", (int) y, *y); + printf("Address y: %x\tValue: %d\n", (int)y, *y); + exit(0); } ERROR Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + print(@); +} + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print((void)`p0); } + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print(); } + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,7 +41,7 @@ */ -#pragma D option bufsize=16 +#pragma D option bufsize=32 #pragma D option bufpolicy=ring #pragma D option statusrate=1nsec Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,8 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,3 +40,8 @@ BEGIN trace(); } + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + trace(@); +} + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -37,3 +39,8 @@ BEGIN { trace((void)`kmem_flags); } + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Make sure we can scope types with modifiers. + */ + +BEGIN +{ + trace((D`int *)0); + trace((const D`int *)0); + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 19:18:00 2013 (r256004) @@ -677,6 +677,12 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no "%s( ) may not be applied to a translated pointer\n", act); } + if (dnp->dn_args->dn_kind == DT_NODE_AGG) { + dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG, + "%s( ) may not be applied to an aggregation%s\n", act, + istrace ? "" : " -- did you mean printa()?"); + } + dt_cg(yypcb, dnp->dn_args); /* Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Oct 2 19:18:00 2013 (r256004) @@ -21,6 +21,7 @@ */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ @@ -254,11 +255,6 @@ dt_decl_spec(ushort_t kind, char *name) ddp->dd_kind = kind; ddp->dd_name = name; - if (name != NULL && strchr(name, '`') != NULL) { - xyerror(D_DECL_SCOPE, "D scoping operator may not be used " - "in a type name\n"); - } - return (dt_decl_check(ddp)); } Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Oct 2 19:18:00 2013 (r256004) @@ -190,8 +190,10 @@ typedef enum { D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */ D_TRACE_VOID, /* trace() argument has void type */ D_TRACE_DYN, /* trace() argument has dynamic type */ + D_TRACE_AGG, /* trace() argument is an aggregation */ D_PRINT_VOID, /* print() argument has void type */ D_PRINT_DYN, /* print() argument has dynamic type */ + D_PRINT_AGG, /* print() argument is an aggregation */ D_TRACEMEM_ADDR, /* tracemem() address bad type */ D_TRACEMEM_SIZE, /* tracemem() size bad type */ D_TRACEMEM_ARGS, /* tracemem() illegal number of args */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 19:20:15 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 9D34D98D; Wed, 2 Oct 2013 19:20:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89557222E; Wed, 2 Oct 2013 19:20:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JKFxg046925; Wed, 2 Oct 2013 19:20:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JKFWQ046924; Wed, 2 Oct 2013 19:20:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310021920.r92JKFWQ046924@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Oct 2013 19:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256005 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:20:15 -0000 Author: jhb Date: Wed Oct 2 19:20:15 2013 New Revision: 256005 URL: http://svnweb.freebsd.org/changeset/base/256005 Log: MFC 233422,233680,233681,237619,239904,249373,252346,252379,252423: Sync locking(9) with HEAD. The only change not merged is that 9 still supports !MPSAFE filesystems. Modified: stable/9/share/man/man9/locking.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/locking.9 ============================================================================== --- stable/9/share/man/man9/locking.9 Wed Oct 2 19:18:00 2013 (r256004) +++ stable/9/share/man/man9/locking.9 Wed Oct 2 19:20:15 2013 (r256005) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2012 +.Dd June 30, 2013 .Dt LOCKING 9 .Os .Sh NAME @@ -33,44 +33,51 @@ .Sh DESCRIPTION The .Em FreeBSD -kernel is written to run across multiple CPUs and as such requires -several different synchronization primitives to allow the developers -to safely access and manipulate the many data types required. +kernel is written to run across multiple CPUs and as such provides +several different synchronization primitives to allow developers +to safely access and manipulate many data types. .Ss Mutexes -Mutexes (also called "sleep mutexes") are the most commonly used +Mutexes (also called "blocking mutexes") are the most commonly used synchronization primitive in the kernel. -Thread acquires (locks) a mutex before accessing data shared with other +A thread acquires (locks) a mutex before accessing data shared with other threads (including interrupt threads), and releases (unlocks) it afterwards. -If the mutex cannot be acquired, the thread requesting it will sleep. +If the mutex cannot be acquired, the thread requesting it will wait. +Mutexes are adaptive by default, meaning that +if the owner of a contended mutex is currently running on another CPU, +then a thread attempting to acquire the mutex will spin rather than yielding +the processor. Mutexes fully support priority propagation. .Pp See .Xr mutex 9 for details. -.Ss Spin mutexes -Spin mutexes are variation of basic mutexes; the main difference between -the two is that spin mutexes never sleep - instead, they spin, waiting -for the thread holding the lock, which runs on another CPU, to release it. -Differently from ordinary mutex, spin mutexes disable interrupts when acquired. -Since disabling interrupts is expensive, they are also generally slower. -Spin mutexes should be used only when necessary, e.g. to protect data shared +.Ss Spin Mutexes +Spin mutexes are a variation of basic mutexes; the main difference between +the two is that spin mutexes never block. +Instead, they spin while waiting for the lock to be released. +To avoid deadlock, a thread that holds a spin mutex must never yield its CPU. +Unlike ordinary mutexes, spin mutexes disable interrupts when acquired. +Since disabling interrupts can be expensive, they are generally slower to +acquire and release. +Spin mutexes should be used only when absolutely necessary, +e.g. to protect data shared with interrupt filter code (see .Xr bus_setup_intr 9 -for details). -.Ss Pool mutexes -With most synchronization primitives, such as mutexes, programmer must -provide a piece of allocated memory to hold the primitive. +for details), +or for scheduler internals. +.Ss Mutex Pools +With most synchronization primitives, such as mutexes, the programmer must +provide memory to hold the primitive. For example, a mutex may be embedded inside the structure it protects. -Pool mutex is a variant of mutex without this requirement - to lock or unlock -a pool mutex, one uses address of the structure being protected with it, -not the mutex itself. -Pool mutexes are seldom used. +Mutex pools provide a preallocated set of mutexes to avoid this +requirement. +Note that mutexes from a pool may only be used as leaf locks. .Pp See .Xr mtx_pool 9 for details. -.Ss Reader/writer locks -Reader/writer locks allow shared access to protected data by multiple threads, +.Ss Reader/Writer Locks +Reader/writer locks allow shared access to protected data by multiple threads or exclusive access by a single thread. The threads with shared access are known as .Em readers @@ -82,26 +89,16 @@ since it may modify protected data. Reader/writer locks can be treated as mutexes (see above and .Xr mutex 9 ) with shared/exclusive semantics. -More specifically, regular mutexes can be -considered to be equivalent to a write-lock on an -.Em rw_lock. -The -.Em rw_lock -locks have priority propagation like mutexes, but priority -can be propagated only to an exclusive holder. +Reader/writer locks support priority propagation like mutexes, +but priority is propagated only to an exclusive holder. This limitation comes from the fact that shared owners are anonymous. -Another important property is that shared holders of -.Em rw_lock -can recurse, but exclusive locks are not allowed to recurse. -This ability should not be used lightly and -.Em may go away. .Pp See .Xr rwlock 9 for details. -.Ss Read-mostly locks -Mostly reader locks are similar to +.Ss Read-Mostly Locks +Read-mostly locks are similar to .Em reader/writer locks but optimized for very infrequent write locking. .Em Read-mostly @@ -113,21 +110,41 @@ data structure. See .Xr rmlock 9 for details. +.Ss Sleepable Read-Mostly Locks +Sleepable read-mostly locks are a variation on read-mostly locks. +Threads holding an exclusive lock may sleep, +but threads holding a shared lock may not. +Priority is propagated to shared owners but not to exclusive owners. .Ss Shared/exclusive locks Shared/exclusive locks are similar to reader/writer locks; the main difference -between them is that shared/exclusive locks may be held during unbounded sleep -(and may thus perform an unbounded sleep). -They are inherently less efficient than mutexes, reader/writer locks -and read-mostly locks. -They don't support priority propagation. -They should be considered to be closely related to -.Xr sleep 9 . -In fact it could in some cases be -considered a conditional sleep. +between them is that shared/exclusive locks may be held during unbounded sleep. +Acquiring a contested shared/exclusive lock can perform an unbounded sleep. +These locks do not support priority propagation. .Pp See .Xr sx 9 for details. +.Ss Lockmanager locks +Lockmanager locks are sleepable shared/exclusive locks used mostly in +.Xr VFS 9 +.Po +as a +.Xr vnode 9 +lock +.Pc +and in the buffer cache +.Po +.Xr BUF_LOCK 9 +.Pc . +They have features other lock types do not have such as sleep +timeouts, blocking upgrades, +writer starvation avoidance, draining, and an interlock mutex, +but this makes them complicated both to use and to implement; +for this reason, they should be avoided. +.Pp +See +.Xr lock 9 +for details. .Ss Counting semaphores Counting semaphores provide a mechanism for synchronizing access to a pool of resources. @@ -140,43 +157,21 @@ See .Xr sema 9 for details. .Ss Condition variables -Condition variables are used in conjunction with mutexes to wait for -conditions to occur. -A thread must hold the mutex before calling the -.Fn cv_wait* , +Condition variables are used in conjunction with locks to wait for +a condition to become true. +A thread must hold the associated lock before calling one of the +.Fn cv_wait , functions. -When a thread waits on a condition, the mutex -is atomically released before the thread is blocked, then reacquired -before the function call returns. +When a thread waits on a condition, the lock +is atomically released before the thread yields the processor +and reacquired before the function call returns. +Condition variables may be used with blocking mutexes, +reader/writer locks, read-mostly locks, and shared/exclusive locks. .Pp See .Xr condvar 9 for details. -.Ss Giant -Giant is an instance of a mutex, with some special characteristics: -.Bl -enum -.It -It is recursive. -.It -Drivers and filesystems can request that Giant be locked around them -by not marking themselves MPSAFE. -Note that infrastructure to do this is slowly going away as non-MPSAFE -drivers either became properly locked or disappear. -.It -Giant must be locked first before other locks. -.It -It is OK to hold Giant while performing unbounded sleep; in such case, -Giant will be dropped before sleeping and picked up after wakeup. -.It -There are places in the kernel that drop Giant and pick it back up -again. -Sleep locks will do this before sleeping. -Parts of the network or VM code may do this as well, depending on the -setting of a sysctl. -This means that you cannot count on Giant keeping other code from -running if your code sleeps, even if you want it to. -.El -.Ss Sleep/wakeup +.Ss Sleep/Wakeup The functions .Fn tsleep , .Fn msleep , @@ -185,7 +180,12 @@ The functions .Fn wakeup , and .Fn wakeup_one -handle event-based thread blocking. +also handle event-based thread blocking. +Unlike condition variables, +arbitrary addresses may be used as wait channels and a dedicated +structure does not need to be allocated. +However, care must be taken to ensure that wait channel addresses are +unique to an event. If a thread must wait for an external event, it is put to sleep by .Fn tsleep , .Fn msleep , @@ -205,9 +205,10 @@ the thread is being put to sleep. All threads sleeping on a single .Fa chan are woken up later by -.Fn wakeup , -often called from inside an interrupt routine, to indicate that the -resource the thread was blocking on is available now. +.Fn wakeup +.Pq often called from inside an interrupt routine +to indicate that the +event the thread was blocking on has occurred. .Pp Several of the sleep functions including .Fn msleep , @@ -223,126 +224,170 @@ includes the flag, then the lock will not be reacquired before returning. The lock is used to ensure that a condition can be checked atomically, and that the current thread can be suspended without missing a -change to the condition, or an associated wakeup. +change to the condition or an associated wakeup. In addition, all of the sleep routines will fully drop the .Va Giant mutex -(even if recursed) +.Pq even if recursed while the thread is suspended and will reacquire the .Va Giant -mutex before the function returns. -.Pp -See -.Xr sleep 9 -for details. +mutex +.Pq restoring any recursion +before the function returns. .Pp -.Ss Lockmanager locks -Shared/exclusive locks, used mostly in -.Xr VFS 9 , -in particular as a -.Xr vnode 9 -lock. -They have features other lock types don't have, such as sleep timeout, -writer starvation avoidance, draining, and interlock mutex, but this makes them -complicated to implement; for this reason, they are deprecated. +The +.Fn pause +function is a special sleep function that waits for a specified +amount of time to pass before the thread resumes execution. +This sleep cannot be terminated early by either an explicit +.Fn wakeup +or a signal. .Pp See -.Xr lock 9 +.Xr sleep 9 for details. +.Ss Giant +Giant is a special mutex used to protect data structures that do not +yet have their own locks. +Since it provides semantics akin to the old +.Xr spl 9 +interface, +Giant has special characteristics: +.Bl -enum +.It +It is recursive. +.It +Drivers and filesystems can request that Giant be locked around them +by not marking themselves MPSAFE. +Note that infrastructure to do this is slowly going away as non-MPSAFE +drivers either became properly locked or disappear. +.It +Giant must be locked before other non-sleepable locks. +.It +Giant is dropped during unbounded sleeps and reacquired after wakeup. +.It +There are places in the kernel that drop Giant and pick it back up +again. +Sleep locks will do this before sleeping. +Parts of the network or VM code may do this as well. +This means that you cannot count on Giant keeping other code from +running if your code sleeps, even if you want it to. +.El .Sh INTERACTIONS -The primitives interact and have a number of rules regarding how +The primitives can interact and have a number of rules regarding how they can and can not be combined. -Many of these rules are checked using the -.Xr witness 4 -code. -.Ss Bounded vs. unbounded sleep -The following primitives perform bounded sleep: mutexes, pool mutexes, -reader/writer locks and read-mostly locks. -.Pp -The following primitives block (perform unbounded sleep): shared/exclusive locks, -counting semaphores, condition variables, sleep/wakeup and lockmanager locks. -.Pp -It is an error to do any operation that could result in any kind of sleep while -holding spin mutex. -.Pp -As a general rule, it is an error to do any operation that could result -in unbounded sleep while holding any primitive from the 'bounded sleep' group. -For example, it is an error to try to acquire shared/exclusive lock while -holding mutex, or to try to allocate memory with M_WAITOK while holding -read-write lock. +Many of these rules are checked by +.Xr witness 4 . +.Ss Bounded vs. Unbounded Sleep +In a bounded sleep +.Po also referred to as +.Dq blocking +.Pc +the only resource needed to resume execution of a thread +is CPU time for the owner of a lock that the thread is waiting to acquire. +In an unbounded sleep +.Po +often referred to as simply +.Dq sleeping +.Pc +a thread waits for an external event or for a condition +to become true. +In particular, +a dependency chain of threads in bounded sleeps should always make forward +progress, +since there is always CPU time available. +This requires that no thread in a bounded sleep is waiting for a lock held +by a thread in an unbounded sleep. +To avoid priority inversions, +a thread in a bounded sleep lends its priority to the owner of the lock +that it is waiting for. +.Pp +The following primitives perform bounded sleeps: +mutexes, reader/writer locks and read-mostly locks. +.Pp +The following primitives perform unbounded sleeps: +sleepable read-mostly locks, shared/exclusive locks, lockmanager locks, +counting semaphores, condition variables, and sleep/wakeup. +.Ss General Principles +.Bl -bullet +.It +It is an error to do any operation that could result in yielding the processor +while holding a spin mutex. +.It +It is an error to do any operation that could result in unbounded sleep +while holding any primitive from the 'bounded sleep' group. +For example, it is an error to try to acquire a shared/exclusive lock while +holding a mutex, or to try to allocate memory with M_WAITOK while holding a +reader/writer lock. .Pp -As a special case, it is possible to call +Note that the lock passed to one of the .Fn sleep or -.Fn mtx_sleep -while holding a single mutex. -It will atomically drop that mutex and reacquire it as part of waking up. -This is often a bad idea because it generally relies on the programmer having -good knowledge of all of the call graph above the place where -.Fn mtx_sleep -is being called and assumptions the calling code has made. -Because the lock gets dropped during sleep, one must re-test all -the assumptions that were made before, all the way up the call graph to the -place where the lock was acquired. -.Pp -It is an error to do any operation that could result in any kind of sleep when -running inside an interrupt filter. -.Pp +.Fn cv_wait +functions is dropped before the thread enters the unbounded sleep and does +not violate this rule. +.It +It is an error to do any operation that could result in yielding of +the processor when running inside an interrupt filter. +.It It is an error to do any operation that could result in unbounded sleep when running inside an interrupt thread. +.El .Ss Interaction table The following table shows what you can and can not do while holding -one of the synchronization primitives discussed: -.Bl -column ".Ic xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent -.It Xo -.Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep -.Xc -.It spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3 -.It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 -.It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 -.It rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 -.It rmlock Ta \&ok Ta \&ok Ta \&no-5 Ta \&ok Ta \&ok-2 Ta \&no-5 +one of the locking primitives discussed. Note that +.Dq sleep +includes +.Fn sema_wait , +.Fn sema_timedwait , +any of the +.Fn cv_wait +functions, +and any of the +.Fn sleep +functions. +.Bl -column ".Ic xxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXX" -offset 3n +.It Em " You want:" Ta spin mtx Ta mutex/rw Ta rmlock Ta sleep rm Ta sx/lk Ta sleep +.It Em "You have: " Ta -------- Ta -------- Ta ------ Ta -------- Ta ------ Ta ------ +.It spin mtx Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-1 +.It mutex/rw Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no-1 +.It rmlock Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no-1 +.It sleep rm Ta \&ok Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok-2 Ta \&ok-2/3 +.It sx Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok-3 +.It lockmgr Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Pp .Em *1 -Recursion is defined per lock. -Lock order is important. +There are calls that atomically release this primitive when going to sleep +and reacquire it on wakeup +.Po +.Fn mtx_sleep , +.Fn rw_sleep , +.Fn msleep_spin , +etc. +.Pc . .Pp .Em *2 -Readers can recurse though writers can not. -Lock order is important. +These cases are only allowed while holding a write lock on a sleepable +read-mostly lock. .Pp .Em *3 -There are calls that atomically release this primitive when going to sleep -and reacquire it on wakeup (e.g. -.Fn mtx_sleep , -.Fn rw_sleep -and -.Fn msleep_spin ) . -.Pp -.Em *4 -Though one can sleep holding an sx lock, one can also use -.Fn sx_sleep -which will atomically release this primitive when going to sleep and +Though one can sleep while holding this lock, +one can also use a +.Fn sleep +function to atomically release this primitive when going to sleep and reacquire it on wakeup. .Pp -.Em *5 -.Em Read-mostly -locks can be initialized to support sleeping while holding a write lock. -See -.Xr rmlock 9 -for details. +Note that non-blocking try operations on locks are always permitted. .Ss Context mode table The next table shows what can be used in different contexts. At this time this is a rather easy to remember table. -.Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent -.It Xo -.Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep -.Xc +.Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXX" -offset 3n +.It Em "Context:" Ta spin mtx Ta mutex/rw Ta rmlock Ta sleep rm Ta sx/lk Ta sleep .It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no -.It interrupt thread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no -.It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no -.It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok +.It interrupt thread: Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no +.It callout: Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no +.It system call: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Sh SEE ALSO .Xr witness 4 , From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 19:23:03 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 2EB40AE6; Wed, 2 Oct 2013 19:23:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1AFB12266; Wed, 2 Oct 2013 19:23:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JN2JW050522; Wed, 2 Oct 2013 19:23:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JN2C8050520; Wed, 2 Oct 2013 19:23:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021923.r92JN2C8050520@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 19:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256006 - stable/9/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:23:03 -0000 Author: pfg Date: Wed Oct 2 19:23:02 2013 New Revision: 256006 URL: http://svnweb.freebsd.org/changeset/base/256006 Log: MFC r254941; Merge a couple of CTF fixes from illumos: 2942 CTF tools need to handle files which legitimately lack data 2978 ctfconvert still needs to ignore legitimately dataless files on SPARC Illumos Revisions: 13745:6b3106b4250f 13754:7231b684c18b Reference: https://www.illumos.org/issues/2942 https://www.illumos.org/issues/2978 Obtained from: Illumos Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Oct 2 19:20:15 2013 (r256005) +++ stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Oct 2 19:23:02 2013 (r256006) @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * DWARF to tdata conversion * @@ -1758,6 +1756,59 @@ die_resolve(dwarf_t *dw) } while (dw->dw_nunres != 0); } +/* + * Any object containing a function or object symbol at any scope should also + * contain DWARF data. + */ +static boolean_t +should_have_dwarf(Elf *elf) +{ + Elf_Scn *scn = NULL; + Elf_Data *data = NULL; + GElf_Shdr shdr; + GElf_Sym sym; + uint32_t symdx = 0; + size_t nsyms = 0; + boolean_t found = B_FALSE; + + while ((scn = elf_nextscn(elf, scn)) != NULL) { + gelf_getshdr(scn, &shdr); + + if (shdr.sh_type == SHT_SYMTAB) { + found = B_TRUE; + break; + } + } + + if (!found) + terminate("cannot convert stripped objects\n"); + + data = elf_getdata(scn, NULL); + nsyms = shdr.sh_size / shdr.sh_entsize; + + for (symdx = 0; symdx < nsyms; symdx++) { + gelf_getsym(data, symdx, &sym); + + if ((GELF_ST_TYPE(sym.st_info) == STT_FUNC) || + (GELF_ST_TYPE(sym.st_info) == STT_TLS) || + (GELF_ST_TYPE(sym.st_info) == STT_OBJECT)) { + char *name; + + name = elf_strptr(elf, shdr.sh_link, sym.st_name); + + /* Studio emits these local symbols regardless */ + if ((strcmp(name, "Bbss.bss") != 0) && + (strcmp(name, "Ttbss.bss") != 0) && + (strcmp(name, "Ddata.data") != 0) && + (strcmp(name, "Ttdata.data") != 0) && + (strcmp(name, "Drodata.rodata") != 0)) + return (B_TRUE); + } + } + + return (B_FALSE); +} + /*ARGSUSED*/ int dw_read(tdata_t *td, Elf *elf, char *filename __unused) @@ -1782,8 +1833,12 @@ dw_read(tdata_t *td, Elf *elf, char *fil if ((rc = dwarf_elf_init(elf, DW_DLC_READ, &dw.dw_dw, &dw.dw_err)) == DW_DLV_NO_ENTRY) { - errno = ENOENT; - return (-1); + if (should_have_dwarf(elf)) { + errno = ENOENT; + return (-1); + } else { + return (0); + } } else if (rc != DW_DLV_OK) { if (dwarf_errno(&dw.dw_err) == DW_DLE_DEBUG_INFO_NULL) { /* @@ -1801,9 +1856,14 @@ dw_read(tdata_t *td, Elf *elf, char *fil &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK) terminate("rc = %d %s\n", rc, dwarf_errmsg(&dw.dw_err)); - if ((cu = die_sibling(&dw, NULL)) == NULL) + if ((cu = die_sibling(&dw, NULL)) == NULL || + (((child = die_child(&dw, cu)) == NULL) && + should_have_dwarf(elf))) { terminate("file does not contain dwarf type data " "(try compiling with -g)\n"); + } else if (child == NULL) { + return (0); + } dw.dw_maxoff = nxthdr - 1; From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 20:40:22 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 266CF7A1; Wed, 2 Oct 2013 20:40:22 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13FFA2751; Wed, 2 Oct 2013 20:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92KeLx1020799; Wed, 2 Oct 2013 20:40:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92KeLNj020798; Wed, 2 Oct 2013 20:40:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310022040.r92KeLNj020798@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Oct 2013 20:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256007 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 20:40:22 -0000 Author: nwhitehorn Date: Wed Oct 2 20:40:21 2013 New Revision: 256007 URL: http://svnweb.freebsd.org/changeset/base/256007 Log: Implement GET_STACK_USAGE() on PowerPC. This implementation is identical to that on x86 and sparc64. Approved by: re (kib) Modified: head/sys/powerpc/include/proc.h Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Wed Oct 2 19:23:02 2013 (r256006) +++ head/sys/powerpc/include/proc.h Wed Oct 2 20:40:21 2013 (r256007) @@ -54,6 +54,18 @@ struct mdproc { #endif #ifdef _KERNEL + +#include + +/* Get the current kernel thread stack usage. */ +#define GET_STACK_USAGE(total, used) do { \ + struct thread *td = curthread; \ + (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \ + (used) = (char *)td->td_kstack + \ + td->td_kstack_pages * PAGE_SIZE - \ + (char *)&td; \ +} while (0) + struct syscall_args { u_int code; struct sysent *callp; From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 20:44:37 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 6BDCAAA9; Wed, 2 Oct 2013 20:44:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5867C2797; Wed, 2 Oct 2013 20:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92Kib6Y025940; Wed, 2 Oct 2013 20:44:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92KibTC025937; Wed, 2 Oct 2013 20:44:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310022044.r92KibTC025937@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 2 Oct 2013 20:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256008 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 20:44:37 -0000 Author: glebius Date: Wed Oct 2 20:44:36 2013 New Revision: 256008 URL: http://svnweb.freebsd.org/changeset/base/256008 Log: Clear knlist before destroying it in tap(4) and tun(4). This fixes later crash, when a kqueue descriptor tries to dereference appropriate knotes. Approved by: re (kib) Modified: head/sys/net/if_tap.c head/sys/net/if_tun.c Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Wed Oct 2 20:40:21 2013 (r256007) +++ head/sys/net/if_tap.c Wed Oct 2 20:44:36 2013 (r256008) @@ -220,6 +220,7 @@ tap_destroy(struct tap_softc *tp) CURVNET_SET(ifp->if_vnet); destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); + knlist_clear(&tp->tap_rsel.si_note, 0); knlist_destroy(&tp->tap_rsel.si_note); ether_ifdetach(ifp); if_free(ifp); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Wed Oct 2 20:40:21 2013 (r256007) +++ head/sys/net/if_tun.c Wed Oct 2 20:44:36 2013 (r256008) @@ -258,6 +258,7 @@ tun_destroy(struct tun_softc *tp) if_free(TUN2IFP(tp)); destroy_dev(dev); seldrain(&tp->tun_rsel); + knlist_clear(&tp->tun_rsel.si_note, 0); knlist_destroy(&tp->tun_rsel.si_note); mtx_destroy(&tp->tun_mtx); cv_destroy(&tp->tun_cv); From owner-svn-src-all@FreeBSD.ORG Wed Oct 2 21:47:26 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 7AEA366A; Wed, 2 Oct 2013 21:47:26 +0000 (UTC) (envelope-from roberto@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6721B2C7E; Wed, 2 Oct 2013 21:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92LlQso081804; Wed, 2 Oct 2013 21:47:26 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92LlQSf081800; Wed, 2 Oct 2013 21:47:26 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201310022147.r92LlQSf081800@svn.freebsd.org> From: Ollivier Robert Date: Wed, 2 Oct 2013 21:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256009 - in head/usr.sbin/ntp: . libparse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 21:47:26 -0000 Author: roberto Date: Wed Oct 2 21:47:25 2013 New Revision: 256009 URL: http://svnweb.freebsd.org/changeset/base/256009 Log: Meinberg clocks support was inadvertently removed during the last vendor import. Add it back. PR: bin/182545 Submitted by: Joerg Pulz Approved by: re (delphij) MFC after: 1 week Modified: head/usr.sbin/ntp/config.h head/usr.sbin/ntp/libparse/Makefile Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Wed Oct 2 20:44:36 2013 (r256008) +++ head/usr.sbin/ntp/config.h Wed Oct 2 21:47:25 2013 (r256009) @@ -84,7 +84,7 @@ #define CLOCK_LOCAL 1 /* Meinberg clocks */ -/* #undef CLOCK_MEINBERG */ +#define CLOCK_MEINBERG 1 /* Magnavox MX4200 GPS receiver */ /* #undef CLOCK_MX4200 */ Modified: head/usr.sbin/ntp/libparse/Makefile ============================================================================== --- head/usr.sbin/ntp/libparse/Makefile Wed Oct 2 20:44:36 2013 (r256008) +++ head/usr.sbin/ntp/libparse/Makefile Wed Oct 2 21:47:25 2013 (r256009) @@ -9,7 +9,7 @@ SRCS= clk_computime.c clk_dcf7000.c clk_ clk_rawdcf.c clk_rcc8000.c clk_schmid.c clk_trimtaip.c \ clk_trimtsip.c clk_varitext.c clk_wharton.c data_mbg.c \ info_trimble.c parse.c parse_conf.c trim_info.c \ - binio.c gpstolfp.c + binio.c gpstolfp.c ieee754io.c mfp_mul.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 01:18:06 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C503E790; Thu, 3 Oct 2013 01:18:06 +0000 (UTC) (envelope-from mdf@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2308277D; Thu, 3 Oct 2013 01:18:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r931I6kl070533; Thu, 3 Oct 2013 01:18:06 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r931I6V7070532; Thu, 3 Oct 2013 01:18:06 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201310030118.r931I6V7070532@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 3 Oct 2013 01:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256013 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 01:18:06 -0000 Author: mdf Date: Thu Oct 3 01:18:06 2013 New Revision: 256013 URL: http://svnweb.freebsd.org/changeset/base/256013 Log: Fix up typos from r255963 in mtree Makefile. BSD.debug.dist should be iterated if present, and remove a stray .endif. Approved by: re (gjb) Modified: head/etc/mtree/Makefile Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Wed Oct 2 23:48:37 2013 (r256012) +++ head/etc/mtree/Makefile Thu Oct 3 01:18:06 2013 (r256013) @@ -2,13 +2,13 @@ .include -FILES= BSD.include.dist \ +FILES= ${_BSD.debug.dist} \ + BSD.include.dist \ BSD.root.dist \ ${_BSD.sendmail.dist} \ BSD.usr.dist \ BSD.var.dist -.endif .if ${MK_DEBUG_FILES} != "no" _BSD.debug.dist= BSD.debug.dist .endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 01:53:18 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 10798F03; Thu, 3 Oct 2013 01:53:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F067F28D8; Thu, 3 Oct 2013 01:53:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r931rHua002022; Thu, 3 Oct 2013 01:53:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r931rHGk002021; Thu, 3 Oct 2013 01:53:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310030153.r931rHGk002021@svn.freebsd.org> From: Rui Paulo Date: Thu, 3 Oct 2013 01:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256014 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 01:53:18 -0000 Author: rpaulo Date: Thu Oct 3 01:53:17 2013 New Revision: 256014 URL: http://svnweb.freebsd.org/changeset/base/256014 Log: Append the Git branch to the version string. Approved by: re (gjb) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Oct 3 01:18:06 2013 (r256013) +++ head/sys/conf/newvers.sh Thu Oct 3 01:53:17 2013 (r256014) @@ -159,6 +159,10 @@ if [ -n "$git_cmd" ] ; then git=" ${git}" fi fi + git_b=`$git_cmd rev-parse --abbrev-ref HEAD` + if [ -n "$git_b" ] ; then + git="${git}(${git_b})" + fi if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 06:14:45 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 256B8C2D; Thu, 3 Oct 2013 06:14:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12FCA2601; Thu, 3 Oct 2013 06:14:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r936Ei5q052330; Thu, 3 Oct 2013 06:14:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r936EirI052329; Thu, 3 Oct 2013 06:14:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310030614.r936EirI052329@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Oct 2013 06:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256015 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 06:14:45 -0000 Author: kib Date: Thu Oct 3 06:14:44 2013 New Revision: 256015 URL: http://svnweb.freebsd.org/changeset/base/256015 Log: MFC r255880: Acquire a hold reference on the vnode when a knote is instantiated. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Oct 3 01:53:17 2013 (r256014) +++ stable/9/sys/kern/vfs_subr.c Thu Oct 3 06:14:44 2013 (r256015) @@ -4525,6 +4525,7 @@ vfs_kqfilter(struct vop_kqfilter_args *a if (vp->v_pollinfo == NULL) return (ENOMEM); knl = &vp->v_pollinfo->vpi_selinfo.si_note; + vhold(vp); knlist_add(knl, kn, 0); return (0); @@ -4540,6 +4541,7 @@ filt_vfsdetach(struct knote *kn) KASSERT(vp->v_pollinfo != NULL, ("Missing v_pollinfo")); knlist_remove(&vp->v_pollinfo->vpi_selinfo.si_note, kn, 0); + vdrop(vp); } /*ARGSUSED*/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 11:51:16 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 08DB759B; Thu, 3 Oct 2013 11:51:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D08AD2CB2; Thu, 3 Oct 2013 11:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93BpF38029731; Thu, 3 Oct 2013 11:51:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93BpFOv029730; Thu, 3 Oct 2013 11:51:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310031151.r93BpFOv029730@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 3 Oct 2013 11:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256019 - head/games/fortune/datfiles X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 11:51:16 -0000 Author: glebius Date: Thu Oct 3 11:51:15 2013 New Revision: 256019 URL: http://svnweb.freebsd.org/changeset/base/256019 Log: Refresh the tips for the new pkg system. Reviewed by: bapt Approved by: re (hrs) Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips ============================================================================== --- head/games/fortune/datfiles/freebsd-tips Thu Oct 3 11:26:19 2013 (r256018) +++ head/games/fortune/datfiles/freebsd-tips Thu Oct 3 11:51:15 2013 (r256019) @@ -8,8 +8,8 @@ a root login. You can add a user to the By pressing "Scroll Lock" you can use the arrow keys to scroll backward through the console output. Press "Scroll Lock" again to turn it off. % -Can't remember if you've installed a certain port or not? Try "pkg_info --Ix port_name". +Can't remember if you've installed a certain port or not? Try "pkg info +-x port_name". % Ever wonder what those numbers after command names were, as in cat(1)? It's the section of the manual the man page is in. "man man" will tell you more. @@ -96,12 +96,6 @@ If you want to play CDs with FreeBSD, a Type 'cdcontrol' then 'help' to learn more. (You may need to set the CDROM environment variable in order to make cdcontrol want to start.) % -If you want to quickly check for duplicate package/port installations, -try the following pkg_info command. - - pkg_info | sort | sed -e 's/-[0-9].*$//' | \ - uniq -c | grep -v '^[[:space:]]*1' -% If you'd like to keep track of applications in the FreeBSD ports tree, take a look at FreshPorts; @@ -356,11 +350,10 @@ adjust, just type 'mixer'. % You can automatically download and install binary packages by doing - pkg_add -r + pkg install -where you replace with the URL to the package. This will also -automatically install the packages the package you download is dependent on -(ie, the packages it needs in order to work.) +This will also automatically install the packages that are dependencies +for the package you install (ie, the packages it needs in order to work.) % You can change the video mode on all consoles by adding something like the following to /etc/rc.conf: @@ -448,8 +441,7 @@ You can use /etc/make.conf to control th on this system. Example entries are in /usr/share/examples/etc/make.conf. % -You can use "pkg_info" to see a list of packages you have installed. - -- Konstantinos Konstantinidis +You can use "pkg info" to see a list of packages you have installed. % You can use the 'fetch' command to retrieve files over ftp or http. From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 12:28:51 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id AA8E5826; Thu, 3 Oct 2013 12:28:51 +0000 (UTC) (envelope-from rene@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8930F2FCD; Thu, 3 Oct 2013 12:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93CSptg048296; Thu, 3 Oct 2013 12:28:51 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93CSp8N048295; Thu, 3 Oct 2013 12:28:51 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201310031228.r93CSp8N048295@svn.freebsd.org> From: Rene Ladan Date: Thu, 3 Oct 2013 12:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256020 - stable/9/usr.bin/calendar/calendars X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 12:28:51 -0000 Author: rene (doc,ports committer) Date: Thu Oct 3 12:28:51 2013 New Revision: 256020 URL: http://svnweb.freebsd.org/changeset/base/256020 Log: MFC r250198 (edwin, 2013-05-03): On 30 April 2013 queen Beatrix resigned and crownprince Willem Alexander became the new king. King's day is on 27 April. MFC r255956 (rene, 2013-09-30): Update the Dutch calendar entries: - prince Johan Friso passed away in 2013 - correct status of queen Maxima and crown princess Catharina-Amalia - language fixes Approved by: gjb (mentor) Modified: stable/9/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/calendar/calendars/ (props changed) Modified: stable/9/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/9/usr.bin/calendar/calendars/calendar.dutch Thu Oct 3 11:51:15 2013 (r256019) +++ stable/9/usr.bin/calendar/calendars/calendar.dutch Thu Oct 3 12:28:51 2013 (r256020) @@ -13,7 +13,7 @@ Easter=Pasen jan/01 Nieuwjaar jan/06 Driekoningen apr/01 1 april -apr/30 Koninginnedag +apr/27 Koningsdag mei/01 Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag @@ -22,11 +22,11 @@ nov/01 Allerheiligen nov/02 Allerzielen nov/11 Sint Maarten nov/11 Elfde-van-de-elfde -dec/05 Sinterklaas avond +dec/05 Sinterklaasavond dec/15 Koninkrijksdag dec/24 Kerstavond -dec/25 Eerste kerstdag -dec/26 Tweede kerstdag +dec/25 Eerste Kerstdag +dec/26 Tweede Kerstdag dec/28 Feest der Onnozele Kinderen dec/31 Oudjaar @@ -40,10 +40,10 @@ Pasen-47 Carnaval (Vastenavond) Pasen-46 Aswoensdag Pasen-7 Palmzondag Pasen-3 Witte Donderdag -Pasen-2 Goede vrijdag -Pasen-1 Stille zaterdag -Pasen Eerste paasdag -Pasen+1 Tweede paasdag +Pasen-2 Goede Vrijdag +Pasen-1 Stille Zaterdag +Pasen Eerste Paasdag +Pasen+1 Tweede Paasdag Pasen+39 Hemelvaartsdag Pasen+49 Eerste Pinksterdag Pasen+50 Tweede Pinksterdag @@ -60,20 +60,20 @@ sep/TueThird Prinsjesdag * Het koningshuis */ jan/19 Prinses Margriet (1943) -jan/31 Koningin Beatrix (1938) +jan/31 Prinses Beatrix (1938) feb/17 Prins Willem III (1817 - 1890) feb/18 Prinses Christina (1947) apr/10 Prinses Ariane (2007) apr/19 Prins Hendrik (1876 - 1934) -apr/27 Kroonprins Willem Alexander (1967) -apr/30 Koningin Juliana (1909 - 2004) +apr/27 Koning Willem-Alexander (1967) +apr/30 Prinses Juliana (1909 - 2004) apr/30 Mr. Pieter van Vollenhoven (1939) -mei/17 Prinses Maxima (1971) +mei/17 Koningin Maxima (1971) jun/26 Prinses Alexia (2005) jun/29 Prins Bernhard (1911 - 2004) aug/05 Prinses Irene (1939) aug/31 Prinses Wilhelmina (1880 - 1962) sep/06 Prins Claus (1925 - 2002) -sep/25 Prins Johan Friso (1968) +sep/25 Prins Johan Friso (1968 - 2013) okt/11 Prins Constantijn (1969) -dec/07 Prinses Catharina-Amalia (2003) +dec/07 Kroonprinses Catharina-Amalia (2003) From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 15:19:17 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 318BA290; Thu, 3 Oct 2013 15:19:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DDE92B04; Thu, 3 Oct 2013 15:19:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93FJGjA040134; Thu, 3 Oct 2013 15:19:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93FJGZn040133; Thu, 3 Oct 2013 15:19:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310031519.r93FJGZn040133@svn.freebsd.org> From: Glen Barber Date: Thu, 3 Oct 2013 15:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256022 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 15:19:17 -0000 Author: gjb Date: Thu Oct 3 15:19:16 2013 New Revision: 256022 URL: http://svnweb.freebsd.org/changeset/base/256022 Log: Do not install bluetooth rc(8) scripts if MK_BLUETOOTH = no. Approved by: re (glebius) MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Oct 3 12:28:51 2013 (r256021) +++ head/etc/rc.d/Makefile Thu Oct 3 15:19:16 2013 (r256022) @@ -21,11 +21,11 @@ FILES= DAEMON \ auditd \ auditdistd \ bgfsck \ - bluetooth \ + ${_bluetooth} \ bootparams \ bridge \ bsnmpd \ - bthidd \ + ${_bthidd} \ ccd \ cleanvar \ cleartmp \ @@ -48,7 +48,7 @@ FILES= DAEMON \ gptboot \ gssd \ hastd \ - hcsecd \ + ${_hcsecd} \ hostapd \ hostid \ hostid_save \ @@ -182,6 +182,9 @@ _nscd= nscd .endif .if ${MK_BLUETOOTH} != "no" +_bluetooth= bluetooth +_bthidd= bthidd +_hcsecd= hcsecd _ubthidhci= ubthidhci .endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 17:50:14 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E901EA77; Thu, 3 Oct 2013 17:50:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5DA423E5; Thu, 3 Oct 2013 17:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93HoEfd019736; Thu, 3 Oct 2013 17:50:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93HoE3L019735; Thu, 3 Oct 2013 17:50:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310031750.r93HoE3L019735@svn.freebsd.org> From: Dimitry Andric Date: Thu, 3 Oct 2013 17:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256024 - head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 17:50:15 -0000 Author: dim Date: Thu Oct 3 17:50:14 2013 New Revision: 256024 URL: http://svnweb.freebsd.org/changeset/base/256024 Log: Pull in r186338 from upstream llvm trunk: Remove invalid assert in DAGTypeLegalizer::RemapValue There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks which, in part, says: // Note that these invariants may not hold momentarily when processing a node: // the node being processed may be put in a map before being marked Processed. Unfortunately, this assert would be valid only if the above-mentioned invariant held unconditionally. This was causing llc to assert when, in fact, everything was fine. Thanks to Richard Sandiford for investigating this issue! Fixes PR16562. This fixes assertions which could occur in the multimedia/ffmpeg1 and multimedia/ffmpeg2 ports. Approved by: re (hrs) Reported by: Matthias Apitz MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Thu Oct 3 17:30:55 2013 (r256023) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Thu Oct 3 17:50:14 2013 (r256024) @@ -615,7 +615,10 @@ void DAGTypeLegalizer::RemapValue(SDValu // replaced with other values. RemapValue(I->second); N = I->second; - assert(N.getNode()->getNodeId() != NewNode && "Mapped to new node!"); + + // Note that it is possible to have N.getNode()->getNodeId() == NewNode at + // this point because it is possible for a node to be put in the map before + // being processed. } } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 18:48:44 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 3715999D; Thu, 3 Oct 2013 18:48:44 +0000 (UTC) (envelope-from trociny@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15C6F281E; Thu, 3 Oct 2013 18:48:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93ImhDZ052040; Thu, 3 Oct 2013 18:48:43 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93ImhNg052036; Thu, 3 Oct 2013 18:48:43 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031848.r93ImhNg052036@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256025 - stable/9/usr.sbin/daemon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:48:44 -0000 Author: trociny Date: Thu Oct 3 18:48:43 2013 New Revision: 256025 URL: http://svnweb.freebsd.org/changeset/base/256025 Log: MFC r255521, r255526, r255707: r255521 (jmg): add support for writing the pid of the daemon program to a pid file so that daemon can be used w/ rc.subr and ports can use the additional functionality, such as keeping the ldap daemon up and running, and have the proper program to signal to exit.. PR: bin/181341 Submitted by: feld r255526 (joel): mdoc: remove EOL whitespace. r255707: 1. Properly clean pid files in the case of the error. 2. Write the supervisor pid before the restart loop, so we don't uselessly rewrite it after every child restart. 3. Remove duplicate ppfh and pfh initialization. Modified: stable/9/usr.sbin/daemon/daemon.8 stable/9/usr.sbin/daemon/daemon.c Directory Properties: stable/9/usr.sbin/daemon/ (props changed) Modified: stable/9/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/9/usr.sbin/daemon/daemon.8 Thu Oct 3 17:50:14 2013 (r256024) +++ stable/9/usr.sbin/daemon/daemon.8 Thu Oct 3 18:48:43 2013 (r256025) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd September 13, 2013 .Dt DAEMON 8 .Os .Sh NAME @@ -35,7 +35,8 @@ .Sh SYNOPSIS .Nm .Op Fl cfr -.Op Fl p Ar pidfile +.Op Fl p Ar child_pidfile +.Op Fl P Ar supervisor_pidfile .Op Fl u Ar user .Ar command arguments ... .Sh DESCRIPTION @@ -53,19 +54,39 @@ Change the current working directory to .It Fl f Redirect standard input, standard output and standard error to .Pa /dev/null . -.It Fl p Ar file +.It Fl p Ar child_pidfile Write the ID of the created process into the -.Ar file +.Ar child_pidfile using the .Xr pidfile 3 functionality. The program is executed in a spawned child process while the .Nm waits until it terminates to keep the -.Ar file +.Ar child_pidfile locked and removes it after the process exits. The -.Ar file +.Ar child_pidfile +owner is the user who runs the +.Nm +regardless of whether the +.Fl u +option is used or not. +.It Fl P Ar supervisor_pidfile +Write the ID of the +.Nm +process into the +.Ar supervisor_pidfile +using the +.Xr pidfile 3 +functionality. +The program is executed in a spawned child process while the +.Nm +waits until it terminates to keep the +.Ar supervisor_pidfile +locked and removes it after the process exits. +The +.Ar supervisor_pidfile owner is the user who runs the .Nm regardless of whether the @@ -79,27 +100,46 @@ Requires adequate superuser privileges. .El .Pp If the -.Fl p +.Fl p , +.Fl P or .Fl r option is specified the program is executed in a spawned child process. The .Nm -waits until it terminates to keep the pid file locked and removes it +waits until it terminates to keep the pid file(s) locked and removes them after the process exits or restarts the program. In this case if the monitoring .Nm receives software termination signal (SIGTERM) it forwards it to the spawned process. -Normally it will cause the child to exit followed by the termination -of the supervising process after removing the pidfile. +Normally it will cause the child to exit, remove the pidfile(s) +and then terminate. +.Pp +The +.Fl P +option is useful combined with the +.Fl r +option as +.Ar supervisor_pidfile +contains the ID of the supervisor +not the child. This is especially important if you use +.Fl r +in an rc script as the +.Fl p +option will give you the child's ID to signal when you attempt to +stop the service, causing +.Nm +to restart the child. .Sh EXIT STATUS The .Nm utility exits 1 if an error is returned by the .Xr daemon 3 -library routine, 2 if the -.Ar pidfile +library routine, 2 if +.Ar child_pidfile +or +.Ar supervisor_pidfile is requested, but cannot be opened, 3 if process is already running (pidfile exists and is locked), otherwise 0. Modified: stable/9/usr.sbin/daemon/daemon.c ============================================================================== --- stable/9/usr.sbin/daemon/daemon.c Thu Oct 3 17:50:14 2013 (r256024) +++ stable/9/usr.sbin/daemon/daemon.c Thu Oct 3 18:48:43 2013 (r256025) @@ -53,16 +53,16 @@ static void usage(void); int main(int argc, char *argv[]) { - struct pidfh *pfh = NULL; + struct pidfh *ppfh, *pfh; sigset_t mask, oldmask; - int ch, nochdir, noclose, restart; - const char *pidfile, *user; + int ch, nochdir, noclose, restart, serrno; + const char *pidfile, *ppidfile, *user; pid_t otherpid, pid; nochdir = noclose = 1; restart = 0; - pidfile = user = NULL; - while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { + ppidfile = pidfile = user = NULL; + while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -73,6 +73,9 @@ main(int argc, char *argv[]) case 'p': pidfile = optarg; break; + case 'P': + ppidfile = optarg; + break; case 'r': restart = 1; break; @@ -89,7 +92,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - pfh = NULL; + ppfh = pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -104,9 +107,27 @@ main(int argc, char *argv[]) err(2, "pidfile ``%s''", pidfile); } } + /* Do the same for actual daemon process. */ + if (ppidfile != NULL) { + ppfh = pidfile_open(ppidfile, 0600, &otherpid); + if (ppfh == NULL) { + serrno = errno; + pidfile_remove(pfh); + errno = serrno; + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); + } + err(2, "ppidfile ``%s''", ppidfile); + } + } - if (daemon(nochdir, noclose) == -1) - err(1, NULL); + if (daemon(nochdir, noclose) == -1) { + warn("daemon"); + goto exit; + } + /* Write out parent pidfile if needed. */ + pidfile_write(ppfh); /* * If the pidfile or restart option is specified the daemon @@ -123,22 +144,28 @@ main(int argc, char *argv[]) * Restore default action for SIGTERM in case the * parent process decided to ignore it. */ - if (signal(SIGTERM, SIG_DFL) == SIG_ERR) - err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Because SIGCHLD is ignored by default, setup dummy handler * for it, so we can mask it. */ - if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) - err(1, "signal"); + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Block interesting signals. */ sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigaddset(&mask, SIGCHLD); - if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) - err(1, "sigprocmask"); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) { + warn("sigprocmask"); + goto exit; + } /* * Try to protect against pageout kill. Ignore the * error, madvise(2) will fail only if a process does @@ -152,8 +179,8 @@ restart: */ pid = fork(); if (pid == -1) { - pidfile_remove(pfh); - err(1, "fork"); + warn("fork"); + goto exit; } } if (pid <= 0) { @@ -176,13 +203,16 @@ restart: */ err(1, "%s", argv[0]); } + setproctitle("%s[%d]", argv[0], pid); if (wait_child(pid, &mask) == 0 && restart) { sleep(1); goto restart; } +exit: pidfile_remove(pfh); - exit(0); /* Exit status does not matter. */ + pidfile_remove(ppfh); + exit(1); /* If daemon(3) succeeded exit status does not matter. */ } static void @@ -240,7 +270,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cfr] [-p pidfile] [-u user] command " - "arguments ...\n"); + "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] " + "[-u user]\n command arguments ...\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 18:50:10 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 5C916B6F; Thu, 3 Oct 2013 18:50:10 +0000 (UTC) (envelope-from trociny@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B9672839; Thu, 3 Oct 2013 18:50:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93IoASk054110; Thu, 3 Oct 2013 18:50:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Io9XE053792; Thu, 3 Oct 2013 18:50:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031850.r93Io9XE053792@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r256026 - stable/8/usr.sbin/daemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:50:10 -0000 Author: trociny Date: Thu Oct 3 18:50:09 2013 New Revision: 256026 URL: http://svnweb.freebsd.org/changeset/base/256026 Log: MFC r255521, r255526, r255707: r255521 (jmg): add support for writing the pid of the daemon program to a pid file so that daemon can be used w/ rc.subr and ports can use the additional functionality, such as keeping the ldap daemon up and running, and have the proper program to signal to exit. PR: bin/181341 Submitted by: feld r255526 (joel): mdoc: remove EOL whitespace. r255707: 1. Properly clean pid files in the case of the error. 2. Write the supervisor pid before the restart loop, so we don't uselessly rewrite it after every child restart. 3. Remove duplicate ppfh and pfh initialization. Modified: stable/8/usr.sbin/daemon/daemon.8 stable/8/usr.sbin/daemon/daemon.c Directory Properties: stable/8/usr.sbin/daemon/ (props changed) Modified: stable/8/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/8/usr.sbin/daemon/daemon.8 Thu Oct 3 18:48:43 2013 (r256025) +++ stable/8/usr.sbin/daemon/daemon.8 Thu Oct 3 18:50:09 2013 (r256026) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd September 13, 2013 .Dt DAEMON 8 .Os .Sh NAME @@ -35,7 +35,8 @@ .Sh SYNOPSIS .Nm .Op Fl cfr -.Op Fl p Ar pidfile +.Op Fl p Ar child_pidfile +.Op Fl P Ar supervisor_pidfile .Op Fl u Ar user .Ar command arguments ... .Sh DESCRIPTION @@ -53,19 +54,39 @@ Change the current working directory to .It Fl f Redirect standard input, standard output and standard error to .Pa /dev/null . -.It Fl p Ar file +.It Fl p Ar child_pidfile Write the ID of the created process into the -.Ar file +.Ar child_pidfile using the .Xr pidfile 3 functionality. The program is executed in a spawned child process while the .Nm waits until it terminates to keep the -.Ar file +.Ar child_pidfile locked and removes it after the process exits. The -.Ar file +.Ar child_pidfile +owner is the user who runs the +.Nm +regardless of whether the +.Fl u +option is used or not. +.It Fl P Ar supervisor_pidfile +Write the ID of the +.Nm +process into the +.Ar supervisor_pidfile +using the +.Xr pidfile 3 +functionality. +The program is executed in a spawned child process while the +.Nm +waits until it terminates to keep the +.Ar supervisor_pidfile +locked and removes it after the process exits. +The +.Ar supervisor_pidfile owner is the user who runs the .Nm regardless of whether the @@ -79,27 +100,46 @@ Requires adequate superuser privileges. .El .Pp If the -.Fl p +.Fl p , +.Fl P or .Fl r option is specified the program is executed in a spawned child process. The .Nm -waits until it terminates to keep the pid file locked and removes it +waits until it terminates to keep the pid file(s) locked and removes them after the process exits or restarts the program. In this case if the monitoring .Nm receives software termination signal (SIGTERM) it forwards it to the spawned process. -Normally it will cause the child to exit followed by the termination -of the supervising process after removing the pidfile. +Normally it will cause the child to exit, remove the pidfile(s) +and then terminate. +.Pp +The +.Fl P +option is useful combined with the +.Fl r +option as +.Ar supervisor_pidfile +contains the ID of the supervisor +not the child. This is especially important if you use +.Fl r +in an rc script as the +.Fl p +option will give you the child's ID to signal when you attempt to +stop the service, causing +.Nm +to restart the child. .Sh EXIT STATUS The .Nm utility exits 1 if an error is returned by the .Xr daemon 3 -library routine, 2 if the -.Ar pidfile +library routine, 2 if +.Ar child_pidfile +or +.Ar supervisor_pidfile is requested, but cannot be opened, 3 if process is already running (pidfile exists and is locked), otherwise 0. Modified: stable/8/usr.sbin/daemon/daemon.c ============================================================================== --- stable/8/usr.sbin/daemon/daemon.c Thu Oct 3 18:48:43 2013 (r256025) +++ stable/8/usr.sbin/daemon/daemon.c Thu Oct 3 18:50:09 2013 (r256026) @@ -53,16 +53,16 @@ static void usage(void); int main(int argc, char *argv[]) { - struct pidfh *pfh = NULL; + struct pidfh *ppfh, *pfh; sigset_t mask, oldmask; - int ch, nochdir, noclose, restart; - const char *pidfile, *user; + int ch, nochdir, noclose, restart, serrno; + const char *pidfile, *ppidfile, *user; pid_t otherpid, pid; nochdir = noclose = 1; restart = 0; - pidfile = user = NULL; - while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { + ppidfile = pidfile = user = NULL; + while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -73,6 +73,9 @@ main(int argc, char *argv[]) case 'p': pidfile = optarg; break; + case 'P': + ppidfile = optarg; + break; case 'r': restart = 1; break; @@ -89,7 +92,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - pfh = NULL; + ppfh = pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -104,9 +107,27 @@ main(int argc, char *argv[]) err(2, "pidfile ``%s''", pidfile); } } + /* Do the same for actual daemon process. */ + if (ppidfile != NULL) { + ppfh = pidfile_open(ppidfile, 0600, &otherpid); + if (ppfh == NULL) { + serrno = errno; + pidfile_remove(pfh); + errno = serrno; + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); + } + err(2, "ppidfile ``%s''", ppidfile); + } + } - if (daemon(nochdir, noclose) == -1) - err(1, NULL); + if (daemon(nochdir, noclose) == -1) { + warn("daemon"); + goto exit; + } + /* Write out parent pidfile if needed. */ + pidfile_write(ppfh); /* * If the pidfile or restart option is specified the daemon @@ -123,22 +144,28 @@ main(int argc, char *argv[]) * Restore default action for SIGTERM in case the * parent process decided to ignore it. */ - if (signal(SIGTERM, SIG_DFL) == SIG_ERR) - err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Because SIGCHLD is ignored by default, setup dummy handler * for it, so we can mask it. */ - if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) - err(1, "signal"); + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Block interesting signals. */ sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigaddset(&mask, SIGCHLD); - if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) - err(1, "sigprocmask"); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) { + warn("sigprocmask"); + goto exit; + } /* * Try to protect against pageout kill. Ignore the * error, madvise(2) will fail only if a process does @@ -152,8 +179,8 @@ restart: */ pid = fork(); if (pid == -1) { - pidfile_remove(pfh); - err(1, "fork"); + warn("fork"); + goto exit; } } if (pid <= 0) { @@ -176,13 +203,16 @@ restart: */ err(1, "%s", argv[0]); } + setproctitle("%s[%d]", argv[0], pid); if (wait_child(pid, &mask) == 0 && restart) { sleep(1); goto restart; } +exit: pidfile_remove(pfh); - exit(0); /* Exit status does not matter. */ + pidfile_remove(ppfh); + exit(1); /* If daemon(3) succeeded exit status does not matter. */ } static void @@ -240,7 +270,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cfr] [-p pidfile] [-u user] command " - "arguments ...\n"); + "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] " + "[-u user]\n command arguments ...\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 18:52:05 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E9613CBA; Thu, 3 Oct 2013 18:52:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C95272874; Thu, 3 Oct 2013 18:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Iq5c4055204; Thu, 3 Oct 2013 18:52:05 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Iq5Gl055199; Thu, 3 Oct 2013 18:52:05 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031852.r93Iq5Gl055199@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256027 - stable/9/sbin/hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:52:06 -0000 Author: trociny Date: Thu Oct 3 18:52:04 2013 New Revision: 256027 URL: http://svnweb.freebsd.org/changeset/base/256027 Log: MFC r255714, r255716, r255717: r255714: Use cv_broadcast() instead of cv_signal() when waking up threads waiting on an empty queue as the queue may have several consumers. Before the fix the following scenario was possible: 2 threads are waiting on empty queue, 2 threads are inserting simultaneously. The first inserting thread detects that the queue is empty and is going to send the signal, but before it sends the second thread inserts too. When the first sends the signal only one of the waiting threads receive it while the other one may wait forever. The scenario above is is believed to be the cause of the observed cases, when ggate_recv_thread() was getting stuck on taking free request, while the free queue was not empty. Reviewed by: pjd Tested by: Yamagi Burmeister yamagi.org r255716: When updating the map of dirty extents, most recently used extents are kept dirty to reduce the number of on-disk metadata updates. The sequence of operations is: 1) acquire the activemap lock; 2) update in-memory map; 3) if the list of keepdirty extents is changed, update on-disk metadata; 4) release the lock. On-disk updates are not frequent in comparison with in-memory updates, while require much more time. So situations are possible when one thread is updating on-disk metadata and another one is waiting for the activemap lock just to update the in-memory map. Improve this by introducing additional, on-disk map lock: when in-memory map is updated and it is detected that the on-disk map needs update too, the on-disk map lock is acquired and the on-memory lock is released before flushing the map. Reported by: Yamagi Burmeister yamagi.org Tested by: Yamagi Burmeister yamagi.org Reviewed by: pjd r255717: Fix comments. Modified: stable/9/sbin/hastd/hast.h stable/9/sbin/hastd/primary.c stable/9/sbin/hastd/secondary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/hast.h ============================================================================== --- stable/9/sbin/hastd/hast.h Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/hast.h Thu Oct 3 18:52:04 2013 (r256027) @@ -226,8 +226,10 @@ struct hast_resource { /* Activemap structure. */ struct activemap *hr_amp; - /* Locked used to synchronize access to hr_amp. */ + /* Lock used to synchronize access to hr_amp. */ pthread_mutex_t hr_amp_lock; + /* Lock used to synchronize access to hr_amp diskmap. */ + pthread_mutex_t hr_amp_diskmap_lock; /* Number of BIO_READ requests. */ uint64_t hr_stat_read; Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/primary.c Thu Oct 3 18:52:04 2013 (r256027) @@ -172,7 +172,7 @@ static pthread_mutex_t metadata_lock; hio_next[(ncomp)]); \ mtx_unlock(&hio_##name##_list_lock[ncomp]); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond[(ncomp)]); \ + cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ } while (0) #define QUEUE_INSERT2(hio, name) do { \ bool _wakeup; \ @@ -182,7 +182,7 @@ static pthread_mutex_t metadata_lock; TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \ bool _last; \ @@ -291,22 +291,28 @@ primary_exitx(int exitcode, const char * exit(exitcode); } +/* Expects res->hr_amp locked, returns unlocked. */ static int hast_activemap_flush(struct hast_resource *res) { const unsigned char *buf; size_t size; + int ret; + mtx_lock(&res->hr_amp_diskmap_lock); buf = activemap_bitmap(res->hr_amp, &size); + mtx_unlock(&res->hr_amp_lock); PJDLOG_ASSERT(buf != NULL); PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0); + ret = 0; if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); res->hr_stat_activemap_write_error++; - return (-1); + ret = -1; } - if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { + if (ret == 0 && res->hr_metaflush == 1 && + g_flush(res->hr_localfd) == -1) { if (errno == EOPNOTSUPP) { pjdlog_warning("The %s provider doesn't support flushing write cache. Disabling it.", res->hr_localpath); @@ -315,10 +321,11 @@ hast_activemap_flush(struct hast_resourc pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); res->hr_stat_activemap_flush_error++; - return (-1); + ret = -1; } } - return (0); + mtx_unlock(&res->hr_amp_diskmap_lock); + return (ret); } static bool @@ -783,6 +790,7 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ + mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); @@ -1288,8 +1296,9 @@ ggate_recv_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); break; case BIO_DELETE: res->hr_stat_delete++; @@ -1649,8 +1658,9 @@ done_queue: if (activemap_need_sync(res->hr_amp, ggio->gctl_offset, ggio->gctl_length)) { (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) (void)refcnt_release(&hio->hio_countdown); } @@ -1917,8 +1927,9 @@ ggate_send_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); } if (ggio->gctl_cmd == BIO_WRITE) { /* @@ -2014,8 +2025,11 @@ sync_thread(void *arg __unused) */ if (activemap_extent_complete(res->hr_amp, syncext)) (void)hast_activemap_flush(res); + else + mtx_unlock(&res->hr_amp_lock); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (dorewind) { dorewind = false; if (offset == -1) Modified: stable/9/sbin/hastd/secondary.c ============================================================================== --- stable/9/sbin/hastd/secondary.c Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/secondary.c Thu Oct 3 18:52:04 2013 (r256027) @@ -85,14 +85,13 @@ static TAILQ_HEAD(, hio) hio_free_list; static pthread_mutex_t hio_free_list_lock; static pthread_cond_t hio_free_list_cond; /* - * Disk thread (the one that do I/O requests) takes requests from this list. + * Disk thread (the one that does I/O requests) takes requests from this list. */ static TAILQ_HEAD(, hio) hio_disk_list; static pthread_mutex_t hio_disk_list_lock; static pthread_cond_t hio_disk_list_cond; /* - * There is one recv list for every component, although local components don't - * use recv lists as local requests are done synchronously. + * Thread that sends requests back to primary takes requests from this list. */ static TAILQ_HEAD(, hio) hio_send_list; static pthread_mutex_t hio_send_list_lock; @@ -115,7 +114,7 @@ static void *send_thread(void *arg); TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE(name, hio) do { \ mtx_lock(&hio_##name##_list_lock); \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 18:53:14 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 4B799DF5; Thu, 3 Oct 2013 18:53:14 +0000 (UTC) (envelope-from trociny@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B86D2881; Thu, 3 Oct 2013 18:53:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93IrEp0055695; Thu, 3 Oct 2013 18:53:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93IrD2l055692; Thu, 3 Oct 2013 18:53:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031853.r93IrD2l055692@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r256028 - stable/8/sbin/hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:53:14 -0000 Author: trociny Date: Thu Oct 3 18:53:13 2013 New Revision: 256028 URL: http://svnweb.freebsd.org/changeset/base/256028 Log: MFC r255714, r255716, r255717: r255714: Use cv_broadcast() instead of cv_signal() when waking up threads waiting on an empty queue as the queue may have several consumers. Before the fix the following scenario was possible: 2 threads are waiting on empty queue, 2 threads are inserting simultaneously. The first inserting thread detects that the queue is empty and is going to send the signal, but before it sends the second thread inserts too. When the first sends the signal only one of the waiting threads receive it while the other one may wait forever. The scenario above is is believed to be the cause of the observed cases, when ggate_recv_thread() was getting stuck on taking free request, while the free queue was not empty. Reviewed by: pjd Tested by: Yamagi Burmeister yamagi.org r255716: When updating the map of dirty extents, most recently used extents are kept dirty to reduce the number of on-disk metadata updates. The sequence of operations is: 1) acquire the activemap lock; 2) update in-memory map; 3) if the list of keepdirty extents is changed, update on-disk metadata; 4) release the lock. On-disk updates are not frequent in comparison with in-memory updates, while require much more time. So situations are possible when one thread is updating on-disk metadata and another one is waiting for the activemap lock just to update the in-memory map. Improve this by introducing additional, on-disk map lock: when in-memory map is updated and it is detected that the on-disk map needs update too, the on-disk map lock is acquired and the on-memory lock is released before flushing the map. Reported by: Yamagi Burmeister yamagi.org Tested by: Yamagi Burmeister yamagi.org Reviewed by: pjd r255717: Fix comments. Modified: stable/8/sbin/hastd/hast.h stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/secondary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hast.h ============================================================================== --- stable/8/sbin/hastd/hast.h Thu Oct 3 18:52:04 2013 (r256027) +++ stable/8/sbin/hastd/hast.h Thu Oct 3 18:53:13 2013 (r256028) @@ -226,8 +226,10 @@ struct hast_resource { /* Activemap structure. */ struct activemap *hr_amp; - /* Locked used to synchronize access to hr_amp. */ + /* Lock used to synchronize access to hr_amp. */ pthread_mutex_t hr_amp_lock; + /* Lock used to synchronize access to hr_amp diskmap. */ + pthread_mutex_t hr_amp_diskmap_lock; /* Number of BIO_READ requests. */ uint64_t hr_stat_read; Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Thu Oct 3 18:52:04 2013 (r256027) +++ stable/8/sbin/hastd/primary.c Thu Oct 3 18:53:13 2013 (r256028) @@ -172,7 +172,7 @@ static pthread_mutex_t metadata_lock; hio_next[(ncomp)]); \ mtx_unlock(&hio_##name##_list_lock[ncomp]); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond[(ncomp)]); \ + cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ } while (0) #define QUEUE_INSERT2(hio, name) do { \ bool _wakeup; \ @@ -182,7 +182,7 @@ static pthread_mutex_t metadata_lock; TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \ bool _last; \ @@ -291,22 +291,28 @@ primary_exitx(int exitcode, const char * exit(exitcode); } +/* Expects res->hr_amp locked, returns unlocked. */ static int hast_activemap_flush(struct hast_resource *res) { const unsigned char *buf; size_t size; + int ret; + mtx_lock(&res->hr_amp_diskmap_lock); buf = activemap_bitmap(res->hr_amp, &size); + mtx_unlock(&res->hr_amp_lock); PJDLOG_ASSERT(buf != NULL); PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0); + ret = 0; if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); res->hr_stat_activemap_write_error++; - return (-1); + ret = -1; } - if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { + if (ret == 0 && res->hr_metaflush == 1 && + g_flush(res->hr_localfd) == -1) { if (errno == EOPNOTSUPP) { pjdlog_warning("The %s provider doesn't support flushing write cache. Disabling it.", res->hr_localpath); @@ -315,10 +321,11 @@ hast_activemap_flush(struct hast_resourc pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); res->hr_stat_activemap_flush_error++; - return (-1); + ret = -1; } } - return (0); + mtx_unlock(&res->hr_amp_diskmap_lock); + return (ret); } static bool @@ -783,6 +790,7 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ + mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); @@ -1288,8 +1296,9 @@ ggate_recv_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); break; case BIO_DELETE: res->hr_stat_delete++; @@ -1649,8 +1658,9 @@ done_queue: if (activemap_need_sync(res->hr_amp, ggio->gctl_offset, ggio->gctl_length)) { (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) (void)refcnt_release(&hio->hio_countdown); } @@ -1917,8 +1927,9 @@ ggate_send_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); } if (ggio->gctl_cmd == BIO_WRITE) { /* @@ -2014,8 +2025,11 @@ sync_thread(void *arg __unused) */ if (activemap_extent_complete(res->hr_amp, syncext)) (void)hast_activemap_flush(res); + else + mtx_unlock(&res->hr_amp_lock); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (dorewind) { dorewind = false; if (offset == -1) Modified: stable/8/sbin/hastd/secondary.c ============================================================================== --- stable/8/sbin/hastd/secondary.c Thu Oct 3 18:52:04 2013 (r256027) +++ stable/8/sbin/hastd/secondary.c Thu Oct 3 18:53:13 2013 (r256028) @@ -85,14 +85,13 @@ static TAILQ_HEAD(, hio) hio_free_list; static pthread_mutex_t hio_free_list_lock; static pthread_cond_t hio_free_list_cond; /* - * Disk thread (the one that do I/O requests) takes requests from this list. + * Disk thread (the one that does I/O requests) takes requests from this list. */ static TAILQ_HEAD(, hio) hio_disk_list; static pthread_mutex_t hio_disk_list_lock; static pthread_cond_t hio_disk_list_cond; /* - * There is one recv list for every component, although local components don't - * use recv lists as local requests are done synchronously. + * Thread that sends requests back to primary takes requests from this list. */ static TAILQ_HEAD(, hio) hio_send_list; static pthread_mutex_t hio_send_list_lock; @@ -115,7 +114,7 @@ static void *send_thread(void *arg); TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE(name, hio) do { \ mtx_lock(&hio_##name##_list_lock); \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 20:39:02 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 3A78386E; Thu, 3 Oct 2013 20:39:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24BB22E27; Thu, 3 Oct 2013 20:39:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Kd21A010252; Thu, 3 Oct 2013 20:39:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93KcvVl010208; Thu, 3 Oct 2013 20:38:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310032038.r93KcvVl010208@svn.freebsd.org> From: Dimitry Andric Date: Thu, 3 Oct 2013 20:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256030 - in head/contrib/llvm: include/llvm/IR lib/AsmParser lib/IR lib/Target/X86 tools/clang/include/clang-c tools/clang/include/clang/AST tools/clang/include/clang/Basic tools/clang... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 20:39:02 -0000 Author: dim Date: Thu Oct 3 20:38:57 2013 New Revision: 256030 URL: http://svnweb.freebsd.org/changeset/base/256030 Log: Pull in r189644 from upstream llvm trunk: Add ms_abi and sysv_abi attribute handling. Based on a patch by Benno Rice! This will help to develop EFI support. Approved by: re (kib) Verified by: benno MFC after: 1 week Modified: head/contrib/llvm/include/llvm/IR/CallingConv.h head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/IR/AsmWriter.cpp head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Modified: head/contrib/llvm/include/llvm/IR/CallingConv.h ============================================================================== --- head/contrib/llvm/include/llvm/IR/CallingConv.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/include/llvm/IR/CallingConv.h Thu Oct 3 20:38:57 2013 (r256030) @@ -119,8 +119,17 @@ namespace CallingConv { SPIR_KERNEL = 76, /// Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins - Intel_OCL_BI = 77 + Intel_OCL_BI = 77, + /// \brief The C convention as specified in the x86-64 supplement to the + /// System V ABI, used on most non-Windows systems. + X86_64_SysV = 78, + + /// \brief The C convention as implemented on Windows/x86-64. This + /// convention differs from the more common \c X86_64_SysV convention + /// in a number of ways, most notably in that XMM registers used to pass + /// arguments are shadowed by GPRs, and vice versa. + X86_64_Win64 = 79 }; } // End CallingConv namespace Modified: head/contrib/llvm/lib/AsmParser/LLLexer.cpp ============================================================================== --- head/contrib/llvm/lib/AsmParser/LLLexer.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/AsmParser/LLLexer.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -556,6 +556,8 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(spir_kernel); KEYWORD(spir_func); KEYWORD(intel_ocl_bicc); + KEYWORD(x86_64_sysvcc); + KEYWORD(x86_64_win64cc); KEYWORD(cc); KEYWORD(c); Modified: head/contrib/llvm/lib/AsmParser/LLParser.cpp ============================================================================== --- head/contrib/llvm/lib/AsmParser/LLParser.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/AsmParser/LLParser.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -1337,6 +1337,8 @@ bool LLParser::ParseOptionalVisibility(u /// ::= 'ptx_device' /// ::= 'spir_func' /// ::= 'spir_kernel' +/// ::= 'x86_64_sysvcc' +/// ::= 'x86_64_win64cc' /// ::= 'cc' UINT /// bool LLParser::ParseOptionalCallingConv(CallingConv::ID &CC) { @@ -1357,6 +1359,8 @@ bool LLParser::ParseOptionalCallingConv( case lltok::kw_spir_kernel: CC = CallingConv::SPIR_KERNEL; break; case lltok::kw_spir_func: CC = CallingConv::SPIR_FUNC; break; case lltok::kw_intel_ocl_bicc: CC = CallingConv::Intel_OCL_BI; break; + case lltok::kw_x86_64_sysvcc: CC = CallingConv::X86_64_SysV; break; + case lltok::kw_x86_64_win64cc: CC = CallingConv::X86_64_Win64; break; case lltok::kw_cc: { unsigned ArbitraryCC; Lex.Lex(); Modified: head/contrib/llvm/lib/AsmParser/LLToken.h ============================================================================== --- head/contrib/llvm/lib/AsmParser/LLToken.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/AsmParser/LLToken.h Thu Oct 3 20:38:57 2013 (r256030) @@ -84,12 +84,13 @@ namespace lltok { kw_c, kw_cc, kw_ccc, kw_fastcc, kw_coldcc, - kw_intel_ocl_bicc, + kw_intel_ocl_bicc, kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc, kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc, kw_msp430_intrcc, kw_ptx_kernel, kw_ptx_device, kw_spir_kernel, kw_spir_func, + kw_x86_64_sysvcc, kw_x86_64_win64cc, // Attributes: kw_attributes, Modified: head/contrib/llvm/lib/IR/AsmWriter.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AsmWriter.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/IR/AsmWriter.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -81,6 +81,8 @@ static void PrintCallingConv(unsigned cc case CallingConv::MSP430_INTR: Out << "msp430_intrcc"; break; case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break; case CallingConv::PTX_Device: Out << "ptx_device"; break; + case CallingConv::X86_64_SysV: Out << "x86_64_sysvcc"; break; + case CallingConv::X86_64_Win64: Out << "x86_64_win64cc"; break; } } Modified: head/contrib/llvm/lib/Target/X86/X86CallingConv.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86CallingConv.td Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/Target/X86/X86CallingConv.td Thu Oct 3 20:38:57 2013 (r256030) @@ -156,6 +156,11 @@ def RetCC_X86_32 : CallingConv<[ def RetCC_X86_64 : CallingConv<[ // HiPE uses RetCC_X86_64_HiPE CCIfCC<"CallingConv::HiPE", CCDelegateTo>, + + // Handle explicit CC selection + CCIfCC<"CallingConv::X86_64_Win64", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_SysV", CCDelegateTo>, + // Mingw64 and native Win64 use Win64 CC CCIfSubtarget<"isTargetWin64()", CCDelegateTo>, @@ -489,6 +494,8 @@ def CC_X86_32 : CallingConv<[ def CC_X86_64 : CallingConv<[ CCIfCC<"CallingConv::GHC", CCDelegateTo>, CCIfCC<"CallingConv::HiPE", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_Win64", CCDelegateTo>, + CCIfCC<"CallingConv::X86_64_SysV", CCDelegateTo>, // Mingw64 and native Win64 use Win64 CC CCIfSubtarget<"isTargetWin64()", CCDelegateTo>, Modified: head/contrib/llvm/lib/Target/X86/X86FastISel.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/Target/X86/X86FastISel.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -717,10 +717,11 @@ bool X86FastISel::X86SelectRet(const Ins CallingConv::ID CC = F.getCallingConv(); if (CC != CallingConv::C && CC != CallingConv::Fast && - CC != CallingConv::X86_FastCall) + CC != CallingConv::X86_FastCall && + CC != CallingConv::X86_64_SysV) return false; - if (Subtarget->isTargetWin64()) + if (Subtarget->isCallingConvWin64(CC)) return false; // Don't handle popping bytes on return for now. @@ -1643,9 +1644,6 @@ bool X86FastISel::FastLowerArguments() { if (!FuncInfo.CanLowerReturn) return false; - if (Subtarget->isTargetWin64()) - return false; - const Function *F = FuncInfo.Fn; if (F->isVarArg()) return false; @@ -1653,7 +1651,10 @@ bool X86FastISel::FastLowerArguments() { CallingConv::ID CC = F->getCallingConv(); if (CC != CallingConv::C) return false; - + + if (Subtarget->isCallingConvWin64(CC)) + return false; + if (!Subtarget->is64Bit()) return false; @@ -1757,8 +1758,10 @@ bool X86FastISel::DoSelectCall(const Ins // Handle only C and fastcc calling conventions for now. ImmutableCallSite CS(CI); CallingConv::ID CC = CS.getCallingConv(); + bool isWin64 = Subtarget->isCallingConvWin64(CC); if (CC != CallingConv::C && CC != CallingConv::Fast && - CC != CallingConv::X86_FastCall) + CC != CallingConv::X86_FastCall && CC != CallingConv::X86_64_Win64 && + CC != CallingConv::X86_64_SysV) return false; // fastcc with -tailcallopt is intended to provide a guaranteed @@ -1772,7 +1775,7 @@ bool X86FastISel::DoSelectCall(const Ins // Don't know how to handle Win64 varargs yet. Nothing special needed for // x86-32. Special handling for x86-64 is implemented. - if (isVarArg && Subtarget->isTargetWin64()) + if (isVarArg && isWin64) return false; // Fast-isel doesn't know about callee-pop yet. @@ -1902,7 +1905,7 @@ bool X86FastISel::DoSelectCall(const Ins I->getParent()->getContext()); // Allocate shadow area for Win64 - if (Subtarget->isTargetWin64()) + if (isWin64) CCInfo.AllocateStack(32, 8); CCInfo.AnalyzeCallOperands(ArgVTs, ArgFlags, CC_X86); @@ -2016,7 +2019,7 @@ bool X86FastISel::DoSelectCall(const Ins X86::EBX).addReg(Base); } - if (Subtarget->is64Bit() && isVarArg && !Subtarget->isTargetWin64()) { + if (Subtarget->is64Bit() && isVarArg && !isWin64) { // Count the number of XMM registers allocated. static const uint16_t XMMArgRegs[] = { X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, @@ -2085,7 +2088,7 @@ bool X86FastISel::DoSelectCall(const Ins if (Subtarget->isPICStyleGOT()) MIB.addReg(X86::EBX, RegState::Implicit); - if (Subtarget->is64Bit() && isVarArg && !Subtarget->isTargetWin64()) + if (Subtarget->is64Bit() && isVarArg && !isWin64) MIB.addReg(X86::AL, RegState::Implicit); // Add implicit physical register uses to the call. Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -1883,13 +1883,19 @@ static bool IsTailCallConvention(Calling CC == CallingConv::HiPE); } +/// \brief Return true if the calling convention is a C calling convention. +static bool IsCCallConvention(CallingConv::ID CC) { + return (CC == CallingConv::C || CC == CallingConv::X86_64_Win64 || + CC == CallingConv::X86_64_SysV); +} + bool X86TargetLowering::mayBeEmittedAsTailCall(CallInst *CI) const { if (!CI->isTailCall() || getTargetMachine().Options.DisableTailCalls) return false; CallSite CS(CI); CallingConv::ID CalleeCC = CS.getCallingConv(); - if (!IsTailCallConvention(CalleeCC) && CalleeCC != CallingConv::C) + if (!IsTailCallConvention(CalleeCC) && !IsCCallConvention(CalleeCC)) return false; return true; @@ -1964,7 +1970,7 @@ X86TargetLowering::LowerFormalArguments( MachineFrameInfo *MFI = MF.getFrameInfo(); bool Is64Bit = Subtarget->is64Bit(); bool IsWindows = Subtarget->isTargetWindows(); - bool IsWin64 = Subtarget->isTargetWin64(); + bool IsWin64 = Subtarget->isCallingConvWin64(CallConv); assert(!(isVarArg && IsTailCallConvention(CallConv)) && "Var args not supported with calling convention fastcc, ghc or hipe"); @@ -1975,9 +1981,8 @@ X86TargetLowering::LowerFormalArguments( ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (IsWin64) { + if (IsWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeFormalArguments(Ins, CC_X86); @@ -2290,7 +2295,7 @@ X86TargetLowering::LowerCall(TargetLower MachineFunction &MF = DAG.getMachineFunction(); bool Is64Bit = Subtarget->is64Bit(); - bool IsWin64 = Subtarget->isTargetWin64(); + bool IsWin64 = Subtarget->isCallingConvWin64(CallConv); bool IsWindows = Subtarget->isTargetWindows(); StructReturnType SR = callIsStructReturn(Outs); bool IsSibcall = false; @@ -2323,9 +2328,8 @@ X86TargetLowering::LowerCall(TargetLower ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (IsWin64) { + if (IsWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeCallOperands(Outs, CC_X86); @@ -2831,13 +2835,12 @@ X86TargetLowering::IsEligibleForTailCall const SmallVectorImpl &OutVals, const SmallVectorImpl &Ins, SelectionDAG &DAG) const { - if (!IsTailCallConvention(CalleeCC) && - CalleeCC != CallingConv::C) + if (!IsTailCallConvention(CalleeCC) && !IsCCallConvention(CalleeCC)) return false; // If -tailcallopt is specified, make fastcc functions tail-callable. const MachineFunction &MF = DAG.getMachineFunction(); - const Function *CallerF = DAG.getMachineFunction().getFunction(); + const Function *CallerF = MF.getFunction(); // If the function return type is x86_fp80 and the callee return type is not, // then the FP_EXTEND of the call result is not a nop. It's not safe to @@ -2847,6 +2850,8 @@ X86TargetLowering::IsEligibleForTailCall CallingConv::ID CallerCC = CallerF->getCallingConv(); bool CCMatch = CallerCC == CalleeCC; + bool IsCalleeWin64 = Subtarget->isCallingConvWin64(CalleeCC); + bool IsCallerWin64 = Subtarget->isCallingConvWin64(CallerCC); if (getTargetMachine().Options.GuaranteedTailCallOpt) { if (IsTailCallConvention(CalleeCC) && CCMatch) @@ -2878,7 +2883,7 @@ X86TargetLowering::IsEligibleForTailCall // Optimizing for varargs on Win64 is unlikely to be safe without // additional testing. - if (Subtarget->isTargetWin64()) + if (IsCalleeWin64 || IsCallerWin64) return false; SmallVector ArgLocs; @@ -2953,9 +2958,8 @@ X86TargetLowering::IsEligibleForTailCall getTargetMachine(), ArgLocs, *DAG.getContext()); // Allocate shadow area for Win64 - if (Subtarget->isTargetWin64()) { + if (IsCalleeWin64) CCInfo.AllocateStack(32, 8); - } CCInfo.AnalyzeCallOperands(Outs, CC_X86); if (CCInfo.getNextStackOffset()) { Modified: head/contrib/llvm/lib/Target/X86/X86Subtarget.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86Subtarget.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/lib/Target/X86/X86Subtarget.h Thu Oct 3 20:38:57 2013 (r256030) @@ -338,7 +338,13 @@ public: } bool isPICStyleStubAny() const { return PICStyle == PICStyles::StubDynamicNoPIC || - PICStyle == PICStyles::StubPIC; } + PICStyle == PICStyles::StubPIC; + } + + bool isCallingConvWin64(CallingConv::ID CC) const { + return (isTargetWin64() && CC != CallingConv::X86_64_SysV) || + CC == CallingConv::X86_64_Win64; + } /// ClassifyGlobalReference - Classify a global variable reference for the /// current subtarget according to how we should reference it in a non-pcrel Modified: head/contrib/llvm/tools/clang/include/clang-c/Index.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang-c/Index.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/include/clang-c/Index.h Thu Oct 3 20:38:57 2013 (r256030) @@ -2683,6 +2683,8 @@ enum CXCallingConv { CXCallingConv_AAPCS_VFP = 7, CXCallingConv_PnaclCall = 8, CXCallingConv_IntelOclBicc = 9, + CXCallingConv_X86_64Win64 = 10, + CXCallingConv_X86_64SysV = 11, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 Modified: head/contrib/llvm/tools/clang/include/clang/AST/Type.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Type.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/include/clang/AST/Type.h Thu Oct 3 20:38:57 2013 (r256030) @@ -3335,7 +3335,9 @@ public: attr_thiscall, attr_pascal, attr_pnaclcall, - attr_inteloclbicc + attr_inteloclbicc, + attr_ms_abi, + attr_sysv_abi }; private: Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td Thu Oct 3 20:38:57 2013 (r256030) @@ -417,6 +417,10 @@ def MayAlias : InheritableAttr { let Spellings = [GNU<"may_alias">, CXX11<"gnu", "may_alias">]; } +def MSABI : InheritableAttr { + let Spellings = [GNU<"ms_abi">, CXX11<"gnu", "ms_abi">]; +} + def MSP430Interrupt : InheritableAttr { let Spellings = []; let Args = [UnsignedArgument<"Number">]; @@ -664,6 +668,10 @@ def StdCall : InheritableAttr { Keyword<"__stdcall">, Keyword<"_stdcall">]; } +def SysVABI : InheritableAttr { + let Spellings = [GNU<"sysv_abi">, CXX11<"gnu", "sysv_abi">]; +} + def ThisCall : InheritableAttr { let Spellings = [GNU<"thiscall">, CXX11<"gnu", "thiscall">, Keyword<"__thiscall">, Keyword<"_thiscall">]; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h Thu Oct 3 20:38:57 2013 (r256030) @@ -206,6 +206,8 @@ namespace clang { CC_X86FastCall, // __attribute__((fastcall)) CC_X86ThisCall, // __attribute__((thiscall)) CC_X86Pascal, // __attribute__((pascal)) + CC_X86_64Win64, // __attribute__((ms_abi)) + CC_X86_64SysV, // __attribute__((sysv_abi)) CC_AAPCS, // __attribute__((pcs("aapcs"))) CC_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp"))) CC_PnaclCall, // __attribute__((pnaclcall)) Modified: head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -921,6 +921,8 @@ struct XMLDumper : public XMLDeclVisitor case CC_X86StdCall: return set("cc", "x86_stdcall"); case CC_X86ThisCall: return set("cc", "x86_thiscall"); case CC_X86Pascal: return set("cc", "x86_pascal"); + case CC_X86_64Win64: return set("cc", "x86_64_win64"); + case CC_X86_64SysV: return set("cc", "x86_64_sysv"); case CC_AAPCS: return set("cc", "aapcs"); case CC_AAPCS_VFP: return set("cc", "aapcs_vfp"); case CC_PnaclCall: return set("cc", "pnaclcall"); Modified: head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -1311,6 +1311,8 @@ void MicrosoftCXXNameMangler::mangleCall switch (CC) { default: llvm_unreachable("Unsupported CC for mangling"); + case CC_X86_64Win64: + case CC_X86_64SysV: case CC_Default: case CC_C: Out << 'A'; break; case CC_X86Pascal: Out << 'C'; break; Modified: head/contrib/llvm/tools/clang/lib/AST/Type.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/Type.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/AST/Type.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -1574,6 +1574,8 @@ StringRef FunctionType::getNameForCallCo case CC_X86FastCall: return "fastcall"; case CC_X86ThisCall: return "thiscall"; case CC_X86Pascal: return "pascal"; + case CC_X86_64Win64: return "ms_abi"; + case CC_X86_64SysV: return "sysv_abi"; case CC_AAPCS: return "aapcs"; case CC_AAPCS_VFP: return "aapcs-vfp"; case CC_PnaclCall: return "pnaclcall"; Modified: head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -650,6 +650,12 @@ void TypePrinter::printFunctionProtoAfte case CC_IntelOclBicc: OS << " __attribute__((intel_ocl_bicc))"; break; + case CC_X86_64Win64: + OS << " __attribute__((ms_abi))"; + break; + case CC_X86_64SysV: + OS << " __attribute__((sysv_abi))"; + break; } if (Info.getNoReturn()) OS << " __attribute__((noreturn))"; @@ -1160,6 +1166,8 @@ void TypePrinter::printAttributedAfter(c case AttributedType::attr_stdcall: OS << "stdcall"; break; case AttributedType::attr_thiscall: OS << "thiscall"; break; case AttributedType::attr_pascal: OS << "pascal"; break; + case AttributedType::attr_ms_abi: OS << "ms_abi"; break; + case AttributedType::attr_sysv_abi: OS << "sysv_abi"; break; case AttributedType::attr_pcs: { OS << "pcs("; QualType t = T->getEquivalentType(); Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -3182,8 +3182,9 @@ public: virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { return (CC == CC_Default || - CC == CC_C || - CC == CC_IntelOclBicc) ? CCCR_OK : CCCR_Warning; + CC == CC_C || + CC == CC_IntelOclBicc || + CC == CC_X86_64Win64) ? CCCR_OK : CCCR_Warning; } virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const { @@ -3219,6 +3220,11 @@ public: virtual BuiltinVaListKind getBuiltinVaListKind() const { return TargetInfo::CharPtrBuiltinVaList; } + virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { + return (CC == CC_C || + CC == CC_IntelOclBicc || + CC == CC_X86_64SysV) ? CCCR_OK : CCCR_Warning; + } }; } // end anonymous namespace Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -41,6 +41,8 @@ static unsigned ClangCallConvToLLVMCallC case CC_X86StdCall: return llvm::CallingConv::X86_StdCall; case CC_X86FastCall: return llvm::CallingConv::X86_FastCall; case CC_X86ThisCall: return llvm::CallingConv::X86_ThisCall; + case CC_X86_64Win64: return llvm::CallingConv::X86_64_Win64; + case CC_X86_64SysV: return llvm::CallingConv::X86_64_SysV; case CC_AAPCS: return llvm::CallingConv::ARM_AAPCS; case CC_AAPCS_VFP: return llvm::CallingConv::ARM_AAPCS_VFP; case CC_IntelOclBicc: return llvm::CallingConv::Intel_OCL_BI; Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -3961,6 +3961,16 @@ static void handleCallConvAttr(Sema &S, PascalAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); return; + case AttributeList::AT_MSABI: + D->addAttr(::new (S.Context) + MSABIAttr(Attr.getRange(), S.Context, + Attr.getAttributeSpellingListIndex())); + return; + case AttributeList::AT_SysVABI: + D->addAttr(::new (S.Context) + SysVABIAttr(Attr.getRange(), S.Context, + Attr.getAttributeSpellingListIndex())); + return; case AttributeList::AT_Pcs: { PcsAttr::PCSType PCS; switch (CC) { @@ -4036,6 +4046,14 @@ bool Sema::CheckCallingConvAttr(const At case AttributeList::AT_StdCall: CC = CC_X86StdCall; break; case AttributeList::AT_ThisCall: CC = CC_X86ThisCall; break; case AttributeList::AT_Pascal: CC = CC_X86Pascal; break; + case AttributeList::AT_MSABI: + CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C : + CC_X86_64Win64; + break; + case AttributeList::AT_SysVABI: + CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_X86_64SysV : + CC_C; + break; case AttributeList::AT_Pcs: { Expr *Arg = attr.getArg(0); StringLiteral *Str = dyn_cast(Arg); @@ -4876,6 +4894,8 @@ static void ProcessInheritableDeclAttr(S case AttributeList::AT_FastCall: case AttributeList::AT_ThisCall: case AttributeList::AT_Pascal: + case AttributeList::AT_MSABI: + case AttributeList::AT_SysVABI: case AttributeList::AT_Pcs: case AttributeList::AT_PnaclCall: case AttributeList::AT_IntelOclBicc: Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Thu Oct 3 18:58:35 2013 (r256029) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp Thu Oct 3 20:38:57 2013 (r256030) @@ -105,6 +105,8 @@ static void diagnoseBadTypeAttribute(Sem case AttributeList::AT_StdCall: \ case AttributeList::AT_ThisCall: \ case AttributeList::AT_Pascal: \ + case AttributeList::AT_MSABI: \ + case AttributeList::AT_SysVABI: \ case AttributeList::AT_Regparm: \ case AttributeList::AT_Pcs: \ case AttributeList::AT_PnaclCall: \ @@ -3296,6 +3298,10 @@ static AttributeList::Kind getAttrListKi return AttributeList::AT_PnaclCall; case AttributedType::attr_inteloclbicc: return AttributeList::AT_IntelOclBicc; + case AttributedType::attr_ms_abi: + return AttributeList::AT_MSABI; + case AttributedType::attr_sysv_abi: + return AttributeList::AT_SysVABI; } llvm_unreachable("unexpected attribute kind!"); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 22:52:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 38DA538A; Thu, 3 Oct 2013 22:52:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25618250E; Thu, 3 Oct 2013 22:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Mq3tX083120; Thu, 3 Oct 2013 22:52:03 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Mq3t4083119; Thu, 3 Oct 2013 22:52:03 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310032252.r93Mq3t4083119@svn.freebsd.org> From: Sean Bruno Date: Thu, 3 Oct 2013 22:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256032 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 22:52:04 -0000 Author: sbruno Date: Thu Oct 3 22:52:03 2013 New Revision: 256032 URL: http://svnweb.freebsd.org/changeset/base/256032 Log: Change len checks for fstypelen and fspathlen to be against absolute len not strlen as they are *not* strings. Discovered by GSOC student, Mike Ma during his fuse.glusterfs port to FreeBSD. Final patch from mckusick@ Submitted by: mckusick@ Approved by: re (hrs) MFC after: 2 weeks Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Oct 3 21:46:43 2013 (r256031) +++ head/sys/kern/vfs_mount.c Thu Oct 3 22:52:03 2013 (r256032) @@ -656,7 +656,7 @@ vfs_donmount(struct thread *td, uint64_t * variables will fit in our mp buffers, including the * terminating NUL. */ - if (fstypelen >= MFSNAMELEN - 1 || fspathlen >= MNAMELEN - 1) { + if (fstypelen > MFSNAMELEN || fspathlen > MNAMELEN) { error = ENAMETOOLONG; goto bail; } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 23:52:03 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 18D35E9; Thu, 3 Oct 2013 23:52:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0486D28E2; Thu, 3 Oct 2013 23:52:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Nq2k0014940; Thu, 3 Oct 2013 23:52:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Nq2v2014939; Thu, 3 Oct 2013 23:52:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310032352.r93Nq2v2014939@svn.freebsd.org> From: Xin LI Date: Thu, 3 Oct 2013 23:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256033 - stable/9/sys/dev/arcmsr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 23:52:03 -0000 Author: delphij Date: Thu Oct 3 23:52:02 2013 New Revision: 256033 URL: http://svnweb.freebsd.org/changeset/base/256033 Log: MFC r255718: Update arcmsr(4) driver to 1.20.00.28 which fixes mutex recursion in CCB abort codepath. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/9/sys/dev/arcmsr/arcmsr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Thu Oct 3 22:52:03 2013 (r256032) +++ stable/9/sys/dev/arcmsr/arcmsr.c Thu Oct 3 23:52:02 2013 (r256033) @@ -74,6 +74,7 @@ ** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 +** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs ****************************************************************************************** */ @@ -145,7 +146,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" #include /* ************************************************************************** @@ -1622,7 +1623,6 @@ static void arcmsr_abort_dr_ccbs(struct u_int32_t intmask_org; int i; - ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); /* disable all outbound interrupts */ intmask_org = arcmsr_disable_allintr(acb); for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) @@ -1641,7 +1641,6 @@ static void arcmsr_abort_dr_ccbs(struct } /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); - ARCMSR_LOCK_RELEASE(&acb->isr_lock); } /* ************************************************************************** @@ -3425,8 +3424,7 @@ static void arcmsr_get_hba_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3475,8 +3473,7 @@ static void arcmsr_get_hbb_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3526,8 +3523,7 @@ static void arcmsr_get_hbc_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3578,8 +3574,7 @@ static void arcmsr_get_hbd_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ @@ -4264,6 +4259,8 @@ static int arcmsr_attach(device_t dev) return (ENOMEM); } arcmsr_mutex_init(acb); + acb->pci_dev = dev; + acb->pci_unit = unit; if(arcmsr_initialize(dev)) { printf("arcmsr%d: initialize failure!\n", unit); arcmsr_mutex_destroy(acb); @@ -4284,8 +4281,6 @@ static int arcmsr_attach(device_t dev) return ENXIO; } acb->irqres = irqres; - acb->pci_dev = dev; - acb->pci_unit = unit; /* * Now let the CAM generic SCSI layer find the SCSI devices on * the bus * start queue to reset to the idle loop. * @@ -4367,7 +4362,7 @@ static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; - char x_type[]={"X-TYPE"}; + char x_type[]={"unknown"}; char *type; int raid6 = 1; @@ -4413,11 +4408,13 @@ static int arcmsr_probe(device_t dev) break; default: type = x_type; + raid6 = 0; break; } if(type == x_type) return(ENXIO); - sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n", type, raid6 ? "(RAID6 capable)" : ""); + sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n%s\n", + type, raid6 ? "(RAID6 capable)" : "", ARCMSR_DRIVER_VERSION); device_set_desc_copy(dev, buf); return 0; } From owner-svn-src-all@FreeBSD.ORG Thu Oct 3 23:56:39 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id A8B5D23D; Thu, 3 Oct 2013 23:56:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8551728F8; Thu, 3 Oct 2013 23:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93NudAK016375; Thu, 3 Oct 2013 23:56:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93NudwB016365; Thu, 3 Oct 2013 23:56:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310032356.r93NudwB016365@svn.freebsd.org> From: Xin LI Date: Thu, 3 Oct 2013 23:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r256034 - stable/8/sys/dev/arcmsr X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 23:56:39 -0000 Author: delphij Date: Thu Oct 3 23:56:38 2013 New Revision: 256034 URL: http://svnweb.freebsd.org/changeset/base/256034 Log: MFC r252857,255718: Refresh vendor driver version which fixes command queue full issue with ARC-1214 and ARC-1224. Update arcmsr(4) driver to 1.20.00.28 which fixes mutex recursion in CCB abort codepath. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/arcmsr/ (props changed) Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Thu Oct 3 23:52:02 2013 (r256033) +++ stable/8/sys/dev/arcmsr/arcmsr.c Thu Oct 3 23:56:38 2013 (r256034) @@ -35,44 +35,46 @@ ******************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support -** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, -** firmware version check -** and firmware update notify for hardware bug fix -** handling if none zero high part physical address -** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy -** add iop message xfer -** with scsi pass-through command -** add new device id of sas raid adapters -** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report -** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x -** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic -** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start -** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed -** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command -** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition -** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** clean unused function +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** firmware version check +** and firmware update notify for hardware bug fix +** handling if none zero high part physical address +** of srb resource +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** add iop message xfer +** with scsi pass-through command +** add new device id of sas raid adapters +** code fit for SPARC64 & PPC +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** and cause g_vfs_done() read write error +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** bus_dmamem_alloc() with BUS_DMA_ZERO +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 +** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 +** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs ****************************************************************************************** */ @@ -144,7 +146,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" #include /* ************************************************************************** @@ -753,7 +755,7 @@ static void arcmsr_srb_complete(struct C if(stand_flag == 1) { atomic_subtract_int(&acb->srboutstandingcount, 1); if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < (acb->firm_numbers_queue -10))) { + acb->srboutstandingcount < (acb->maxOutstanding -10))) { acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } @@ -1599,7 +1601,7 @@ static void arcmsr_rescan_lun(struct Ada if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) return; - if (xpt_create_path(&path, xpt_periph, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) + if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); return; @@ -1620,7 +1622,6 @@ static void arcmsr_abort_dr_ccbs(struct u_int32_t intmask_org; int i; - ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); /* disable all outbound interrupts */ intmask_org = arcmsr_disable_allintr(acb); for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) @@ -1639,7 +1640,6 @@ static void arcmsr_abort_dr_ccbs(struct } /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); - ARCMSR_LOCK_RELEASE(&acb->isr_lock); } /* ************************************************************************** @@ -1939,11 +1939,11 @@ static void arcmsr_hbc_postqueue_isr(str /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); + throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); - break; + throttling = 0; } - throttling++; } /*drain reply FIFO*/ } /* @@ -2686,7 +2686,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= acb->firm_numbers_queue) { + if(acb->srboutstandingcount >= acb->maxOutstanding) { if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) == 0) { xpt_freeze_simq(acb->psim, 1); @@ -3461,13 +3461,16 @@ static void arcmsr_get_hba_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3507,13 +3510,16 @@ static void arcmsr_get_hbb_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBB_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBB_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3554,13 +3560,16 @@ static void arcmsr_get_hbc_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3602,13 +3611,16 @@ static void arcmsr_get_hbd_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -4285,6 +4297,8 @@ static int arcmsr_attach(device_t dev) return (ENOMEM); } arcmsr_mutex_init(acb); + acb->pci_dev = dev; + acb->pci_unit = unit; if(arcmsr_initialize(dev)) { printf("arcmsr%d: initialize failure!\n", unit); arcmsr_mutex_destroy(acb); @@ -4305,8 +4319,6 @@ static int arcmsr_attach(device_t dev) return ENXIO; } acb->irqres = irqres; - acb->pci_dev = dev; - acb->pci_unit = unit; /* * Now let the CAM generic SCSI layer find the SCSI devices on * the bus * start queue to reset to the idle loop. * @@ -4388,7 +4400,7 @@ static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; - char x_type[]={"X-TYPE"}; + char x_type[]={"unknown"}; char *type; int raid6 = 1; @@ -4434,11 +4446,13 @@ static int arcmsr_probe(device_t dev) break; default: type = x_type; + raid6 = 0; break; } if(type == x_type) return(ENXIO); - sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n", type, raid6 ? "(RAID6 capable)" : ""); + sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n%s\n", + type, raid6 ? "(RAID6 capable)" : "", ARCMSR_DRIVER_VERSION); device_set_desc_copy(dev, buf); return 0; } Modified: stable/8/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.h Thu Oct 3 23:52:02 2013 (r256033) +++ stable/8/sys/dev/arcmsr/arcmsr.h Thu Oct 3 23:56:38 2013 (r256034) @@ -1182,6 +1182,7 @@ struct AdapterControlBlock { u_int32_t pktReturnCount; u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; + u_int32_t maxOutstanding; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 02:21:40 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 729AEB5F; Fri, 4 Oct 2013 02:21:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A62E2E14; Fri, 4 Oct 2013 02:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r942LeSh095639; Fri, 4 Oct 2013 02:21:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r942Levs095636; Fri, 4 Oct 2013 02:21:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310040221.r942Levs095636@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 4 Oct 2013 02:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256038 - head/sys/dev/nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 02:21:40 -0000 Author: yongari Date: Fri Oct 4 02:21:39 2013 New Revision: 256038 URL: http://svnweb.freebsd.org/changeset/base/256038 Log: Fix clearing MAC stats registers. Previously it cleared every fourth register. Submitted by: Paul A. Patience Approved by: re (gjb) Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri Oct 4 02:18:30 2013 (r256037) +++ head/sys/dev/nfe/if_nfe.c Fri Oct 4 02:21:39 2013 (r256038) @@ -3205,8 +3205,8 @@ nfe_stats_clear(struct nfe_softc *sc) else return; - for (i = 0; i < mib_cnt; i += sizeof(uint32_t)) - NFE_READ(sc, NFE_TX_OCTET + i); + for (i = 0; i < mib_cnt; i++) + NFE_READ(sc, NFE_TX_OCTET + i * sizeof(uint32_t)); if ((sc->nfe_flags & NFE_MIB_V3) != 0) { NFE_READ(sc, NFE_TX_UNICAST); From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 02:44:05 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C4C66E40; Fri, 4 Oct 2013 02:44:05 +0000 (UTC) (envelope-from hrs@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A44822ECC; Fri, 4 Oct 2013 02:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r942i5JH006728; Fri, 4 Oct 2013 02:44:05 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r942i5bv006725; Fri, 4 Oct 2013 02:44:05 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310040244.r942i5bv006725@svn.freebsd.org> From: Hiroki Sato Date: Fri, 4 Oct 2013 02:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256039 - in 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 02:44:05 -0000 Author: hrs Date: Fri Oct 4 02:44:04 2013 New Revision: 256039 URL: http://svnweb.freebsd.org/changeset/base/256039 Log: Add epair(4) support in $cloned_interfaces. One should be specified as "epair0" in $cloned_interfaces and "epair0[ab]" in the others in rc.conf like the following: cloned_interfaces="epair0" ifconfig_epair0a="inet 192.168.1.1/24" ifconfig_epair0b="inet 192.168.2.1/24" /etc/rc.d/netif now accepts both "netif start epair0" and "netif start epair0a". Approved by: re (kib) Modified: head/etc/network.subr head/etc/rc.d/netif Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Oct 4 02:21:39 2013 (r256038) +++ head/etc/network.subr Fri Oct 4 02:44:04 2013 (r256039) @@ -1198,8 +1198,7 @@ ifscript_down() # clone_up() { - local _prefix _list ifn ifopt _iflist _n tmpargs - _prefix= + local _list ifn ifopt _iflist _n tmpargs _list= _iflist=$* @@ -1211,15 +1210,34 @@ clone_up() ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; *) continue ;; esac - # Skip if ifn already exists. - if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then - continue - fi - ${IFCONFIG_CMD} ${ifn} create `get_if_var ${ifn} create_args_IF` - if [ $? -eq 0 ]; then - _list="${_list}${_prefix}${ifn}" - [ -z "$_prefix" ] && _prefix=' ' - fi + case $ifn in + epair[0-9]*) + # epair(4) uses epair[0-9] for creation and + # epair[0-9][ab] for configuration. + # + # Skip if ${ifn}a or ${ifn}b already exist. + if ${IFCONFIG_CMD} ${ifn}a > /dev/null 2>&1; then + continue + elif ${IFCONFIG_CMD} ${ifn}b > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} ${ifn} create \ + `get_if_var ${ifn} create_args_IF` + if [ $? -eq 0 ]; then + _list="$_list ${ifn}a ${ifn}b" + fi + ;; + *) + # Skip if ${ifn} already exists. + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} ${ifn} create \ + `get_if_var ${ifn} create_args_IF` + if [ $? -eq 0 ]; then + _list="$_list $ifn" + fi + esac done if [ -n "$gif_interfaces" ]; then warn "\$gif_interfaces is obsolete. Use \$cloned_interfaces instead." @@ -1245,16 +1263,15 @@ clone_up() ;; esac if [ $? -eq 0 ]; then - _list="${_list}${_prefix}${ifn}" - [ -z "$_prefix" ] && _prefix=' ' + _list="$_list $ifn" fi tmpargs=$(get_if_var $ifn gifconfig_IF) eval ifconfig_${ifn}=\"tunnel \$tmpargs\" done - if [ -n "${_list}" ]; then - echo "Created clone interfaces: ${_list}." + if [ -n "${_list# }" ]; then + echo "Created clone interfaces: ${_list# }." fi - debug "Cloned: ${_list}" + debug "Cloned: ${_list# }" } # clone_down @@ -1263,8 +1280,7 @@ clone_up() # clone_down() { - local _prefix _list ifn ifopt _iflist _sticky - _prefix= + local _list ifn _difn ifopt _iflist _sticky _list= _iflist=$* @@ -1286,20 +1302,40 @@ clone_down() ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; *) continue ;; esac - # Skip if ifn does not exist. - if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then - continue - fi - ${IFCONFIG_CMD} -n ${ifn} destroy - if [ $? -eq 0 ]; then - _list="${_list}${_prefix}${ifn}" - [ -z "$_prefix" ] && _prefix=' ' - fi + case $ifn in + epair[0-9]*) + # Note: epair(4) uses epair[0-9] for removal and + # epair[0-9][ab] for configuration. + # + # Skip if both of ${ifn}a and ${ifn}b do not exist. + if ${IFCONFIG_CMD} ${ifn}a > /dev/null 2>&1; then + _difn=${ifn}a + elif ${IFCONFIG_CMD} ${ifn}b > /dev/null 2>&1; then + _difn=${ifn}b + else + continue + fi + ${IFCONFIG_CMD} -n $_difn destroy + if [ $? -eq 0 ]; then + _list="$_list ${ifn}a ${ifn}b" + fi + ;; + *) + # Skip if ifn does not exist. + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi + ${IFCONFIG_CMD} -n ${ifn} destroy + if [ $? -eq 0 ]; then + _list="$_list $ifn" + fi + ;; + esac done - if [ -n "${_list}" ]; then - echo "Destroyed clone interfaces: ${_list}." + if [ -n "${_list# }" ]; then + echo "Destroyed clone interfaces: ${_list# }." fi - debug "Destroyed clones: ${_list}" + debug "Destroyed clones: ${_list# }" } # childif_create @@ -1574,17 +1610,33 @@ list_net_interfaces() fi done _tmplist="${_lo}${_tmplist# }" - ;; + ;; *) - _tmplist="${network_interfaces} ${cloned_interfaces}" - + for _if in ${network_interfaces} ${cloned_interfaces}; do + # epair(4) uses epair[0-9] for creation and + # epair[0-9][ab] for configuration. + case $_if in + epair[0-9]*) + _tmplist="$_tmplist ${_if}a ${_if}b" + ;; + *) + _tmplist="$_tmplist $_if" + ;; + esac + done + # # lo0 is effectively mandatory, so help prevent foot-shooting # case "$_tmplist" in - lo0|'lo0 '*|*' lo0'|*' lo0 '*) ;; # This is fine, do nothing - *) _tmplist="lo0 ${_tmplist}" ;; - esac + lo0|'lo0 '*|*' lo0'|*' lo0 '*) + # This is fine, do nothing + _tmplist="${_tmplist# }" + ;; + *) + _tmplist="lo0 ${_tmplist# }" ;; + esac + ;; esac _list= @@ -1596,14 +1648,14 @@ list_net_interfaces() _list="${_list# } ${_if}" fi done - ;; + ;; dhcp) for _if in ${_tmplist} ; do if dhcpif $_if; then _list="${_list# } ${_if}" fi done - ;; + ;; noautoconf) for _if in ${_tmplist} ; do if ! ipv6_autoconfif $_if && \ @@ -1611,17 +1663,17 @@ list_net_interfaces() _list="${_list# } ${_if}" fi done - ;; + ;; autoconf) for _if in ${_tmplist} ; do if ipv6_autoconfif $_if; then _list="${_list# } ${_if}" fi done - ;; + ;; *) _list=${_tmplist} - ;; + ;; esac echo $_list Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Fri Oct 4 02:21:39 2013 (r256038) +++ head/etc/rc.d/netif Fri Oct 4 02:44:04 2013 (r256039) @@ -72,7 +72,7 @@ network_start() ifnet_rename $cmdifn # Configure the interface(s). - network_common ifn_start + network_common ifn_start $cmdifn if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter @@ -109,7 +109,7 @@ network_stop0() cmdifn=$* # Deconfigure the interface(s) - network_common ifn_stop + network_common ifn_stop $cmdifn # Destroy cloned interfaces if [ -n "$_clone_down" ]; then @@ -129,7 +129,7 @@ network_stop0() # an interface and then calls $routine. network_common() { - local _cooked_list _fail _func _ok _str + local _cooked_list _tmp_list _fail _func _ok _str _cmdifn _func= @@ -137,26 +137,45 @@ network_common() err 1 "network_common(): No function name specified." else _func="$1" + shift fi # Set the scope of the command (all interfaces or just one). # _cooked_list= - if [ -n "$cmdifn" ]; then + _tmp_list= + _cmdifn=$* + if [ -n "$_cmdifn" ]; then # Don't check that the interface(s) exist. We need to run # the down code even when the interface doesn't exist to # kill off wpa_supplicant. # XXXBED: is this really true or does wpa_supplicant die? # if so, we should get rid of the devd entry - _cooked_list="$cmdifn" + _cooked_list="$_cmdifn" else _cooked_list="`list_net_interfaces`" fi + # Expand epair[0-9] to epair[0-9][ab]. + for ifn in $_cooked_list; do + case ${ifn#epair} in + [0-9]*[ab]) ;; # Skip epair[0-9]*[ab]. + [0-9]*) + for _str in $_cooked_list; do + case $_str in + $ifn) _tmp_list="$_tmp_list ${ifn}a ${ifn}b" ;; + *) _tmp_list="$_tmp_list ${ifn}" ;; + esac + done + _cooked_list=${_tmp_list# } + ;; + esac + done + _dadwait= _fail= _ok= - for ifn in ${_cooked_list}; do + for ifn in ${_cooked_list# }; do # Skip if ifn does not exist. case $_func in ifn_stop) From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 04:15:19 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 04030870; Fri, 4 Oct 2013 04:15:19 +0000 (UTC) (envelope-from hrs@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E47F922ED; Fri, 4 Oct 2013 04:15:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r944FI1X055209; Fri, 4 Oct 2013 04:15:18 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r944FIuT055208; Fri, 4 Oct 2013 04:15:18 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201310040415.r944FIuT055208@svn.freebsd.org> From: Hiroki Sato Date: Fri, 4 Oct 2013 04:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256040 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 04:15:19 -0000 Author: hrs Date: Fri Oct 4 04:15:18 2013 New Revision: 256040 URL: http://svnweb.freebsd.org/changeset/base/256040 Log: Do not attempt to do AF-specific configurations on a interface when noafif() is true. The following warning message was displayed when pflog0 interface existed, for example: ifconfig: ioctl(SIOCGIFINFO_IN6): Protocol family not supported Reported by: bz Approved by: re (gjb) Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Oct 4 02:44:04 2013 (r256039) +++ head/etc/network.subr Fri Oct 4 04:15:18 2013 (r256040) @@ -48,9 +48,11 @@ ifn_start() ifscript_up ${ifn} && cfg=0 ifconfig_up ${ifn} && cfg=0 - afexists inet && ipv4_up ${ifn} && cfg=0 - afexists inet6 && ipv6_up ${ifn} && cfg=0 - afexists ipx && ipx_up ${ifn} && cfg=0 + if ! noafif $ifn; then + afexists inet && ipv4_up ${ifn} && cfg=0 + afexists inet6 && ipv6_up ${ifn} && cfg=0 + afexists ipx && ipx_up ${ifn} && cfg=0 + fi childif_create ${ifn} && cfg=0 return $cfg @@ -68,9 +70,11 @@ ifn_stop() [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" - afexists ipx && ipx_down ${ifn} && cfg=0 - afexists inet6 && ipv6_down ${ifn} && cfg=0 - afexists inet && ipv4_down ${ifn} && cfg=0 + if ! noafif $ifn; then + afexists ipx && ipx_down ${ifn} && cfg=0 + afexists inet6 && ipv6_down ${ifn} && cfg=0 + afexists inet && ipv4_down ${ifn} && cfg=0 + fi ifconfig_down ${ifn} && cfg=0 ifscript_down ${ifn} && cfg=0 childif_destroy ${ifn} && cfg=0 @@ -103,7 +107,7 @@ ifconfig_up() fi # inet6 specific - if afexists inet6; then + if ! noafif $1 && afexists inet6; then if checkyesno ipv6_activate_all_interfaces; then _ipv6_opts="-ifdisabled" elif [ "$1" != "lo0" ]; then @@ -463,6 +467,7 @@ noafif() case $_if in pflog[0-9]*|\ pfsync[0-9]*|\ + usbus[0-9]*|\ an[0-9]*|\ ath[0-9]*|\ ipw[0-9]*|\ From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 10:01:21 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EE305D8D; Fri, 4 Oct 2013 10:01:20 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAE8F2294; Fri, 4 Oct 2013 10:01:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94A1KjT037666; Fri, 4 Oct 2013 10:01:20 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94A1K1O037663; Fri, 4 Oct 2013 10:01:20 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201310041001.r94A1K1O037663@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 4 Oct 2013 10:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256045 - head/sys/mips/nlm/dev/sec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 10:01:21 -0000 Author: jchandra Date: Fri Oct 4 10:01:20 2013 New Revision: 256045 URL: http://svnweb.freebsd.org/changeset/base/256045 Log: Style fixes for the Netlogic XLP RSA driver Updates to the Netlogic XLP on-chp RSA block driver. The changes are to follow style(9) guidelines, to improve readability and to remove unnecessary initialization. No changes to logic have been introduced by this commit. Submitted by: Venkatesh J. V. Approved by: re (hrs) Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c head/sys/mips/nlm/dev/sec/nlmrsalib.h Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmrsa.c Fri Oct 4 09:02:02 2013 (r256044) +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Fri Oct 4 10:01:20 2013 (r256045) @@ -62,14 +62,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include +#include #ifdef NLM_RSA_DEBUG -int print_krp_params(struct cryptkop *krp); +static int print_krp_params(struct cryptkop *krp); #endif static int xlp_rsa_init(struct xlp_rsa_softc *sc, int node); @@ -97,7 +97,7 @@ static device_method_t xlp_rsa_methods[] /* crypto device methods */ DEVMETHOD(cryptodev_newsession, xlp_rsa_newsession), - DEVMETHOD(cryptodev_freesession,xlp_rsa_freesession), + DEVMETHOD(cryptodev_freesession, xlp_rsa_freesession), DEVMETHOD(cryptodev_kprocess, xlp_rsa_kprocess), DEVMETHOD_END @@ -113,29 +113,25 @@ static devclass_t xlp_rsa_devclass; DRIVER_MODULE(nlmrsa, pci, xlp_rsa_driver, xlp_rsa_devclass, 0, 0); MODULE_DEPEND(nlmrsa, crypto, 1, 1, 1); -void -nlm_xlprsaecc_msgring_handler(int vc, int size, int code, int src_id, - struct nlm_fmn_msg *msg, void *data); - #ifdef NLM_RSA_DEBUG -int +static int print_krp_params(struct cryptkop *krp) { int i; - printf("krp->krp_op :%d\n",krp->krp_op); - printf("krp->krp_status :%d\n",krp->krp_status); - printf("krp->krp_iparams:%d\n",krp->krp_iparams); - printf("krp->krp_oparams:%d\n",krp->krp_oparams); - for (i=0;ikrp_iparams+krp->krp_oparams;i++) { - printf("krp->krp_param[%d].crp_p :0x%llx\n",i, + printf("krp->krp_op :%d\n", krp->krp_op); + printf("krp->krp_status :%d\n", krp->krp_status); + printf("krp->krp_iparams:%d\n", krp->krp_iparams); + printf("krp->krp_oparams:%d\n", krp->krp_oparams); + for (i = 0; i < krp->krp_iparams + krp->krp_oparams; i++) { + printf("krp->krp_param[%d].crp_p :0x%llx\n", i, (unsigned long long)krp->krp_param[i].crp_p); - printf("krp->krp_param[%d].crp_nbits :%d\n",i, + printf("krp->krp_param[%d].crp_nbits :%d\n", i, krp->krp_param[i].crp_nbits); - printf("krp->krp_param[%d].crp_nbytes :%d\n",i, - (krp->krp_param[i].crp_nbits+7)/8); + printf("krp->krp_param[%d].crp_nbytes :%d\n", i, + howmany(krp->krp_param[i].crp_nbits, 8)); } - return 0; + return (0); } #endif @@ -155,19 +151,20 @@ xlp_rsa_init(struct xlp_rsa_softc *sc, i printf("Couldn't register rsa/ecc msgring handler\n"); goto errout; } - m.msg[0] = m.msg[1] = m.msg[2] = m.msg[3] = 0; fbvc = nlm_cpuid() / CMS_MAX_VCPU_VC; /* Do the CMS credit initialization */ /* Currently it is configured by default to 50 when kernel comes up */ - if ((cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, - M_NOWAIT | M_ZERO)) == NULL) { + cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (cmd == NULL) { err = ENOMEM; printf("Failed to allocate mem for cmd\n"); goto errout; } size = sizeof(nlm_rsa_ucode_data); - if ((cmd->rsasrc = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { + cmd->rsasrc = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); + if (cmd->rsasrc == NULL) { err = ENOMEM; printf("Failed to allocate mem for cmd->rsasrc\n"); goto errout; @@ -184,6 +181,7 @@ xlp_rsa_init(struct xlp_rsa_softc *sc, i vtophys(cmd->rsasrc)); /* Software scratch pad */ m.msg[2] = (uintptr_t)cmd; + m.msg[3] = 0; for (dstvc = sc->rsaecc_vc_start; dstvc <= sc->rsaecc_vc_end; dstvc++) { ret = nlm_fmn_msgsend(dstvc, 3, FMN_SWCODE_RSA, &m); @@ -215,38 +213,38 @@ void nlm_xlprsaecc_msgring_handler(int vc, int size, int code, int src_id, struct nlm_fmn_msg *msg, void *data) { - struct xlp_rsa_command *cmd = NULL; - struct xlp_rsa_softc *sc = NULL; + struct xlp_rsa_command *cmd; + struct xlp_rsa_softc *sc; + struct crparam *outparam; + int ostart; KASSERT(code == FMN_SWCODE_RSA, - ("%s: bad code = %d, expected code = %d\n", __FUNCTION__, code, + ("%s: bad code = %d, expected code = %d\n", __func__, code, FMN_SWCODE_RSA)); - sc = (struct xlp_rsa_softc *)data; + sc = data; KASSERT(src_id >= sc->rsaecc_vc_start && src_id <= sc->rsaecc_vc_end, - ("%s: bad src_id = %d, expect %d - %d\n", __FUNCTION__, + ("%s: bad src_id = %d, expect %d - %d\n", __func__, src_id, sc->rsaecc_vc_start, sc->rsaecc_vc_end)); cmd = (struct xlp_rsa_command *)(uintptr_t)msg->msg[1]; - KASSERT(cmd != NULL, ("%s:cmd not received properly\n", - __FUNCTION__)); + KASSERT(cmd != NULL, ("%s:cmd not received properly\n", __func__)); KASSERT(RSA_ERROR(msg->msg[0]) == 0, - ("%s: Message rcv msg0 %llx msg1 %llx err %x \n", __FUNCTION__, + ("%s: Message rcv msg0 %llx msg1 %llx err %x \n", __func__, (unsigned long long)msg->msg[0], (unsigned long long)msg->msg[1], (int)RSA_ERROR(msg->msg[0]))); - xlp_rsa_inp2hwformat(((uint8_t *)cmd->rsasrc+ - (cmd->rsaopsize*cmd->krp->krp_iparams)), - cmd->krp->krp_param[cmd->krp->krp_iparams].crp_p, - ((cmd->krp->krp_param[cmd->krp->krp_iparams].crp_nbits+7)/8), 1); - + ostart = cmd->krp->krp_iparams; + outparam = &cmd->krp->krp_param[ostart]; + xlp_rsa_inp2hwformat(cmd->rsasrc + cmd->rsaopsize * ostart, + outparam->crp_p, + howmany(outparam->crp_nbits, 8), + 1); if (cmd->krp != NULL) crypto_kdone(cmd->krp); xlp_free_cmd_params(cmd); - - return; } static int @@ -302,7 +300,6 @@ xlp_rsa_attach(device_t dev) error_exit: return (ENXIO); - } /* @@ -323,8 +320,8 @@ static int xlp_rsa_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri) { struct xlp_rsa_softc *sc = device_get_softc(dev); - int sesn; struct xlp_rsa_session *ses = NULL; + int sesn; if (sidp == NULL || cri == NULL || sc == NULL) return (EINVAL); @@ -346,7 +343,7 @@ xlp_rsa_newsession(device_t dev, u_int32 if (ses == NULL) { sesn = sc->sc_nsessions; - ses = malloc((sesn + 1)*sizeof(struct xlp_rsa_session), + ses = malloc((sesn + 1) * sizeof(*ses), M_DEVBUF, M_NOWAIT); if (ses == NULL) return (ENOMEM); @@ -392,16 +389,17 @@ xlp_rsa_freesession(device_t dev, u_int6 static void xlp_free_cmd_params(struct xlp_rsa_command *cmd) { + if (cmd->rsasrc != NULL) free(cmd->rsasrc, M_DEVBUF); if (cmd != NULL) free(cmd, M_DEVBUF); - return; } static int xlp_get_rsa_opsize(struct xlp_rsa_command *cmd, unsigned int bits) { + if (bits == 0) return (-1); /* XLP hardware expects always a fixed size with unused bytes @@ -436,25 +434,25 @@ xlp_rsa_inp2hwformat(uint8_t *src, uint8 uint8_t result) { uint32_t pdwords, pbytes; - int i=0, j=0, k=0; + int i, j, k; - pdwords = (paramsize / 8); - pbytes = (paramsize % 8); + pdwords = paramsize / 8; + pbytes = paramsize % 8; for (i = 0, k = 0; i < pdwords; i++) { /* copy dwords of inp/hw to hw/out format */ for (j = 7; j >= 0; j--, k++) - dst[(i*8)+j] = src[k]; + dst[i * 8 + j] = src[k]; } if (pbytes) { - if (!result) { + if (result == 0) { /* copy rem bytes of input data to hw format */ for (j = 7; k < paramsize; j--, k++) - dst[(i*8)+j] = src[k]; + dst[i * 8 + j] = src[k]; } else { /* copy rem bytes of hw data to exp output format */ for (j = 7; k < paramsize; j--, k++) - dst[k] = src[(i*8)+j]; + dst[k] = src[i * 8 + j]; } } @@ -470,14 +468,13 @@ nlm_crypto_complete_rsa_request(struct x int ret; fbvc = nlm_cpuid() / CMS_MAX_VCPU_VC; - m.msg[0] = m.msg[1] = m.msg[2] = m.msg[3] = 0; - m.msg[0] = nlm_crypto_form_rsa_ecc_fmn_entry0(1, cmd->rsatype, cmd->rsafn, vtophys(cmd->rsasrc)); m.msg[1] = nlm_crypto_form_rsa_ecc_fmn_entry1(0, 1, fbvc, - vtophys(cmd->rsasrc + (cmd->rsaopsize * cmd->krp->krp_iparams))); + vtophys(cmd->rsasrc + cmd->rsaopsize * cmd->krp->krp_iparams)); /* Software scratch pad */ m.msg[2] = (uintptr_t)cmd; + m.msg[3] = 0; /* Send the message to rsa engine vc */ ret = nlm_fmn_msgsend(sc->rsaecc_vc_start, 3, FMN_SWCODE_RSA, &m); @@ -494,14 +491,16 @@ static int xlp_rsa_kprocess(device_t dev, struct cryptkop *krp, int hint) { struct xlp_rsa_softc *sc = device_get_softc(dev); - struct xlp_rsa_command *cmd = NULL; + struct xlp_rsa_command *cmd; + struct crparam *kp; int err = -1, i; if (krp == NULL || krp->krp_callback == NULL) return (EINVAL); - if ((cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, - M_NOWAIT | M_ZERO)) == NULL) { + cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (cmd == NULL) { err = ENOMEM; goto errout; } @@ -516,19 +515,22 @@ xlp_rsa_kprocess(device_t dev, struct cr break; goto errout; default: - printf("Op:%d not yet supported\n", krp->krp_op); + device_printf(dev, "Op:%d not yet supported\n", krp->krp_op); goto errout; } - if ((xlp_get_rsa_opsize(cmd, - krp->krp_param[krp->krp_iparams-1].crp_nbits)) != 0) { + err = xlp_get_rsa_opsize(cmd, + krp->krp_param[krp->krp_iparams - 1].crp_nbits); + if (err != 0) { err = EINVAL; goto errout; } cmd->rsafn = 0; /* Mod Exp */ - if ((cmd->rsasrc = malloc((cmd->rsaopsize * - (krp->krp_iparams+krp->krp_oparams)), M_DEVBUF, - M_NOWAIT | M_ZERO)) == NULL) { + cmd->rsasrc = malloc( + cmd->rsaopsize * (krp->krp_iparams + krp->krp_oparams), + M_DEVBUF, + M_NOWAIT | M_ZERO); + if (cmd->rsasrc == NULL) { err = ENOMEM; goto errout; } @@ -536,13 +538,12 @@ xlp_rsa_kprocess(device_t dev, struct cr err = EINVAL; goto errout; } - - for (i=0;ikrp_iparams;i++) { - KASSERT(krp->krp_param[i].crp_nbits != 0, - ("%s: parameter[%d]'s length is zero\n", __FUNCTION__, i)); - xlp_rsa_inp2hwformat(krp->krp_param[i].crp_p, - ((uint8_t *)cmd->rsasrc+(i*cmd->rsaopsize)), - ((krp->krp_param[i].crp_nbits+7)/8), 0); + for (i = 0, kp = krp->krp_param; i < krp->krp_iparams; i++, kp++) { + KASSERT(kp->crp_nbits != 0, + ("%s: parameter[%d]'s length is zero\n", __func__, i)); + xlp_rsa_inp2hwformat(kp->crp_p, + cmd->rsasrc + i * cmd->rsaopsize, + howmany(kp->crp_nbits, 8), 0); } if (nlm_crypto_complete_rsa_request(sc, cmd) != 0) goto errout; Modified: head/sys/mips/nlm/dev/sec/nlmrsalib.h ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmrsalib.h Fri Oct 4 09:02:02 2013 (r256044) +++ head/sys/mips/nlm/dev/sec/nlmrsalib.h Fri Oct 4 10:01:20 2013 (r256045) @@ -30,12 +30,10 @@ #ifndef _NLMRSALIB_H_ #define _NLMRSALIB_H_ -#define XLP_RSA_SESSION(sid) ((sid) & 0x000007ff) -#define XLP_RSA_SID(crd,ses) (((crd) << 28) | ((ses) & 0x7ff)) +#define XLP_RSA_SESSION(sid) ((sid) & 0x000007ff) +#define XLP_RSA_SID(crd,ses) (((crd) << 28) | ((ses) & 0x7ff)) -#define NUM_RSAECC_VC 9 - -#define RSA_ERROR(__msg0) ((__msg0 >> 53) & 0x1f) +#define RSA_ERROR(msg0) (((msg0) >> 53) & 0x1f) struct xlp_rsa_session { uint32_t sessionid; @@ -65,4 +63,8 @@ struct xlp_rsa_softc { int rsaecc_vc_end; }; +void +nlm_xlprsaecc_msgring_handler(int vc, int size, int code, int src_id, + struct nlm_fmn_msg *msg, void *data); + #endif /* _NLMRSALIB_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 11:11:52 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 4C5F7EAA; Fri, 4 Oct 2013 11:11:52 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 395052622; Fri, 4 Oct 2013 11:11:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94BBqJm080197; Fri, 4 Oct 2013 11:11:52 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94BBpvR080195; Fri, 4 Oct 2013 11:11:51 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201310041111.r94BBpvR080195@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 4 Oct 2013 11:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256046 - head/sys/mips/nlm/dev/sec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 11:11:52 -0000 Author: jchandra Date: Fri Oct 4 11:11:51 2013 New Revision: 256046 URL: http://svnweb.freebsd.org/changeset/base/256046 Log: Fixes for the Netlogic XLP on-chip RSA block driver The changes are to: * Use contigmalloc/contigfree which handling microcode buffer * Use a different buffer to send microcode to each engine * Swap microcode in little-endian compilation * Fix freeback message queue id field * Simplify xlp_get_rsa_opsize() to remove unnecessary checks * Fix NULL check after use in xlp_free_cmd_params() * Do better error handling when the hardware returns error * Fix error codes in few cases Submitted by: Vekatesh J. V. Approved by: re (hrs) Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c Modified: head/sys/mips/nlm/dev/sec/nlmrsa.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmrsa.c Fri Oct 4 10:01:20 2013 (r256045) +++ head/sys/mips/nlm/dev/sec/nlmrsa.c Fri Oct 4 11:11:51 2013 (r256046) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -69,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef NLM_RSA_DEBUG -static int print_krp_params(struct cryptkop *krp); +static void print_krp_params(struct cryptkop *krp); #endif static int xlp_rsa_init(struct xlp_rsa_softc *sc, int node); @@ -114,7 +115,7 @@ DRIVER_MODULE(nlmrsa, pci, xlp_rsa_drive MODULE_DEPEND(nlmrsa, crypto, 1, 1, 1); #ifdef NLM_RSA_DEBUG -static int +static void print_krp_params(struct cryptkop *krp) { int i; @@ -131,7 +132,6 @@ print_krp_params(struct cryptkop *krp) printf("krp->krp_param[%d].crp_nbytes :%d\n", i, howmany(krp->krp_param[i].crp_nbits, 8)); } - return (0); } #endif @@ -139,7 +139,7 @@ static int xlp_rsa_init(struct xlp_rsa_softc *sc, int node) { struct xlp_rsa_command *cmd = NULL; - uint32_t size, fbvc, dstvc, endsel, regval; + uint32_t fbvc, dstvc, endsel, regval; struct nlm_fmn_msg m; int err, ret, i; uint64_t base; @@ -151,39 +151,36 @@ xlp_rsa_init(struct xlp_rsa_softc *sc, i printf("Couldn't register rsa/ecc msgring handler\n"); goto errout; } - fbvc = nlm_cpuid() / CMS_MAX_VCPU_VC; + fbvc = nlm_cpuid() * 4 + XLPGE_FB_VC; /* Do the CMS credit initialization */ /* Currently it is configured by default to 50 when kernel comes up */ - cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (cmd == NULL) { - err = ENOMEM; - printf("Failed to allocate mem for cmd\n"); - goto errout; - } - size = sizeof(nlm_rsa_ucode_data); - cmd->rsasrc = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (cmd->rsasrc == NULL) { - err = ENOMEM; - printf("Failed to allocate mem for cmd->rsasrc\n"); - goto errout; - } - if (((uintptr_t)cmd->rsasrc & (XLP_L2L3_CACHELINE_SIZE - 1))) { - err = EINVAL; - printf("cmd->rsasrc is not cacheline aligned\n"); - goto errout; - } - memcpy(cmd->rsasrc, (uint8_t *)nlm_rsa_ucode_data, size); - m.msg[0] = nlm_crypto_form_rsa_ecc_fmn_entry0(1, 0x70, 0, - vtophys(cmd->rsasrc)); - m.msg[1] = nlm_crypto_form_rsa_ecc_fmn_entry1(0, 1, fbvc, - vtophys(cmd->rsasrc)); - /* Software scratch pad */ - m.msg[2] = (uintptr_t)cmd; - m.msg[3] = 0; - +#if BYTE_ORDER == LITTLE_ENDIAN + for (i = 0; i < nitems(nlm_rsa_ucode_data); i++) + nlm_rsa_ucode_data[i] = htobe64(nlm_rsa_ucode_data[i]); +#endif for (dstvc = sc->rsaecc_vc_start; dstvc <= sc->rsaecc_vc_end; dstvc++) { + cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, + M_NOWAIT | M_ZERO); + KASSERT(cmd != NULL, ("%s:cmd is NULL\n", __func__)); + cmd->rsasrc = contigmalloc(sizeof(nlm_rsa_ucode_data), + M_DEVBUF, + (M_WAITOK | M_ZERO), + 0UL /* low address */, -1UL /* high address */, + XLP_L2L3_CACHELINE_SIZE /* alignment */, + 0UL /* boundary */); + KASSERT(cmd->rsasrc != NULL, + ("%s:cmd->rsasrc is NULL\n", __func__)); + memcpy(cmd->rsasrc, nlm_rsa_ucode_data, + sizeof(nlm_rsa_ucode_data)); + m.msg[0] = nlm_crypto_form_rsa_ecc_fmn_entry0(1, 0x70, 0, + vtophys(cmd->rsasrc)); + m.msg[1] = nlm_crypto_form_rsa_ecc_fmn_entry1(0, 1, fbvc, + vtophys(cmd->rsasrc)); + /* Software scratch pad */ + m.msg[2] = (uintptr_t)cmd; + m.msg[3] = 0; + ret = nlm_fmn_msgsend(dstvc, 3, FMN_SWCODE_RSA, &m); if (ret != 0) { err = -1; @@ -230,19 +227,23 @@ nlm_xlprsaecc_msgring_handler(int vc, in cmd = (struct xlp_rsa_command *)(uintptr_t)msg->msg[1]; KASSERT(cmd != NULL, ("%s:cmd not received properly\n", __func__)); - KASSERT(RSA_ERROR(msg->msg[0]) == 0, - ("%s: Message rcv msg0 %llx msg1 %llx err %x \n", __func__, - (unsigned long long)msg->msg[0], (unsigned long long)msg->msg[1], - (int)RSA_ERROR(msg->msg[0]))); - - ostart = cmd->krp->krp_iparams; - outparam = &cmd->krp->krp_param[ostart]; - xlp_rsa_inp2hwformat(cmd->rsasrc + cmd->rsaopsize * ostart, - outparam->crp_p, - howmany(outparam->crp_nbits, 8), - 1); - if (cmd->krp != NULL) + if (RSA_ERROR(msg->msg[0]) != 0) { + printf("%s: Message rcv msg0 %llx msg1 %llx err %x \n", + __func__, (unsigned long long)msg->msg[0], + (unsigned long long)msg->msg[1], + (int)RSA_ERROR(msg->msg[0])); + cmd->krp->krp_status = EBADMSG; + } + + if (cmd->krp != NULL) { + ostart = cmd->krp->krp_iparams; + outparam = &cmd->krp->krp_param[ostart]; + xlp_rsa_inp2hwformat(cmd->rsasrc + cmd->rsaopsize * ostart, + outparam->crp_p, + howmany(outparam->crp_nbits, 8), + 1); crypto_kdone(cmd->krp); + } xlp_free_cmd_params(cmd); } @@ -277,7 +278,7 @@ xlp_rsa_attach(device_t dev) freq = nlm_set_device_frequency(node, DFS_DEVICE_RSA, 250); if (bootverbose) device_printf(dev, "RSA Freq: %dMHz\n", freq); - if(pci_get_device(dev) == PCI_DEVICE_ID_NLM_RSA) { + if (pci_get_device(dev) == PCI_DEVICE_ID_NLM_RSA) { device_set_desc(dev, "XLP RSA/ECC Accelerator"); if ((sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE)) < 0) { @@ -285,7 +286,7 @@ xlp_rsa_attach(device_t dev) goto error_exit; } if (crypto_kregister(sc->sc_cid, CRK_MOD_EXP, 0) != 0) - printf("register failed for CRK_MOD_EXP\n"); + goto error_exit; base = nlm_get_rsa_pcibase(node); qstart = nlm_qidstart(base); @@ -390,43 +391,43 @@ static void xlp_free_cmd_params(struct xlp_rsa_command *cmd) { - if (cmd->rsasrc != NULL) - free(cmd->rsasrc, M_DEVBUF); - if (cmd != NULL) - free(cmd, M_DEVBUF); + if (cmd == NULL) + return; + if (cmd->rsasrc != NULL) { + if (cmd->krp == NULL) /* Micro code load */ + contigfree(cmd->rsasrc, sizeof(nlm_rsa_ucode_data), + M_DEVBUF); + else + free(cmd->rsasrc, M_DEVBUF); + } + free(cmd, M_DEVBUF); } static int xlp_get_rsa_opsize(struct xlp_rsa_command *cmd, unsigned int bits) { - if (bits == 0) + if (bits == 0 || bits > 8192) return (-1); /* XLP hardware expects always a fixed size with unused bytes * zeroed out in the input data */ if (bits <= 512) { cmd->rsatype = 0x40; - cmd->rsaopsize = (512/8); - return (0); - } else if ((bits > 512) && (bits <= 1024)) { + cmd->rsaopsize = 64; + } else if (bits <= 1024) { cmd->rsatype = 0x41; - cmd->rsaopsize = (1024/8); - return (0); - } else if ((bits > 1024) && (bits <= 2048)) { + cmd->rsaopsize = 128; + } else if (bits <= 2048) { cmd->rsatype = 0x42; - cmd->rsaopsize = (2048/8); - return (0); - } else if ((bits > 2048) && (bits <= 4096)) { + cmd->rsaopsize = 256; + } else if (bits <= 4096) { cmd->rsatype = 0x43; - cmd->rsaopsize = (4096/8); - return (0); - } else if ((bits > 4096) && (bits <= 8192)) { + cmd->rsaopsize = 512; + } else if (bits <= 8192) { cmd->rsatype = 0x44; - cmd->rsaopsize = (8192/8); - return (0); - } else { - return (-1); + cmd->rsaopsize = 1024; } + return (0); } static int @@ -467,7 +468,8 @@ nlm_crypto_complete_rsa_request(struct x struct nlm_fmn_msg m; int ret; - fbvc = nlm_cpuid() / CMS_MAX_VCPU_VC; + fbvc = nlm_cpuid() * 4 + XLPGE_FB_VC; + m.msg[0] = nlm_crypto_form_rsa_ecc_fmn_entry0(1, cmd->rsatype, cmd->rsafn, vtophys(cmd->rsasrc)); m.msg[1] = nlm_crypto_form_rsa_ecc_fmn_entry1(0, 1, fbvc, @@ -493,22 +495,20 @@ xlp_rsa_kprocess(device_t dev, struct cr struct xlp_rsa_softc *sc = device_get_softc(dev); struct xlp_rsa_command *cmd; struct crparam *kp; - int err = -1, i; + int err, i; if (krp == NULL || krp->krp_callback == NULL) return (EINVAL); cmd = malloc(sizeof(struct xlp_rsa_command), M_DEVBUF, M_NOWAIT | M_ZERO); - if (cmd == NULL) { - err = ENOMEM; - goto errout; - } + KASSERT(cmd != NULL, ("%s:cmd is NULL\n", __func__)); cmd->krp = krp; #ifdef NLM_RSA_DEBUG print_krp_params(krp); #endif + err = EOPNOTSUPP; switch (krp->krp_op) { case CRK_MOD_EXP: if (krp->krp_iparams == 3 && krp->krp_oparams == 1) @@ -534,10 +534,7 @@ xlp_rsa_kprocess(device_t dev, struct cr err = ENOMEM; goto errout; } - if (((uintptr_t)cmd->rsasrc & (XLP_L2L3_CACHELINE_SIZE - 1))) { - err = EINVAL; - goto errout; - } + for (i = 0, kp = krp->krp_param; i < krp->krp_iparams; i++, kp++) { KASSERT(kp->crp_nbits != 0, ("%s: parameter[%d]'s length is zero\n", __func__, i)); @@ -545,7 +542,8 @@ xlp_rsa_kprocess(device_t dev, struct cr cmd->rsasrc + i * cmd->rsaopsize, howmany(kp->crp_nbits, 8), 0); } - if (nlm_crypto_complete_rsa_request(sc, cmd) != 0) + err = nlm_crypto_complete_rsa_request(sc, cmd); + if (err != 0) goto errout; return (0); From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 11:55:21 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 57BBAFAF; Fri, 4 Oct 2013 11:55:21 +0000 (UTC) (envelope-from uqs@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4446B28BE; Fri, 4 Oct 2013 11:55:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94BtLUE007621; Fri, 4 Oct 2013 11:55:21 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94BtLbS007620; Fri, 4 Oct 2013 11:55:21 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201310041155.r94BtLbS007620@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 4 Oct 2013 11:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256048 - head/sys/modules/ibcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 11:55:21 -0000 Author: uqs Date: Fri Oct 4 11:55:20 2013 New Revision: 256048 URL: http://svnweb.freebsd.org/changeset/base/256048 Log: Fix make depend. Approved by: re (glebius) Modified: head/sys/modules/ibcore/Makefile Modified: head/sys/modules/ibcore/Makefile ============================================================================== --- head/sys/modules/ibcore/Makefile Fri Oct 4 11:16:48 2013 (r256047) +++ head/sys/modules/ibcore/Makefile Fri Oct 4 11:55:20 2013 (r256048) @@ -11,7 +11,7 @@ SRCS+= agent.h core_priv.h mad.c notice. SRCS+= cache.c device.c mad_priv.h packer.c sysfs.c user_mad.c verbs.c SRCS+= cm.c fmr_pool.c mad_rmpp.c sa.h ucm.c uverbs.h cma.c SRCS+= linux_compat.c linux_radix.c linux_idr.c -SRCS+= vnode_if.h device_if.h bus_if.h pci_if.h opt_inet.h +SRCS+= vnode_if.h device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/infiniband/core CFLAGS+= -I${.CURDIR}/../mlx4ib From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 16:08:45 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 06C61844; Fri, 4 Oct 2013 16:08:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E84812667; Fri, 4 Oct 2013 16:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94G8iwn072490; Fri, 4 Oct 2013 16:08:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94G8iqi072489; Fri, 4 Oct 2013 16:08:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310041608.r94G8iqi072489@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Oct 2013 16:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256050 - head/bin/pkill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 16:08:45 -0000 Author: trasz Date: Fri Oct 4 16:08:44 2013 New Revision: 256050 URL: http://svnweb.freebsd.org/changeset/base/256050 Log: Remove useless check - ki_loginclass is an array; can't be NULL. CID: 1006559 Approved by: re (kib) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Modified: head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Fri Oct 4 13:27:19 2013 (r256049) +++ head/bin/pkill/pkill.c Fri Oct 4 16:08:44 2013 (r256050) @@ -481,7 +481,6 @@ main(int argc, char **argv) * We skip P_SYSTEM processes to match ps(1) output. */ if ((kp->ki_flag & P_SYSTEM) == 0 && - kp->ki_loginclass != NULL && strcmp(kp->ki_loginclass, li->li_name) == 0) break; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 16:44:25 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 2A01A892; Fri, 4 Oct 2013 16:44:25 +0000 (UTC) (envelope-from joel@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1767F288F; Fri, 4 Oct 2013 16:44:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94GiOB4096604; Fri, 4 Oct 2013 16:44:24 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94GiOVd096602; Fri, 4 Oct 2013 16:44:24 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201310041644.r94GiOVd096602@svn.freebsd.org> From: Joel Dahl Date: Fri, 4 Oct 2013 16:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256051 - in head: share/man/man5 usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 16:44:25 -0000 Author: joel (doc committer) Date: Fri Oct 4 16:44:24 2013 New Revision: 256051 URL: http://svnweb.freebsd.org/changeset/base/256051 Log: mdoc: remove EOL whitespace. Approved by: re (blanket) Modified: head/share/man/man5/src.conf.5 head/usr.bin/calendar/calendar.1 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Oct 4 16:08:44 2013 (r256050) +++ head/share/man/man5/src.conf.5 Fri Oct 4 16:44:24 2013 (r256051) @@ -129,7 +129,7 @@ Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste -Set to not install binutils (as, c++-filt, gconv, +Set to not install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic The option does not generally work for build targets, unless some alternative Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Fri Oct 4 16:08:44 2013 (r256050) +++ head/usr.bin/calendar/calendar.1 Fri Oct 4 16:44:24 2013 (r256051) @@ -180,7 +180,7 @@ a continuation of the previous line. The .Nm file is preprocessed by a limited subset of -.Xr cpp 1 +.Xr cpp 1 internally, allowing the inclusion of shared files such as lists of company holidays or meetings. This limited subset consists of \fB#include #ifndef #endif\fR and \fB#define\fR. From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 16:52:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 17493B29; Fri, 4 Oct 2013 16:52:04 +0000 (UTC) (envelope-from grehan@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03A5128F2; Fri, 4 Oct 2013 16:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94Gq3tr002000; Fri, 4 Oct 2013 16:52:03 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94Gq3Sk001996; Fri, 4 Oct 2013 16:52:03 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310041652.r94Gq3Sk001996@svn.freebsd.org> From: Peter Grehan Date: Fri, 4 Oct 2013 16:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256052 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 16:52:04 -0000 Author: grehan Date: Fri Oct 4 16:52:03 2013 New Revision: 256052 URL: http://svnweb.freebsd.org/changeset/base/256052 Log: Block-layer backend interface for bhyve block-io device emulations. Approved by: re@ (blanket) Added: head/usr.sbin/bhyve/block_if.c (contents, props changed) head/usr.sbin/bhyve/block_if.h (contents, props changed) Added: head/usr.sbin/bhyve/block_if.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/block_if.c Fri Oct 4 16:52:03 2013 (r256052) @@ -0,0 +1,426 @@ +/*- + * Copyright (c) 2013 Peter Grehan + * 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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "block_if.h" + +#define BLOCKIF_SIG 0xb109b109 + +#define BLOCKIF_MAXREQ 16 + +enum blockop { + BOP_READ, + BOP_WRITE, + BOP_FLUSH, + BOP_CANCEL +}; + +enum blockstat { + BST_FREE, + BST_INUSE +}; + +struct blockif_elem { + TAILQ_ENTRY(blockif_elem) be_link; + struct blockif_req *be_req; + enum blockop be_op; + enum blockstat be_status; +}; + +struct blockif_ctxt { + int bc_magic; + int bc_fd; + int bc_rdonly; + off_t bc_size; + int bc_sectsz; + pthread_t bc_btid; + pthread_mutex_t bc_mtx; + pthread_cond_t bc_cond; + int bc_closing; + + /* Request elements and free/inuse queues */ + TAILQ_HEAD(, blockif_elem) bc_freeq; + TAILQ_HEAD(, blockif_elem) bc_inuseq; + u_int bc_req_count; + struct blockif_elem bc_reqs[BLOCKIF_MAXREQ]; +}; + +static int +blockif_enqueue(struct blockif_ctxt *bc, struct blockif_req *breq, + enum blockop op) +{ + struct blockif_elem *be; + + assert(bc->bc_req_count < BLOCKIF_MAXREQ); + + be = TAILQ_FIRST(&bc->bc_freeq); + assert(be != NULL); + assert(be->be_status == BST_FREE); + + TAILQ_REMOVE(&bc->bc_freeq, be, be_link); + be->be_status = BST_INUSE; + be->be_req = breq; + be->be_op = op; + TAILQ_INSERT_TAIL(&bc->bc_inuseq, be, be_link); + + bc->bc_req_count++; + + return (0); +} + +static int +blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem *el) +{ + struct blockif_elem *be; + + if (bc->bc_req_count == 0) + return (ENOENT); + + be = TAILQ_FIRST(&bc->bc_inuseq); + assert(be != NULL); + assert(be->be_status == BST_INUSE); + *el = *be; + + TAILQ_REMOVE(&bc->bc_inuseq, be, be_link); + be->be_status = BST_FREE; + be->be_req = NULL; + TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); + + bc->bc_req_count--; + + return (0); +} + +static void +blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be) +{ + struct blockif_req *br; + int err; + + br = be->be_req; + err = 0; + + switch (be->be_op) { + case BOP_READ: + if (preadv(bc->bc_fd, br->br_iov, br->br_iovcnt, + br->br_offset) < 0) + err = errno; + break; + case BOP_WRITE: + if (bc->bc_rdonly) + err = EROFS; + else if (pwritev(bc->bc_fd, br->br_iov, br->br_iovcnt, + br->br_offset) < 0) + err = errno; + break; + case BOP_FLUSH: + break; + case BOP_CANCEL: + err = EINTR; + break; + default: + err = EINVAL; + break; + } + + (*br->br_callback)(br, err); +} + +static void * +blockif_thr(void *arg) +{ + struct blockif_ctxt *bc; + struct blockif_elem req; + + bc = arg; + + for (;;) { + pthread_mutex_lock(&bc->bc_mtx); + while (!blockif_dequeue(bc, &req)) { + pthread_mutex_unlock(&bc->bc_mtx); + blockif_proc(bc, &req); + pthread_mutex_lock(&bc->bc_mtx); + } + pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); + pthread_mutex_unlock(&bc->bc_mtx); + + /* + * Check ctxt status here to see if exit requested + */ + if (bc->bc_closing) + pthread_exit(NULL); + } + + /* Not reached */ + return (NULL); +} + +struct blockif_ctxt * +blockif_open(const char *optstr, const char *ident) +{ + char tname[MAXCOMLEN + 1]; + char *nopt, *xopts; + struct blockif_ctxt *bc; + struct stat sbuf; + off_t size; + int extra, fd, i, sectsz; + int nocache, sync, ro; + + nocache = 0; + sync = 0; + ro = 0; + + /* + * The first element in the optstring is always a pathname. + * Optional elements follow + */ + nopt = strdup(optstr); + for (xopts = strtok(nopt, ","); + xopts != NULL; + xopts = strtok(NULL, ",")) { + if (!strcmp(xopts, "nocache")) + nocache = 1; + else if (!strcmp(xopts, "sync")) + sync = 1; + else if (!strcmp(xopts, "ro")) + ro = 1; + } + + extra = 0; + if (nocache) + extra |= O_DIRECT; + if (sync) + extra |= O_SYNC; + + fd = open(nopt, (ro ? O_RDONLY : O_RDWR) | extra); + if (fd < 0 && !ro) { + /* Attempt a r/w fail with a r/o open */ + fd = open(nopt, O_RDONLY | extra); + ro = 1; + } + + if (fd < 0) { + perror("Could not open backing file"); + return (NULL); + } + + if (fstat(fd, &sbuf) < 0) { + perror("Could not stat backing file"); + close(fd); + return (NULL); + } + + /* + * Deal with raw devices + */ + size = sbuf.st_size; + sectsz = DEV_BSIZE; + if (S_ISCHR(sbuf.st_mode)) { + if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || + ioctl(fd, DIOCGSECTORSIZE, §sz)) { + perror("Could not fetch dev blk/sector size"); + close(fd); + return (NULL); + } + assert(size != 0); + assert(sectsz != 0); + } + + bc = malloc(sizeof(struct blockif_ctxt)); + if (bc == NULL) { + close(fd); + return (NULL); + } + + memset(bc, 0, sizeof(*bc)); + bc->bc_magic = BLOCKIF_SIG; + bc->bc_fd = fd; + bc->bc_size = size; + bc->bc_sectsz = sectsz; + pthread_mutex_init(&bc->bc_mtx, NULL); + pthread_cond_init(&bc->bc_cond, NULL); + TAILQ_INIT(&bc->bc_freeq); + TAILQ_INIT(&bc->bc_inuseq); + bc->bc_req_count = 0; + for (i = 0; i < BLOCKIF_MAXREQ; i++) { + bc->bc_reqs[i].be_status = BST_FREE; + TAILQ_INSERT_HEAD(&bc->bc_freeq, &bc->bc_reqs[i], be_link); + } + + pthread_create(&bc->bc_btid, NULL, blockif_thr, bc); + + snprintf(tname, sizeof(tname), "%s blk-%s", vmname, ident); + pthread_set_name_np(bc->bc_btid, tname); + + return (bc); +} + +static int +blockif_request(struct blockif_ctxt *bc, struct blockif_req *breq, + enum blockop op) +{ + int err; + + err = 0; + + pthread_mutex_lock(&bc->bc_mtx); + if (bc->bc_req_count < BLOCKIF_MAXREQ) { + /* + * Enqueue and inform the block i/o thread + * that there is work available + */ + blockif_enqueue(bc, breq, op); + pthread_cond_signal(&bc->bc_cond); + } else { + /* + * Callers are not allowed to enqueue more than + * the specified blockif queue limit. Return an + * error to indicate that the queue length has been + * exceeded. + */ + err = E2BIG; + } + pthread_mutex_unlock(&bc->bc_mtx); + + return (err); +} + +int +blockif_read(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_READ)); +} + +int +blockif_write(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_WRITE)); +} + +int +blockif_flush(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_FLUSH)); +} + +int +blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_CANCEL)); +} + +int +blockif_close(struct blockif_ctxt *bc) +{ + void *jval; + int err; + + err = 0; + + assert(bc->bc_magic == BLOCKIF_SIG); + + /* + * Stop the block i/o thread + */ + bc->bc_closing = 1; + pthread_cond_signal(&bc->bc_cond); + pthread_join(bc->bc_btid, &jval); + + /* XXX Cancel queued i/o's ??? */ + + /* + * Release resources + */ + bc->bc_magic = 0; + close(bc->bc_fd); + free(bc); + + return (0); +} + +/* + * Accessors + */ +off_t +blockif_size(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (bc->bc_size); +} + +int +blockif_sectsz(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (bc->bc_sectsz); +} + +int +blockif_queuesz(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (BLOCKIF_MAXREQ); +} + +int +blockif_is_ro(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (bc->bc_rdonly); +} Added: head/usr.sbin/bhyve/block_if.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/block_if.h Fri Oct 4 16:52:03 2013 (r256052) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2013 Peter Grehan + * 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 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$ + */ + +/* + * The block API to be used by bhyve block-device emulations. The routines + * are thread safe, with no assumptions about the context of the completion + * callback - it may occur in the caller's context, or asynchronously in + * another thread. + */ + +#ifndef _BLOCK_IF_H_ +#define _BLOCK_IF_H_ + +#include +#include + +#define BLOCKIF_IOV_MAX 32 /* not practical to be IOV_MAX */ + +struct blockif_req { + struct iovec br_iov[BLOCKIF_IOV_MAX]; + int br_iovcnt; + off_t br_offset; + void (*br_callback)(struct blockif_req *req, int err); + void *br_param; +}; + +struct blockif_ctxt; +struct blockif_ctxt *blockif_open(const char *optstr, const char *ident); +off_t blockif_size(struct blockif_ctxt *bc); +int blockif_sectsz(struct blockif_ctxt *bc); +int blockif_queuesz(struct blockif_ctxt *bc); +int blockif_is_ro(struct blockif_ctxt *bc); +int blockif_read(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_write(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_flush(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_close(struct blockif_ctxt *bc); + +#endif /* _BLOCK_IF_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 17:21:01 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id E29B59C0; Fri, 4 Oct 2013 17:21:01 +0000 (UTC) (envelope-from jmg@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF8672AA1; Fri, 4 Oct 2013 17:21:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94HL17x022187; Fri, 4 Oct 2013 17:21:01 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94HL1if022185; Fri, 4 Oct 2013 17:21:01 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201310041721.r94HL1if022185@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 4 Oct 2013 17:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256053 - in head/sys: amd64/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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 17:21:02 -0000 Author: jmg Date: Fri Oct 4 17:21:01 2013 New Revision: 256053 URL: http://svnweb.freebsd.org/changeset/base/256053 Log: add aesni module to i386 and amd64 NOTES... Approved by: re (gjb) Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Oct 4 16:52:03 2013 (r256052) +++ head/sys/amd64/conf/NOTES Fri Oct 4 17:21:01 2013 (r256053) @@ -503,6 +503,7 @@ device asmc device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG +device aesni # AES-NI OpenCrypto module # # Laptop/Notebook options: Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Oct 4 16:52:03 2013 (r256052) +++ head/sys/i386/conf/NOTES Fri Oct 4 17:21:01 2013 (r256053) @@ -857,6 +857,7 @@ device asmc device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG +device aesni # AES-NI OpenCrypto module # # Laptop/Notebook options: From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 17:52:57 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id AACFB70A; Fri, 4 Oct 2013 17:52:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 971182C98; Fri, 4 Oct 2013 17:52:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94HqvqR041321; Fri, 4 Oct 2013 17:52:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94HqvGA041313; Fri, 4 Oct 2013 17:52:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310041752.r94HqvGA041313@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Oct 2013 17:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256054 - stable/9/bin/pkill X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 17:52:57 -0000 Author: trasz Date: Fri Oct 4 17:52:56 2013 New Revision: 256054 URL: http://svnweb.freebsd.org/changeset/base/256054 Log: MFC r254134: Add -c flag to pgrep(1) and pkill(1), to match login classes. Modified: stable/9/bin/pkill/pkill.1 stable/9/bin/pkill/pkill.c Directory Properties: stable/9/bin/pkill/ (props changed) Modified: stable/9/bin/pkill/pkill.1 ============================================================================== --- stable/9/bin/pkill/pkill.1 Fri Oct 4 17:21:01 2013 (r256053) +++ stable/9/bin/pkill/pkill.1 Fri Oct 4 17:52:56 2013 (r256054) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 11, 2010 +.Dd August 9, 2013 .Dt PKILL 1 .Os .Sh NAME @@ -44,6 +44,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl d Ar delim .Op Fl g Ar pgrp .Op Fl j Ar jid @@ -60,6 +61,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl g Ar pgrp .Op Fl j Ar jid .Op Fl s Ar sid @@ -130,6 +132,9 @@ or process and all of its ancestors are excluded (unless .Fl v is used). +.It Fl c Ar class +Restrict matches to processes running with specified login class +.Ar class . .It Fl f Match against full argument lists. The default is to match against process names. Modified: stable/9/bin/pkill/pkill.c ============================================================================== --- stable/9/bin/pkill/pkill.c Fri Oct 4 17:21:01 2013 (r256053) +++ stable/9/bin/pkill/pkill.c Fri Oct 4 17:52:56 2013 (r256054) @@ -79,12 +79,14 @@ enum listtype { LT_TTY, LT_PGRP, LT_JID, - LT_SID + LT_SID, + LT_CLASS }; struct list { SLIST_ENTRY(list) li_chain; long li_number; + char *li_name; }; SLIST_HEAD(listhead, list); @@ -116,6 +118,7 @@ static struct listhead ppidlist = SLIST_ static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist); static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist); static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist); +static struct listhead classlist = SLIST_HEAD_INITIALIZER(classlist); static void usage(void) __attribute__((__noreturn__)); static int killact(const struct kinfo_proc *); @@ -179,7 +182,7 @@ main(int argc, char **argv) execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -222,6 +225,10 @@ main(int argc, char **argv) case 'a': ancestors++; break; + case 'c': + makelist(&classlist, LT_CLASS, optarg); + criteria = 1; + break; case 'd': if (!pgrep) usage(); @@ -469,6 +476,20 @@ main(int argc, char **argv) continue; } + SLIST_FOREACH(li, &classlist, li_chain) { + /* + * We skip P_SYSTEM processes to match ps(1) output. + */ + if ((kp->ki_flag & P_SYSTEM) == 0 && + kp->ki_loginclass != NULL && + strcmp(kp->ki_loginclass, li->li_name) == 0) + break; + } + if (SLIST_FIRST(&classlist) != NULL && li == NULL) { + selected[i] = 0; + continue; + } + if (argc == 0) selected[i] = 1; } @@ -562,9 +583,9 @@ usage(void) fprintf(stderr, "usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n" - " [-P ppid] [-U uid] [-g pgrp] [-j jid] [-s sid]\n" - " [-t tty] [-u euid] pattern ...\n", getprogname(), - ustr); + " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid]\n" + " [-s sid] [-t tty] [-u euid] pattern ...\n", + getprogname(), ustr); exit(STATUS_BADUSAGE); } @@ -664,8 +685,10 @@ makelist(struct listhead *head, enum lis SLIST_INSERT_HEAD(head, li, li_chain); empty = 0; - li->li_number = (uid_t)strtol(sp, &ep, 0); - if (*ep == '\0') { + if (type != LT_CLASS) + li->li_number = (uid_t)strtol(sp, &ep, 0); + + if (type != LT_CLASS && *ep == '\0') { switch (type) { case LT_PGRP: if (li->li_number == 0) @@ -750,6 +773,12 @@ foundtty: if ((st.st_mode & S_IFCHR) == errx(STATUS_BADUSAGE, "Invalid jail ID `%s'", sp); break; + case LT_CLASS: + li->li_number = -1; + li->li_name = strdup(sp); + if (li->li_name == NULL) + err(STATUS_ERROR, "Cannot allocate memory"); + break; default: usage(); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 18:27:03 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8E40157E; Fri, 4 Oct 2013 18:27:03 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 610EF2E4F; Fri, 4 Oct 2013 18:27:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94IR3Oa063459; Fri, 4 Oct 2013 18:27:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94IR2Nb063455; Fri, 4 Oct 2013 18:27:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310041827.r94IR2Nb063455@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 4 Oct 2013 18:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256055 - in head/usr.bin: . svn svn/lib/libapr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 18:27:03 -0000 Author: nwhitehorn Date: Fri Oct 4 18:27:02 2013 New Revision: 256055 URL: http://svnweb.freebsd.org/changeset/base/256055 Log: Disable use of compiler atomic builtins. For APR, this is limited to architectures where they are known not to work. For SVN itself, use the least common denominator and disable them across the board. This allows svnlite to build and run on all FreeBSD architectures. Approved by: re (gjb) Modified: head/usr.bin/Makefile head/usr.bin/svn/lib/libapr/apr_private.h head/usr.bin/svn/svn_private_config.h Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Oct 4 17:52:56 2013 (r256054) +++ head/usr.bin/Makefile Fri Oct 4 18:27:02 2013 (r256055) @@ -366,13 +366,9 @@ SUBDIR+= users SUBDIR+= who .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || \ - ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "i386" || \ - (${MACHINE_ARCH} == "armv6" && ${COMPILER_TYPE} == "clang") .if ${MK_SVN} == "yes" || ${MK_SVNLITE} == "yes" SUBDIR+= svn .endif -.endif .include Modified: head/usr.bin/svn/lib/libapr/apr_private.h ============================================================================== --- head/usr.bin/svn/lib/libapr/apr_private.h Fri Oct 4 17:52:56 2013 (r256054) +++ head/usr.bin/svn/lib/libapr/apr_private.h Fri Oct 4 18:27:02 2013 (r256055) @@ -97,7 +97,9 @@ #define HAVE_ARPA_INET_H 1 /* Define if compiler provides atomic builtins */ +#if !defined(__mips__) && !defined(__arm__) #define HAVE_ATOMIC_BUILTINS 1 +#endif /* Define if BONE_VERSION is defined in sys/socket.h */ /* #undef HAVE_BONE_VERSION */ Modified: head/usr.bin/svn/svn_private_config.h ============================================================================== --- head/usr.bin/svn/svn_private_config.h Fri Oct 4 17:52:56 2013 (r256054) +++ head/usr.bin/svn/svn_private_config.h Fri Oct 4 18:27:02 2013 (r256055) @@ -153,7 +153,7 @@ #define SVN_FS_WANT_DB_PATCH 14 /* Define if compiler provides atomic builtins */ -#define SVN_HAS_ATOMIC_BUILTINS 1 +#define SVN_HAS_ATOMIC_BUILTINS 0 /* Is GNOME Keyring support enabled? */ /* #undef SVN_HAVE_GNOME_KEYRING */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 18:31:39 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id F32A790D; Fri, 4 Oct 2013 18:31:38 +0000 (UTC) (envelope-from grehan@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E01EA2EC6; Fri, 4 Oct 2013 18:31:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94IVco9067285; Fri, 4 Oct 2013 18:31:38 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94IVcLJ067283; Fri, 4 Oct 2013 18:31:38 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310041831.r94IVcLJ067283@svn.freebsd.org> From: Peter Grehan Date: Fri, 4 Oct 2013 18:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256056 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 18:31:39 -0000 Author: grehan Date: Fri Oct 4 18:31:38 2013 New Revision: 256056 URL: http://svnweb.freebsd.org/changeset/base/256056 Log: Import Zhixiang Yu's GSoC'13 AHCI emulation: https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI This provides ICH8 SATA disk and ATAPI ports, selectable via the bhyve slot command-line parameter: SATA -s ,ahci-hd, ATAPI -s ,ahci-cd, Slight modifications by: grehan@ Approved by: re@ (blanket) Obtained from: FreeBSD GSoC'13 Added: head/usr.sbin/bhyve/ahci.h (contents, props changed) head/usr.sbin/bhyve/pci_ahci.c (contents, props changed) Added: head/usr.sbin/bhyve/ahci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/ahci.h Fri Oct 4 18:31:38 2013 (r256056) @@ -0,0 +1,304 @@ +/*- + * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 2009-2012 Alexander Motin + * 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, + * without modification, immediately at the beginning of the file. + * 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 _AHCI_H_ +#define _AHCI_H_ + +/* ATA register defines */ +#define ATA_DATA 0 /* (RW) data */ + +#define ATA_FEATURE 1 /* (W) feature */ +#define ATA_F_DMA 0x01 /* enable DMA */ +#define ATA_F_OVL 0x02 /* enable overlap */ + +#define ATA_COUNT 2 /* (W) sector count */ + +#define ATA_SECTOR 3 /* (RW) sector # */ +#define ATA_CYL_LSB 4 /* (RW) cylinder# LSB */ +#define ATA_CYL_MSB 5 /* (RW) cylinder# MSB */ +#define ATA_DRIVE 6 /* (W) Sector/Drive/Head */ +#define ATA_D_LBA 0x40 /* use LBA addressing */ +#define ATA_D_IBM 0xa0 /* 512 byte sectors, ECC */ + +#define ATA_COMMAND 7 /* (W) command */ + +#define ATA_ERROR 8 /* (R) error */ +#define ATA_E_ILI 0x01 /* illegal length */ +#define ATA_E_NM 0x02 /* no media */ +#define ATA_E_ABORT 0x04 /* command aborted */ +#define ATA_E_MCR 0x08 /* media change request */ +#define ATA_E_IDNF 0x10 /* ID not found */ +#define ATA_E_MC 0x20 /* media changed */ +#define ATA_E_UNC 0x40 /* uncorrectable data */ +#define ATA_E_ICRC 0x80 /* UDMA crc error */ +#define ATA_E_ATAPI_SENSE_MASK 0xf0 /* ATAPI sense key mask */ + +#define ATA_IREASON 9 /* (R) interrupt reason */ +#define ATA_I_CMD 0x01 /* cmd (1) | data (0) */ +#define ATA_I_IN 0x02 /* read (1) | write (0) */ +#define ATA_I_RELEASE 0x04 /* released bus (1) */ +#define ATA_I_TAGMASK 0xf8 /* tag mask */ + +#define ATA_STATUS 10 /* (R) status */ +#define ATA_ALTSTAT 11 /* (R) alternate status */ +#define ATA_S_ERROR 0x01 /* error */ +#define ATA_S_INDEX 0x02 /* index */ +#define ATA_S_CORR 0x04 /* data corrected */ +#define ATA_S_DRQ 0x08 /* data request */ +#define ATA_S_DSC 0x10 /* drive seek completed */ +#define ATA_S_SERVICE 0x10 /* drive needs service */ +#define ATA_S_DWF 0x20 /* drive write fault */ +#define ATA_S_DMA 0x20 /* DMA ready */ +#define ATA_S_READY 0x40 /* drive ready */ +#define ATA_S_BUSY 0x80 /* busy */ + +#define ATA_CONTROL 12 /* (W) control */ +#define ATA_A_IDS 0x02 /* disable interrupts */ +#define ATA_A_RESET 0x04 /* RESET controller */ +#define ATA_A_4BIT 0x08 /* 4 head bits */ +#define ATA_A_HOB 0x80 /* High Order Byte enable */ + +/* SATA register defines */ +#define ATA_SSTATUS 13 +#define ATA_SS_DET_MASK 0x0000000f +#define ATA_SS_DET_NO_DEVICE 0x00000000 +#define ATA_SS_DET_DEV_PRESENT 0x00000001 +#define ATA_SS_DET_PHY_ONLINE 0x00000003 +#define ATA_SS_DET_PHY_OFFLINE 0x00000004 + +#define ATA_SS_SPD_MASK 0x000000f0 +#define ATA_SS_SPD_NO_SPEED 0x00000000 +#define ATA_SS_SPD_GEN1 0x00000010 +#define ATA_SS_SPD_GEN2 0x00000020 +#define ATA_SS_SPD_GEN3 0x00000040 + +#define ATA_SS_IPM_MASK 0x00000f00 +#define ATA_SS_IPM_NO_DEVICE 0x00000000 +#define ATA_SS_IPM_ACTIVE 0x00000100 +#define ATA_SS_IPM_PARTIAL 0x00000200 +#define ATA_SS_IPM_SLUMBER 0x00000600 + +#define ATA_SERROR 14 +#define ATA_SE_DATA_CORRECTED 0x00000001 +#define ATA_SE_COMM_CORRECTED 0x00000002 +#define ATA_SE_DATA_ERR 0x00000100 +#define ATA_SE_COMM_ERR 0x00000200 +#define ATA_SE_PROT_ERR 0x00000400 +#define ATA_SE_HOST_ERR 0x00000800 +#define ATA_SE_PHY_CHANGED 0x00010000 +#define ATA_SE_PHY_IERROR 0x00020000 +#define ATA_SE_COMM_WAKE 0x00040000 +#define ATA_SE_DECODE_ERR 0x00080000 +#define ATA_SE_PARITY_ERR 0x00100000 +#define ATA_SE_CRC_ERR 0x00200000 +#define ATA_SE_HANDSHAKE_ERR 0x00400000 +#define ATA_SE_LINKSEQ_ERR 0x00800000 +#define ATA_SE_TRANSPORT_ERR 0x01000000 +#define ATA_SE_UNKNOWN_FIS 0x02000000 +#define ATA_SE_EXCHANGED 0x04000000 + +#define ATA_SCONTROL 15 +#define ATA_SC_DET_MASK 0x0000000f +#define ATA_SC_DET_IDLE 0x00000000 +#define ATA_SC_DET_RESET 0x00000001 +#define ATA_SC_DET_DISABLE 0x00000004 + +#define ATA_SC_SPD_MASK 0x000000f0 +#define ATA_SC_SPD_NO_SPEED 0x00000000 +#define ATA_SC_SPD_SPEED_GEN1 0x00000010 +#define ATA_SC_SPD_SPEED_GEN2 0x00000020 +#define ATA_SC_SPD_SPEED_GEN3 0x00000040 + +#define ATA_SC_IPM_MASK 0x00000f00 +#define ATA_SC_IPM_NONE 0x00000000 +#define ATA_SC_IPM_DIS_PARTIAL 0x00000100 +#define ATA_SC_IPM_DIS_SLUMBER 0x00000200 + +#define ATA_SACTIVE 16 + +#define AHCI_MAX_PORTS 32 +#define AHCI_MAX_SLOTS 32 + +/* SATA AHCI v1.0 register defines */ +#define AHCI_CAP 0x00 +#define AHCI_CAP_NPMASK 0x0000001f +#define AHCI_CAP_SXS 0x00000020 +#define AHCI_CAP_EMS 0x00000040 +#define AHCI_CAP_CCCS 0x00000080 +#define AHCI_CAP_NCS 0x00001F00 +#define AHCI_CAP_NCS_SHIFT 8 +#define AHCI_CAP_PSC 0x00002000 +#define AHCI_CAP_SSC 0x00004000 +#define AHCI_CAP_PMD 0x00008000 +#define AHCI_CAP_FBSS 0x00010000 +#define AHCI_CAP_SPM 0x00020000 +#define AHCI_CAP_SAM 0x00080000 +#define AHCI_CAP_ISS 0x00F00000 +#define AHCI_CAP_ISS_SHIFT 20 +#define AHCI_CAP_SCLO 0x01000000 +#define AHCI_CAP_SAL 0x02000000 +#define AHCI_CAP_SALP 0x04000000 +#define AHCI_CAP_SSS 0x08000000 +#define AHCI_CAP_SMPS 0x10000000 +#define AHCI_CAP_SSNTF 0x20000000 +#define AHCI_CAP_SNCQ 0x40000000 +#define AHCI_CAP_64BIT 0x80000000 + +#define AHCI_GHC 0x04 +#define AHCI_GHC_AE 0x80000000 +#define AHCI_GHC_MRSM 0x00000004 +#define AHCI_GHC_IE 0x00000002 +#define AHCI_GHC_HR 0x00000001 + +#define AHCI_IS 0x08 +#define AHCI_PI 0x0c +#define AHCI_VS 0x10 + +#define AHCI_CCCC 0x14 +#define AHCI_CCCC_TV_MASK 0xffff0000 +#define AHCI_CCCC_TV_SHIFT 16 +#define AHCI_CCCC_CC_MASK 0x0000ff00 +#define AHCI_CCCC_CC_SHIFT 8 +#define AHCI_CCCC_INT_MASK 0x000000f8 +#define AHCI_CCCC_INT_SHIFT 3 +#define AHCI_CCCC_EN 0x00000001 +#define AHCI_CCCP 0x18 + +#define AHCI_EM_LOC 0x1C +#define AHCI_EM_CTL 0x20 +#define AHCI_EM_MR 0x00000001 +#define AHCI_EM_TM 0x00000100 +#define AHCI_EM_RST 0x00000200 +#define AHCI_EM_LED 0x00010000 +#define AHCI_EM_SAFTE 0x00020000 +#define AHCI_EM_SES2 0x00040000 +#define AHCI_EM_SGPIO 0x00080000 +#define AHCI_EM_SMB 0x01000000 +#define AHCI_EM_XMT 0x02000000 +#define AHCI_EM_ALHD 0x04000000 +#define AHCI_EM_PM 0x08000000 + +#define AHCI_CAP2 0x24 +#define AHCI_CAP2_BOH 0x00000001 +#define AHCI_CAP2_NVMP 0x00000002 +#define AHCI_CAP2_APST 0x00000004 + +#define AHCI_OFFSET 0x100 +#define AHCI_STEP 0x80 + +#define AHCI_P_CLB 0x00 +#define AHCI_P_CLBU 0x04 +#define AHCI_P_FB 0x08 +#define AHCI_P_FBU 0x0c +#define AHCI_P_IS 0x10 +#define AHCI_P_IE 0x14 +#define AHCI_P_IX_DHR 0x00000001 +#define AHCI_P_IX_PS 0x00000002 +#define AHCI_P_IX_DS 0x00000004 +#define AHCI_P_IX_SDB 0x00000008 +#define AHCI_P_IX_UF 0x00000010 +#define AHCI_P_IX_DP 0x00000020 +#define AHCI_P_IX_PC 0x00000040 +#define AHCI_P_IX_MP 0x00000080 + +#define AHCI_P_IX_PRC 0x00400000 +#define AHCI_P_IX_IPM 0x00800000 +#define AHCI_P_IX_OF 0x01000000 +#define AHCI_P_IX_INF 0x04000000 +#define AHCI_P_IX_IF 0x08000000 +#define AHCI_P_IX_HBD 0x10000000 +#define AHCI_P_IX_HBF 0x20000000 +#define AHCI_P_IX_TFE 0x40000000 +#define AHCI_P_IX_CPD 0x80000000 + +#define AHCI_P_CMD 0x18 +#define AHCI_P_CMD_ST 0x00000001 +#define AHCI_P_CMD_SUD 0x00000002 +#define AHCI_P_CMD_POD 0x00000004 +#define AHCI_P_CMD_CLO 0x00000008 +#define AHCI_P_CMD_FRE 0x00000010 +#define AHCI_P_CMD_CCS_MASK 0x00001f00 +#define AHCI_P_CMD_CCS_SHIFT 8 +#define AHCI_P_CMD_ISS 0x00002000 +#define AHCI_P_CMD_FR 0x00004000 +#define AHCI_P_CMD_CR 0x00008000 +#define AHCI_P_CMD_CPS 0x00010000 +#define AHCI_P_CMD_PMA 0x00020000 +#define AHCI_P_CMD_HPCP 0x00040000 +#define AHCI_P_CMD_MPSP 0x00080000 +#define AHCI_P_CMD_CPD 0x00100000 +#define AHCI_P_CMD_ESP 0x00200000 +#define AHCI_P_CMD_FBSCP 0x00400000 +#define AHCI_P_CMD_APSTE 0x00800000 +#define AHCI_P_CMD_ATAPI 0x01000000 +#define AHCI_P_CMD_DLAE 0x02000000 +#define AHCI_P_CMD_ALPE 0x04000000 +#define AHCI_P_CMD_ASP 0x08000000 +#define AHCI_P_CMD_ICC_MASK 0xf0000000 +#define AHCI_P_CMD_NOOP 0x00000000 +#define AHCI_P_CMD_ACTIVE 0x10000000 +#define AHCI_P_CMD_PARTIAL 0x20000000 +#define AHCI_P_CMD_SLUMBER 0x60000000 + +#define AHCI_P_TFD 0x20 +#define AHCI_P_SIG 0x24 +#define AHCI_P_SSTS 0x28 +#define AHCI_P_SCTL 0x2c +#define AHCI_P_SERR 0x30 +#define AHCI_P_SACT 0x34 +#define AHCI_P_CI 0x38 +#define AHCI_P_SNTF 0x3C +#define AHCI_P_FBS 0x40 +#define AHCI_P_FBS_EN 0x00000001 +#define AHCI_P_FBS_DEC 0x00000002 +#define AHCI_P_FBS_SDE 0x00000004 +#define AHCI_P_FBS_DEV 0x00000f00 +#define AHCI_P_FBS_DEV_SHIFT 8 +#define AHCI_P_FBS_ADO 0x0000f000 +#define AHCI_P_FBS_ADO_SHIFT 12 +#define AHCI_P_FBS_DWE 0x000f0000 +#define AHCI_P_FBS_DWE_SHIFT 16 + +/* Just to be sure, if building as module. */ +#if MAXPHYS < 512 * 1024 +#undef MAXPHYS +#define MAXPHYS 512 * 1024 +#endif +/* Pessimistic prognosis on number of required S/G entries */ +#define AHCI_SG_ENTRIES (roundup(btoc(MAXPHYS) + 1, 8)) +/* Command list. 32 commands. First, 1Kbyte aligned. */ +#define AHCI_CL_OFFSET 0 +#define AHCI_CL_SIZE 32 +/* Command tables. Up to 32 commands, Each, 128byte aligned. */ +#define AHCI_CT_OFFSET (AHCI_CL_OFFSET + AHCI_CL_SIZE * AHCI_MAX_SLOTS) +#define AHCI_CT_SIZE (128 + AHCI_SG_ENTRIES * 16) +/* Total main work area. */ +#define AHCI_WORK_SIZE (AHCI_CT_OFFSET + AHCI_CT_SIZE * ch->numslots) + +#endif /* _AHCI_H_ */ Added: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Oct 4 18:31:38 2013 (r256056) @@ -0,0 +1,1805 @@ +/*- + * Copyright (c) 2013 Zhixiang Yu + * 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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "ahci.h" +#include "block_if.h" + +#define MAX_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ + +#define PxSIG_ATA 0x00000101 /* ATA drive */ +#define PxSIG_ATAPI 0xeb140101 /* ATAPI drive */ + +enum sata_fis_type { + FIS_TYPE_REGH2D = 0x27, /* Register FIS - host to device */ + FIS_TYPE_REGD2H = 0x34, /* Register FIS - device to host */ + FIS_TYPE_DMAACT = 0x39, /* DMA activate FIS - device to host */ + FIS_TYPE_DMASETUP = 0x41, /* DMA setup FIS - bidirectional */ + FIS_TYPE_DATA = 0x46, /* Data FIS - bidirectional */ + FIS_TYPE_BIST = 0x58, /* BIST activate FIS - bidirectional */ + FIS_TYPE_PIOSETUP = 0x5F, /* PIO setup FIS - device to host */ + FIS_TYPE_SETDEVBITS = 0xA1, /* Set dev bits FIS - device to host */ +}; + +/* + * SCSI opcodes + */ +#define TEST_UNIT_READY 0x00 +#define REQUEST_SENSE 0x03 +#define INQUIRY 0x12 +#define START_STOP_UNIT 0x1B +#define PREVENT_ALLOW 0x1E +#define READ_CAPACITY 0x25 +#define READ_10 0x28 +#define POSITION_TO_ELEMENT 0x2B +#define READ_TOC 0x43 +#define GET_EVENT_STATUS_NOTIFICATION 0x4A +#define MODE_SENSE_10 0x5A +#define READ_12 0xA8 +#define READ_CD 0xBE + +/* + * SCSI mode page codes + */ +#define MODEPAGE_RW_ERROR_RECOVERY 0x01 +#define MODEPAGE_CD_CAPABILITIES 0x2A + +/* + * Debug printf + */ +#ifdef AHCI_DEBUG +static FILE *dbg; +#define DPRINTF(format, arg...) do{fprintf(dbg, format, ##arg);fflush(dbg);}while(0) +#else +#define DPRINTF(format, arg...) +#endif +#define WPRINTF(format, arg...) printf(format, ##arg) + +struct ahci_ioreq { + struct blockif_req io_req; + struct ahci_port *io_pr; + STAILQ_ENTRY(ahci_ioreq) io_list; + uint8_t *cfis; + uint32_t len; + uint32_t done; + int slot; + int prdtl; +}; + +struct ahci_port { + struct blockif_ctxt *bctx; + struct pci_ahci_softc *pr_sc; + uint64_t cmd_lst; + uint64_t rfis; + int atapi; + int reset; + int mult_sectors; + uint8_t xfermode; + uint8_t sense_key; + uint8_t asc; + + uint32_t clb; + uint32_t clbu; + uint32_t fb; + uint32_t fbu; + uint32_t is; + uint32_t ie; + uint32_t cmd; + uint32_t unused0; + uint32_t tfd; + uint32_t sig; + uint32_t ssts; + uint32_t sctl; + uint32_t serr; + uint32_t sact; + uint32_t ci; + uint32_t sntf; + uint32_t fbs; + + /* + * i/o request info + */ + struct ahci_ioreq *ioreq; + int ioqsz; + STAILQ_HEAD(ahci_fhead, ahci_ioreq) iofhd; +}; + +struct ahci_cmd_hdr { + uint16_t flags; + uint16_t prdtl; + uint32_t prdbc; + uint64_t ctba; + uint32_t reserved[4]; +}; + +struct ahci_prdt_entry { + uint64_t dba; + uint32_t reserved; + uint32_t dbc; +}; + +struct pci_ahci_softc { + struct pci_devinst *asc_pi; + pthread_mutex_t mtx; + int ports; + uint32_t cap; + uint32_t ghc; + uint32_t is; + uint32_t pi; + uint32_t vs; + uint32_t ccc_ctl; + uint32_t ccc_pts; + uint32_t em_loc; + uint32_t em_ctl; + uint32_t cap2; + uint32_t bohc; + struct ahci_port port[MAX_PORTS]; +}; +#define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) + +static inline void lba_to_msf(uint8_t *buf, int lba) +{ + lba += 150; + buf[0] = (lba / 75) / 60; + buf[1] = (lba / 75) % 60; + buf[2] = lba % 75; +} + +/* + * generate HBA intr depending on whether or not ports within + * the controller have an interrupt pending. + */ +static void +ahci_generate_intr(struct pci_ahci_softc *sc) +{ + int i; + + for (i = 0; i < sc->ports; i++) { + struct ahci_port *pr; + pr = &sc->port[i]; + if (pr->is & pr->ie) + sc->is |= (1 << i); + } + + DPRINTF("%s %x\n", __func__, sc->is); + + if (sc->is && (sc->ghc & AHCI_GHC_IE)) + pci_generate_msi(sc->asc_pi, 0); +} + +static void +ahci_write_fis(struct ahci_port *p, enum sata_fis_type ft, uint8_t *fis) +{ + int offset, len, irq; + + if (p->rfis == 0 || !(p->cmd & AHCI_P_CMD_FRE)) + return; + + switch (ft) { + case FIS_TYPE_REGD2H: + offset = 0x40; + len = 20; + irq = AHCI_P_IX_DHR; + break; + case FIS_TYPE_SETDEVBITS: + offset = 0x58; + len = 8; + irq = AHCI_P_IX_SDB; + break; + case FIS_TYPE_PIOSETUP: + offset = 0x20; + len = 20; + irq = 0; + break; + default: + WPRINTF("unsupported fis type %d\n", ft); + return; + } + memcpy(p->rfis + offset, fis, len); + if (irq) { + p->is |= irq; + ahci_generate_intr(p->pr_sc); + } +} + +static void +ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd) +{ + uint8_t fis[8]; + uint8_t error; + + error = (tfd >> 8) & 0xff; + memset(fis, 0, sizeof(fis)); + fis[0] = error; + fis[2] = tfd & 0x77; + *(uint32_t *)(fis + 4) = (1 << slot); + if (fis[2] & ATA_S_ERROR) + p->is |= AHCI_P_IX_TFE; + p->tfd = tfd; + ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); +} + +static void +ahci_write_fis_d2h(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t tfd) +{ + uint8_t fis[20]; + uint8_t error; + + error = (tfd >> 8) & 0xff; + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_REGD2H; + fis[1] = (1 << 6); + fis[2] = tfd & 0xff; + fis[3] = error; + fis[4] = cfis[4]; + fis[5] = cfis[5]; + fis[6] = cfis[6]; + fis[7] = cfis[7]; + fis[8] = cfis[8]; + fis[9] = cfis[9]; + fis[10] = cfis[10]; + fis[11] = cfis[11]; + fis[12] = cfis[12]; + fis[13] = cfis[13]; + if (fis[2] & ATA_S_ERROR) + p->is |= AHCI_P_IX_TFE; + p->tfd = tfd; + p->ci &= ~(1 << slot); + ahci_write_fis(p, FIS_TYPE_REGD2H, fis); +} + +static void +ahci_write_reset_fis_d2h(struct ahci_port *p) +{ + uint8_t fis[20]; + + memset(fis, 0, sizeof(fis)); + fis[0] = FIS_TYPE_REGD2H; + fis[3] = 1; + fis[4] = 1; + if (p->atapi) { + fis[5] = 0x14; + fis[6] = 0xeb; + } + fis[12] = 1; + ahci_write_fis(p, FIS_TYPE_REGD2H, fis); +} + +static void +ahci_port_reset(struct ahci_port *pr) +{ + pr->sctl = 0; + pr->serr = 0; + pr->sact = 0; + pr->xfermode = ATA_UDMA6; + pr->mult_sectors = 128; + + if (!pr->bctx) { + pr->ssts = ATA_SS_DET_NO_DEVICE; + pr->sig = 0xFFFFFFFF; + pr->tfd = 0x7F; + return; + } + pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN2 | + ATA_SS_IPM_ACTIVE; + pr->tfd = (1 << 8) | ATA_S_DSC | ATA_S_DMA; + if (!pr->atapi) { + pr->sig = PxSIG_ATA; + pr->tfd |= ATA_S_READY; + } else + pr->sig = PxSIG_ATAPI; + ahci_write_reset_fis_d2h(pr); +} + +static void +ahci_reset(struct pci_ahci_softc *sc) +{ + int i; + + sc->ghc = AHCI_GHC_AE; + sc->is = 0; + for (i = 0; i < sc->ports; i++) { + sc->port[i].ie = 0; + sc->port[i].is = 0; + ahci_port_reset(&sc->port[i]); + } +} + +static void +ata_string(uint8_t *dest, const char *src, int len) +{ + int i; + + for (i = 0; i < len; i++) { + if (*src) + dest[i ^ 1] = *src++; + else + dest[i ^ 1] = ' '; + } +} + +static void +atapi_string(uint8_t *dest, const char *src, int len) +{ + int i; + + for (i = 0; i < len; i++) { + if (*src) + dest[i] = *src++; + else + dest[i] = ' '; + } +} + +static void +ahci_handle_dma(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done, + int seek) +{ + struct ahci_ioreq *aior; + struct blockif_req *breq; + struct pci_ahci_softc *sc; + struct ahci_prdt_entry *prdt; + struct ahci_cmd_hdr *hdr; + uint64_t lba; + uint32_t len; + int i, err, iovcnt, ncq, readop; + + sc = p->pr_sc; + prdt = (struct ahci_prdt_entry *)(cfis + 0x80); + hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + ncq = 0; + readop = 1; + + prdt += seek; + if (cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || + cfis[2] == ATA_WRITE_FPDMA_QUEUED) + readop = 0; + + if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || + cfis[2] == ATA_READ_FPDMA_QUEUED) { + lba = ((uint64_t)cfis[10] << 40) | + ((uint64_t)cfis[9] << 32) | + ((uint64_t)cfis[8] << 24) | + ((uint64_t)cfis[6] << 16) | + ((uint64_t)cfis[5] << 8) | + cfis[4]; + len = cfis[11] << 8 | cfis[3]; + if (!len) + len = 65536; + ncq = 1; + } else if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { + lba = ((uint64_t)cfis[10] << 40) | + ((uint64_t)cfis[9] << 32) | + ((uint64_t)cfis[8] << 24) | + ((uint64_t)cfis[6] << 16) | + ((uint64_t)cfis[5] << 8) | + cfis[4]; + len = cfis[13] << 8 | cfis[12]; + if (!len) + len = 65536; + } else { + lba = ((cfis[7] & 0xf) << 24) | (cfis[6] << 16) | + (cfis[5] << 8) | cfis[4]; + len = cfis[12]; + if (!len) + len = 256; + } + lba *= blockif_sectsz(p->bctx); + len *= blockif_sectsz(p->bctx); + + /* + * Pull request off free list + */ + aior = STAILQ_FIRST(&p->iofhd); + assert(aior != NULL); + STAILQ_REMOVE_HEAD(&p->iofhd, io_list); + aior->cfis = cfis; + aior->slot = slot; + aior->len = len; + aior->done = done; + breq = &aior->io_req; + breq->br_offset = lba + done; + iovcnt = hdr->prdtl - seek; + if (iovcnt > BLOCKIF_IOV_MAX) { + aior->prdtl = iovcnt - BLOCKIF_IOV_MAX; + iovcnt = BLOCKIF_IOV_MAX; + } else + aior->prdtl = 0; + breq->br_iovcnt = iovcnt; + + /* + * Build up the iovec based on the prdt + */ + for (i = 0; i < iovcnt; i++) { + breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), + prdt->dba, prdt->dbc + 1); + breq->br_iov[i].iov_len = prdt->dbc + 1; + aior->done += (prdt->dbc + 1); + prdt++; + } + if (readop) + err = blockif_read(p->bctx, breq); + else + err = blockif_write(p->bctx, breq); + assert(err == 0); + + if (!aior->prdtl && ncq) + p->ci &= ~(1 << slot); +} + +static void +ahci_handle_flush(struct ahci_port *p, int slot, uint8_t *cfis) +{ + struct ahci_ioreq *aior; + struct blockif_req *breq; + int err; + + /* + * Pull request off free list + */ + aior = STAILQ_FIRST(&p->iofhd); + assert(aior != NULL); + STAILQ_REMOVE_HEAD(&p->iofhd, io_list); + aior->cfis = cfis; + aior->slot = slot; + aior->len = 0; + breq = &aior->io_req; + + err = blockif_flush(p->bctx, breq); + assert(err == 0); +} + +static inline void +write_prdt(struct ahci_port *p, int slot, uint8_t *cfis, + void *buf, int size) +{ + struct ahci_cmd_hdr *hdr; + struct ahci_prdt_entry *prdt; + void *from; + int i, len; + + hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + len = size; + from = buf; + prdt = (struct ahci_prdt_entry *)(cfis + 0x80); + for (i = 0; i < hdr->prdtl && len; i++) { + uint8_t *ptr = paddr_guest2host(ahci_ctx(p->pr_sc), + prdt->dba, prdt->dbc + 1); + memcpy(ptr, from, prdt->dbc + 1); + len -= (prdt->dbc + 1); + from += (prdt->dbc + 1); + prdt++; + } + hdr->prdbc = size - len; +} + +static void +handle_identify(struct ahci_port *p, int slot, uint8_t *cfis) +{ + struct ahci_cmd_hdr *hdr; + + hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + if (p->atapi || hdr->prdtl == 0) { + p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; + p->is |= AHCI_P_IX_TFE; + } else { + uint16_t buf[256]; + uint64_t sectors; + + sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); + memset(buf, 0, sizeof(buf)); + buf[0] = 0x0040; + /* TODO emulate different serial? */ + ata_string((uint8_t *)(buf+10), "123456", 20); + ata_string((uint8_t *)(buf+23), "001", 8); + ata_string((uint8_t *)(buf+27), "BHYVE SATA DISK", 40); + buf[47] = (0x8000 | 128); + buf[48] = 0x1; + buf[49] = (1 << 8 | 1 << 9 | 1 << 11); + buf[50] = (1 << 14); + buf[53] = (1 << 1 | 1 << 2); + if (p->mult_sectors) + buf[59] = (0x100 | p->mult_sectors); + buf[60] = sectors; + buf[61] = (sectors >> 16); + buf[63] = 0x7; + if (p->xfermode & ATA_WDMA0) + buf[63] |= (1 << ((p->xfermode & 7) + 8)); + buf[64] = 0x3; + buf[65] = 100; + buf[66] = 100; + buf[67] = 100; + buf[68] = 100; + buf[75] = 31; + buf[76] = (1 << 8 | 1 << 2); + buf[80] = 0x1f0; + buf[81] = 0x28; + buf[82] = (1 << 5 | 1 << 14); + buf[83] = (1 << 10 | 1 << 12 | 1 << 13 | 1 << 14); + buf[84] = (1 << 14); + buf[85] = (1 << 5 | 1 << 14); + buf[86] = (1 << 10 | 1 << 12 | 1 << 13); + buf[87] = (1 << 14); + buf[88] = 0x7f; + if (p->xfermode & ATA_UDMA0) + buf[88] |= (1 << ((p->xfermode & 7) + 8)); + buf[93] = (1 | 1 <<14); + buf[100] = sectors; + buf[101] = (sectors >> 16); + buf[102] = (sectors >> 32); + buf[103] = (sectors >> 48); + write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); + p->tfd = ATA_S_DSC | ATA_S_READY; + p->is |= AHCI_P_IX_DP; + } + p->ci &= ~(1 << slot); + ahci_generate_intr(p->pr_sc); +} + +static void +handle_atapi_identify(struct ahci_port *p, int slot, uint8_t *cfis) +{ + if (!p->atapi) { + p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; + p->is |= AHCI_P_IX_TFE; + } else { + uint16_t buf[256]; + + memset(buf, 0, sizeof(buf)); + buf[0] = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + /* TODO emulate different serial? */ + ata_string((uint8_t *)(buf+10), "123456", 20); + ata_string((uint8_t *)(buf+23), "001", 8); + ata_string((uint8_t *)(buf+27), "BHYVE SATA DVD ROM", 40); + buf[49] = (1 << 9 | 1 << 8); + buf[50] = (1 << 14 | 1); + buf[53] = (1 << 2 | 1 << 1); + buf[62] = 0x3f; + buf[63] = 7; + buf[64] = 3; + buf[65] = 100; + buf[66] = 100; + buf[67] = 100; + buf[68] = 100; + buf[76] = (1 << 2 | 1 << 1); + buf[78] = (1 << 5); + buf[80] = (0x1f << 4); + buf[82] = (1 << 4); + buf[83] = (1 << 14); + buf[84] = (1 << 14); + buf[85] = (1 << 4); + buf[87] = (1 << 14); + buf[88] = (1 << 14 | 0x7f); + write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); + p->tfd = ATA_S_DSC | ATA_S_READY; + p->is |= AHCI_P_IX_DHR; + } + p->ci &= ~(1 << slot); + ahci_generate_intr(p->pr_sc); +} + +static void +atapi_inquiry(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t buf[36]; + uint8_t *acmd; + int len; + + acmd = cfis + 0x40; + + buf[0] = 0x05; + buf[1] = 0x80; + buf[2] = 0x00; + buf[3] = 0x21; + buf[4] = 31; + buf[5] = 0; + buf[6] = 0; + buf[7] = 0; + atapi_string(buf + 8, "BHYVE", 8); + atapi_string(buf + 16, "BHYVE DVD-ROM", 16); + atapi_string(buf + 32, "001", 4); + + len = sizeof(buf); + if (len > acmd[4]) + len = acmd[4]; + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + write_prdt(p, slot, cfis, buf, len); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); +} + +static void +atapi_read_capacity(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t buf[8]; + uint64_t sectors; + + sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); + sectors >>= 2; + be32enc(buf, sectors - 1); + be32enc(buf + 4, 2048); + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + write_prdt(p, slot, cfis, buf, sizeof(buf)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); +} + +static void +atapi_read_toc(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t *acmd; + uint8_t format; + int len; + + acmd = cfis + 0x40; + + len = be16dec(acmd + 7); + format = acmd[9] >> 6; + switch (format) { + case 0: + { + int msf, size; + uint64_t sectors; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 18:44:48 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 32F6FCD0; Fri, 4 Oct 2013 18:44:48 +0000 (UTC) (envelope-from grehan@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2056A2F58; Fri, 4 Oct 2013 18:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94IilIH075228; Fri, 4 Oct 2013 18:44:48 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94IilqM075227; Fri, 4 Oct 2013 18:44:47 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310041844.r94IilqM075227@svn.freebsd.org> From: Peter Grehan Date: Fri, 4 Oct 2013 18:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256057 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 18:44:48 -0000 Author: grehan Date: Fri Oct 4 18:44:47 2013 New Revision: 256057 URL: http://svnweb.freebsd.org/changeset/base/256057 Log: Hook up the AHCI and blockif code to the build. Approved by: re@ (blanket) Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri Oct 4 18:31:38 2013 (r256056) +++ head/usr.sbin/bhyve/Makefile Fri Oct 4 18:44:47 2013 (r256057) @@ -6,8 +6,8 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 -SRCS= acpi.c atpic.c bhyverun.c consport.c dbgport.c elcr.c inout.c -SRCS+= ioapic.c mem.c mevent.c mptbl.c +SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c +SRCS+= inout.c ioapic.c mem.c mevent.c mptbl.c pci_ahci.c SRCS+= pci_emul.c pci_hostbridge.c pci_passthru.c pci_virtio_block.c SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pmtmr.c post.c rtc.c SRCS+= virtio.c xmsr.c spinup_ap.c From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 19:31:42 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 32F7A25E; Fri, 4 Oct 2013 19:31:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06C3D2229; Fri, 4 Oct 2013 19:31:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94JVfwW006682; Fri, 4 Oct 2013 19:31:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94JVfvj006676; Fri, 4 Oct 2013 19:31:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310041931.r94JVfvj006676@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Oct 2013 19:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256058 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 19:31:42 -0000 Author: trasz Date: Fri Oct 4 19:31:41 2013 New Revision: 256058 URL: http://svnweb.freebsd.org/changeset/base/256058 Log: Don't leak memory when removing an unconnected session, and remove useless UMA_ZONE_NOFREE that caused another leak when unloading the module. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Oct 4 18:44:47 2013 (r256057) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Oct 4 19:31:41 2013 (r256058) @@ -1255,7 +1255,7 @@ cfiscsi_init(void) cfiscsi_data_wait_zone = uma_zcreate("cfiscsi_data_wait", sizeof(struct cfiscsi_data_wait), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); return (0); Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Oct 4 18:44:47 2013 (r256057) +++ head/sys/dev/iscsi/icl.c Fri Oct 4 19:31:41 2013 (r256058) @@ -957,6 +957,7 @@ icl_pdu_queue(struct icl_pdu *ip) if (ic->ic_disconnecting || ic->ic_socket == NULL) { ICL_DEBUG("icl_pdu_queue on closed connection"); ICL_CONN_UNLOCK(ic); + icl_pdu_free(ip); return; } TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); @@ -1259,10 +1260,10 @@ icl_load(void) icl_conn_zone = uma_zcreate("icl_conn", sizeof(struct icl_conn), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); icl_pdu_zone = uma_zcreate("icl_pdu", sizeof(struct icl_pdu), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); refcount_init(&icl_ncons, 0); } Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Oct 4 18:44:47 2013 (r256057) +++ head/sys/dev/iscsi/iscsi.c Fri Oct 4 19:31:41 2013 (r256058) @@ -2030,7 +2030,7 @@ iscsi_load(void) iscsi_outstanding_zone = uma_zcreate("iscsi_outstanding", sizeof(struct iscsi_outstanding), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); error = make_dev_p(MAKEDEV_CHECKNAME, &sc->sc_cdev, &iscsi_cdevsw, NULL, UID_ROOT, GID_WHEEL, 0600, "iscsi"); From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 19:57:47 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 984B3D97; Fri, 4 Oct 2013 19:57:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 849CC237C; Fri, 4 Oct 2013 19:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94JvlBN023037; Fri, 4 Oct 2013 19:57:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94JvlAW023036; Fri, 4 Oct 2013 19:57:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310041957.r94JvlAW023036@svn.freebsd.org> From: Dimitry Andric Date: Fri, 4 Oct 2013 19:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256059 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 19:57:47 -0000 Author: dim Date: Fri Oct 4 19:57:47 2013 New Revision: 256059 URL: http://svnweb.freebsd.org/changeset/base/256059 Log: MFC r255978: Pull in r191711 from upstream llvm trunk: The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress on ADD16rr opcodes, if src1 != src, since that would cause convertToThreeAddress to try to create a virtual register. This is not permitted after register allocation, which is when the X86FixupLEAs pass runs. This patch fixes PR16785. Pull in r191715 from upstream llvm trunk: Forgot to add a break statement. This should enable building the x11-toolskits/libXaw port with CPUTYPE=atom. Reported by: Kenta Suzumoto Modified: stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Fri Oct 4 19:31:41 2013 (r256058) +++ stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Fri Oct 4 19:57:47 2013 (r256059) @@ -125,6 +125,15 @@ FixupLEAPass::postRAConvertToLEA(Machine // which requires isImm() to be true return 0; } + break; + case X86::ADD16rr: + case X86::ADD16rr_DB: + if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) { + // if src1 != src2, then convertToThreeAddress will + // need to create a Virtual register, which we cannot do + // after register allocation. + return 0; + } } return TII->convertToThreeAddress(MFI, MBBI, 0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 21:25:55 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id EF2B6C01; Fri, 4 Oct 2013 21:25:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCDDE27A6; Fri, 4 Oct 2013 21:25:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94LPtPq081349; Fri, 4 Oct 2013 21:25:55 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94LPtVK081348; Fri, 4 Oct 2013 21:25:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310042125.r94LPtVK081348@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 4 Oct 2013 21:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256060 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 21:25:56 -0000 Author: jilles Date: Fri Oct 4 21:25:55 2013 New Revision: 256060 URL: http://svnweb.freebsd.org/changeset/base/256060 Log: kldxref: Do not depend on the directory order. Sort the filenames to get a consistent result between machines of the same architecture. Also, sort FTS_D entries after other entries so kldxref -R works properly in the uncommon case that a directory contains both subdirectories and modules. Previously, this may have happened to work, depending on the order of files in the directory. PR: bin/182098 Submitted by: Derek Schrock (original version) Tested by: Derek Schrock Approved by: re (delphij) MFC after: 1 week Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Fri Oct 4 19:57:47 2013 (r256059) +++ head/usr.sbin/kldxref/kldxref.c Fri Oct 4 21:25:55 2013 (r256060) @@ -274,6 +274,16 @@ usage(void) exit(1); } +int +compare(const FTSENT *const *a, const FTSENT *const *b) +{ + if ((*a)->fts_info == FTS_D && (*b)->fts_info != FTS_D) + return 1; + if ((*a)->fts_info != FTS_D && (*b)->fts_info == FTS_D) + return -1; + return strcmp((*a)->fts_name, (*b)->fts_name); +} + int main(int argc, char *argv[]) { @@ -315,7 +325,7 @@ main(int argc, char *argv[]) err(1, "%s", argv[0]); } - ftsp = fts_open(argv, fts_options, 0); + ftsp = fts_open(argv, fts_options, compare); if (ftsp == NULL) exit(1); From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 22:05:24 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 10186E73; Fri, 4 Oct 2013 22:05:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F282A29B3; Fri, 4 Oct 2013 22:05:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94M5NFV006597; Fri, 4 Oct 2013 22:05:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94M5Nvt006596; Fri, 4 Oct 2013 22:05:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310042205.r94M5Nvt006596@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Oct 2013 22:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256061 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 22:05:24 -0000 Author: kib Date: Fri Oct 4 22:05:23 2013 New Revision: 256061 URL: http://svnweb.freebsd.org/changeset/base/256061 Log: Add padding to match the compat32 struct stat32 definition to the real struct stat on 32bit architectures. Debugged and tested by: bsam Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (marius) Modified: head/sys/compat/freebsd32/freebsd32.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Fri Oct 4 21:25:55 2013 (r256060) +++ head/sys/compat/freebsd32/freebsd32.h Fri Oct 4 22:05:23 2013 (r256061) @@ -175,6 +175,7 @@ struct stat32 { u_int32_t st_blksize; u_int32_t st_flags; u_int32_t st_gen; + int32_t st_lspare; struct timespec32 st_birthtim; unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32)); From owner-svn-src-all@FreeBSD.ORG Fri Oct 4 23:29:08 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id C640CFB6; Fri, 4 Oct 2013 23:29:08 +0000 (UTC) (envelope-from grehan@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A445E2D31; Fri, 4 Oct 2013 23:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94NT8vD061189; Fri, 4 Oct 2013 23:29:08 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94NT8x7061186; Fri, 4 Oct 2013 23:29:08 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310042329.r94NT8x7061186@svn.freebsd.org> From: Peter Grehan Date: Fri, 4 Oct 2013 23:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256062 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 23:29:08 -0000 Author: grehan Date: Fri Oct 4 23:29:07 2013 New Revision: 256062 URL: http://svnweb.freebsd.org/changeset/base/256062 Log: Remove obsolete cmd-line options and code associated with these. The mux-vcpus option may return at some point, given it's utility in finding bhyve (and FreeBSD) bugs. Approved by: re@ (blanket) Discussed with: neel@ Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/pit_8254.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Oct 4 22:05:23 2013 (r256061) +++ head/usr.sbin/bhyve/bhyverun.c Fri Oct 4 23:29:07 2013 (r256062) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -61,9 +60,6 @@ __FBSDID("$FreeBSD$"); #include "spinup_ap.h" #include "rtc.h" -#define DEFAULT_GUEST_HZ 100 -#define DEFAULT_GUEST_TSLICE 200 - #define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */ #define VMEXIT_SWITCH 0 /* force vcpu switch in mux mode */ @@ -77,14 +73,11 @@ __FBSDID("$FreeBSD$"); typedef int (*vmexit_handler_t)(struct vmctx *, struct vm_exit *, int *vcpu); -int guest_tslice = DEFAULT_GUEST_TSLICE; -int guest_hz = DEFAULT_GUEST_HZ; char *vmname; int guest_ncpus; static int pincpu = -1; -static int guest_vcpu_mux; static int guest_vmexit_on_hlt, guest_vmexit_on_pause, disable_x2apic; static int foundcpus; @@ -102,7 +95,7 @@ static void vm_loop(struct vmctx *ctx, i struct vm_exit vmexit[VM_MAXCPU]; -struct fbsdstats { +struct bhyvestats { uint64_t vmexit_bogus; uint64_t vmexit_bogus_switch; uint64_t vmexit_hlt; @@ -125,28 +118,24 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehABHIP][-g ][-z ][-s ]" - "[-S ][-p pincpu][-n ][-m lowmem][-M highmem]" + "Usage: %s [-aehAHIP][-g ][-s ][-S ]" + "[-c vcpus][-p pincpu][-m mem]" " \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" " -g: gdb port (default is %d and 0 means don't open)\n" " -c: # cpus (default 1)\n" " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" - " -B: inject breakpoint exception on vm entry\n" " -H: vmexit from the guest on hlt\n" " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" " -e: exit on unhandled i/o access\n" " -h: help\n" - " -z: guest hz (default is %d)\n" " -s: PCI slot config\n" " -S: legacy PCI slot config\n" - " -m: memory size in MB\n" - " -x: mux vcpus to 1 hcpu\n" - " -t: mux vcpu timeslice hz (default %d)\n", - progname, DEFAULT_GDB_PORT, DEFAULT_GUEST_HZ, - DEFAULT_GUEST_TSLICE); + " -m: memory size in MB\n", + progname, DEFAULT_GDB_PORT); + exit(code); } @@ -178,13 +167,6 @@ fbsdrun_vmexit_on_hlt(void) return (guest_vmexit_on_hlt); } -int -fbsdrun_muxed(void) -{ - - return (guest_vcpu_mux); -} - static void * fbsdrun_start_thread(void *param) { @@ -226,7 +208,7 @@ fbsdrun_addcpu(struct vmctx *ctx, int vc vmexit[vcpu].rip = rip; vmexit[vcpu].inst_length = 0; - if (vcpu == BSP || !guest_vcpu_mux){ + if (vcpu == BSP) { mt_vmm_info[vcpu].mt_ctx = ctx; mt_vmm_info[vcpu].mt_vcpu = vcpu; @@ -264,17 +246,10 @@ static int vmexit_handle_notify(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu, uint32_t eax) { -#if PG_DEBUG /* put all types of debug here */ - if (eax == 0) { - pause_noswitch = 1; - } else if (eax == 1) { - pause_noswitch = 0; - } else { - pause_noswitch = 0; - if (eax == 5) { - vm_set_capability(ctx, *pvcpu, VM_CAP_MTRAP_EXIT, 1); - } - } +#if BHYVE_DEBUG + /* + * put guest-driven debug here + */ #endif return (VMEXIT_CONTINUE); } @@ -337,11 +312,6 @@ vmexit_wrmsr(struct vmctx *ctx, struct v newcpu = emulate_wrmsr(ctx, *pvcpu, vme->u.msr.code,vme->u.msr.wval); - if (guest_vcpu_mux && *pvcpu != newcpu) { - retval = VMEXIT_SWITCH; - *pvcpu = newcpu; - } - return (retval); } @@ -354,11 +324,6 @@ vmexit_spinup_ap(struct vmctx *ctx, stru newcpu = spinup_ap(ctx, *pvcpu, vme->u.spinup_ap.vcpu, vme->u.spinup_ap.rip); - if (guest_vcpu_mux && *pvcpu != newcpu) { - retval = VMEXIT_SWITCH; - *pvcpu = newcpu; - } - return (retval); } @@ -378,58 +343,42 @@ vmexit_vmx(struct vmctx *ctx, struct vm_ return (VMEXIT_ABORT); } -static int bogus_noswitch = 1; - static int vmexit_bogus(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + stats.vmexit_bogus++; - if (!guest_vcpu_mux || guest_ncpus == 1 || bogus_noswitch) { - return (VMEXIT_RESTART); - } else { - stats.vmexit_bogus_switch++; - vmexit->inst_length = 0; - *pvcpu = -1; - return (VMEXIT_SWITCH); - } + return (VMEXIT_RESTART); } static int vmexit_hlt(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + stats.vmexit_hlt++; - if (fbsdrun_muxed()) { - *pvcpu = -1; - return (VMEXIT_SWITCH); - } else { - /* - * Just continue execution with the next instruction. We use - * the HLT VM exit as a way to be friendly with the host - * scheduler. - */ - return (VMEXIT_CONTINUE); - } -} -static int pause_noswitch; + /* + * Just continue execution with the next instruction. We use + * the HLT VM exit as a way to be friendly with the host + * scheduler. + */ + return (VMEXIT_CONTINUE); +} static int vmexit_pause(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + stats.vmexit_pause++; - if (fbsdrun_muxed() && !pause_noswitch) { - *pvcpu = -1; - return (VMEXIT_SWITCH); - } else { - return (VMEXIT_CONTINUE); - } + return (VMEXIT_CONTINUE); } static int vmexit_mtrap(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { + stats.vmexit_mtrap++; return (VMEXIT_RESTART); @@ -460,39 +409,6 @@ vmexit_paging(struct vmctx *ctx, struct return (VMEXIT_CONTINUE); } -static void -sigalrm(int sig) -{ - return; -} - -static void -setup_timeslice(void) -{ - struct sigaction sa; - struct itimerval itv; - int error; - - /* - * Setup a realtime timer to generate a SIGALRM at a - * frequency of 'guest_tslice' ticks per second. - */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = sigalrm; - - error = sigaction(SIGALRM, &sa, NULL); - assert(error == 0); - - itv.it_interval.tv_sec = 0; - itv.it_interval.tv_usec = 1000000 / guest_tslice; - itv.it_value.tv_sec = 0; - itv.it_value.tv_usec = 1000000 / guest_tslice; - - error = setitimer(ITIMER_REAL, &itv, NULL); - assert(error == 0); -} - static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, [VM_EXITCODE_VMX] = vmexit_vmx, @@ -511,9 +427,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin int error, rc, prevcpu; enum vm_exitcode exitcode; - if (guest_vcpu_mux) - setup_timeslice(); - if (pincpu >= 0) { CPU_ZERO(&mask); CPU_SET(pincpu + vcpu, &mask); @@ -550,15 +463,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin rc = (*handler[exitcode])(ctx, &vmexit[vcpu], &vcpu); switch (rc) { - case VMEXIT_SWITCH: - assert(guest_vcpu_mux); - if (vcpu == -1) { - stats.cpu_switch_rotate++; - vcpu = fbsdrun_get_next_cpu(prevcpu); - } else { - stats.cpu_switch_direct++; - } - /* fall through */ case VMEXIT_CONTINUE: rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; break; @@ -594,21 +498,20 @@ num_vcpus_allowed(struct vmctx *ctx) int main(int argc, char *argv[]) { - int c, error, gdb_port, inject_bkpt, tmp, err, ioapic, bvmcons; + int c, error, gdb_port, tmp, err, ioapic, bvmcons; int max_vcpus; struct vmctx *ctx; uint64_t rip; size_t memsize; bvmcons = 0; - inject_bkpt = 0; progname = basename(argv[0]); gdb_port = DEFAULT_GDB_PORT; guest_ncpus = 1; ioapic = 0; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehABHIPxp:g:c:z:s:S:n:m:")) != -1) { + while ((c = getopt(argc, argv, "abehAHIPp:g:c:s:S:m:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -619,12 +522,6 @@ main(int argc, char *argv[]) case 'b': bvmcons = 1; break; - case 'B': - inject_bkpt = 1; - break; - case 'x': - guest_vcpu_mux = 1; - break; case 'p': pincpu = atoi(optarg); break; @@ -634,12 +531,6 @@ main(int argc, char *argv[]) case 'g': gdb_port = atoi(optarg); break; - case 'z': - guest_hz = atoi(optarg); - break; - case 't': - guest_tslice = atoi(optarg); - break; case 's': if (pci_parse_slot(optarg, 0) != 0) exit(1); @@ -677,16 +568,6 @@ main(int argc, char *argv[]) if (argc != 1) usage(1); - /* No need to mux if guest is uni-processor */ - if (guest_ncpus <= 1) - guest_vcpu_mux = 0; - - /* vmexit on hlt if guest is muxed */ - if (guest_vcpu_mux) { - guest_vmexit_on_hlt = 1; - guest_vmexit_on_pause = 1; - } - vmname = argv[0]; ctx = vm_open(vmname); @@ -765,11 +646,6 @@ main(int argc, char *argv[]) error = vm_get_register(ctx, BSP, VM_REG_GUEST_RIP, &rip); assert(error == 0); - if (inject_bkpt) { - error = vm_inject_event(ctx, BSP, VM_HW_EXCEPTION, IDT_BP); - assert(error == 0); - } - /* * build the guest tables, MP etc. */ Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Fri Oct 4 22:05:23 2013 (r256061) +++ head/usr.sbin/bhyve/bhyverun.h Fri Oct 4 23:29:07 2013 (r256062) @@ -36,8 +36,6 @@ #endif struct vmctx; -extern int guest_hz; -extern int guest_tslice; extern int guest_ncpus; extern char *vmname; Modified: head/usr.sbin/bhyve/pit_8254.c ============================================================================== --- head/usr.sbin/bhyve/pit_8254.c Fri Oct 4 22:05:23 2013 (r256061) +++ head/usr.sbin/bhyve/pit_8254.c Fri Oct 4 23:29:07 2013 (r256062) @@ -153,10 +153,10 @@ pit_update_counter(struct counter *c, in * of the program. * * If the counter's initial value is not programmed we - * assume a value that would be set to generate 'guest_hz' + * assume a value that would be set to generate 100 * interrupts per second. */ - c->initial = TIMER_DIV(PIT_8254_FREQ, guest_hz); + c->initial = TIMER_DIV(PIT_8254_FREQ, 100); gettimeofday(&c->tv, NULL); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 01:56:53 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id DF7E7CDD; Sat, 5 Oct 2013 01:56:53 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pb0-x22f.google.com (mail-pb0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB3B72251; Sat, 5 Oct 2013 01:56:53 +0000 (UTC) Received: by mail-pb0-f47.google.com with SMTP id rr4so4706948pbb.6 for ; Fri, 04 Oct 2013 18:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZQg8RR10MzKx2NI8/5QBdWnL9FJnn08hBIZXXDVbTdE=; b=XgF/VosTWHftqgdDdd1aFYr3GMyMUK/w/WEs2QL7psc2hlyi/g9FNTMBOGWr7/b2wt pwdRwvzupBxipoyiLeZTQcCfuWZWhJqvFTKGWxSwtgEZd7GnIMcW/fxMQHB7/5UAAkdz nK988m9U0xvq/6IX/7gsZXb32a2xkB/TIptQVaEH10AsVKzhzcITdHK6Lke+tVwiQHc8 RRSFc/KjSWymq2WAHIDM+oz3uM9LTVnlL75m/LIkt03XfqCdfQxETQxs7Gv8m778wmEb wiZYUIYeXUK85BhYHvK6ZLpwCJl4tHUYyQNi3C+Yj1tlEjjknkyfzknPs2z1mdYxj81N xAvQ== MIME-Version: 1.0 X-Received: by 10.67.14.231 with SMTP id fj7mr18794755pad.115.1380938212812; Fri, 04 Oct 2013 18:56:52 -0700 (PDT) Received: by 10.68.253.162 with HTTP; Fri, 4 Oct 2013 18:56:52 -0700 (PDT) In-Reply-To: <201310041831.r94IVcLJ067283@svn.freebsd.org> References: <201310041831.r94IVcLJ067283@svn.freebsd.org> Date: Fri, 4 Oct 2013 21:56:52 -0400 Message-ID: Subject: Re: svn commit: r256056 - head/usr.sbin/bhyve From: Aryeh Friedman To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 01:56:54 -0000 > Log: > Import Zhixiang Yu's GSoC'13 AHCI emulation: > https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI > > This provides ICH8 SATA disk and ATAPI ports, selectable > via the bhyve slot command-line parameter: > > SATA > -s ,ahci-hd, > > ATAPI > -s ,ahci-cd, > Does this mean it will now take /dev/cdX as a parameter? From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 16:22:34 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 9BAA6FF6; Sat, 5 Oct 2013 16:22:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6F229DC; Sat, 5 Oct 2013 16:22:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95GMYKT094471; Sat, 5 Oct 2013 16:22:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95GMYvk094470; Sat, 5 Oct 2013 16:22:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310051622.r95GMYvk094470@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 5 Oct 2013 16:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256065 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 16:22:34 -0000 Author: trasz Date: Sat Oct 5 16:22:33 2013 New Revision: 256065 URL: http://svnweb.freebsd.org/changeset/base/256065 Log: Split cfiscsi_datamove() in two; no functional changes. Approved by: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Oct 5 16:21:01 2013 (r256064) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Oct 5 16:22:33 2013 (r256065) @@ -2239,20 +2239,16 @@ cfiscsi_lun_disable(void *arg, struct ct } static void -cfiscsi_datamove(union ctl_io *io) +cfiscsi_datamove_in(union ctl_io *io) { struct cfiscsi_session *cs; struct icl_pdu *request, *response; const struct iscsi_bhs_scsi_command *bhssc; struct iscsi_bhs_data_in *bhsdi; - struct iscsi_bhs_r2t *bhsr2t; - struct cfiscsi_data_wait *cdw; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; size_t copy_len, len, off; const char *addr; int ctl_sg_count, error, i; - uint32_t target_transfer_tag; - bool done; request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; cs = PDU_SESSION(request); @@ -2278,215 +2274,240 @@ cfiscsi_datamove(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { #if 0 - if (ctl_sg_count > 1) - CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); + if (ctl_sg_count > 1) + CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); #endif - /* - * This is the offset within the current SCSI command; - * i.e. for the first call of datamove(), it will be 0, - * and for subsequent ones it will be the sum of lengths - * of previous ones. - */ - off = htonl(io->scsiio.kern_rel_offset); - if (off > 1) - CFISCSI_SESSION_DEBUG(cs, "off = %zd", off); - - i = 0; - addr = NULL; - len = 0; - response = NULL; - bhsdi = NULL; - for (;;) { - KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); + /* + * This is the offset within the current SCSI command; + * i.e. for the first call of datamove(), it will be 0, + * and for subsequent ones it will be the sum of lengths + * of previous ones. + */ + off = htonl(io->scsiio.kern_rel_offset); + if (off > 1) + CFISCSI_SESSION_DEBUG(cs, "off = %zd", off); + + i = 0; + addr = NULL; + len = 0; + response = NULL; + bhsdi = NULL; + for (;;) { + KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); + if (response == NULL) { + response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { - response = - cfiscsi_pdu_new_response(request, M_NOWAIT); - if (response == NULL) { - CFISCSI_SESSION_WARN(cs, "failed to " - "allocate memory; dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - return; - } - bhsdi = (struct iscsi_bhs_data_in *) - response->ip_bhs; - bhsdi->bhsdi_opcode = - ISCSI_BHS_OPCODE_SCSI_DATA_IN; - bhsdi->bhsdi_initiator_task_tag = - bhssc->bhssc_initiator_task_tag; - bhsdi->bhsdi_datasn = - htonl(PDU_EXPDATASN(request)); - PDU_EXPDATASN(request)++; - bhsdi->bhsdi_buffer_offset = htonl(off); - } - - if (len == 0) { - addr = ctl_sglist[i].addr; - len = ctl_sglist[i].len; - KASSERT(len > 0, ("len <= 0")); - } - - copy_len = len; - if (response->ip_data_len + copy_len > - cs->cs_max_data_segment_length) - copy_len = cs->cs_max_data_segment_length - - response->ip_data_len; - KASSERT(copy_len <= len, ("copy_len > len")); - error = icl_pdu_append_data(response, addr, copy_len, M_NOWAIT); - if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); icl_pdu_free(request); - icl_pdu_free(response); cfiscsi_session_terminate(cs); return; } - addr += copy_len; - len -= copy_len; - off += copy_len; - io->scsiio.ext_data_filled += copy_len; + bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; + bhsdi->bhsdi_opcode = ISCSI_BHS_OPCODE_SCSI_DATA_IN; + bhsdi->bhsdi_initiator_task_tag = + bhssc->bhssc_initiator_task_tag; + bhsdi->bhsdi_datasn = htonl(PDU_EXPDATASN(request)); + PDU_EXPDATASN(request)++; + bhsdi->bhsdi_buffer_offset = htonl(off); + } - if (len == 0) { - /* - * End of scatter-gather segment; - * proceed to the next one... - */ - if (i == ctl_sg_count - 1) { - /* - * ... unless this was the last one. - */ - break; - } - i++; - } + if (len == 0) { + addr = ctl_sglist[i].addr; + len = ctl_sglist[i].len; + KASSERT(len > 0, ("len <= 0")); + } - if (response->ip_data_len == - cs->cs_max_data_segment_length) { + copy_len = len; + if (response->ip_data_len + copy_len > + cs->cs_max_data_segment_length) + copy_len = cs->cs_max_data_segment_length - + response->ip_data_len; + KASSERT(copy_len <= len, ("copy_len > len")); + error = icl_pdu_append_data(response, addr, copy_len, M_NOWAIT); + if (error != 0) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + icl_pdu_free(response); + cfiscsi_session_terminate(cs); + return; + } + addr += copy_len; + len -= copy_len; + off += copy_len; + io->scsiio.ext_data_filled += copy_len; + + if (len == 0) { + /* + * End of scatter-gather segment; + * proceed to the next one... + */ + if (i == ctl_sg_count - 1) { /* - * Can't stuff more data into the current PDU; - * queue it. Note that's not enough to check - * for kern_data_resid == 0 instead; there - * may be several Data-In PDUs for the final - * call to cfiscsi_datamove(), and we want - * to set the F flag only on the last of them. + * ... unless this was the last one. */ - if (off == io->scsiio.kern_total_len) - bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; - KASSERT(response->ip_data_len > 0, - ("sending empty Data-In")); - cfiscsi_pdu_queue(response); - response = NULL; - bhsdi = NULL; + break; } + i++; } - KASSERT(i == ctl_sg_count - 1, ("missed SG segment")); - KASSERT(len == 0, ("missed data from SG segment")); - if (response != NULL) { - if (off == io->scsiio.kern_total_len) { + + if (response->ip_data_len == cs->cs_max_data_segment_length) { + /* + * Can't stuff more data into the current PDU; + * queue it. Note that's not enough to check + * for kern_data_resid == 0 instead; there + * may be several Data-In PDUs for the final + * call to cfiscsi_datamove(), and we want + * to set the F flag only on the last of them. + */ + if (off == io->scsiio.kern_total_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; - } else { - CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " - "have %zd, need %zd", off, - (size_t)io->scsiio.kern_total_len); - } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); + response = NULL; + bhsdi = NULL; } + } + KASSERT(i == ctl_sg_count - 1, ("missed SG segment")); + KASSERT(len == 0, ("missed data from SG segment")); + if (response != NULL) { + if (off == io->scsiio.kern_total_len) { + bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; + } else { + CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " + "have %zd, need %zd", off, + (size_t)io->scsiio.kern_total_len); + } + KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); + cfiscsi_pdu_queue(response); + } - io->scsiio.be_move_done(io); - } else { - CFISCSI_SESSION_LOCK(cs); - target_transfer_tag = cs->cs_target_transfer_tag; - cs->cs_target_transfer_tag++; - CFISCSI_SESSION_UNLOCK(cs); + io->scsiio.be_move_done(io); +} + +static void +cfiscsi_datamove_out(union ctl_io *io) +{ + struct cfiscsi_session *cs; + struct icl_pdu *request, *response; + const struct iscsi_bhs_scsi_command *bhssc; + struct iscsi_bhs_r2t *bhsr2t; + struct cfiscsi_data_wait *cdw; + uint32_t target_transfer_tag; + bool done; + + request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + cs = PDU_SESSION(request); + + bhssc = (const struct iscsi_bhs_scsi_command *)request->ip_bhs; + KASSERT((bhssc->bhssc_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == + ISCSI_BHS_OPCODE_SCSI_COMMAND, + ("bhssc->bhssc_opcode != ISCSI_BHS_OPCODE_SCSI_COMMAND")); + + /* + * We need to record it so that we can properly report + * underflow/underflow. + */ + PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; + + CFISCSI_SESSION_LOCK(cs); + target_transfer_tag = cs->cs_target_transfer_tag; + cs->cs_target_transfer_tag++; + CFISCSI_SESSION_UNLOCK(cs); #if 0 - CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " - "task tag 0x%x, target transfer tag 0x%x", - bhssc->bhssc_initiator_task_tag, target_transfer_tag); + CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " + "task tag 0x%x, target transfer tag 0x%x", + bhssc->bhssc_initiator_task_tag, target_transfer_tag); #endif - cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); - if (cdw == NULL) { - CFISCSI_SESSION_WARN(cs, "failed to " - "allocate memory; dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); + cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); + if (cdw == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + } + cdw->cdw_ctl_io = io; + cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); + cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; + + if (cs->cs_immediate_data && icl_pdu_data_segment_length(request) > 0) { + done = cfiscsi_handle_data_segment(request, cdw); + if (done) { + uma_zfree(cfiscsi_data_wait_zone, cdw); + io->scsiio.be_move_done(io); + return; } - cdw->cdw_ctl_io = io; - cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); - cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - - if (cs->cs_immediate_data && - icl_pdu_data_segment_length(request) > 0) { - done = cfiscsi_handle_data_segment(request, cdw); - if (done) { - uma_zfree(cfiscsi_data_wait_zone, cdw); - io->scsiio.be_move_done(io); - return; - } #if 0 - if (io->scsiio.ext_data_filled != 0) - CFISCSI_SESSION_DEBUG(cs, "got %zd bytes of immediate data, need %zd", - io->scsiio.ext_data_filled, io->scsiio.kern_data_len); + if (io->scsiio.ext_data_filled != 0) + CFISCSI_SESSION_DEBUG(cs, "got %zd bytes of immediate data, need %zd", + io->scsiio.ext_data_filled, io->scsiio.kern_data_len); #endif - } + } - CFISCSI_SESSION_LOCK(cs); - TAILQ_INSERT_TAIL(&cs->cs_waiting_for_data_out, cdw, cdw_next); - CFISCSI_SESSION_UNLOCK(cs); + CFISCSI_SESSION_LOCK(cs); + TAILQ_INSERT_TAIL(&cs->cs_waiting_for_data_out, cdw, cdw_next); + CFISCSI_SESSION_UNLOCK(cs); - /* - * XXX: We should limit the number of outstanding R2T PDUs - * per task to MaxOutstandingR2T. - */ - response = cfiscsi_pdu_new_response(request, M_NOWAIT); - if (response == NULL) { - CFISCSI_SESSION_WARN(cs, "failed to " - "allocate memory; dropping connection"); - icl_pdu_free(request); - cfiscsi_session_terminate(cs); - } - bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; - bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; - bhsr2t->bhsr2t_flags = 0x80; - bhsr2t->bhsr2t_lun = bhssc->bhssc_lun; - bhsr2t->bhsr2t_initiator_task_tag = - bhssc->bhssc_initiator_task_tag; - bhsr2t->bhsr2t_target_transfer_tag = - htonl(target_transfer_tag); - /* - * XXX: Here we assume that cfiscsi_datamove() won't ever - * be running concurrently on several CPUs for a given - * command. - */ - bhsr2t->bhsr2t_r2tsn = htonl(PDU_R2TSN(request)); - PDU_R2TSN(request)++; - /* - * This is the offset within the current SCSI command; - * i.e. for the first call of datamove(), it will be 0, - * and for subsequent ones it will be the sum of lengths - * of previous ones. - * - * The ext_data_filled is to account for unsolicited - * (immediate) data that might have already arrived. - */ - bhsr2t->bhsr2t_buffer_offset = - htonl(io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled); - /* - * This is the total length (sum of S/G lengths) this call - * to cfiscsi_datamove() is supposed to handle. - * - * XXX: Limit it to MaxBurstLength. - */ - bhsr2t->bhsr2t_desired_data_transfer_length = - htonl(io->scsiio.kern_data_len - io->scsiio.ext_data_filled); - cfiscsi_pdu_queue(response); + /* + * XXX: We should limit the number of outstanding R2T PDUs + * per task to MaxOutstandingR2T. + */ + response = cfiscsi_pdu_new_response(request, M_NOWAIT); + if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); } + bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; + bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; + bhsr2t->bhsr2t_flags = 0x80; + bhsr2t->bhsr2t_lun = bhssc->bhssc_lun; + bhsr2t->bhsr2t_initiator_task_tag = bhssc->bhssc_initiator_task_tag; + bhsr2t->bhsr2t_target_transfer_tag = htonl(target_transfer_tag); + /* + * XXX: Here we assume that cfiscsi_datamove() won't ever + * be running concurrently on several CPUs for a given + * command. + */ + bhsr2t->bhsr2t_r2tsn = htonl(PDU_R2TSN(request)); + PDU_R2TSN(request)++; + /* + * This is the offset within the current SCSI command; + * i.e. for the first call of datamove(), it will be 0, + * and for subsequent ones it will be the sum of lengths + * of previous ones. + * + * The ext_data_filled is to account for unsolicited + * (immediate) data that might have already arrived. + */ + bhsr2t->bhsr2t_buffer_offset = + htonl(io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled); + /* + * This is the total length (sum of S/G lengths) this call + * to cfiscsi_datamove() is supposed to handle. + * + * XXX: Limit it to MaxBurstLength. + */ + bhsr2t->bhsr2t_desired_data_transfer_length = + htonl(io->scsiio.kern_data_len - io->scsiio.ext_data_filled); + cfiscsi_pdu_queue(response); +} + +static void +cfiscsi_datamove(union ctl_io *io) +{ + + if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) + cfiscsi_datamove_in(io); + else + cfiscsi_datamove_out(io); } static void From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 18:07:25 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 80BF4B5D; Sat, 5 Oct 2013 18:07:25 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0B32E34; Sat, 5 Oct 2013 18:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95I7Pva048590; Sat, 5 Oct 2013 18:07:25 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95I7P0M048589; Sat, 5 Oct 2013 18:07:25 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201310051807.r95I7P0M048589@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 5 Oct 2013 18:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256066 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 18:07:25 -0000 Author: bryanv Date: Sat Oct 5 18:07:24 2013 New Revision: 256066 URL: http://svnweb.freebsd.org/changeset/base/256066 Log: Do not hold the vtnet Rx queue lock when calling up into the stack This matches other similar drivers and avoids various LOR warnings. Approved by: re (marius) Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 (r256065) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 (r256066) @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s rxq->vtnrx_stats.vrxs_ipackets++; rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; - /* VTNET_RXQ_UNLOCK(rxq); */ + VTNET_RXQ_UNLOCK(rxq); (*ifp->if_input)(ifp, m); - /* VTNET_RXQ_LOCK(rxq); */ + VTNET_RXQ_LOCK(rxq); } static int @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) m_adj(m, adjsz); vtnet_rxq_input(rxq, m, hdr); + + /* Must recheck after dropping the Rx lock. */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; } if (deq > 0) From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 18:53:04 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 26FCF9F2; Sat, 5 Oct 2013 18:53:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12B622021; Sat, 5 Oct 2013 18:53:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95Ir3I8073480; Sat, 5 Oct 2013 18:53:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95Ir3OP073479; Sat, 5 Oct 2013 18:53:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201310051853.r95Ir3OP073479@svn.freebsd.org> From: Alan Cox Date: Sat, 5 Oct 2013 18:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256068 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 18:53:04 -0000 Author: alc Date: Sat Oct 5 18:53:03 2013 New Revision: 256068 URL: http://svnweb.freebsd.org/changeset/base/256068 Log: Tidy up kmeminit(): Since r245575, 'nmbclusters' is calculated after kmeminit() runs, so it contributes nothing to 'vm_kmem_size'; update a comment to reflect that r254025 replaced the kmem submap with the kmem arena. Reviewed by: kib Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat Oct 5 18:41:27 2013 (r256067) +++ head/sys/kern/kern_malloc.c Sat Oct 5 18:53:03 2013 (r256068) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -699,10 +698,10 @@ kmeminit(void) * VM_KMEM_SIZE_MAX is dependent on the maximum KVA space * available. * - * Note that the kmem_map is also used by the zone allocator, + * Note that the kmem arena is also used by the zone allocator, * so make sure that there is enough space. */ - vm_kmem_size = VM_KMEM_SIZE + nmbclusters * PAGE_SIZE; + vm_kmem_size = VM_KMEM_SIZE; mem_size = cnt.v_page_count; #if defined(VM_KMEM_SIZE_SCALE) From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 19:17:57 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 6C3812FF; Sat, 5 Oct 2013 19:17:57 +0000 (UTC) (envelope-from hiren@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58DD92150; Sat, 5 Oct 2013 19:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95JHv4E086663; Sat, 5 Oct 2013 19:17:57 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95JHuBj086661; Sat, 5 Oct 2013 19:17:56 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201310051917.r95JHuBj086661@svn.freebsd.org> From: Hiren Panchasara Date: Sat, 5 Oct 2013 19:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256069 - in head/sys/dev: e1000 ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 19:17:57 -0000 Author: hiren Date: Sat Oct 5 19:17:56 2013 New Revision: 256069 URL: http://svnweb.freebsd.org/changeset/base/256069 Log: Expose system level ixgbe sysctls. Device level sysctls are already exposed as dev.ix. Fixing the case where number of queues for igb is auto-tuned and hw.igb.num_queues does not return current/updated value. Reviewed by: jfv Approved by: re (delphij) MFC after: 2 weeks Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Oct 5 18:53:03 2013 (r256068) +++ head/sys/dev/e1000/if_igb.c Sat Oct 5 19:17:56 2013 (r256069) @@ -2883,6 +2883,9 @@ igb_setup_msix(struct adapter *adapter) if (queues > maxqueues) queues = maxqueues; + /* reflect correct sysctl value */ + igb_num_queues = queues; + /* ** One vector (RX/TX pair) per queue ** plus an additional for Link interrupt Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Oct 5 18:53:03 2013 (r256068) +++ head/sys/dev/ixgbe/ixgbe.c Sat Oct 5 19:17:56 2013 (r256069) @@ -234,6 +234,9 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); ** TUNEABLE PARAMETERS: */ +static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD, 0, + "IXGBE driver parameters"); + /* ** AIM: Adaptive Interrupt Moderation ** which means that the interrupt rate @@ -242,17 +245,29 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); */ static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); +SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0, + "Enable adaptive interrupt moderation"); static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); +SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, + &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second"); /* How many packets rxeof tries to clean at a time */ static int ixgbe_rx_process_limit = 256; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); +SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &ixgbe_rx_process_limit, 0, + "Maximum number of received packets to process at a time," + "-1 means unlimited"); /* How many packets txeof tries to clean at a time */ static int ixgbe_tx_process_limit = 256; TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit); +SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, + &ixgbe_tx_process_limit, 0, + "Maximum number of sent packets to process at a time," + "-1 means unlimited"); /* ** Smart speed setting, default to on @@ -269,6 +284,8 @@ static int ixgbe_smart_speed = ixgbe_sma */ static int ixgbe_enable_msix = 1; TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); +SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, + "Enable MSI-X interrupts"); /* * Number of Queues, can be set to 0, @@ -278,6 +295,8 @@ TUNABLE_INT("hw.ixgbe.enable_msix", &ixg */ static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); +SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, + "Number of queues to configure, 0 indicates autoconfigure"); /* ** Number of TX descriptors per ring, @@ -286,10 +305,14 @@ TUNABLE_INT("hw.ixgbe.num_queues", &ixgb */ static int ixgbe_txd = PERFORM_TXD; TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); +SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, + "Number of receive descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); +SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0, + "Number of receive descriptors per queue"); /* ** Defining this on will allow the use @@ -2442,6 +2465,9 @@ ixgbe_setup_msix(struct adapter *adapter else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; + /* reflect correct sysctl value */ + ixgbe_num_queues = queues; + /* ** Want one vector (RX/TX pair) per queue ** plus an additional for Link. From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 19:51:10 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 6FD16B93; Sat, 5 Oct 2013 19:51:10 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40C4E22DF; Sat, 5 Oct 2013 19:51:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95JpARn004359; Sat, 5 Oct 2013 19:51:10 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95Jp9Jt004357; Sat, 5 Oct 2013 19:51:09 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310051951.r95Jp9Jt004357@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 5 Oct 2013 19:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256071 - in head/sys: dev/hyperv/vmbus x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 19:51:10 -0000 Author: gibbs Date: Sat Oct 5 19:51:09 2013 New Revision: 256071 URL: http://svnweb.freebsd.org/changeset/base/256071 Log: Correct panic caused by attaching both Xen PV and HyperV virtualization aware drivers on Xen hypervisors that advertise support for some HyperV features. x86/xen/hvm.c: When running in HVM mode on a Xen hypervisor, set vm_guest to VM_GUEST_XEN so other virtualization aware components in the FreeBSD kernel can detect this mode is active. dev/hyperv/vmbus/hv_hv.c: Use vm_guest to ignore Xen's HyperV emulation when Xen is detected and Xen PV drivers are active. Reported by: Shanker Balan Submitted by: Roger Pau Monné Sponsored by: Citrix Systems R&D Reviewed by: gibbs Approved by: re (Xen blanket) Modified: head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/x86/xen/hvm.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Sat Oct 5 19:29:48 2013 (r256070) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Sat Oct 5 19:51:09 2013 (r256071) @@ -29,6 +29,8 @@ /** * Implements low-level interactions with Hypver-V/Azure */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -88,6 +90,14 @@ hv_vmbus_query_hypervisor_presence(void) { u_int regs[4]; int hyper_v_detected = 0; + + /* + * When Xen is detected and native Xen PV support is enabled, + * ignore Xen's HyperV emulation. + */ + if (vm_guest == VM_GUEST_XEN) + return (0); + do_cpuid(1, regs); if (regs[2] & 0x80000000) { /* if(a hypervisor is detected) */ /* make sure this really is Hyper-V */ Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Sat Oct 5 19:29:48 2013 (r256070) +++ head/sys/x86/xen/hvm.c Sat Oct 5 19:51:09 2013 (r256071) @@ -700,6 +700,7 @@ xen_hvm_init(enum xen_hvm_init_type init setup_xen_features(); cpu_ops = xen_hvm_cpu_ops; + vm_guest = VM_GUEST_XEN; break; case XEN_HVM_INIT_RESUME: if (error != 0) From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 21:12:57 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id CE84535C; Sat, 5 Oct 2013 21:12:57 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D5502698; Sat, 5 Oct 2013 21:12:57 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1VSVNh-0007Zp-SQ; Sat, 05 Oct 2013 21:11:05 +0400 Message-ID: <525080A6.6020505@FreeBSD.org> Date: Sun, 06 Oct 2013 01:12:06 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130728 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bryan Venteicher Subject: Re: svn commit: r256066 - head/sys/dev/virtio/network References: <201310051807.r95I7P0M048589@svn.freebsd.org> In-Reply-To: <201310051807.r95I7P0M048589@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OKFVRDOILALMDSUPPHHS" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 21:12:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OKFVRDOILALMDSUPPHHS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05.10.2013 22:07, Bryan Venteicher wrote: > Author: bryanv > Date: Sat Oct 5 18:07:24 2013 > New Revision: 256066 > URL: http://svnweb.freebsd.org/changeset/base/256066 >=20 > Log: > Do not hold the vtnet Rx queue lock when calling up into the stack Do you measure performance penalty for this? > =20 > This matches other similar drivers and avoids various LOR warnings. We're currently trying to eliminate such things in other drivers like ixgbe, maybe there can be some other way to eliminate possible LORs? > =20 > Approved by: re (marius) >=20 > Modified: > head/sys/dev/virtio/network/if_vtnet.c >=20 > Modified: head/sys/dev/virtio/network/if_vtnet.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/virtio/network/if_vtnet.c Sat Oct 5 16:22:33 2013 (r2= 56065) > +++ head/sys/dev/virtio/network/if_vtnet.c Sat Oct 5 18:07:24 2013 (r2= 56066) > @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s > rxq->vtnrx_stats.vrxs_ipackets++; > rxq->vtnrx_stats.vrxs_ibytes +=3D m->m_pkthdr.len; > =20 > - /* VTNET_RXQ_UNLOCK(rxq); */ > + VTNET_RXQ_UNLOCK(rxq); > (*ifp->if_input)(ifp, m); > - /* VTNET_RXQ_LOCK(rxq); */ > + VTNET_RXQ_LOCK(rxq); > } > =20 > static int > @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) > m_adj(m, adjsz); > =20 > vtnet_rxq_input(rxq, m, hdr); > + > + /* Must recheck after dropping the Rx lock. */ > + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) =3D=3D 0) > + break; > } > =20 > if (deq > 0) >=20 ------enig2OKFVRDOILALMDSUPPHHS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJQgKsACgkQwcJ4iSZ1q2mXFACeKALmk4J6AXeXeFgdab8uGtm5 nJMAoJURs9Tzu88UJMTgZX7j13gJPcoR =FV4Y -----END PGP SIGNATURE----- ------enig2OKFVRDOILALMDSUPPHHS-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 21:22:36 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 8B4F8614; Sat, 5 Oct 2013 21:22:36 +0000 (UTC) (envelope-from neel@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 725BF26FE; Sat, 5 Oct 2013 21:22:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95LMaJY052303; Sat, 5 Oct 2013 21:22:36 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95LMZBr052297; Sat, 5 Oct 2013 21:22:35 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310052122.r95LMZBr052297@svn.freebsd.org> From: Neel Natu Date: Sat, 5 Oct 2013 21:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256072 - in head: lib/libvmmapi sys/amd64/amd64 sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel sys/amd64/vmm/io usr.sbin/bhyve usr.sbin/bhyvectl usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 21:22:36 -0000 Author: neel Date: Sat Oct 5 21:22:35 2013 New Revision: 256072 URL: http://svnweb.freebsd.org/changeset/base/256072 Log: Merge projects/bhyve_npt_pmap into head. Make the amd64/pmap code aware of nested page table mappings used by bhyve guests. This allows bhyve to associate each guest with its own vmspace and deal with nested page faults in the context of that vmspace. This also enables features like accessed/dirty bit tracking, swapping to disk and transparent superpage promotions of guest memory. Guest vmspace: Each bhyve guest has a unique vmspace to represent the physical memory allocated to the guest. Each memory segment allocated by the guest is mapped into the guest's address space via the 'vmspace->vm_map' and is backed by an object of type OBJT_DEFAULT. pmap types: The amd64/pmap now understands two types of pmaps: PT_X86 and PT_EPT. The PT_X86 pmap type is used by the vmspace associated with the host kernel as well as user processes executing on the host. The PT_EPT pmap is used by the vmspace associated with a bhyve guest. Page Table Entries: The EPT page table entries as mostly similar in functionality to regular page table entries although there are some differences in terms of what bits are used to express that functionality. For e.g. the dirty bit is represented by bit 9 in the nested PTE as opposed to bit 6 in the regular x86 PTE. Therefore the bitmask representing the dirty bit is now computed at runtime based on the type of the pmap. Thus PG_M that was previously a macro now becomes a local variable that is initialized at runtime using 'pmap_modified_bit(pmap)'. An additional wrinkle associated with EPT mappings is that older Intel processors don't have hardware support for tracking accessed/dirty bits in the PTE. This means that the amd64/pmap code needs to emulate these bits to provide proper accounting to the VM subsystem. This is achieved by using the following mapping for EPT entries that need emulation of A/D bits: Bit Position Interpreted By PG_V 52 software (accessed bit emulation handler) PG_RW 53 software (dirty bit emulation handler) PG_A 0 hardware (aka EPT_PG_RD) PG_M 1 hardware (aka EPT_PG_WR) The idea to use the mapping listed above for A/D bit emulation came from Alan Cox (alc@). The final difference with respect to x86 PTEs is that some EPT implementations do not support superpage mappings. This is recorded in the 'pm_flags' field of the pmap. TLB invalidation: The amd64/pmap code has a number of ways to do invalidation of mappings that may be cached in the TLB: single page, multiple pages in a range or the entire TLB. All of these funnel into a single EPT invalidation routine called 'pmap_invalidate_ept()'. This routine bumps up the EPT generation number and sends an IPI to the host cpus that are executing the guest's vcpus. On a subsequent entry into the guest it will detect that the EPT has changed and invalidate the mappings from the TLB. Guest memory access: Since the guest memory is no longer wired we need to hold the host physical page that backs the guest physical page before we can access it. The helper functions 'vm_gpa_hold()/vm_gpa_release()' are available for this purpose. PCI passthru: Guest's with PCI passthru devices will wire the entire guest physical address space. The MMIO BAR associated with the passthru device is backed by a vm_object of type OBJT_SG. An IOMMU domain is created only for guest's that have one or more PCI passthru devices attached to them. Limitations: There isn't a way to map a guest physical page without execute permissions. This is because the amd64/pmap code interprets the guest physical mappings as user mappings since they are numerically below VM_MAXUSER_ADDRESS. Since PG_U shares the same bit position as EPT_PG_EXECUTE all guest mappings become automatically executable. Thanks to Alan Cox and Konstantin Belousov for their rigorous code reviews as well as their support and encouragement. Thanks for John Baldwin for reviewing the use of OBJT_SG as the backing object for pci passthru mmio regions. Special thanks to Peter Holm for testing the patch on short notice. Approved by: re Discussed with: grehan Reviewed by: alc, kib Tested by: pho Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/pmap.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/ept.c head/sys/amd64/vmm/intel/ept.h head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vmx_support.S head/sys/amd64/vmm/io/ppt.c head/sys/amd64/vmm/io/ppt.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_mem.c head/sys/amd64/vmm/vmm_mem.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/rtc.c head/usr.sbin/bhyvectl/bhyvectl.c head/usr.sbin/bhyveload/bhyveload.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat Oct 5 19:51:09 2013 (r256071) +++ head/lib/libvmmapi/vmmapi.c Sat Oct 5 21:22:35 2013 (r256072) @@ -124,7 +124,8 @@ vm_destroy(struct vmctx *vm) } int -vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len) +vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, + int *wired) { int error; struct vm_memory_segment seg; @@ -133,6 +134,8 @@ vm_get_memory_seg(struct vmctx *ctx, vm_ seg.gpa = gpa; error = ioctl(ctx->fd, VM_GET_MEMORY_SEG, &seg); *ret_len = seg.len; + if (wired != NULL) + *wired = seg.wired; return (error); } @@ -741,3 +744,23 @@ vcpu_reset(struct vmctx *vmctx, int vcpu done: return (error); } + +int +vm_get_gpa_pmap(struct vmctx *ctx, uint64_t gpa, uint64_t *pte, int *num) +{ + int error, i; + struct vm_gpa_pte gpapte; + + bzero(&gpapte, sizeof(gpapte)); + gpapte.gpa = gpa; + + error = ioctl(ctx->fd, VM_GET_GPA_PMAP, &gpapte); + + if (error == 0) { + *num = gpapte.ptenum; + for (i = 0; i < gpapte.ptenum; i++) + pte[i] = gpapte.pte[i]; + } + + return (error); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat Oct 5 19:51:09 2013 (r256071) +++ head/lib/libvmmapi/vmmapi.h Sat Oct 5 21:22:35 2013 (r256072) @@ -45,9 +45,11 @@ enum vm_mmap_style { int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); -int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len); +int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, + int *wired); int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len); +int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Oct 5 19:51:09 2013 (r256071) +++ head/sys/amd64/amd64/machdep.c Sat Oct 5 21:22:35 2013 (r256072) @@ -1574,7 +1574,7 @@ getmemsize(caddr_t kmdp, u_int64_t first /* * map page into kernel: valid, read/write,non-cacheable */ - *pte = pa | PG_V | PG_RW | PG_N; + *pte = pa | PG_V | PG_RW | PG_NC_PWT | PG_NC_PCD; invltlb(); tmp = *(int *)ptr; Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Oct 5 19:51:09 2013 (r256071) +++ head/sys/amd64/amd64/pmap.c Sat Oct 5 21:22:35 2013 (r256072) @@ -76,6 +76,8 @@ * SUCH DAMAGE. */ +#define AMD64_NPT_AWARE + #include __FBSDID("$FreeBSD$"); @@ -143,6 +145,120 @@ __FBSDID("$FreeBSD$"); #include #endif +static __inline boolean_t +pmap_emulate_ad_bits(pmap_t pmap) +{ + + return ((pmap->pm_flags & PMAP_EMULATE_AD_BITS) != 0); +} + +static __inline pt_entry_t +pmap_valid_bit(pmap_t pmap) +{ + pt_entry_t mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = X86_PG_V; + break; + case PT_EPT: + if (pmap_emulate_ad_bits(pmap)) + mask = EPT_PG_EMUL_V; + else + mask = EPT_PG_READ; + break; + default: + panic("pmap_valid_bit: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + +static __inline pt_entry_t +pmap_rw_bit(pmap_t pmap) +{ + pt_entry_t mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = X86_PG_RW; + break; + case PT_EPT: + if (pmap_emulate_ad_bits(pmap)) + mask = EPT_PG_EMUL_RW; + else + mask = EPT_PG_WRITE; + break; + default: + panic("pmap_rw_bit: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + +static __inline pt_entry_t +pmap_global_bit(pmap_t pmap) +{ + pt_entry_t mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = X86_PG_G; + break; + case PT_EPT: + mask = 0; + break; + default: + panic("pmap_global_bit: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + +static __inline pt_entry_t +pmap_accessed_bit(pmap_t pmap) +{ + pt_entry_t mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = X86_PG_A; + break; + case PT_EPT: + if (pmap_emulate_ad_bits(pmap)) + mask = EPT_PG_READ; + else + mask = EPT_PG_A; + break; + default: + panic("pmap_accessed_bit: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + +static __inline pt_entry_t +pmap_modified_bit(pmap_t pmap) +{ + pt_entry_t mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = X86_PG_M; + break; + case PT_EPT: + if (pmap_emulate_ad_bits(pmap)) + mask = EPT_PG_WRITE; + else + mask = EPT_PG_M; + break; + default: + panic("pmap_modified_bit: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + #if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ #define PMAP_INLINE __attribute__((__gnu_inline__)) inline @@ -247,6 +363,8 @@ static struct md_page *pv_table; pt_entry_t *CMAP1 = 0; caddr_t CADDR1 = 0; +static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags for x86 pmaps */ + static struct unrhdr pcid_unr; static struct mtx pcid_mtx; int pmap_pcid_enabled = 1; @@ -306,12 +424,12 @@ static void pmap_fill_ptp(pt_entry_t *fi static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va); -static void pmap_pde_attr(pd_entry_t *pde, int cache_bits); +static void pmap_pde_attr(pd_entry_t *pde, int cache_bits, int mask); static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp); static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t sva, vm_prot_t prot); -static void pmap_pte_attr(pt_entry_t *pte, int cache_bits); +static void pmap_pte_attr(pt_entry_t *pte, int cache_bits, int mask); static int pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, struct spglist *free, struct rwlock **lockp); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, @@ -323,7 +441,7 @@ static boolean_t pmap_try_insert_pv_entr vm_page_t m, struct rwlock **lockp); static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde); -static void pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde); +static void pmap_update_pde_invalidate(pmap_t, vm_offset_t va, pd_entry_t pde); static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); @@ -416,7 +534,9 @@ static __inline pdp_entry_t * pmap_pdpe(pmap_t pmap, vm_offset_t va) { pml4_entry_t *pml4e; + pt_entry_t PG_V; + PG_V = pmap_valid_bit(pmap); pml4e = pmap_pml4e(pmap, va); if ((*pml4e & PG_V) == 0) return (NULL); @@ -438,7 +558,9 @@ static __inline pd_entry_t * pmap_pde(pmap_t pmap, vm_offset_t va) { pdp_entry_t *pdpe; + pt_entry_t PG_V; + PG_V = pmap_valid_bit(pmap); pdpe = pmap_pdpe(pmap, va); if (pdpe == NULL || (*pdpe & PG_V) == 0) return (NULL); @@ -460,7 +582,9 @@ static __inline pt_entry_t * pmap_pte(pmap_t pmap, vm_offset_t va) { pd_entry_t *pde; + pt_entry_t PG_V; + PG_V = pmap_valid_bit(pmap); pde = pmap_pde(pmap, va); if (pde == NULL || (*pde & PG_V) == 0) return (NULL); @@ -490,6 +614,8 @@ vtopte(vm_offset_t va) { u_int64_t mask = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + NPML4EPGSHIFT)) - 1); + KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopte on a uva/gpa 0x%0lx", va)); + return (PTmap + ((va >> PAGE_SHIFT) & mask)); } @@ -498,6 +624,8 @@ vtopde(vm_offset_t va) { u_int64_t mask = ((1ul << (NPDEPGSHIFT + NPDPEPGSHIFT + NPML4EPGSHIFT)) - 1); + KASSERT(va >= VM_MAXUSER_ADDRESS, ("vtopde on a uva/gpa 0x%0lx", va)); + return (PDmap + ((va >> PDRSHIFT) & mask)); } @@ -601,22 +729,24 @@ create_pagetables(vm_paddr_t *firstaddr) /* XXX not fully used, underneath 2M pages */ pt_p = (pt_entry_t *)KPTphys; for (i = 0; ptoa(i) < *firstaddr; i++) - pt_p[i] = ptoa(i) | PG_RW | PG_V | PG_G; + pt_p[i] = ptoa(i) | X86_PG_RW | X86_PG_V | X86_PG_G; /* Now map the page tables at their location within PTmap */ pd_p = (pd_entry_t *)KPDphys; for (i = 0; i < nkpt; i++) - pd_p[i] = (KPTphys + ptoa(i)) | PG_RW | PG_V; + pd_p[i] = (KPTphys + ptoa(i)) | X86_PG_RW | X86_PG_V; /* Map from zero to end of allocations under 2M pages */ /* This replaces some of the KPTphys entries above */ for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) - pd_p[i] = (i << PDRSHIFT) | PG_RW | PG_V | PG_PS | PG_G; + pd_p[i] = (i << PDRSHIFT) | X86_PG_RW | X86_PG_V | PG_PS | + X86_PG_G; /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); for (i = 0; i < nkpdpe; i++) - pdp_p[i + KPDPI] = (KPDphys + ptoa(i)) | PG_RW | PG_V | PG_U; + pdp_p[i + KPDPI] = (KPDphys + ptoa(i)) | X86_PG_RW | X86_PG_V | + PG_U; /* * Now, set up the direct map region using 2MB and/or 1GB pages. If @@ -630,36 +760,36 @@ create_pagetables(vm_paddr_t *firstaddr) for (i = NPDEPG * ndm1g, j = 0; i < NPDEPG * ndmpdp; i++, j++) { pd_p[j] = (vm_paddr_t)i << PDRSHIFT; /* Preset PG_M and PG_A because demotion expects it. */ - pd_p[j] |= PG_RW | PG_V | PG_PS | PG_G | - PG_M | PG_A; + pd_p[j] |= X86_PG_RW | X86_PG_V | PG_PS | X86_PG_G | + X86_PG_M | X86_PG_A; } pdp_p = (pdp_entry_t *)DMPDPphys; for (i = 0; i < ndm1g; i++) { pdp_p[i] = (vm_paddr_t)i << PDPSHIFT; /* Preset PG_M and PG_A because demotion expects it. */ - pdp_p[i] |= PG_RW | PG_V | PG_PS | PG_G | - PG_M | PG_A; + pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_PS | X86_PG_G | + X86_PG_M | X86_PG_A; } for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); - pdp_p[i] |= PG_RW | PG_V | PG_U; + pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_U; } /* And recursively map PML4 to itself in order to get PTmap */ p4_p = (pml4_entry_t *)KPML4phys; p4_p[PML4PML4I] = KPML4phys; - p4_p[PML4PML4I] |= PG_RW | PG_V | PG_U; + p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U; /* Connect the Direct Map slot(s) up to the PML4. */ for (i = 0; i < ndmpdpphys; i++) { p4_p[DMPML4I + i] = DMPDPphys + ptoa(i); - p4_p[DMPML4I + i] |= PG_RW | PG_V | PG_U; + p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V | PG_U; } /* Connect the KVA slots up to the PML4 */ for (i = 0; i < NKPML4E; i++) { p4_p[KPML4BASE + i] = KPDPphys + ptoa(i); - p4_p[KPML4BASE + i] |= PG_RW | PG_V | PG_U; + p4_p[KPML4BASE + i] |= X86_PG_RW | X86_PG_V | PG_U; } } @@ -705,6 +835,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ CPU_ZERO(&kernel_pmap->pm_save); TAILQ_INIT(&kernel_pmap->pm_pvchunk); + kernel_pmap->pm_flags = pmap_flags; /* * Initialize the global pv list lock. @@ -948,35 +1079,131 @@ SYSCTL_ULONG(_vm_pmap_pdpe, OID_AUTO, de * Low level helper routines..... ***************************************************/ +static pt_entry_t +pmap_swap_pat(pmap_t pmap, pt_entry_t entry) +{ + int x86_pat_bits = X86_PG_PTE_PAT | X86_PG_PDE_PAT; + + switch (pmap->pm_type) { + case PT_X86: + /* Verify that both PAT bits are not set at the same time */ + KASSERT((entry & x86_pat_bits) != x86_pat_bits, + ("Invalid PAT bits in entry %#lx", entry)); + + /* Swap the PAT bits if one of them is set */ + if ((entry & x86_pat_bits) != 0) + entry ^= x86_pat_bits; + break; + case PT_EPT: + /* + * Nothing to do - the memory attributes are represented + * the same way for regular pages and superpages. + */ + break; + default: + panic("pmap_switch_pat_bits: bad pm_type %d", pmap->pm_type); + } + + return (entry); +} + /* * Determine the appropriate bits to set in a PTE or PDE for a specified * caching mode. */ static int -pmap_cache_bits(int mode, boolean_t is_pde) +pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde) { int cache_bits, pat_flag, pat_idx; if (mode < 0 || mode >= PAT_INDEX_SIZE || pat_index[mode] < 0) panic("Unknown caching mode %d\n", mode); - /* The PAT bit is different for PTE's and PDE's. */ - pat_flag = is_pde ? PG_PDE_PAT : PG_PTE_PAT; + switch (pmap->pm_type) { + case PT_X86: + /* The PAT bit is different for PTE's and PDE's. */ + pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; + + /* Map the caching mode to a PAT index. */ + pat_idx = pat_index[mode]; + + /* Map the 3-bit index value into the PAT, PCD, and PWT bits. */ + cache_bits = 0; + if (pat_idx & 0x4) + cache_bits |= pat_flag; + if (pat_idx & 0x2) + cache_bits |= PG_NC_PCD; + if (pat_idx & 0x1) + cache_bits |= PG_NC_PWT; + break; + + case PT_EPT: + cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode); + break; - /* Map the caching mode to a PAT index. */ - pat_idx = pat_index[mode]; + default: + panic("unsupported pmap type %d", pmap->pm_type); + } - /* Map the 3-bit index value into the PAT, PCD, and PWT bits. */ - cache_bits = 0; - if (pat_idx & 0x4) - cache_bits |= pat_flag; - if (pat_idx & 0x2) - cache_bits |= PG_NC_PCD; - if (pat_idx & 0x1) - cache_bits |= PG_NC_PWT; return (cache_bits); } +static int +pmap_cache_mask(pmap_t pmap, boolean_t is_pde) +{ + int mask; + + switch (pmap->pm_type) { + case PT_X86: + mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; + break; + case PT_EPT: + mask = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(0x7); + break; + default: + panic("pmap_cache_mask: invalid pm_type %d", pmap->pm_type); + } + + return (mask); +} + +static __inline boolean_t +pmap_ps_enabled(pmap_t pmap) +{ + + return (pg_ps_enabled && (pmap->pm_flags & PMAP_PDE_SUPERPAGE) != 0); +} + +static void +pmap_update_pde_store(pmap_t pmap, pd_entry_t *pde, pd_entry_t newpde) +{ + + switch (pmap->pm_type) { + case PT_X86: + break; + case PT_EPT: + /* + * XXX + * This is a little bogus since the generation number is + * supposed to be bumped up when a region of the address + * space is invalidated in the page tables. + * + * In this case the old PDE entry is valid but yet we want + * to make sure that any mappings using the old entry are + * invalidated in the TLB. + * + * The reason this works as expected is because we rendezvous + * "all" host cpus and force any vcpu context to exit as a + * side-effect. + */ + atomic_add_acq_long(&pmap->pm_eptgen, 1); + break; + default: + panic("pmap_update_pde_store: bad pm_type %d", pmap->pm_type); + } + pde_store(pde, newpde); +} + /* * After changing the page size for the specified virtual address in the page * table, flush the corresponding entries from the processor's TLB. Only the @@ -985,8 +1212,17 @@ pmap_cache_bits(int mode, boolean_t is_p * The calling thread must be pinned to a processor. */ static void -pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde) +pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va, pd_entry_t newpde) { + pt_entry_t PG_G; + + if (pmap->pm_type == PT_EPT) + return; + + KASSERT(pmap->pm_type == PT_X86, + ("pmap_update_pde_invalidate: invalid type %d", pmap->pm_type)); + + PG_G = pmap_global_bit(pmap); if ((newpde & PG_PS) == 0) /* Demotion: flush a specific 2MB page mapping. */ @@ -1048,12 +1284,61 @@ pmap_invalidate_page_pcid(pmap_t pmap, v * immutable. The kernel page table is always active on every * processor. */ + +/* + * Interrupt the cpus that are executing in the guest context. + * This will force the vcpu to exit and the cached EPT mappings + * will be invalidated by the host before the next vmresume. + */ +static __inline void +pmap_invalidate_ept(pmap_t pmap) +{ + + sched_pin(); + KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active), + ("pmap_invalidate_ept: absurd pm_active")); + + /* + * The TLB mappings associated with a vcpu context are not + * flushed each time a different vcpu is chosen to execute. + * + * This is in contrast with a process's vtop mappings that + * are flushed from the TLB on each context switch. + * + * Therefore we need to do more than just a TLB shootdown on + * the active cpus in 'pmap->pm_active'. To do this we keep + * track of the number of invalidations performed on this pmap. + * + * Each vcpu keeps a cache of this counter and compares it + * just before a vmresume. If the counter is out-of-date an + * invept will be done to flush stale mappings from the TLB. + */ + atomic_add_acq_long(&pmap->pm_eptgen, 1); + + /* + * Force the vcpu to exit and trap back into the hypervisor. + * + * XXX this is not optimal because IPI_AST builds a trapframe + * whereas all we need is an 'eoi' followed by 'iret'. + */ + ipi_selected(pmap->pm_active, IPI_AST); + sched_unpin(); +} + void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { cpuset_t other_cpus; u_int cpuid; + if (pmap->pm_type == PT_EPT) { + pmap_invalidate_ept(pmap); + return; + } + + KASSERT(pmap->pm_type == PT_X86, + ("pmap_invalidate_page: invalid type %d", pmap->pm_type)); + sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { if (!pmap_pcid_enabled) { @@ -1124,6 +1409,14 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid; + if (pmap->pm_type == PT_EPT) { + pmap_invalidate_ept(pmap); + return; + } + + KASSERT(pmap->pm_type == PT_X86, + ("pmap_invalidate_range: invalid type %d", pmap->pm_type)); + sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { if (!pmap_pcid_enabled) { @@ -1175,6 +1468,14 @@ pmap_invalidate_all(pmap_t pmap) uint64_t cr3; u_int cpuid; + if (pmap->pm_type == PT_EPT) { + pmap_invalidate_ept(pmap); + return; + } + + KASSERT(pmap->pm_type == PT_X86, + ("pmap_invalidate_all: invalid type %d", pmap->pm_type)); + sched_pin(); cpuid = PCPU_GET(cpuid); if (pmap == kernel_pmap || @@ -1243,6 +1544,7 @@ pmap_invalidate_cache(void) struct pde_action { cpuset_t invalidate; /* processors that invalidate their TLB */ + pmap_t pmap; vm_offset_t va; pd_entry_t *pde; pd_entry_t newpde; @@ -1255,7 +1557,7 @@ pmap_update_pde_action(void *arg) struct pde_action *act = arg; if (act->store == PCPU_GET(cpuid)) - pde_store(act->pde, act->newpde); + pmap_update_pde_store(act->pmap, act->pde, act->newpde); } static void @@ -1264,7 +1566,7 @@ pmap_update_pde_teardown(void *arg) struct pde_action *act = arg; if (CPU_ISSET(PCPU_GET(cpuid), &act->invalidate)) - pmap_update_pde_invalidate(act->va, act->newpde); + pmap_update_pde_invalidate(act->pmap, act->va, act->newpde); } /* @@ -1286,7 +1588,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t cpuid = PCPU_GET(cpuid); other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - if (pmap == kernel_pmap) + if (pmap == kernel_pmap || pmap->pm_type == PT_EPT) active = all_cpus; else { active = pmap->pm_active; @@ -1296,6 +1598,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t act.store = cpuid; act.invalidate = active; act.va = va; + act.pmap = pmap; act.pde = pde; act.newpde = newpde; CPU_SET(cpuid, &active); @@ -1303,9 +1606,9 @@ pmap_update_pde(pmap_t pmap, vm_offset_t smp_no_rendevous_barrier, pmap_update_pde_action, pmap_update_pde_teardown, &act); } else { - pde_store(pde, newpde); + pmap_update_pde_store(pmap, pde, newpde); if (CPU_ISSET(cpuid, &active)) - pmap_update_pde_invalidate(va, newpde); + pmap_update_pde_invalidate(pmap, va, newpde); } sched_unpin(); } @@ -1318,8 +1621,17 @@ PMAP_INLINE void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) - invlpg(va); + switch (pmap->pm_type) { + case PT_X86: + if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) + invlpg(va); + break; + case PT_EPT: + pmap->pm_eptgen++; + break; + default: + panic("pmap_invalidate_page: unknown type: %d", pmap->pm_type); + } } PMAP_INLINE void @@ -1327,17 +1639,35 @@ pmap_invalidate_range(pmap_t pmap, vm_of { vm_offset_t addr; - if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) - for (addr = sva; addr < eva; addr += PAGE_SIZE) - invlpg(addr); + switch (pmap->pm_type) { + case PT_X86: + if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) + for (addr = sva; addr < eva; addr += PAGE_SIZE) + invlpg(addr); + break; + case PT_EPT: + pmap->pm_eptgen++; + break; + default: + panic("pmap_invalidate_range: unknown type: %d", pmap->pm_type); + } } PMAP_INLINE void pmap_invalidate_all(pmap_t pmap) { - if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) - invltlb(); + switch (pmap->pm_type) { + case PT_X86: + if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) + invltlb(); + break; + case PT_EPT: + pmap->pm_eptgen++; + break; + default: + panic("pmap_invalidate_all: unknown type %d", pmap->pm_type); + } } PMAP_INLINE void @@ -1351,9 +1681,9 @@ static void pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde) { - pde_store(pde, newpde); + pmap_update_pde_store(pmap, pde, newpde); if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) - pmap_update_pde_invalidate(va, newpde); + pmap_update_pde_invalidate(pmap, va, newpde); else CPU_ZERO(&pmap->pm_save); } @@ -1455,10 +1785,11 @@ pmap_extract(pmap_t pmap, vm_offset_t va { pdp_entry_t *pdpe; pd_entry_t *pde; - pt_entry_t *pte; + pt_entry_t *pte, PG_V; vm_paddr_t pa; pa = 0; + PG_V = pmap_valid_bit(pmap); PMAP_LOCK(pmap); pdpe = pmap_pdpe(pmap, va); if (pdpe != NULL && (*pdpe & PG_V) != 0) { @@ -1493,12 +1824,14 @@ vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { pd_entry_t pde, *pdep; - pt_entry_t pte; + pt_entry_t pte, PG_RW, PG_V; vm_paddr_t pa; vm_page_t m; pa = 0; m = NULL; + PG_RW = pmap_rw_bit(pmap); + PG_V = pmap_valid_bit(pmap); PMAP_LOCK(pmap); retry: pdep = pmap_pde(pmap, va); @@ -1571,16 +1904,18 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p pt_entry_t *pte; pte = vtopte(va); - pte_store(pte, pa | PG_RW | PG_V | PG_G); + pte_store(pte, pa | X86_PG_RW | X86_PG_V | X86_PG_G); } static __inline void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode) { pt_entry_t *pte; + int cache_bits; pte = vtopte(va); - pte_store(pte, pa | PG_RW | PG_V | PG_G | pmap_cache_bits(mode, 0)); + cache_bits = pmap_cache_bits(kernel_pmap, mode, 0); + pte_store(pte, pa | X86_PG_RW | X86_PG_V | X86_PG_G | cache_bits); } /* @@ -1629,20 +1964,22 @@ pmap_qenter(vm_offset_t sva, vm_page_t * { pt_entry_t *endpte, oldpte, pa, *pte; vm_page_t m; + int cache_bits; oldpte = 0; pte = vtopte(sva); endpte = pte + count; while (pte < endpte) { m = *ma++; - pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); - if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { + cache_bits = pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0); + pa = VM_PAGE_TO_PHYS(m) | cache_bits; + if ((*pte & (PG_FRAME | X86_PG_PTE_CACHE)) != pa) { oldpte |= *pte; - pte_store(pte, pa | PG_G | PG_RW | PG_V); + pte_store(pte, pa | X86_PG_G | X86_PG_RW | X86_PG_V); } pte++; } - if (__predict_false((oldpte & PG_V) != 0)) + if (__predict_false((oldpte & X86_PG_V) != 0)) pmap_invalidate_range(kernel_pmap, sva, sva + count * PAGE_SIZE); } @@ -1841,6 +2178,7 @@ pmap_pinit0(pmap_t pmap) TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); pmap->pm_pcid = pmap_pcid_enabled ? 0 : -1; + pmap->pm_flags = pmap_flags; } /* @@ -1848,9 +2186,10 @@ pmap_pinit0(pmap_t pmap) * such as one in a vmspace structure. */ int -pmap_pinit(pmap_t pmap) +pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) { vm_page_t pml4pg; + vm_paddr_t pml4phys; int i; /* @@ -1860,41 +2199,61 @@ pmap_pinit(pmap_t pmap) VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) VM_WAIT; - pmap->pm_cr3 = VM_PAGE_TO_PHYS(pml4pg); - pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pmap->pm_cr3); + pml4phys = VM_PAGE_TO_PHYS(pml4pg); + pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pml4phys); + pmap->pm_pcid = -1; + pmap->pm_cr3 = ~0; /* initialize to an invalid value */ if ((pml4pg->flags & PG_ZERO) == 0) pagezero(pmap->pm_pml4); - /* Wire in kernel global address entries. */ - for (i = 0; i < NKPML4E; i++) { - pmap->pm_pml4[KPML4BASE + i] = (KPDPphys + (i << PAGE_SHIFT)) | - PG_RW | PG_V | PG_U; - } - for (i = 0; i < ndmpdpphys; i++) { - pmap->pm_pml4[DMPML4I + i] = (DMPDPphys + (i << PAGE_SHIFT)) | - PG_RW | PG_V | PG_U; - } + /* + * Do not install the host kernel mappings in the nested page + * tables. These mappings are meaningless in the guest physical + * address space. + */ + if ((pmap->pm_type = pm_type) == PT_X86) { + pmap->pm_cr3 = pml4phys; + + /* Wire in kernel global address entries. */ + for (i = 0; i < NKPML4E; i++) { + pmap->pm_pml4[KPML4BASE + i] = (KPDPphys + ptoa(i)) | + X86_PG_RW | X86_PG_V | PG_U; + } + for (i = 0; i < ndmpdpphys; i++) { + pmap->pm_pml4[DMPML4I + i] = (DMPDPphys + ptoa(i)) | + X86_PG_RW | X86_PG_V | PG_U; + } + + /* install self-referential address mapping entry(s) */ + pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | + X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; - /* install self-referential address mapping entry(s) */ - pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | PG_V | PG_RW | PG_A | PG_M; + if (pmap_pcid_enabled) { + pmap->pm_pcid = alloc_unr(&pcid_unr); + if (pmap->pm_pcid != -1) + pmap->pm_cr3 |= pmap->pm_pcid; + } + } pmap->pm_root.rt_root = 0; CPU_ZERO(&pmap->pm_active); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); - if (pmap_pcid_enabled) { - pmap->pm_pcid = alloc_unr(&pcid_unr); - if (pmap->pm_pcid != -1) - pmap->pm_cr3 |= pmap->pm_pcid; - } else { - pmap->pm_pcid = -1; - } + pmap->pm_flags = flags; + pmap->pm_eptgen = 0; CPU_ZERO(&pmap->pm_save); return (1); } +int +pmap_pinit(pmap_t pmap) +{ + + return (pmap_pinit_type(pmap, PT_X86, pmap_flags)); +} + /* * This routine is called if the desired page table page does not exist. * @@ -1910,9 +2269,15 @@ static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) { vm_page_t m, pdppg, pdpg; + pt_entry_t PG_A, PG_M, PG_RW, PG_V; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + PG_A = pmap_accessed_bit(pmap); + PG_M = pmap_modified_bit(pmap); + PG_V = pmap_valid_bit(pmap); + PG_RW = pmap_rw_bit(pmap); + /* * Allocate a page table page. */ @@ -2040,9 +2405,11 @@ static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t pdpindex, ptepindex; - pdp_entry_t *pdpe; + pdp_entry_t *pdpe, PG_V; vm_page_t pdpg; + PG_V = pmap_valid_bit(pmap); + retry: pdpe = pmap_pdpe(pmap, va); if (pdpe != NULL && (*pdpe & PG_V) != 0) { @@ -2064,9 +2431,11 @@ static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) { vm_pindex_t ptepindex; - pd_entry_t *pd; + pd_entry_t *pd, PG_V; vm_page_t m; + PG_V = pmap_valid_bit(pmap); + /* * Calculate pagetable page index */ @@ -2140,7 +2509,7 @@ pmap_release(pmap_t pmap) pmap_invalidate_all(pmap); } - m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4)); for (i = 0; i < NKPML4E; i++) /* KVA */ pmap->pm_pml4[KPML4BASE + i] = 0; @@ -2211,7 +2580,7 @@ pmap_growkernel(vm_offset_t addr) addr = kernel_map->max_offset; while (kernel_vm_end < addr) { pdpe = pmap_pdpe(kernel_pmap, kernel_vm_end); - if ((*pdpe & PG_V) == 0) { + if ((*pdpe & X86_PG_V) == 0) { /* We need a new PDP entry */ nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDPSHIFT, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | @@ -2221,12 +2590,12 @@ pmap_growkernel(vm_offset_t addr) if ((nkpg->flags & PG_ZERO) == 0) pmap_zero_page(nkpg); paddr = VM_PAGE_TO_PHYS(nkpg); - *pdpe = (pdp_entry_t) - (paddr | PG_V | PG_RW | PG_A | PG_M); + *pdpe = (pdp_entry_t)(paddr | X86_PG_V | X86_PG_RW | + X86_PG_A | X86_PG_M); continue; /* try again */ } pde = pmap_pdpe_to_pde(pdpe, kernel_vm_end); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Oct 5 23:11:03 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id DAB59C92; Sat, 5 Oct 2013 23:11:03 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C773A2A99; Sat, 5 Oct 2013 23:11:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95NB3Nc009054; Sat, 5 Oct 2013 23:11:03 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95NB2TL009041; Sat, 5 Oct 2013 23:11:02 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201310052311.r95NB2TL009041@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 5 Oct 2013 23:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256073 - in head/sys: amd64/include dev/xen/timer i386/include i386/xen x86/acpica x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 23:11:03 -0000 Author: gibbs Date: Sat Oct 5 23:11:01 2013 New Revision: 256073 URL: http://svnweb.freebsd.org/changeset/base/256073 Log: Formalize the concept of virtual CPU ids by adding a per-cpu vcpu_id field. Perform vcpu enumeration for Xen PV and HVM environments and convert all Xen drivers to use vcpu_id instead of a hard coded assumption of the mapping algorithm (acpi or apic ID) in use. Submitted by: Roger Pau Monné Sponsored by: Citrix Systems R&D Reviewed by: gibbs Approved by: re (blanket Xen) amd64/include/pcpu.h: i386/include/pcpu.h: Add vcpu_id to the amd64 and i386 pcpu structures. dev/xen/timer/timer.c x86/xen/xen_intr.c Use new vcpu_id instead of assuming acpi_id == vcpu_id. i386/xen/mp_machdep.c: i386/xen/mptable.c x86/xen/hvm.c: Perform Xen HVM and Xen full PV vcpu_id mapping. x86/xen/hvm.c: x86/acpica/madt.c Change SYSINIT ordering of acpi CPU enumeration so that it is guaranteed to be available at the time of Xen HVM vcpu id mapping. Modified: head/sys/amd64/include/pcpu.h head/sys/dev/xen/timer/timer.c head/sys/i386/include/pcpu.h head/sys/i386/xen/mp_machdep.c head/sys/i386/xen/mptable.c head/sys/x86/acpica/madt.c head/sys/x86/xen/hvm.c head/sys/x86/xen/xen_intr.c Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/amd64/include/pcpu.h Sat Oct 5 23:11:01 2013 (r256073) @@ -62,7 +62,8 @@ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ - char __pad[161] /* be divisor of PAGE_SIZE \ + u_int pc_vcpu_id; /* Xen vCPU ID */ \ + char __pad[157] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/dev/xen/timer/timer.c Sat Oct 5 23:11:01 2013 (r256073) @@ -396,7 +396,7 @@ xentimer_et_start(struct eventtimer *et, { int error = 0, i = 0; struct xentimer_softc *sc = et->et_priv; - int cpu = PCPU_GET(acpi_id); + int cpu = PCPU_GET(vcpu_id); struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); uint64_t first_in_ns, next_time; @@ -433,7 +433,7 @@ xentimer_et_start(struct eventtimer *et, static int xentimer_et_stop(struct eventtimer *et) { - int cpu = PCPU_GET(acpi_id); + int cpu = PCPU_GET(vcpu_id); struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); pcpu->timer = 0; Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/i386/include/pcpu.h Sat Oct 5 23:11:01 2013 (r256073) @@ -62,13 +62,13 @@ struct shadow_time_info { vm_paddr_t *pc_pdir_shadow; \ uint64_t pc_processed_system_time; \ struct shadow_time_info pc_shadow_time; \ - char __pad[189] + char __pad[185] #else /* !XEN */ #define PCPU_XEN_FIELDS \ ; \ - char __pad[237] + char __pad[233] #endif @@ -84,7 +84,8 @@ struct shadow_time_info { u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_apic_id; \ int pc_private_tss; /* Flag indicating private tss*/\ - u_int pc_cmci_mask /* MCx banks for CMCI */ \ + u_int pc_cmci_mask; /* MCx banks for CMCI */ \ + u_int pc_vcpu_id /* Xen vCPU ID */ \ PCPU_XEN_FIELDS #ifdef _KERNEL Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/i386/xen/mp_machdep.c Sat Oct 5 23:11:01 2013 (r256073) @@ -783,13 +783,7 @@ start_all_aps(void) dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO), bootAP); pc->pc_apic_id = cpu_apic_ids[bootAP]; - /* - * The i386 PV port uses the apic_id as vCPU id, but the - * PVHVM port needs to use the acpi_id, so set it for PV - * also in order to work with shared devices between PV - * and PVHVM. - */ - pc->pc_acpi_id = cpu_apic_ids[bootAP]; + pc->pc_vcpu_id = cpu_apic_ids[bootAP]; pc->pc_prvspace = pc; pc->pc_curthread = 0; Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/i386/xen/mptable.c Sat Oct 5 23:11:01 2013 (r256073) @@ -88,7 +88,7 @@ mptable_setup_local(void) { PCPU_SET(apic_id, 0); - PCPU_SET(acpi_id, 0); + PCPU_SET(vcpu_id, 0); return (0); } Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/x86/acpica/madt.c Sat Oct 5 23:11:01 2013 (r256073) @@ -575,4 +575,4 @@ madt_set_ids(void *dummy) la->la_acpi_id); } } -SYSINIT(madt_set_ids, SI_SUB_CPU, SI_ORDER_ANY, madt_set_ids, NULL); +SYSINIT(madt_set_ids, SI_SUB_CPU, SI_ORDER_MIDDLE, madt_set_ids, NULL); Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/x86/xen/hvm.c Sat Oct 5 23:11:01 2013 (r256073) @@ -744,6 +744,22 @@ xen_hvm_sysinit(void *arg __unused) } static void +xen_set_vcpu_id(void) +{ + struct pcpu *pc; + int i; + + /* Set vcpu_id to acpi_id */ + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_vcpu_id = pc->pc_acpi_id; + if (bootverbose) + printf("XEN: CPU %u has VCPU ID %u\n", + i, pc->pc_vcpu_id); + } +} + +static void xen_hvm_cpu_init(void) { struct vcpu_register_vcpu_info info; @@ -763,7 +779,7 @@ xen_hvm_cpu_init(void) } vcpu_info = DPCPU_PTR(vcpu_local_info); - cpu = PCPU_GET(acpi_id); + cpu = PCPU_GET(vcpu_id); info.mfn = vtophys(vcpu_info) >> PAGE_SHIFT; info.offset = vtophys(vcpu_info) - trunc_page(vtophys(vcpu_info)); @@ -779,3 +795,4 @@ SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SYSINIT(xen_setup_cpus, SI_SUB_SMP, SI_ORDER_FIRST, xen_setup_cpus, NULL); #endif SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); +SYSINIT(xen_set_vcpu_id, SI_SUB_CPU, SI_ORDER_ANY, xen_set_vcpu_id, NULL); Modified: head/sys/x86/xen/xen_intr.c ============================================================================== --- head/sys/x86/xen/xen_intr.c Sat Oct 5 21:22:35 2013 (r256072) +++ head/sys/x86/xen/xen_intr.c Sat Oct 5 23:11:01 2013 (r256073) @@ -611,9 +611,9 @@ xen_rebind_ipi(struct xenisrc *isrc) { #ifdef SMP int cpu = isrc->xi_cpu; - int acpi_id = pcpu_find(cpu)->pc_acpi_id; + int vcpu_id = pcpu_find(cpu)->pc_vcpu_id; int error; - struct evtchn_bind_ipi bind_ipi = { .vcpu = acpi_id }; + struct evtchn_bind_ipi bind_ipi = { .vcpu = vcpu_id }; error = HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, &bind_ipi); @@ -640,10 +640,10 @@ static void xen_rebind_virq(struct xenisrc *isrc) { int cpu = isrc->xi_cpu; - int acpi_id = pcpu_find(cpu)->pc_acpi_id; + int vcpu_id = pcpu_find(cpu)->pc_vcpu_id; int error; struct evtchn_bind_virq bind_virq = { .virq = isrc->xi_virq, - .vcpu = acpi_id }; + .vcpu = vcpu_id }; error = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &bind_virq); @@ -796,7 +796,7 @@ xen_intr_assign_cpu(struct intsrc *base_ #ifdef SMP struct evtchn_bind_vcpu bind_vcpu; struct xenisrc *isrc; - u_int to_cpu, acpi_id; + u_int to_cpu, vcpu_id; int error; #ifdef XENHVM @@ -805,7 +805,7 @@ xen_intr_assign_cpu(struct intsrc *base_ #endif to_cpu = apic_cpuid(apic_id); - acpi_id = pcpu_find(to_cpu)->pc_acpi_id; + vcpu_id = pcpu_find(to_cpu)->pc_vcpu_id; xen_intr_intrcnt_add(to_cpu); mtx_lock(&xen_intr_isrc_lock); @@ -830,7 +830,7 @@ xen_intr_assign_cpu(struct intsrc *base_ } bind_vcpu.port = isrc->xi_port; - bind_vcpu.vcpu = acpi_id; + bind_vcpu.vcpu = vcpu_id; /* * Allow interrupts to be fielded on the new VCPU before @@ -1063,9 +1063,9 @@ xen_intr_bind_virq(device_t dev, u_int v driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, xen_intr_handle_t *port_handlep) { - int acpi_id = pcpu_find(cpu)->pc_acpi_id; + int vcpu_id = pcpu_find(cpu)->pc_vcpu_id; struct xenisrc *isrc; - struct evtchn_bind_virq bind_virq = { .virq = virq, .vcpu = acpi_id }; + struct evtchn_bind_virq bind_virq = { .virq = virq, .vcpu = vcpu_id }; int error; /* Ensure the target CPU is ready to handle evtchn interrupts. */ @@ -1126,9 +1126,9 @@ xen_intr_alloc_and_bind_ipi(device_t dev xen_intr_handle_t *port_handlep) { #ifdef SMP - int acpi_id = pcpu_find(cpu)->pc_acpi_id; + int vcpu_id = pcpu_find(cpu)->pc_vcpu_id; struct xenisrc *isrc; - struct evtchn_bind_ipi bind_ipi = { .vcpu = acpi_id }; + struct evtchn_bind_ipi bind_ipi = { .vcpu = vcpu_id }; int error; /* Ensure the target CPU is ready to handle evtchn interrupts. */